@cardor/agent-harness-kit 1.7.5 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -36,6 +36,7 @@ npx ahk init
36
36
  - [`ahk dashboard`](#ahk-dashboard)
37
37
  - [`ahk status`](#ahk-status)
38
38
  - [`ahk health`](#ahk-health)
39
+ - [`ahk doctor`](#ahk-doctor)
39
40
  - [`ahk sync`](#ahk-sync)
40
41
  - [`ahk serve`](#ahk-serve)
41
42
  - [`ahk task add`](#ahk-task-add)
@@ -227,6 +228,24 @@ ahk health
227
228
 
228
229
  ---
229
230
 
231
+ ### `ahk doctor`
232
+
233
+ Checks that the installed lib version, agent files, and harness skills are all in sync.
234
+
235
+ ```bash
236
+ ahk doctor
237
+ ```
238
+
239
+ Reports three categories:
240
+
241
+ - **lib version** — compares installed version against the latest on npm. Shows `[✓]` if up to date, `[!]` if an update is available, or `[~]` if the registry could not be reached.
242
+ - **agent files** — reads each agent file on disk and compares against what `ahk build` would generate. Reports `[!]` with the file name if outdated.
243
+ - **harness skills** — checks that `ahk-ask`, `ahk-consultant`, and `ahk-triage` skills exist and match the bundled source. Reports `[!]` if missing or outdated.
244
+
245
+ Run `ahk build` to fix any reported issues.
246
+
247
+ ---
248
+
230
249
  ### `ahk sync`
231
250
 
232
251
  Syncs `.harness/feature_list.json` ↔ SQLite. Tasks already in the DB are skipped by slug. Use this to seed the backlog from the JSON file without duplicating existing tasks.
@@ -596,6 +615,7 @@ The harness exposes these tools via MCP. Agents use them instead of reading file
596
615
  | `tasks.acceptance_get` | `taskId` | Returns all acceptance criteria for a task with their `id`, `task_id`, `criterion` text, and `met` status. Use the returned `id` values with `tasks.acceptance.update` |
597
616
  | `deps.snapshot` | _(none)_ | Snapshot current `package.json` dependencies to `.harness/deps-lock.json` |
598
617
  | `deps.check` | _(none)_ | Compare current `package.json` against `.harness/deps-lock.json`. Returns `{ significant, added, removed, majorBumps, advisory }` |
618
+ | `ahk.doctor` | _(none)_ | Check lib version, agent files, and harness skills sync status. Returns `{ lib: { current, latest, outdated }, agents: { outdated, upToDate }, skills: { missing, outdated, ok } }` |
599
619
 
600
620
  ---
601
621
 
@@ -628,6 +648,7 @@ Each agent role has a scoped set of MCP tools enforced through the agent definit
628
648
  | `permissions.check` | ✅ | ✅ | ❌ | ✅ | ✅ |
629
649
  | `deps.snapshot` | ❌ | ❌ | ✅ | ❌ | ❌ |
630
650
  | `deps.check` | ❌ | ❌ | ✅ | ❌ | ❌ |
651
+ | `ahk.doctor` | ✅ | ✅ | ✅ | ✅ | ✅ |
631
652
 
632
653
  **explorer** is read-only for task state — can query but cannot mutate status or mark criteria.
633
654
  **reviewer** is the only role that can mark acceptance criteria as met (`tasks.acceptance.update`).
@@ -23,6 +23,40 @@ Read files. Think. Write your advisory to the harness. That is all.
23
23
 
24
24
  ---
25
25
 
26
+ ## Direct Consultation Mode — No Harness
27
+
28
+ When invoked via `/ahk-consultant` or directly by lead in lightweight mode, you operate without any MCP harness calls.
29
+
30
+ ### What direct consultation mode means
31
+
32
+ - **DO NOT** call `actions.start`, `actions.write`, `actions.complete`, `actions.record_tool`, `actions.record_file` — no harness tracking
33
+ - **DO NOT** call `tasks.get`, `tasks.claim` — no task lifecycle
34
+ - Read the codebase and skills, then return your advisory as plain text to the calling agent
35
+
36
+ ### Skill discovery (required in this mode)
37
+
38
+ The provider (Claude Code, OpenCode, Codex CLI) automatically scans skill directories at session startup and injects skill names and descriptions into your context. You do not need to run `ls` or any filesystem command.
39
+
40
+ Before writing your advisory:
41
+ 1. Check the skills already available in your context — the provider has pre-loaded them
42
+ 2. Identify which are relevant to the user's topic (match by name and description)
43
+ 3. Include a **Relevant skills** section in your output:
44
+ - List matching skills by name (e.g., `nodejs-backend-patterns`)
45
+ - Briefly explain why each is relevant to this specific topic
46
+ - If NO installed skills match: state this and recommend `npx autoskills` to fetch appropriate skill packs
47
+
48
+ ### Output format for direct consultation mode
49
+
50
+ Return structured plain text (not written to harness) with these sections:
51
+
52
+ - **Patterns to follow** — what existing conventions apply
53
+ - **Risks & warnings** — what could go wrong
54
+ - **Best practices** — what the implementer should keep in mind
55
+ - **Relevant skills** — matched skills from context, or `npx autoskills` recommendation
56
+ - **Dependency notes** — only if the question touches package.json or deps
57
+
58
+ ---
59
+
26
60
  ## Responsibilities
27
61
 
28
62
  - Read the explorer's output via `actions.get(taskId)`
@@ -39,6 +39,46 @@ Violating this constraint corrupts the audit trail and bypasses the review proce
39
39
 
40
40
  ---
41
41
 
42
+ ## Lightweight Request Modes — Skip the Full Pipeline
43
+
44
+ Some user interactions do NOT require MCP tasks, health checks, or the builder/reviewer pipeline. These are pure information or advisory requests.
45
+
46
+ ### Recognize these patterns
47
+
48
+ You are in **lightweight mode** when:
49
+ - The user invokes `/ahk-ask`, `/ahk-consultant`, or `/ahk-triage`
50
+ - The user asks a question about the codebase with no intent to change it ("where is", "does this have", "how does X work", "explain Y")
51
+ - The user asks for advice on an approach without asking you to implement it
52
+ - The user describes a bug and asks for analysis, not a fix
53
+
54
+ ### What lightweight mode means
55
+
56
+ When in lightweight mode:
57
+ - **DO NOT** run `bash health.sh` — no changes are happening
58
+ - **DO NOT** call `tasks.add`, `tasks.claim`, `tasks.get`, `tasks.update` — no task lifecycle
59
+ - **DO NOT** call `actions.start`, `actions.write`, `actions.complete`, `actions.record_tool`, `actions.record_file` — no harness tracking
60
+ - **DO NOT** invoke builder or reviewer
61
+ - **DO** invoke explorer (and consultant if relevant) as subagents, passing them the user's question and explicit instructions that they are in no-harness mode
62
+ - **DO** produce a direct, synthesized answer for the user
63
+
64
+ ### How to detect lightweight mode vs. full pipeline
65
+
66
+ | Signal | Mode |
67
+ |--------|------|
68
+ | User invoked `/ahk-ask`, `/ahk-consultant`, `/ahk-triage` | Lightweight — follow skill instructions |
69
+ | "where is", "how does", "does this have", "explain", "find" | Lightweight — answer directly |
70
+ | "what do you think of", "review my approach", "is this a good idea" | Lightweight consultant mode |
71
+ | "why is this failing", "help me diagnose", describes bug asking for analysis | Lightweight triage mode |
72
+ | "implement", "build", "add", "fix", "create", "change", "delete" | Full pipeline — proceed normally |
73
+
74
+ ### File creation in lightweight mode
75
+
76
+ You may only create files in lightweight mode if the user **explicitly** asks to save the output (e.g., "write the triage report to TRIAGE.md"). Even then, do not use the full harness pipeline — just write the file directly.
77
+
78
+ > **If in lightweight mode: skip Step 1 (Orient) entirely.** No health.sh, no MCP calls.
79
+
80
+ ---
81
+
42
82
  ## Responsibilities
43
83
 
44
84
  - Pick and claim exactly one task per session
@@ -87,6 +127,25 @@ bash health.sh
87
127
 
88
128
  If exit code ≠ 0 → **stop immediately**. Report the health failure and do not proceed.
89
129
 
130
+ Then call `mcp__agent-harness-kit__ahk_doctor` (the doctor MCP tool):
131
+
132
+ ```json
133
+ ahk.doctor → returns { lib, agents, skills }
134
+ ```
135
+
136
+ If the response reports any issues, show a brief **non-blocking** warning to the user before continuing:
137
+
138
+ ```
139
+ ⚠ ahk-doctor: lib outdated (1.7.3 → 1.7.5) — run `npm i @cardor/agent-harness-kit@latest && ahk build`
140
+ ⚠ ahk-doctor: agent files outdated (lead.md, consultant.md) — run `ahk build`
141
+ ⚠ ahk-doctor: skills missing (ahk-triage) — run `ahk build`
142
+ ```
143
+
144
+ Rules:
145
+ - Do NOT block the session — warn and continue regardless
146
+ - If the MCP tool returns an error or is unreachable: skip silently, proceed normally
147
+ - **Skip this entire doctor check when in lightweight mode** (lightweight mode has no MCP calls)
148
+
90
149
  Then call `permissions.check` — if `in_sync: false`, inform the user before proceeding:
91
150
  > "Your agent permissions are outdated. Run `ahk build --sync` to update, or I can guide you."
92
151
  Wait for the user to acknowledge before continuing the session.