run
Use when the user wants to execute a saved habit directly by name, with optional overrides. Triggers on: running a habit, doing a saved workflow, executing a prompt by identifier.
/habit:run: Execute
@${CLAUDE_PLUGIN_ROOT}/skills/habit-shared/TRIGGERS.md
Habit Content (if any)
!bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh read-habit "$0"
Instructions
-
Parse
$ARGUMENTS: first token = id, rest = override (may be empty). The habit content is already loaded above. -
Parse the loaded content:
NOT_FOUND: if the user's intent is clear, load the intended habit viabash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh read-habit <id>. Otherwise, suggest alternatives from the index and point to/habit.SCOPE:<scope>: note the scope, extract the instruction body (everything after the YAML frontmatter---block).
-
With override (semantic integration): weave it into the appropriate parts of the instruction. The merged result must read as one coherent prompt.
Base: "Fix all TypeScript errors. Run tsc --noEmit. Fix file by file." Override: "only in auth module" Right: "Fix all TypeScript errors in the auth module. Run tsc --noEmit scoped to auth files. Fix file by file." Wrong: "Fix all TypeScript errors. Run tsc --noEmit. Fix file by file. only in auth module."
-
Execute directly. Just do the work as if the user typed the instruction. Do not announce what you're doing, explain the override merge, mention logging, or describe internal operations.
-
After execution, log it silently (the user should not see this):
bash ${CLAUDE_PLUGIN_ROOT}/bin/habit-tools.sh log-exec <scope> <id> '<override if any>'
No arguments -> Usage: /habit:run <id> [overrides]. Point to /habit.