@jaggerxtrm/specialists 3.3.4 → 3.4.1

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.
Files changed (39) hide show
  1. package/README.md +4 -2
  2. package/bin/install.js +15 -204
  3. package/config/hooks/specialists-session-start.mjs +3 -3
  4. package/config/skills/specialists-creator/SKILL.md +22 -1
  5. package/config/skills/using-specialists/SKILL.md +261 -50
  6. package/config/specialists/debugger.specialist.yaml +121 -0
  7. package/config/specialists/executor.specialist.yaml +257 -0
  8. package/config/specialists/explorer.specialist.yaml +13 -7
  9. package/config/specialists/memory-processor.specialist.yaml +15 -1
  10. package/config/specialists/overthinker.specialist.yaml +16 -3
  11. package/config/specialists/{parallel-runner.specialist.yaml → parallel-review.specialist.yaml} +15 -1
  12. package/config/specialists/planner.specialist.yaml +31 -24
  13. package/config/specialists/reviewer.specialist.yaml +142 -0
  14. package/config/specialists/specialists-creator.specialist.yaml +10 -2
  15. package/config/specialists/sync-docs.specialist.yaml +20 -5
  16. package/config/specialists/test-runner.specialist.yaml +8 -1
  17. package/config/specialists/xt-merge.specialist.yaml +97 -16
  18. package/dist/index.js +2775 -1120
  19. package/package.json +1 -1
  20. package/config/skills/specialists-usage-workspace/iteration-1/eval-bead-background/old_skill/outputs/result.md +0 -105
  21. package/config/skills/specialists-usage-workspace/iteration-1/eval-bead-background/with_skill/outputs/result.md +0 -93
  22. package/config/skills/specialists-usage-workspace/iteration-1/eval-fresh-setup/old_skill/outputs/result.md +0 -113
  23. package/config/skills/specialists-usage-workspace/iteration-1/eval-fresh-setup/with_skill/outputs/result.md +0 -131
  24. package/config/skills/specialists-usage-workspace/iteration-1/eval-yaml-debug/old_skill/outputs/result.md +0 -159
  25. package/config/skills/specialists-usage-workspace/iteration-1/eval-yaml-debug/with_skill/outputs/result.md +0 -150
  26. package/config/skills/specialists-usage-workspace/iteration-2/eval-bug-investigation/with_skill/outputs/result.md +0 -180
  27. package/config/skills/specialists-usage-workspace/iteration-2/eval-bug-investigation/with_skill/timing.json +0 -5
  28. package/config/skills/specialists-usage-workspace/iteration-2/eval-bug-investigation/without_skill/outputs/result.md +0 -223
  29. package/config/skills/specialists-usage-workspace/iteration-2/eval-bug-investigation/without_skill/timing.json +0 -5
  30. package/config/skills/specialists-usage-workspace/iteration-2/eval-code-review/with_skill/timing.json +0 -5
  31. package/config/skills/specialists-usage-workspace/iteration-2/eval-code-review/without_skill/outputs/result.md +0 -146
  32. package/config/skills/specialists-usage-workspace/iteration-2/eval-code-review/without_skill/timing.json +0 -5
  33. package/config/skills/specialists-usage-workspace/iteration-2/eval-test-coverage/with_skill/outputs/result.md +0 -89
  34. package/config/skills/specialists-usage-workspace/iteration-2/eval-test-coverage/with_skill/timing.json +0 -5
  35. package/config/skills/specialists-usage-workspace/iteration-2/eval-test-coverage/without_skill/outputs/result.md +0 -96
  36. package/config/skills/specialists-usage-workspace/iteration-2/eval-test-coverage/without_skill/timing.json +0 -5
  37. package/config/skills/specialists-usage-workspace/skill-snapshot/SKILL.md.old +0 -237
  38. package/config/specialists/auto-remediation.specialist.yaml +0 -70
  39. package/config/specialists/bug-hunt.specialist.yaml +0 -96
@@ -5,14 +5,16 @@ description: >
5
5
  ask whether to delegate. Consult before any: code review, security audit, deep bug
6
6
  investigation, test generation, multi-file refactor, or architecture analysis. Also
7
7
  use for the mechanics of delegation: --bead workflow, --context-depth, background
8
- jobs, MCP tools (use_specialist, start_specialist, poll_specialist), specialists init,
8
+ jobs, MCP tools (use_specialist, start_specialist, feed_specialist), specialists init,
9
9
  or specialists doctor. Don't wait for the user to say "use a specialist" — proactively
10
10
  evaluate whether delegation makes sense.
11
- version: 3.1
11
+ version: 3.6
12
12
  ---
13
13
 
14
14
  # Specialists Usage
15
15
 
16
+ When this skill is loaded, you are a **coordinator first**: delegate substantial work to specialists, monitor progress, and synthesize outcomes for the user.
17
+
16
18
  Specialists are autonomous AI agents that run independently — fresh context, different
17
19
  model, no prior bias. Delegate when a task would take you significant effort, spans
18
20
  multiple files, or benefits from a dedicated focused run.
@@ -29,6 +31,8 @@ Before starting any substantial task, ask: is this worth delegating?
29
31
  - It spans multiple files or modules
30
32
  - A fresh perspective adds value (code review, security audit)
31
33
  - It can run in the background while you do other things
34
+ - You have multiple independent tasks — dispatch them as a wave
35
+ - It's a review/analysis loop (audit → approve/deny → resume) that benefits from interactive keep-alive
32
36
 
33
37
  **Do it yourself when:**
34
38
  - It's a single-file edit or quick config change
@@ -44,24 +48,60 @@ When in doubt, delegate. Specialists run in parallel — you don't have to wait.
44
48
  For tracked work, always use `--bead`. This gives the specialist your issue as context,
45
49
  links results back to the tracker, and creates an audit trail.
46
50
 
51
+ ### CLI commands
52
+
53
+ ```bash
54
+ specialists init # first-time project setup
55
+ specialists list # discover available specialists
56
+ specialists run <name> --bead <id> # foreground run (streams output)
57
+ specialists run <name> --prompt "..." # ad-hoc (no bead tracking)
58
+ specialists feed -f # tail merged feed (all jobs)
59
+ specialists feed <job-id> # events for a specific job
60
+ specialists result <job-id> # final output text
61
+ specialists steer <job-id> "new direction" # redirect ANY running job mid-run
62
+ specialists resume <job-id> "next task" # resume a waiting keep-alive job
63
+ specialists stop <job-id> # cancel a job
64
+ specialists edit <name> # edit a specialist's YAML config
65
+ specialists status --job <job-id> # single-job detail view
66
+ specialists clean # purge old job directories
67
+ specialists doctor # health check
68
+ ```
69
+
70
+ ### Typical flow
71
+
47
72
  ```bash
48
73
  # 1. Create a bead describing what you need
49
- bd create --title "Audit authentication module for security issues" --type task --priority 2
50
- # unitAI-abc
74
+ bd create --title "Fix auth token refresh bug" --type bug --priority 2
75
+ # -> unitAI-abc
51
76
 
52
- # 2. Find and run the right specialist
53
- specialists list
54
- specialists run security-audit --bead unitAI-abc --background
77
+ # 2. Run the right specialist against the bead
78
+ specialists run executor --bead unitAI-abc &
79
+ # -> Job started: a1b2c3
55
80
 
56
- # 3. Keep working; check in when ready
57
- specialists feed -f
81
+ # 3. Monitor (pick one)
82
+ specialists feed a1b2c3 # check events so far
83
+ specialists feed -f # tail all active jobs
58
84
 
59
85
  # 4. Read results and close
60
- specialists result <job-id>
61
- bd close unitAI-abc --reason "2 issues found, filed as follow-ups"
86
+ specialists result a1b2c3
87
+ bd close unitAI-abc --reason "Fixed: token refresh now retries on 401"
88
+ ```
89
+
90
+ ### Giving specialists extra context via bead notes
91
+
92
+ `--prompt` and `--bead` cannot be combined. When you need to give a specialist
93
+ specific instructions beyond what's in the bead description, update the bead notes first:
94
+
95
+ ```bash
96
+ bd update unitAI-abc --notes "INSTRUCTION: Rewrite docs/cli-reference.md from current
97
+ source. Read every command in src/cli/ and src/index.ts. Document all flags and examples."
98
+
99
+ specialists run executor --bead unitAI-abc &
62
100
  ```
63
101
 
64
- **`--background`** returns immediately; use for anything that will take more than ~30 seconds.
102
+ This pattern was used extensively in Wave 5 of a real session 4 executors all received
103
+ writing instructions via bead notes and successfully produced doc files.
104
+
65
105
  **`--context-depth N`** — how many levels of parent-bead context to inject (default: 1).
66
106
  **`--no-beads`** — skip creating an auto-tracking sub-bead, but still reads the `--bead` input.
67
107
 
@@ -71,61 +111,178 @@ bd close unitAI-abc --reason "2 issues found, filed as follow-ups"
71
111
 
72
112
  Run `specialists list` to see what's available. Match by task type:
73
113
 
74
- | Task type | Look for |
75
- |-----------|----------|
76
- | Bug / regression investigation | `bug-hunt`, `overthinker` |
77
- | Code review | `parallel-review`, `codebase-explorer` |
78
- | Test generation | `test-runner` |
79
- | Architecture / exploration | `codebase-explorer`, `feature-design` |
80
- | Planning / scoping | `planner` |
81
- | Documentation sync | `sync-docs` |
82
-
83
- When unsure, read descriptions: `specialists list --json | jq '.[].description'`
114
+ | Task type | Best specialist | Why |
115
+ |-----------|----------------|-----|
116
+ | Bug fix / implementation | **executor** (gpt-5.3-codex) | HIGH perms, writes code + tests autonomously |
117
+ | Bug investigation / "why is X broken" | **debugger** (claude-sonnet-4-6) | GitNexus-first triage, 5-phase investigation, hypothesis ranking, evidence-backed remediation. Use for ANY root cause analysis. |
118
+ | Design decisions / tradeoffs | **overthinker** (gpt-5.4) | 4-phase reasoning: analysis, devil's advocate, synthesis, conclusion. Interactive by default (`execution.interactive: true`). |
119
+ | Code review / compliance | **reviewer** (claude-sonnet-4-6) | Post-run compliance checks, verdict contract (PASS/PARTIAL/FAIL). Interactive by default (`execution.interactive: true`). |
120
+ | Multi-backend review | **parallel-review** (claude-sonnet-4-6) | Concurrent review across multiple AI backends |
121
+ | Architecture exploration | **explorer** (claude-haiku-4-5) | Fast codebase mapping, READ_ONLY |
122
+ | Reference docs / dense schemas | **explorer** (claude-haiku-4-5) | Better than sync-docs for reference-heavy output |
123
+ | Planning / scoping | **planner** (claude-sonnet-4-6) | Structured issue breakdown with deps |
124
+ | Doc audit / drift detection | **sync-docs** (claude-sonnet-4-6) | Interactive by default (`execution.interactive: true`): audits first, then approve/deny via `resume` |
125
+ | Doc drift / audit | **sync-docs** (claude-sonnet-4-6) | Detects stale docs, restructures content |
126
+ | Doc writing / updates | **executor** (gpt-5.3-codex) | sync-docs defaults to audit mode; executor writes files |
127
+ | Test generation | **test-runner** (claude-haiku-4-5) | Runs suites, interprets failures |
128
+ | Specialist authoring | **specialists-creator** (claude-sonnet-4-6) | Guides YAML creation against schema |
129
+
130
+ ### Specialist selection lessons (from real sessions)
131
+
132
+ - **debugger** is the most powerful investigation specialist. Uses GitNexus call-chain tracing (when available) for 5-phase root cause analysis with ranked hypotheses. Use for ANY "why is X broken" question — don't do the investigation yourself.
133
+ - **sync-docs** is an interactive specialist — it audits first, then waits for approval before executing. This is correct behavior, not a bug.
134
+ - **overthinker** and **reviewer** are also interactive.
135
+ - Canonical pattern: use `start_specialist` / `specialists run` normally; interactive specialists now default to keep-alive via `execution.interactive: true`.
136
+ - Use `--no-keep-alive` only when you explicitly want a one-shot run.
137
+ - **explorer** is fast and cheap (Haiku) but READ_ONLY — output auto-appends to the input bead's notes. Use for investigation, not implementation.
138
+ - **executor** is the workhorse — HIGH permissions, writes code and docs, runs tests, closes beads. Best for any task that needs files written.
139
+ - **use_specialist MCP** is best for quick foreground runs where you need the result immediately in your context.
140
+
141
+ ### Pi extensions availability (known gap)
142
+
143
+ GitNexus and Serena are **pi extensions** (not MCP servers) at `~/.pi/agent/extensions/`.
144
+ Specialists run with `--no-extensions` and only selectively re-enable `quality-gates` and
145
+ `service-skills`. GitNexus (call-chain tracing for debugger/planner) and Serena LSP
146
+ (token-efficient reads for explorer/executor) are NOT currently wired. Tracked as `unitAI-4abv`.
84
147
 
85
148
  ---
86
149
 
87
- ## When a Specialist Fails
150
+ ## Steering and Resume
151
+
152
+ ### Steer — redirect any running job
88
153
 
89
- If a specialist times out or errors, **don't silently fall back to doing the work yourself**.
90
- Surface the failure — the user may want to fix the specialist config or switch to a different one.
154
+ `steer` sends a message to a running specialist. Delivered after the current tool call
155
+ finishes, before the next LLM call. Works for **all running jobs**.
91
156
 
92
157
  ```bash
93
- specialists feed <job-id> # see what happened
94
- specialists doctor # check for systemic issues
158
+ # Specialist is going off track — redirect it
159
+ specialists steer a1b2c3 "STOP what you are doing. Focus only on supervisor.ts"
160
+
161
+ # Specialist is auditing when it should be writing
162
+ specialists steer a1b2c3 "Do NOT audit. Write the actual file to disk now."
163
+ ```
164
+
165
+ Real example from today: an explorer was reading every file in src/cli/ when we only needed
166
+ confirmation that steering worked. Sent `specialists steer 763ff4 "STOP. Just output:
167
+ STEERING WORKS"` — message delivered, output confirmed in 2 seconds.
168
+
169
+ ### Resume — continue an interactive session
170
+
171
+ `resume` sends a new prompt to a specialist that has finished its turn and is `waiting`.
172
+ Works for jobs started with keep-alive behavior (including specialists with `execution.interactive: true`).
173
+ The session retains full conversation history.
174
+
175
+ ```bash
176
+ # Start an overthinker for multi-turn design work
177
+ # overthinker is interactive by default, so no extra flag is required
178
+ specialists run overthinker --bead unitAI-xyz &
179
+ # -> Job started: d4e5f6 (completes Phase 4, enters waiting state)
180
+
181
+ # Read the design output
182
+ specialists result d4e5f6
183
+
184
+ # Ask follow-up questions
185
+ specialists resume d4e5f6 "What about backward compatibility with existing YAML files?"
186
+ specialists resume d4e5f6 "How would you handle migration from the old schema?"
95
187
  ```
96
188
 
97
- If you need to retry: try foreground mode (no `--background`) for shorter timeout exposure,
98
- or try a different specialist. If all else fails, tell the user what you attempted and why
99
- it failed before doing the work yourself.
189
+ Use interactive specialists when you plan to iterate: design reviews, multi-phase analysis,
190
+ investigation that may need follow-up questions based on findings.
191
+ Use `--no-keep-alive` only when you want to force single-turn behavior.
100
192
 
101
193
  ---
102
194
 
103
- ## Ad-Hoc (No Tracking)
195
+ ## Wave Orchestration
196
+
197
+ For multiple independent tasks, dispatch specialists in parallel waves.
198
+
199
+ ### Planning a wave
200
+
201
+ Group tasks by dependency:
202
+ 1. **Wave 1**: Bug fixes and blockers (unblock downstream work)
203
+ 2. **Wave 2**: Features and design (now that the surface is stable)
204
+ 3. **Wave 3**: Documentation (after code changes land — use executors, not sync-docs)
205
+
206
+ ### Dispatching a wave
104
207
 
105
208
  ```bash
106
- specialists run codebase-explorer --prompt "Map the feed command architecture"
209
+ # Fire multiple specialists in parallel (--background for reliable detach)
210
+ specialists run executor --bead unitAI-abc --background
211
+ specialists run executor --bead unitAI-def --background
212
+ specialists run overthinker --bead unitAI-ghi --background
107
213
  ```
108
214
 
109
- Use `--prompt` only for throwaway exploration. For anything worth remembering, use `--bead`.
215
+ ### Monitoring a wave
216
+
217
+ ```bash
218
+ # Quick status check on all jobs
219
+ for job in abc123 def456 ghi789; do
220
+ python3 -c "import json; d=json.load(open('.specialists/jobs/$job/status.json')); \
221
+ print(f'$job {d[\"specialist\"]:12} {d[\"status\"]:10} {d.get(\"elapsed_s\",\"?\")}s')"
222
+ done
223
+
224
+ # Or use feed for event-level detail
225
+ specialists feed <job-id>
226
+ ```
227
+
228
+ ### Between waves
229
+
230
+ After each wave completes:
231
+ 1. **Read results**: `specialists result <job-id>` for each
232
+ 2. **Validate**: run lint + tests on the combined output
233
+ 3. **Commit**: stage, commit, push — clean git before next wave
234
+ 4. **Close beads**: `bd close <id> --reason "..."`
235
+
236
+ ### Real wave example (from a 6-wave session)
237
+
238
+ ```
239
+ Wave 1: 2x executor → fixed --background flag + migrated start_specialist to Supervisor
240
+ Wave 2: overthinker + 2x executor → output contract design + retry logic + footer fix
241
+ Wave 3: 4x sync-docs + 3x explorer → docs audit (produced reports, not files)
242
+ Wave 4: 5x executor + 2x explorer → output contract impl + READ_ONLY auto-append + 4 fixes
243
+ Wave 5: 4x executor → rewrote 4 doc files (executors write files, sync-docs only audits)
244
+ Wave 6: 4x executor + overthinker (interactive) → cleanup + manifest design with follow-ups
245
+ ```
246
+
247
+ Key insight: **executors write files, sync-docs audits**. When you need docs written
248
+ to disk, use executor with bead notes containing "INSTRUCTION: Write <file>...".
110
249
 
111
250
  ---
112
251
 
113
- ## Example: Delegation in Practice
252
+ ## Coordinator Responsibilities
114
253
 
115
- You're asked to review `src/auth/` for security issues. Without delegation, you'd read
116
- every file and write findings yourself — 15+ minutes, your full attention.
254
+ As the orchestrator, you own things specialists cannot do:
117
255
 
118
- With a specialist:
256
+ ### 1. Validate combined output across specialists
257
+ Multiple specialists writing to the same worktree can conflict. After each wave:
119
258
  ```bash
120
- bd create --title "Security review: src/auth/" --type task --priority 1 # → unitAI-xyz
121
- specialists list --category security
122
- specialists run security-audit --bead unitAI-xyz --background # → job_4a2b1c
123
- # go do other work
124
- specialists result job_4a2b1c
125
- bd close unitAI-xyz --reason "Found 2 issues, filed unitAI-abc, unitAI-def"
259
+ npm run lint # or project-specific quality gate
260
+ bun test # run affected tests
261
+ git diff --stat # review what changed
262
+ ```
263
+
264
+ ### 2. Handle failures don't silently fall back
265
+ If a specialist stalls or errors, surface it. Don't quietly do the work yourself.
266
+ ```bash
267
+ specialists feed <job-id> # see what happened
268
+ specialists doctor # check for systemic issues
126
269
  ```
127
270
 
128
- The specialist runs with full bead context, on a model tuned for the task, while you stay unblocked.
271
+ Options when a specialist fails:
272
+ - **Steer** it back on track: `specialists steer <id> "Focus on X instead"`
273
+ - **Switch specialist** (e.g., sync-docs stalls → try explorer or executor)
274
+ - **Stop and report** to the user before doing it yourself
275
+
276
+ ### 3. Close beads and commit between waves
277
+ Keep git clean between waves. Specialists write to the same worktree, so stacking
278
+ uncommitted changes from multiple waves creates merge pain.
279
+
280
+ ### 4. Run drift detection after doc-heavy sessions
281
+ ```bash
282
+ python3 .agents/skills/sync-docs/scripts/drift_detector.py scan --json
283
+ # Then dispatch executor for any stale docs, stamp synced_at on fresh ones:
284
+ python3 .agents/skills/sync-docs/scripts/drift_detector.py update-sync <file>
285
+ ```
129
286
 
130
287
  ---
131
288
 
@@ -137,22 +294,76 @@ Available after `specialists init` and session restart.
137
294
  |------|---------|
138
295
  | `specialist_init` | Bootstrap once per session |
139
296
  | `use_specialist` | Foreground run; pass `bead_id` for tracked work |
140
- | `start_specialist` | Async: returns job ID immediately |
141
- | `poll_specialist` | Check status + delta output |
142
- | `stop_specialist` | Cancel |
143
- | `run_parallel` | Concurrent or pipeline execution |
297
+ | `start_specialist` | Async: returns job ID immediately (Supervisor-backed) |
298
+ | `feed_specialist` | Cursor-paginated run events (status + deltas) |
299
+ | `resume_specialist` | Next-turn prompt for keep-alive jobs in `waiting` |
300
+ | `steer_specialist` | Mid-run steering message for active jobs |
301
+ | `stop_specialist` | Cancel (sends SIGTERM to job PID) |
144
302
  | `specialist_status` | Circuit breaker health + staleness |
145
303
 
304
+ ### CLI vs MCP equivalences
305
+
306
+ | Action | CLI | MCP |
307
+ |--------|-----|-----|
308
+ | Run foreground (one-shot) | `specialists run <name> --bead <id>` | `use_specialist({name, bead_id})` |
309
+ | Run background (interactive-capable) | `specialists run <name> --bead <id> --background` | `start_specialist({name, bead_id})` |
310
+ | Monitor events | `specialists feed <job-id>` | `feed_specialist({job_id, cursor})` |
311
+ | Read result | `specialists result <job-id>` | — (CLI only) |
312
+ | Steer mid-run | `specialists steer <job-id> "msg"` | `steer_specialist({job_id, message})` |
313
+ | Resume waiting | `specialists resume <job-id> "task"` | `resume_specialist({job_id, task})` |
314
+ | Cancel | `specialists stop <job-id>` | `stop_specialist({job_id})` |
315
+
316
+ **Canonical pattern:** `use_specialist` is one-shot. For interactive review/analysis flows,
317
+ use `start_specialist` then `resume_specialist`.
318
+
319
+ **Prefer CLI** for most orchestration work — it's simpler and output is easier to inspect.
320
+ **Use MCP** (`use_specialist`) when you need a direct one-shot result in your conversation context.
321
+
322
+ ---
323
+
324
+ ## feed_specialist Observation Pattern
325
+
326
+ Use cursor-based polling for structured progress when monitoring long specialist runs:
327
+
328
+ ```bash
329
+ # first read
330
+ feed_specialist({job_id: "abc123"})
331
+ # => {events:[...], next_cursor: 12, has_more: true, is_complete: false}
332
+
333
+ # continue from cursor
334
+ feed_specialist({job_id: "abc123", cursor: 12})
335
+ # => {events:[...], next_cursor: 25, has_more: false, is_complete: true}
336
+ ```
337
+
338
+ When `is_complete: true` and `has_more: false`, fetch final text with:
339
+
340
+ ```bash
341
+ specialists result <job-id>
342
+ ```
343
+
344
+ ---
345
+
346
+ ## Known Issues
347
+
348
+ - **sync-docs audit-first behavior is expected** for interactive review/audit flow.
349
+ Start normally, read the audit output, then `specialists resume <job-id> "approved: execute phase 4-5"`
350
+ if you want it to apply fixes.
351
+ - **READ_ONLY output auto-appends** to the input bead after completion. No manual piping
352
+ needed (fixed in the Supervisor). But the output also lives in `specialists result`.
353
+
146
354
  ---
147
355
 
148
356
  ## Setup and Troubleshooting
149
357
 
150
358
  ```bash
151
- specialists init # first-time setup: creates specialists/, wires AGENTS.md
359
+ specialists init # first-time setup: creates .specialists/, wires AGENTS.md/CLAUDE.md
152
360
  specialists doctor # health check: hooks, MCP, zombie jobs
361
+ specialists edit <name> # edit a specialist's YAML config
153
362
  ```
154
363
 
155
364
  - **"specialist not found"** → `specialists list` (project-scope only)
156
- - **Job hangs** → `specialists feed <id>`; `specialists stop` to cancel
365
+ - **Job hangs** → `specialists steer <id> "finish up"` or `specialists stop <id>`
157
366
  - **MCP tools missing** → `specialists init` then restart Claude Code
158
367
  - **YAML skipped** → stderr shows `[specialists] skipping <file>: <reason>`
368
+ - **Stall timeout** → specialist hit 120s inactivity. Check `specialists feed <id>`, then retry or switch specialist.
369
+ - **`--prompt` and `--bead` conflict** → use bead notes: `bd update <id> --notes "INSTRUCTION: ..."` then `--bead` only.
@@ -0,0 +1,121 @@
1
+ specialist:
2
+ metadata:
3
+ name: debugger
4
+ version: 1.2.0
5
+ description: >-
6
+ Autonomous debugger: given any symptom, error, or stack trace, systematically
7
+ traces call chains with GitNexus, identifies root cause at file:line precision,
8
+ ranks hypotheses, and delivers a prioritized, evidence-backed remediation plan.
9
+ category: debugging
10
+ tags:
11
+ - debugging
12
+ - root-cause
13
+ - investigation
14
+ - remediation
15
+ - gitnexus
16
+ - call-chain
17
+ - autonomous
18
+ updated: "2026-03-27"
19
+
20
+ execution:
21
+ mode: tool
22
+ model: anthropic/claude-sonnet-4-6
23
+ fallback_model: qwen-cli/qwen3-coder-plus
24
+ timeout_ms: 0
25
+ stall_timeout_ms: 120000
26
+ response_format: markdown
27
+ permission_required: LOW
28
+ thinking_level: low
29
+
30
+ prompt:
31
+ system: |
32
+ You are an autonomous debugger specialist. Given a symptom, error message, or
33
+ stack trace, you conduct a disciplined, tool-driven investigation to identify
34
+ the root cause and deliver an actionable remediation plan.
35
+
36
+ ## Investigation Workflow
37
+
38
+ Work through these phases in order. Stop as soon as you have enough evidence.
39
+
40
+ ### Phase 0 — GitNexus Triage (preferred, skip if unavailable)
41
+
42
+ Use the knowledge graph to orient yourself before touching any source files.
43
+
44
+ 1. `gitnexus_query({query: "<error text or symptom>"})`
45
+ 2. `gitnexus_context({name: "<suspect symbol>"})`
46
+ 3. Read `gitnexus://repo/{name}/process/{processName}` for execution trace details
47
+ 4. Optional: `gitnexus_cypher({query: "MATCH path = ..."})` for custom traversal
48
+
49
+ Then read source files only for pinpointed suspects — never the whole codebase.
50
+
51
+ ### Phase 1 — File Discovery (fallback if GitNexus unavailable)
52
+
53
+ Parse the symptom for candidate locations:
54
+ - stack trace file paths + line numbers
55
+ - module/import names in errors
56
+ - error codes or exception types tied to subsystems
57
+
58
+ Use `grep` and `find` to locate code quickly; read only relevant sections.
59
+
60
+ ### Phase 2 — Root Cause Analysis
61
+
62
+ Determine:
63
+ - the exact line/expression causing failure
64
+ - causal explanation of observed symptom
65
+ - whether root cause or downstream effect
66
+ - likely side effects on related components
67
+
68
+ ### Phase 3 — Hypothesis Ranking
69
+
70
+ Produce 3–5 ranked hypotheses, each with:
71
+ - hypothesis statement
72
+ - supporting evidence
73
+ - quick confirmation experiment/command
74
+ - confidence (HIGH/MEDIUM/LOW)
75
+
76
+ ### Phase 4 — Remediation Plan
77
+
78
+ Produce up to 5 prioritized remediation steps with:
79
+ - file/line scope
80
+ - expected outcome
81
+ - verification command
82
+ - residual risks
83
+
84
+ ## Output Format
85
+
86
+ Always output a complete **Bug Investigation Report**:
87
+ - Symptoms
88
+ - Investigation path (GitNexus traces or files analyzed)
89
+ - Root cause (with file:line references)
90
+ - Ranked hypotheses
91
+ - Fix plan
92
+ - Concise summary
93
+
94
+ EFFICIENCY RULE: Stop using tools and write the final report after at most 15 tool calls.
95
+
96
+ task_template: |
97
+ Debug the following issue:
98
+
99
+ $prompt
100
+
101
+ Working directory: $cwd
102
+
103
+ Start with gitnexus_query for the symptom/error text if GitNexus is available.
104
+ Then trace call chains with gitnexus_context. Read source files for pinpointed suspects.
105
+ Fall back to grep/find if GitNexus is unavailable. Produce a full Bug Investigation Report.
106
+
107
+ skills:
108
+ paths:
109
+ - .agents/skills/xt-debugging/SKILL.md
110
+
111
+ capabilities:
112
+ required_tools: [bash, grep, find, read]
113
+ external_commands: [grep]
114
+
115
+ validation:
116
+ files_to_watch:
117
+ - src/specialist/schema.ts
118
+ - src/specialist/runner.ts
119
+ - .agents/skills/xt-debugging/SKILL.md
120
+ stale_threshold_days: 30
121
+