skills/hermit-routines/SKILL.md
Manages scheduled routines as per-session CronCreate jobs. Each enabled routine in config.json becomes an idle-gated CronCreate registered at session launch.
npx skillsauth add gtapps/claude-code-hermit hermit-routinesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Register and manage scheduled routines as per-session CronCreate jobs. Each routine fires only when the REPL is idle — no mid-task interruptions. Mirrors the /watch skill pattern.
/claude-code-hermit:hermit-routines load register all enabled config.routines as CronCreates
/claude-code-hermit:hermit-routines list list configured routines from config.json
/claude-code-hermit:hermit-routines status list active CronCreate registrations
/claude-code-hermit:hermit-routines stop [id] stop a specific routine's CronCreate
/claude-code-hermit:hermit-routines stop --all stop all active routine CronCreates
Called automatically by hermit-start.py on always-on launches. Can also be called manually to apply config changes mid-session.
Resolve the plugin root path: run echo $CLAUDE_PLUGIN_ROOT via Bash. Store as pluginRoot. This env var is available at skill execution time but NOT inside cron-delivered prompts — it must be baked into each prompt at registration.
Read config.routines, filter enabled: true. If none, log "No enabled routines in config." and stop.
Call CronList. For each entry whose prompt contains [hermit-routine:: call CronDelete with its ID. Unconditional reset — ensures stale entries from prior sessions are cleared and the 7-day auto-expiry clock is reset.
For each enabled routine, build the prompt string (see templates below), then call CronCreate:
cron: the routine's schedule fieldrecurring: truedurable: falseprompt: the resolved prompt stringPer-routine error isolation: if CronCreate throws for one routine (bad cron expression, hit the 50-task session limit, etc.), record the failure and continue with the next routine. Do not abort the loop — one bad config entry must not prevent unrelated routines from registering.
Log one line summarizing outcomes: Routines registered: <id1>, <id2> (<N> ok, <M> failed). If any failed, list each failed id with the error on its own line.
Use run_during_waiting (rdw) from the config entry to select the template. Default run_during_waiting is false when the field is absent.
rdw=true — routine fires even when session_state is waiting:
[hermit-routine:<id>] Invoke /<skill>. After it completes, run:
<pluginRoot>/scripts/log-routine-event.sh <id> fired
rdw=false (default) — routine is suppressed when session_state is waiting:
[hermit-routine:<id>] Read .claude-code-hermit/state/runtime.json. If session_state is "waiting", run:
<pluginRoot>/scripts/log-routine-event.sh <id> skipped-waiting
and stop. Otherwise: invoke /<skill>. After it completes, run:
<pluginRoot>/scripts/log-routine-event.sh <id> fired
Replace <pluginRoot> with the resolved absolute path from step 1, <id> with the routine's id, and <skill> with the routine's skill field. The skill string is passed verbatim to the slash invocation (so claude-code-hermit:brief --morning becomes /claude-code-hermit:brief --morning). log-routine-event.sh takes <id> <event> only.
Special case — heartbeat-restart: append Then invoke /claude-code-hermit:hermit-routines load to re-arm all routine CronCreates and reset the 7-day expiry clock. to the prompt (after the trailing fired log line). Daily re-arm via this routine is what keeps routine CronCreates from ever reaching the 7-day auto-expiry in always-on deployments.
Show configured routines from config.json (not from CronList — this is the config view, not the live view).
config.routines.Routines (config.json):
# ID Schedule Skill RDW Status
1. heartbeat-restart 0 4 * * * claude-code-hermit:heartbeat start true enabled
2. weekly-review 0 23 * * 0 claude-code-hermit:weekly-review false disabled
Show active CronCreate registrations for hermit routines.
CronList. Filter entries whose prompt starts with [hermit-routine:./claude-code-hermit:hermit-routines load to register."Active routine CronCreates:
ID CRON-ID SCHEDULE
heartbeat-restart 4e007cf4 0 4 * * *
Extract the routine ID from the [hermit-routine:<id>] prefix in the prompt.
stop <id>:
CronList. Find the entry whose prompt contains [hermit-routine:<id>].CronDelete it. Log: "Stopped routine: <id>."stop (no id):
CronList, filter [hermit-routine:*] entries.--all).stop --all:
CronList. For each [hermit-routine:*] entry: CronDelete.hermit-settings routines automatically invokes /claude-code-hermit:hermit-routines load after writing config. If you edit config.json by hand, run /claude-code-hermit:hermit-routines load to apply — no session restart needed.hermit-start.py calls /claude-code-hermit:hermit-routines load only on always-on launches. Operators using /session interactively who want routines must run /claude-code-hermit:hermit-routines load themselves.$CLAUDE_PLUGIN_ROOT is NOT available in cron-delivered prompts. Always resolve and bake the absolute path at load time.durable: false (default). CronCreates die with the session. hermit-start.py re-registers on every always-on launch.heartbeat-restart. load resets the 7-day clock unconditionally on each call. The heartbeat-restart routine fires daily and re-invokes /claude-code-hermit:hermit-routines load, so entries never reach expiry. If you disable heartbeat-restart, routine CronCreates expire after 7 days — re-enable it, or run /claude-code-hermit:hermit-routines load weekly by hand.data-ai
Initializes or resumes a work session. Loads context from OPERATOR.md and SHELL.md, orients the agent, and establishes what to work on. Use at the beginning of every work session.
tools
Evolves hermit configuration and templates after a plugin update. Detects version gaps, presents new features, walks through new settings. Run after updating the plugin.
testing
Initializes the autonomous agent in the current project. Creates the state directory, templates, OPERATOR.md, and config.json. Appends session discipline to CLAUDE.md. Detects installed hermits. Run once per project, like git init.
tools
Generates Docker scaffolding and walks the operator through the full deployment — token setup, build, start, MCP plugin configuration, workspace trust, and verification. Offers to back up and overwrite existing Docker files. Run after /hatch.