hk-local-run-spec
Skill100 starsChanged 9 months agoMITView on GitHub
Plan and execute an odin spec. Handles working directory, auth, nested-session detection, and post-run diagnostics. Use whenever the user wants to run a spec, test a spec, or do a smoke test. Triggers on: 'run this spec', 'test this spec', 'odin plan', 'smoke test', or /hk-local-run-spec.
- Reads credentials
In this repository24 other files it gives its agents.
- AGENTS.mdAGENTS.md
- harness_usage_status/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- harness_usage_status/CLAUDE.mdCLAUDE.md
- odin/CLAUDE.mdCLAUDE.md
- taskit/CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- fable-auditSkill
- hk-arch-auditSkill
- hk-autonomy-auditSkill
- hk-breadcrumb-creatorSkill
- hk-changelogSkill
- hk-compoundSkill
- hk-follow-breadcrumbSkill
- hk-local-diagnoseSkill
- hk-local-logsSkill
- hk-merge-resolveSkill
- hk-mock-firstSkill
- hk-rcaSkill
- hk-refineSkill
- hk-scout-wikiSkill
- hk-shift-changelogSkill
- hk-skill-creatorSkill
- hk-slop-auditSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Run the full odin spec workflow: plan, review, execute.
- Very specific: line 25
--quick: use --quiet mode (non-interactive, spinner only)
- Distinctive: line 39
Check if we're inside a Claude Code session:
- Distinctive: line 46
If we're inside Claude Code (the var is set or we detect we're in an agent context), we cannot run odin plan/exec directly.
- Very specific: line 55
Check that temp_test_dir/ exists and has a .env:
- Distinctive: line 61
If missing, tell the user:
- Very specific: line 77
If --quick was passed, use --quiet (which implies --auto).
- Very specific: line 113
If --exec-only was passed, skip the plan/review sections and only show the exec + diagnostic commands.
- Distinctive: line 117
Always remind the user to run the diagnostic after execution:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/hk-local-run-spec — Spec Runner
Run the full odin spec workflow: plan, review, execute. Handles the gotchas so you don't have to remember them.
Usage
/hk-local-run-spec ../sample_specs/poem_spec.md
/hk-local-run-spec ../sample_specs/poem_spec.md --quick
/hk-local-run-spec ../sample_specs/poem_spec.md --mock
/hk-local-run-spec --exec-only a1b2Arguments
Parse $ARGUMENTS to extract:
- spec_path (required unless
--exec-only): path to the spec markdown file - --quick: use
--quietmode (non-interactive, spinner only) - --mock: pass
--mockto exec (no backend writes) - --exec-only <task_id>: skip planning, just execute a specific task
The critical gotcha
Odin plan/exec invokes claude -p as a subprocess. It cannot run from inside another Claude Code session. Nested Claude Code calls fail silently or hang.
This skill detects the nested session and provides the user with copy-paste commands instead of trying to run them directly.
Execution
Step 1: Detect environment
Check if we're inside a Claude Code session:
# Claude Code sets this env var when running
echo "${CLAUDE_CODE_ENTRYPOINT:-not_set}"If we're inside Claude Code (the var is set or we detect we're in an agent context), we cannot run odin plan/exec directly. Instead, provide copy-paste commands.
Step 2: Resolve paths
REPO_ROOT=$(git rev-parse --show-toplevel)
WORK_DIR="$REPO_ROOT/odin/temp_test_dir"Check that temp_test_dir/ exists and has a .env:
ls "$WORK_DIR/.env" 2>/dev/nullIf missing, tell the user:
temp_test_dir/ not found or missing .env.
Create it: cd odin && mkdir -p temp_test_dir && cp .env.example temp_test_dir/.env
Then edit temp_test_dir/.env with your ODIN_ADMIN_USER and ODIN_ADMIN_PASSWORD.Step 3: Generate commands
Build the commands based on arguments:
Plan phase (skip if --exec-only):
cd "$WORK_DIR" && odin plan <spec_path> --quietIf --quick was passed, use --quiet (which implies --auto). Otherwise default to --auto for non-interactive execution.
Review phase (skip if --exec-only):
cd "$WORK_DIR" && odin specs
cd "$WORK_DIR" && odin statusExec phase:
cd "$WORK_DIR" && odin exec <task_id> [--mock]Step 4: Output
Since we're almost always inside Claude Code (that's where this skill runs), output the commands for the user to copy-paste into a regular terminal:
## Spec Run Commands
Run these from a regular terminal (not inside Claude Code):
### 1. Plan
cd <WORK_DIR> && odin plan <spec_path> --auto
### 2. Review
cd <WORK_DIR> && odin specs
cd <WORK_DIR> && odin status
### 3. Execute (run for each task)
cd <WORK_DIR> && odin exec <task_id> [--mock]
### 4. Post-run diagnostic
cd <REPO_ROOT>/taskit/taskit-backend && python testing_tools/spec_trace.py <spec_id> --briefIf --exec-only was passed, skip the plan/review sections and only show the exec + diagnostic commands.
Step 5: Post-run diagnostic hint
Always remind the user to run the diagnostic after execution:
After execution completes, check results with:
/hk-local-diagnose spec <spec_id> --briefThis connects the two skills into a natural workflow.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

