My solution for that is to use skills and add a omnibus shell script in each particular skill folder that does all the deterministic steps and then write the skill markdown to only use the script, usually passing a command line step parameter to the script. I also usually add a note in the skill markdown that it should monitor how it calls the script and suggest any improvements when the skill is used.
As an example I have a `today` skill that has a today.sh script that can check my email, bug tracker, calendars, custom timesheet system and other systems via the script and then the skill assembles a nice summary of what is happening today along with a suggested schedule.