$npx -y skills add deepklarity/harness-kit --skill hk-local-run-specPlan 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-
| 1 | # /hk-local-run-spec — Spec Runner |
| 2 | |
| 3 | Run the full odin spec workflow: plan, review, execute. Handles the gotchas so you don't have to remember them. |
| 4 | |
| 5 | ## Usage |
| 6 | |
| 7 | ``` |
| 8 | /hk-local-run-spec ../sample_specs/poem_spec.md |
| 9 | /hk-local-run-spec ../sample_specs/poem_spec.md --quick |
| 10 | /hk-local-run-spec ../sample_specs/poem_spec.md --mock |
| 11 | /hk-local-run-spec --exec-only a1b2 |
| 12 | ``` |
| 13 | |
| 14 | ## Arguments |
| 15 | |
| 16 | Parse `$ARGUMENTS` to extract: |
| 17 | - **spec_path** (required unless `--exec-only`): path to the spec markdown file |
| 18 | - **--quick**: use `--quiet` mode (non-interactive, spinner only) |
| 19 | - **--mock**: pass `--mock` to exec (no backend writes) |
| 20 | - **--exec-only <task_id>**: skip planning, just execute a specific task |
| 21 | |
| 22 | ## The critical gotcha |
| 23 | |
| 24 | **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. |
| 25 | |
| 26 | This skill detects the nested session and provides the user with copy-paste commands instead of trying to run them directly. |
| 27 | |
| 28 | ## Execution |
| 29 | |
| 30 | ### Step 1: Detect environment |
| 31 | |
| 32 | Check if we're inside a Claude Code session: |
| 33 | |
| 34 | ```bash |
| 35 | # Claude Code sets this env var when running |
| 36 | echo "${CLAUDE_CODE_ENTRYPOINT:-not_set}" |
| 37 | ``` |
| 38 | |
| 39 | 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. |
| 40 | |
| 41 | ### Step 2: Resolve paths |
| 42 | |
| 43 | ```bash |
| 44 | REPO_ROOT=$(git rev-parse --show-toplevel) |
| 45 | WORK_DIR="$REPO_ROOT/odin/temp_test_dir" |
| 46 | ``` |
| 47 | |
| 48 | Check that `temp_test_dir/` exists and has a `.env`: |
| 49 | |
| 50 | ```bash |
| 51 | ls "$WORK_DIR/.env" 2>/dev/null |
| 52 | ``` |
| 53 | |
| 54 | If missing, tell the user: |
| 55 | ``` |
| 56 | temp_test_dir/ not found or missing .env. |
| 57 | Create it: cd odin && mkdir -p temp_test_dir && cp .env.example temp_test_dir/.env |
| 58 | Then edit temp_test_dir/.env with your ODIN_ADMIN_USER and ODIN_ADMIN_PASSWORD. |
| 59 | ``` |
| 60 | |
| 61 | ### Step 3: Generate commands |
| 62 | |
| 63 | Build the commands based on arguments: |
| 64 | |
| 65 | **Plan phase** (skip if `--exec-only`): |
| 66 | ```bash |
| 67 | cd "$WORK_DIR" && odin plan <spec_path> --quiet |
| 68 | ``` |
| 69 | |
| 70 | If `--quick` was passed, use `--quiet` (which implies `--auto`). Otherwise default to `--auto` for non-interactive execution. |
| 71 | |
| 72 | **Review phase** (skip if `--exec-only`): |
| 73 | ```bash |
| 74 | cd "$WORK_DIR" && odin specs |
| 75 | cd "$WORK_DIR" && odin status |
| 76 | ``` |
| 77 | |
| 78 | **Exec phase**: |
| 79 | ```bash |
| 80 | cd "$WORK_DIR" && odin exec <task_id> [--mock] |
| 81 | ``` |
| 82 | |
| 83 | ### Step 4: Output |
| 84 | |
| 85 | 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: |
| 86 | |
| 87 | ``` |
| 88 | ## Spec Run Commands |
| 89 | |
| 90 | Run these from a regular terminal (not inside Claude Code): |
| 91 | |
| 92 | ### 1. Plan |
| 93 | cd <WORK_DIR> && odin plan <spec_path> --auto |
| 94 | |
| 95 | ### 2. Review |
| 96 | cd <WORK_DIR> && odin specs |
| 97 | cd <WORK_DIR> && odin status |
| 98 | |
| 99 | ### 3. Execute (run for each task) |
| 100 | cd <WORK_DIR> && odin exec <task_id> [--mock] |
| 101 | |
| 102 | ### 4. Post-run diagnostic |
| 103 | cd <REPO_ROOT>/taskit/taskit-backend && python testing_tools/spec_trace.py <spec_id> --brief |
| 104 | ``` |
| 105 | |
| 106 | If `--exec-only` was passed, skip the plan/review sections and only show the exec + diagnostic commands. |
| 107 | |
| 108 | ### Step 5: Post-run diagnostic hint |
| 109 | |
| 110 | Always remind the user to run the diagnostic after execution: |
| 111 | |
| 112 | ``` |
| 113 | After execution completes, check results with: |
| 114 | /hk-local-diagnose spec <spec_id> --brief |
| 115 | ``` |
| 116 | |
| 117 | This connects the two skills into a natural workflow. |