$npx -y skills add deepklarity/harness-kit --skill hk-local-diagnoseRun diagnostic scripts on tasks, specs, boards, or reflections. Wraps testing_tools/ with proper working directory and output mode selection. Use this skill whenever the user wants to inspect, debug, or check the state of a task, spec, board, or reflection — even if they don't sa
| 1 | # /hk-local-diagnose — Diagnostic Script Runner |
| 2 | |
| 3 | Run the right diagnostic script with the right flags, from the right directory. No more remembering paths or cd-ing around. |
| 4 | |
| 5 | ## Usage |
| 6 | |
| 7 | ``` |
| 8 | /hk-local-diagnose task 42 |
| 9 | /hk-local-diagnose task 42 --brief |
| 10 | /hk-local-diagnose spec 15 --json --sections tasks,problems |
| 11 | /hk-local-diagnose board |
| 12 | /hk-local-diagnose board 3 |
| 13 | /hk-local-diagnose reflection 8 --full |
| 14 | /hk-local-diagnose snapshot sp25 ../../tests/e2e_snapshots/smoke |
| 15 | ``` |
| 16 | |
| 17 | ## Arguments |
| 18 | |
| 19 | Parse `$ARGUMENTS` to extract: |
| 20 | - **type** (required): `task`, `spec`, `board`, `reflection`, or `snapshot` |
| 21 | - **id** (required for all except `board`): the numeric ID or spec prefix |
| 22 | - **flags** (optional): `--brief`, `--full`, `--json`, `--slim`, `--sections <list>` |
| 23 | |
| 24 | If no flags are provided, default to `--brief` — this is the token-efficient choice for LLM consumption. The user can always ask for `--full` if they need more. |
| 25 | |
| 26 | ## Script mapping |
| 27 | |
| 28 | | Type | Script | Required args | |
| 29 | |------|--------|---------------| |
| 30 | | `task` | `task_inspect.py <id>` | id | |
| 31 | | `spec` | `spec_trace.py <id>` | id | |
| 32 | | `board` | `board_overview.py [id]` | id optional | |
| 33 | | `reflection` | `reflection_inspect.py <id>` | id | |
| 34 | | `snapshot` | `snapshot_extractor.py <id> <output_dir>` | id + output_dir | |
| 35 | |
| 36 | ## Execution |
| 37 | |
| 38 | All scripts run from the `taskit/taskit-backend/` directory. The working directory for execution is always: |
| 39 | |
| 40 | ``` |
| 41 | REPO_ROOT/taskit/taskit-backend/ |
| 42 | ``` |
| 43 | |
| 44 | Where `REPO_ROOT` is the git repository root (find it with `git rev-parse --show-toplevel`). |
| 45 | |
| 46 | ### Step 1: Resolve the repo root |
| 47 | |
| 48 | ```bash |
| 49 | REPO_ROOT=$(git rev-parse --show-toplevel) |
| 50 | ``` |
| 51 | |
| 52 | ### Step 2: Build and run the command |
| 53 | |
| 54 | ```bash |
| 55 | cd "$REPO_ROOT/taskit/taskit-backend" && python testing_tools/<script> <id> [flags] |
| 56 | ``` |
| 57 | |
| 58 | Pass through any `--brief`, `--full`, `--json`, `--slim`, or `--sections` flags directly to the script. |
| 59 | |
| 60 | ### Step 3: Display the output |
| 61 | |
| 62 | Print the script output directly. Do not summarize or interpret — the scripts already produce well-structured output with problem detection built in. |
| 63 | |
| 64 | If the script exits with a non-zero code, show the error and suggest: |
| 65 | - Check that the ID exists: "Is task/spec/board {id} a valid ID?" |
| 66 | - Check that the Django app is set up: "Is the taskit-backend database accessible?" |
| 67 | |
| 68 | ## Error handling |
| 69 | |
| 70 | If `$ARGUMENTS` is empty or missing the type, print usage help: |
| 71 | |
| 72 | ``` |
| 73 | Usage: /hk-local-diagnose <type> <id> [flags] |
| 74 | |
| 75 | Types: task, spec, board, reflection, snapshot |
| 76 | Flags: --brief (default), --full, --json, --slim, --sections <list> |
| 77 | |
| 78 | Examples: |
| 79 | /hk-local-diagnose task 42 |
| 80 | /hk-local-diagnose spec 15 --json --sections tasks,problems |
| 81 | /hk-local-diagnose board |
| 82 | ``` |