@jaggerxtrm/specialists 3.17.0 โ†’ 3.18.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 (255) hide show
  1. package/README.md +268 -134
  2. package/config/mandatory-rules/executor-delivery.md +4 -0
  3. package/config/mandatory-rules/json-only-final-output.md +13 -0
  4. package/config/mandatory-rules/service-skills-diff-scan-mandatory.md +26 -0
  5. package/config/mandatory-rules/service-skills-gitnexus-triage.md +5 -0
  6. package/config/mandatory-rules/test-runner-execution-scope.md +4 -0
  7. package/config/skills/setup-specialists/SKILL.md +556 -0
  8. package/config/skills/specialists-creator/SKILL.md +132 -4
  9. package/config/skills/specialists-creator/scripts/audit-spec-uniformity.mjs +1 -1
  10. package/config/skills/using-specialists-v3/SKILL.md +80 -20
  11. package/config/specialists/bare.specialist.json +3 -3
  12. package/config/specialists/changelog-drafter.specialist.json +5 -4
  13. package/config/specialists/changelog-keeper.specialist.json +7 -6
  14. package/config/specialists/debugger.specialist.json +2 -2
  15. package/config/specialists/executor.specialist.json +2 -2
  16. package/config/specialists/explorer.specialist.json +4 -4
  17. package/config/specialists/memory-processor.specialist.json +3 -3
  18. package/config/specialists/node-coordinator.specialist.json +3 -3
  19. package/config/specialists/obligations-scanner.specialist.json +67 -17
  20. package/config/specialists/overthinker.specialist.json +3 -3
  21. package/config/specialists/planner.specialist.json +4 -4
  22. package/config/specialists/quant-methodologist.specialist.json +145 -0
  23. package/config/specialists/quant-researcher.specialist.json +144 -0
  24. package/config/specialists/researcher.specialist.json +5 -5
  25. package/config/specialists/reviewer.specialist.json +1 -1
  26. package/config/specialists/seconder.specialist.json +2 -2
  27. package/config/specialists/security-auditor.specialist.json +2 -2
  28. package/config/specialists/service-skills-sync.specialist.json +90 -75
  29. package/config/specialists/specialists-creator.specialist.json +4 -4
  30. package/config/specialists/sync-docs.specialist.json +4 -4
  31. package/config/specialists/test-engineer.specialist.json +3 -3
  32. package/config/specialists/test-runner.specialist.json +7 -7
  33. package/config/specialists/transcriber.specialist.json +3 -3
  34. package/config/specialists/xt-merge.specialist.json +4 -4
  35. package/dist/asset-contract.json +22 -3
  36. package/dist/index.js +28711 -18517
  37. package/dist/lib.js +10020 -6150
  38. package/dist/types/cli/console/components.d.ts +83 -0
  39. package/dist/types/cli/console/components.d.ts.map +1 -0
  40. package/dist/types/cli/console/config-source.d.ts +58 -0
  41. package/dist/types/cli/console/config-source.d.ts.map +1 -0
  42. package/dist/types/cli/console/forensic.d.ts +11 -0
  43. package/dist/types/cli/console/forensic.d.ts.map +1 -0
  44. package/dist/types/cli/console/git.d.ts +28 -0
  45. package/dist/types/cli/console/git.d.ts.map +1 -0
  46. package/dist/types/cli/console/help.d.ts +2 -0
  47. package/dist/types/cli/console/help.d.ts.map +1 -0
  48. package/dist/types/cli/console/log.d.ts +13 -0
  49. package/dist/types/cli/console/log.d.ts.map +1 -0
  50. package/dist/types/cli/console/repo-config.d.ts +26 -0
  51. package/dist/types/cli/console/repo-config.d.ts.map +1 -0
  52. package/dist/types/cli/console/repo-discovery.d.ts +12 -0
  53. package/dist/types/cli/console/repo-discovery.d.ts.map +1 -0
  54. package/dist/types/cli/console/runtime.d.ts +12 -0
  55. package/dist/types/cli/console/runtime.d.ts.map +1 -0
  56. package/dist/types/cli/console/subscribe-prototype.d.ts +18 -0
  57. package/dist/types/cli/console/subscribe-prototype.d.ts.map +1 -0
  58. package/dist/types/cli/console/theme.d.ts +91 -0
  59. package/dist/types/cli/console/theme.d.ts.map +1 -0
  60. package/dist/types/cli/console/types.d.ts +231 -0
  61. package/dist/types/cli/console/types.d.ts.map +1 -0
  62. package/dist/types/cli/console/view-model.d.ts +252 -0
  63. package/dist/types/cli/console/view-model.d.ts.map +1 -0
  64. package/dist/types/cli/console.d.ts +2 -0
  65. package/dist/types/cli/console.d.ts.map +1 -0
  66. package/dist/types/cli/db.d.ts.map +1 -1
  67. package/dist/types/cli/doctor.d.ts.map +1 -1
  68. package/dist/types/cli/edit.d.ts.map +1 -1
  69. package/dist/types/cli/epic.d.ts.map +1 -1
  70. package/dist/types/cli/feed.d.ts.map +1 -1
  71. package/dist/types/cli/forensic.d.ts +2 -0
  72. package/dist/types/cli/forensic.d.ts.map +1 -0
  73. package/dist/types/cli/format-helpers.d.ts +4 -2
  74. package/dist/types/cli/format-helpers.d.ts.map +1 -1
  75. package/dist/types/cli/help.d.ts.map +1 -1
  76. package/dist/types/cli/init.d.ts +10 -0
  77. package/dist/types/cli/init.d.ts.map +1 -1
  78. package/dist/types/cli/list.d.ts.map +1 -1
  79. package/dist/types/cli/log.d.ts.map +1 -1
  80. package/dist/types/cli/merge.d.ts.map +1 -1
  81. package/dist/types/cli/metrics.d.ts +2 -0
  82. package/dist/types/cli/metrics.d.ts.map +1 -0
  83. package/dist/types/cli/ps.d.ts.map +1 -1
  84. package/dist/types/cli/result.d.ts.map +1 -1
  85. package/dist/types/cli/run.d.ts +20 -0
  86. package/dist/types/cli/run.d.ts.map +1 -1
  87. package/dist/types/cli/script.d.ts +3 -0
  88. package/dist/types/cli/script.d.ts.map +1 -1
  89. package/dist/types/cli/serve.d.ts.map +1 -1
  90. package/dist/types/cli/setup.d.ts +19 -1
  91. package/dist/types/cli/setup.d.ts.map +1 -1
  92. package/dist/types/cli/status.d.ts.map +1 -1
  93. package/dist/types/cli/version-check.d.ts +1 -0
  94. package/dist/types/cli/version-check.d.ts.map +1 -1
  95. package/dist/types/index.d.ts +1 -1
  96. package/dist/types/pi/session.d.ts +12 -1
  97. package/dist/types/pi/session.d.ts.map +1 -1
  98. package/dist/types/server.d.ts +15 -0
  99. package/dist/types/server.d.ts.map +1 -1
  100. package/dist/types/specialist/benchmarks.d.ts +37 -0
  101. package/dist/types/specialist/benchmarks.d.ts.map +1 -0
  102. package/dist/types/specialist/chain-identity.d.ts +7 -1
  103. package/dist/types/specialist/chain-identity.d.ts.map +1 -1
  104. package/dist/types/specialist/control.d.ts.map +1 -1
  105. package/dist/types/specialist/dead-job-audit.d.ts +20 -0
  106. package/dist/types/specialist/dead-job-audit.d.ts.map +1 -0
  107. package/dist/types/specialist/forensic-events.d.ts +138 -0
  108. package/dist/types/specialist/forensic-events.d.ts.map +1 -0
  109. package/dist/types/specialist/forensic-renderer.d.ts +34 -0
  110. package/dist/types/specialist/forensic-renderer.d.ts.map +1 -0
  111. package/dist/types/specialist/git-diff-evidence.d.ts +28 -0
  112. package/dist/types/specialist/git-diff-evidence.d.ts.map +1 -0
  113. package/dist/types/specialist/global-config.d.ts +389 -0
  114. package/dist/types/specialist/global-config.d.ts.map +1 -0
  115. package/dist/types/specialist/launch.d.ts +9 -0
  116. package/dist/types/specialist/launch.d.ts.map +1 -1
  117. package/dist/types/specialist/live-aggregates.d.ts +46 -0
  118. package/dist/types/specialist/live-aggregates.d.ts.map +1 -0
  119. package/dist/types/specialist/loader.d.ts +50 -1
  120. package/dist/types/specialist/loader.d.ts.map +1 -1
  121. package/dist/types/specialist/model-chain.d.ts +7 -0
  122. package/dist/types/specialist/model-chain.d.ts.map +1 -0
  123. package/dist/types/specialist/model-probes.d.ts +28 -0
  124. package/dist/types/specialist/model-probes.d.ts.map +1 -0
  125. package/dist/types/specialist/node-contract.d.ts +18 -18
  126. package/dist/types/specialist/node-supervisor.d.ts.map +1 -1
  127. package/dist/types/specialist/observability-db.d.ts +1 -1
  128. package/dist/types/specialist/observability-db.d.ts.map +1 -1
  129. package/dist/types/specialist/observability-sqlite.d.ts +101 -0
  130. package/dist/types/specialist/observability-sqlite.d.ts.map +1 -1
  131. package/dist/types/specialist/pr-drift-refresh.d.ts +17 -0
  132. package/dist/types/specialist/pr-drift-refresh.d.ts.map +1 -0
  133. package/dist/types/specialist/preset-resolver.d.ts +56 -0
  134. package/dist/types/specialist/preset-resolver.d.ts.map +1 -0
  135. package/dist/types/specialist/prometheus-projection.d.ts +25 -0
  136. package/dist/types/specialist/prometheus-projection.d.ts.map +1 -0
  137. package/dist/types/specialist/runner.d.ts +29 -1
  138. package/dist/types/specialist/runner.d.ts.map +1 -1
  139. package/dist/types/specialist/schema.d.ts +163 -54
  140. package/dist/types/specialist/schema.d.ts.map +1 -1
  141. package/dist/types/specialist/script-runner.d.ts +5 -1
  142. package/dist/types/specialist/script-runner.d.ts.map +1 -1
  143. package/dist/types/specialist/snapshot-diff.d.ts +8 -0
  144. package/dist/types/specialist/snapshot-diff.d.ts.map +1 -0
  145. package/dist/types/specialist/source-queue.d.ts +13 -0
  146. package/dist/types/specialist/source-queue.d.ts.map +1 -0
  147. package/dist/types/specialist/status-load.d.ts.map +1 -1
  148. package/dist/types/specialist/supervisor.d.ts +25 -1
  149. package/dist/types/specialist/supervisor.d.ts.map +1 -1
  150. package/dist/types/specialist/timeline-events.d.ts +70 -1
  151. package/dist/types/specialist/timeline-events.d.ts.map +1 -1
  152. package/dist/types/tools/specialist/resume_specialist.tool.d.ts +4 -4
  153. package/dist/types/tools/specialist/specialist_status.tool.d.ts +1 -1
  154. package/dist/types/tools/specialist/steer_specialist.tool.d.ts +4 -4
  155. package/dist/types/tools/specialist/use_specialist.tool.d.ts +16 -16
  156. package/docs/ARCHITECTURE.md +1176 -0
  157. package/docs/TODO.md +9 -0
  158. package/docs/architecture.md +11 -0
  159. package/docs/archive/2026-03-13-bd-decision-context-template-plan.md +96 -0
  160. package/docs/archive/AGENT-HANDOFF.md +351 -0
  161. package/docs/archive/PARITY-ANALYSIS.md +296 -0
  162. package/docs/archive/SPECIALISTS_REFACTOR.md.md +30 -0
  163. package/docs/archive/cc-programmatic.md +216 -0
  164. package/docs/archive/claude-agent-sdk.md +594 -0
  165. package/docs/archive/decision-specialist-directory.md +41 -0
  166. package/docs/archive/discoveries.md +148 -0
  167. package/docs/archive/executor-benchmark-protocol.md +198 -0
  168. package/docs/archive/future-features.md +66 -0
  169. package/docs/archive/gzrx-completion-critique.md +183 -0
  170. package/docs/archive/gzrx-research-notes.md +401 -0
  171. package/docs/archive/gzrx-tool-catalog.md +760 -0
  172. package/docs/archive/iron-review-hardening-qa-chain-substrate.md +322 -0
  173. package/docs/archive/iron-review-hardening.html +1004 -0
  174. package/docs/archive/issuetracking.md +312 -0
  175. package/docs/archive/qa-v3.0.2.md +220 -0
  176. package/docs/archive/restructure.md +231 -0
  177. package/docs/archive/script-specialists.md +1254 -0
  178. package/docs/archive/spec-v3.md +792 -0
  179. package/docs/archive/specialist-stats.md +127 -0
  180. package/docs/archive/specialists-friction-audit.md +1347 -0
  181. package/docs/archive/specialists-runtime-critique.md +170 -0
  182. package/docs/archive/specialists-service-evaluation.md +713 -0
  183. package/docs/archive/specialists-substrate-alignment.md +255 -0
  184. package/docs/archive/substrate-review.md +1288 -0
  185. package/docs/archive/test-writer-specialist.md +254 -0
  186. package/docs/archive/using-specialists-v3-improvements-2026-05-09.md +600 -0
  187. package/docs/archive/xtrm-specialists-analysis.md +314 -0
  188. package/docs/authoring.md +701 -0
  189. package/docs/background-jobs.md +203 -0
  190. package/docs/bare-specialists.md +83 -0
  191. package/docs/benchmarks/executor-benchmark-runner.md +66 -0
  192. package/docs/bootstrap.md +161 -0
  193. package/docs/cli-reference.md +1645 -0
  194. package/docs/deploying-alongside.md +155 -0
  195. package/docs/design/README.md +36 -0
  196. package/docs/design/darth-feedor-migration.md +290 -0
  197. package/docs/design/roadmap/README.md +32 -0
  198. package/docs/design/roadmap/chain-templates/README.md +146 -0
  199. package/docs/design/roadmap/chain-templates/code-quick.formula.json +27 -0
  200. package/docs/design/roadmap/chain-templates/code-standard.formula.json +126 -0
  201. package/docs/design/roadmap/chain-templates/code-with-advisors.formula.json +128 -0
  202. package/docs/design/roadmap/chain-templates/code-with-tests.formula.json +76 -0
  203. package/docs/design/roadmap/chain-templates/debug.formula.json +128 -0
  204. package/docs/design/roadmap/chain-templates/doc-sync.formula.json +28 -0
  205. package/docs/design/roadmap/chain-templates/memory-hygiene.formula.json +27 -0
  206. package/docs/design/roadmap/chain-templates/planning.formula.json +27 -0
  207. package/docs/design/roadmap/chain-templates/premortem.formula.json +26 -0
  208. package/docs/design/roadmap/chain-templates/release-prep.formula.json +36 -0
  209. package/docs/design/roadmap/chain-templates/research-only.formula.json +28 -0
  210. package/docs/design/roadmap/chain-templates/restitch.formula.json +125 -0
  211. package/docs/design/roadmap/chain-templates/security-deep.formula.json +161 -0
  212. package/docs/design/roadmap/chain-templates/test-only.formula.json +52 -0
  213. package/docs/design/roadmap/chain-templates/triage.formula.json +35 -0
  214. package/docs/design/roadmap/history/handoff-from-substrate-design.md +87 -0
  215. package/docs/design/roadmap/history/substrate-reconciliation.md +105 -0
  216. package/docs/design/roadmap/specialists-roadmap.md +1261 -0
  217. package/docs/design/sp-console-subscribe-via-materializer.md +231 -0
  218. package/docs/design/sp-console-tui-mock-v2.html +293 -0
  219. package/docs/design/sp-console-tui-mock.html +120 -0
  220. package/docs/design/sp-console-tui.md +340 -0
  221. package/docs/design/specialist-agentops-suite.md +323 -0
  222. package/docs/design/substrate/channels.md +14 -0
  223. package/docs/design/substrate/devops-platform-engineering-prd.md +446 -0
  224. package/docs/design/substrate/html-design-example.md +339 -0
  225. package/docs/design/xtrm-tiers-architecture.svg +132 -0
  226. package/docs/devops/dependency-verdict-materialization.md +46 -0
  227. package/docs/epic-readiness.md +75 -0
  228. package/docs/examples/mercury-atomic-summarizer.specialist.json +26 -0
  229. package/docs/examples/smoke-echo-text-expected-keys.specialist.json +25 -0
  230. package/docs/examples/smoke-echo.specialist.json +25 -0
  231. package/docs/features.md +1577 -0
  232. package/docs/hooks.md +81 -0
  233. package/docs/installation.md +142 -0
  234. package/docs/manifest.md +184 -0
  235. package/docs/mcp-servers.md +73 -0
  236. package/docs/mcp-tools.md +71 -0
  237. package/docs/nodes.md +231 -0
  238. package/docs/observability-metrics.md +152 -0
  239. package/docs/operator/sp-console-v2-walkthrough.md +410 -0
  240. package/docs/overrides-guide.md +306 -0
  241. package/docs/pi-rpc-boundary.md +118 -0
  242. package/docs/pi-session.md +195 -0
  243. package/docs/release.md +22 -0
  244. package/docs/skills.md +132 -0
  245. package/docs/specialists/handoff-schema.md +181 -0
  246. package/docs/specialists-catalog.md +99 -0
  247. package/docs/specialists-service-install.md +226 -0
  248. package/docs/specialists-service.md +363 -0
  249. package/docs/surface-ownership.md +138 -0
  250. package/docs/upgrade-notes/kan-90-global-user-config.md +114 -0
  251. package/docs/upgrade-notes/kan-91-expanded-overrides.md +261 -0
  252. package/docs/workflow.md +114 -0
  253. package/docs/worktree.md +71 -0
  254. package/docs/worktrees.md +309 -0
  255. package/package.json +7 -4
package/docs/TODO.md ADDED
@@ -0,0 +1,9 @@
1
+ ---
2
+ title: Todo
3
+ scope: todo
4
+ category: reference
5
+ version: 1.0.0
6
+ updated: 2026-03-19
7
+ domain: []
8
+ ---
9
+
@@ -0,0 +1,11 @@
1
+ # Architecture addendum
2
+
3
+ ## Benchmark and probe cache layout
4
+
5
+ Benchmark snapshots live under `~/.cache/specialists/benchmarks/<source>.json`.
6
+ Each file stores `source`, `source_url`, `fetched_at`, and normalized `models` rows.
7
+ Writes use temp file, fsync, then rename.
8
+
9
+ Agentic follow-through probes live under `~/.cache/specialists/probes/<model>-<spec>-<sha>/<run-id>/`.
10
+ Each run directory contains isolated probe workspace files, `events.jsonl`, and `probe-summary.json`.
11
+ Probe code passes run directory as specialist `projectDir`; transcript paths remain under probe cache.
@@ -0,0 +1,96 @@
1
+ # Idea Plan: Decision Context Template for Beads-Driven Specialist Work
2
+
3
+ Date: 2026-03-13
4
+ Status: idea (not tracked as a bd issue yet)
5
+ Owner: unassigned
6
+
7
+ ## Problem
8
+
9
+ Specialist runs can inherit task context from beads, but rationale is inconsistently captured.
10
+ We often store outcomes, yet miss structured decision context:
11
+
12
+ - what was chosen (`decision`)
13
+ - what else was considered (`alternatives`)
14
+ - why this choice was acceptable (`tradeoffs`)
15
+
16
+ Without this, downstream specialists and future sessions can see *what* happened, but not reliably *why*.
17
+
18
+ ## Goal
19
+
20
+ Add a lightweight, repeatable convention so issue content can carry decision rationale and flow through `specialists run --bead <id>` pipelines.
21
+
22
+ ## Non-Goals
23
+
24
+ - No bd schema fork or database migration
25
+ - No large redesign of specialists runtime
26
+ - No mandatory enforcement in the first iteration
27
+
28
+ ## Proposed Shape
29
+
30
+ Use a documentation-level template first:
31
+
32
+ ```md
33
+ ## Decision
34
+ ## Alternatives Considered
35
+ ## Tradeoffs
36
+ ## Rationale
37
+ ## Follow-ups
38
+ ```
39
+
40
+ Store this in issue `description` or `notes`, depending on workflow stage.
41
+
42
+ ## Phased Plan
43
+
44
+ ### Phase 0: Document the convention
45
+
46
+ - Add canonical template doc under `docs/`
47
+ - Add short usage rules and examples:
48
+ - When to use full template vs short form
49
+ - Minimum quality bar for each section
50
+
51
+ ### Phase 1: Agent-facing adoption
52
+
53
+ - Update `AGENTS.md` beads workflow guidance to reference the template
54
+ - Require template for implementation/refactor/architecture issues
55
+ - Keep optional for trivial bugs/chore work
56
+
57
+ ### Phase 2: Prompt-path integration
58
+
59
+ - Ensure bead context passed to specialists preserves section headings
60
+ - Prefer explicit rendering order in prompt context:
61
+ - Task
62
+ - Notes
63
+ - Decision context sections
64
+
65
+ ### Phase 3: Optional guardrail
66
+
67
+ - Add a non-blocking hook warning when `bd create`/`bd update` for qualifying issues lacks required sections
68
+ - Later, optionally make blocking for selected issue types
69
+
70
+ ## Success Criteria
71
+
72
+ - New implementation issues include decision context sections by default
73
+ - Specialists receiving bead context can reference rationale explicitly
74
+ - Reduced repeated โ€œwhy did we pick this?โ€ rediscovery in follow-up runs
75
+
76
+ ## Risks
77
+
78
+ - Overhead: template may feel heavy for small tasks
79
+ - Empty sections: form completion without meaningful content
80
+ - Friction: hard gates too early may slow work
81
+
82
+ ## Mitigations
83
+
84
+ - Start with convention + examples, not blocking
85
+ - Scope requirement to high-value issue types first
86
+ - Add enforcement only after adoption baseline is reached
87
+
88
+ ## Open Questions
89
+
90
+ - Which issue types should require full template?
91
+ - Should we keep `Rationale` separate from `Tradeoffs`?
92
+ - Should memories (`bd remember`) reference these sections directly?
93
+
94
+ ## Suggested Next Step
95
+
96
+ If this idea is approved, create one bd task to implement **Phase 0 + Phase 1** only, then reassess before enforcement work.
@@ -0,0 +1,351 @@
1
+ ---
2
+ title: "Agent Handoff: Specialists"
3
+ scope: specialists
4
+ category: guide
5
+ version: 1.0.0
6
+ updated: 2026-03-22
7
+ synced_at: d043215
8
+ description: "Self-contained context for continuing work on the specialists project across agent sessions."
9
+ ---
10
+
11
+ <!-- INDEX: auto-generated by validate_doc.py โ€” do not edit manually -->
12
+ | Section | Summary |
13
+ |---|---|
14
+ | [Current State (2026-03-22)](#current-state-2026-03-22) | **Phase 0 โ€” Hook system alignment** (commit d143a09 + unitAI-5nm): |
15
+ | [What This Project Is](#what-this-project-is) | **Specialists** is an MCP (Model Context Protocol) server that lets Claude Code discover and delegate to autonomous codi |
16
+ | [Architecture](#architecture) | **Two execution modes:** |
17
+ | [Key Files](#key-files) | | Path | Purpose | |
18
+ | [Current State](#current-state) | - **pi** v0 |
19
+ | [xtrm-tools Parity Status (as of 2026-03-20)](#xtrm-tools-parity-status-as-of-2026-03-20) | Specialists hooks and session flow must stay in sync with xtrm-tools canonical |
20
+ | [Open Issues (30 total)](#open-issues-30-total) | | Priority | Count | Category | |
21
+ | [Critical Dependency Chain (P1)](#critical-dependency-chain-p1) | These issues form a chain โ€” each unblocks the next: |
22
+ | [P1 Bugs](#p1-bugs) | - **Symptom:** \`specialists stop <id>\` kills pi, \`status |
23
+ | [P1 Features (non-chain)](#p1-features-non-chain) | \`\`\` |
24
+ | [P2 Issues (8)](#p2-issues-8) | | ID | Type | Title | |
25
+ | [P3-P4 Issues (3)](#p3-p4-issues-3) | | ID | Priority | Title | |
26
+ | [Recommended Starting Point](#recommended-starting-point) | 1 |
27
+ | [Quick Commands](#quick-commands) | \`\`\`bash |
28
+ | [Build & Test](#build-test) | \`\`\`bash |
29
+ | [Related Docs](#related-docs) | - \`README |
30
+ <!-- END INDEX -->
31
+
32
+ # Specialists โ€” Agent Handoff Document
33
+
34
+ > One-MCP-Server, Many Specialists. Self-contained context for continuing work.
35
+
36
+ ---
37
+
38
+ ## Current State (2026-03-22)
39
+
40
+ ### Phases Complete
41
+
42
+ **Phase 0 โ€” Hook system alignment** (commit d143a09 + unitAI-5nm):
43
+ - `specialists/hooks/` has exactly 2 files: `specialists-complete.mjs`, `specialists-session-start.mjs`
44
+ - xtrm-tools is REQUIRED for the hook system; specialists does not bundle beads hooks
45
+ - `src/pi/session.ts`: `--no-extensions` + selective re-enable of `quality-gates`/`service-skills`
46
+ - `bin/install.js`: prereq checks (pi/bd/xt), installs 2 hooks, registers MCP in `.mcp.json`
47
+
48
+ **Phase 1 โ€” Core bugs** (commit ca51fb6):
49
+ - `unitAI-fgy` โœ“: `onBeadCreated` fires at bead creation before Pi starts
50
+ - `unitAI-0ef` โœ“: SIGTERM โ†’ `killFn` โ†’ `SessionKilledError` โ†’ `status:'error'`
51
+
52
+ **Phase 2 โ€” Output pinning** (PR #42, commit c67c0e7):
53
+ - `unitAI-iuj` โœ“: specialist output pinned to bead notes with `prompt_hash`, `git_sha`, `elapsed_ms`, `model`, `backend`
54
+
55
+ **Phase 3 โ€” Workflow** (PR #45, commit a90a58a):
56
+ - `unitAI-7fm` โœ“: `specialists init` registers MCP in `.mcp.json`
57
+ - `unitAI-55d` โœ“: `specialists run --bead <id>` โ€” bead IS the prompt; `bd show <id> --json`
58
+ - `unitAI-slu` โœ“: single-bead lifecycle enforced โ€” `--bead` runs skip `createBead`; `ownsBead` gates `closeBead`
59
+
60
+ **Phase 4 โ€” Context injection** (PR #47, commits 2e3365b + 35cb506):
61
+ - `unitAI-750` โœ“: `--context-depth <n>` flag (default 1 with --bead); `getCompletedBlockers(id, depth)` walks dep tree via `bd dep list --json`, reads closed blocker notes; `buildBeadContext(bead, blockers[])` injects as `## Context from completed dependencies:` section
62
+ - Fix: `--no-beads` no longer blocks `--bead` reads โ€” split `beadReader` (always available) from `beadsClient` (tracking only)
63
+
64
+ **Post-sprint housekeeping** (commits c40c9fb, 04d2e36):
65
+ - `$cwd` injected as built-in template variable in `runner.ts` โ€” 6 specialists use it; was never substituted
66
+ - `planner.specialist.yaml` fixed: removed `defaults` key (not in schema) + `READ_WRITE` โ†’ `HIGH` permission; was silently dropped by loader
67
+ - `unitAI-vbl` (P2 bug): loader should warn on invalid YAML instead of silent skip โ€” filed
68
+ - `unitAI-hdd` (P2 task): `specialist-author` skill to guide writing valid YAML โ€” filed
69
+ - Global install: `npm install -g .` โ†’ `specialists` available system-wide (v3.2.0, 11 specialists)
70
+
71
+ ### Key architecture decisions (binding)
72
+ 1. **xtrm-tools is REQUIRED** for hooks โ€” specialists handles only agent running
73
+ 2. **Orchestrator pattern is correct** โ€” Claude claims issue, spawns specialist, closes on completion
74
+ 3. **Pi subprocess isolation** โ€” `--no-extensions` prevents beads extension from blocking edits in subprocess
75
+ 4. **Single-bead lifecycle** โ€” `--bead <id>` uses the orchestrator's bead directly; runner never creates a second one
76
+
77
+ ### Next priorities (open board)
78
+ Run `bd ready` to see current queue. Top candidates:
79
+ - `unitAI-9re` (P1) โ€” `specialists feed -f`: global live feed across all running jobs
80
+ - `unitAI-4az` (P1) โ€” compact save/restore hooks (needed for long specialist sessions)
81
+ - `unitAI-vbl` (P2) โ€” loader warn on invalid YAML (quick fix, high value)
82
+ - `unitAI-hdd` (P2) โ€” specialist-author skill
83
+ - `unitAI-c64` (P2) โ€” Memory curator specialist (now unblocked by iuj)
84
+ - `unitAI-hos` (P2) โ€” Commit/PR provenance hook
85
+
86
+ ### Full issue board context
87
+ See `docs/xtrm-specialists-analysis.md` for full classification, sprint history, and architecture decisions.
88
+
89
+ ---
90
+
91
+ ## What This Project Is
92
+
93
+ **Specialists** is an MCP (Model Context Protocol) server that lets Claude Code discover and delegate to autonomous coding agents. Each "specialist" is a full AI agent scoped to a specific domain (bug hunting, architecture analysis, code review) โ€” powered by [pi](https://github.com/mariozechner/pi).
94
+
95
+ **Key insight:** Designed for agents, not users. Claude autonomously routes heavy tasks to the right specialist.
96
+
97
+ ---
98
+
99
+ ## Architecture
100
+
101
+ ```
102
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
103
+ โ”‚ Claude Code โ”‚
104
+ โ”‚ โ”‚
105
+ โ”‚ MCP (control plane) CLI (execution plane) โ”‚
106
+ โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚
107
+ โ”‚ specialist_init specialists run \ โ”‚
108
+ โ”‚ use_specialist <name> --backgroundโ”‚
109
+ โ”‚ specialists result โ”‚
110
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
111
+ โ†“ file-based job state
112
+ .specialists/jobs/<id>/
113
+ status.json result.txt events.jsonl
114
+ ```
115
+
116
+ **Two execution modes:**
117
+ 1. **Synchronous** (MCP \`use_specialist\`) โ€” short tasks, returns result directly
118
+ 2. **Background** (CLI \`--background\`) โ€” long tasks, writes to disk, notification on completion
119
+
120
+ ---
121
+
122
+ ## Key Files
123
+
124
+ | Path | Purpose |
125
+ |------|---------|
126
+ | \`src/index.ts\` | CLI entry point, command routing |
127
+ | \`src/specialist/runner.ts\` | Specialist execution, bead creation |
128
+ | \`src/specialist/supervisor.ts\` | Background job lifecycle, status management |
129
+ | \`src/pi/session.ts\` | PiAgentSession: spawn/start/prompt/waitForDone/close |
130
+ | \`src/cli/run.ts\` | \`specialists run\` command |
131
+ | \`src/cli/status.ts\` | \`specialists status\` command |
132
+ | \`bin/install.js\` | Hook/MCP installation (being retired) |
133
+ | \`hooks/*.mjs\` | 7 Claude Code hooks |
134
+ | \`specialists/*.yaml\` | 9 built-in specialist definitions |
135
+
136
+ ---
137
+
138
+ ## Current State
139
+
140
+ ### System Health โœ…
141
+ - **pi** v0.60.0 โ€” 7 providers active
142
+ - **beads** v0.59.0 โ€” issue tracking integrated
143
+ - **MCP** registered and working
144
+ - **9 specialists** available (project scope)
145
+
146
+ ### Available Specialists
147
+
148
+ | Name | Model | Purpose |
149
+ |------|-------|---------|
150
+ | \`init-session\` | Haiku | Git state analysis, context surfacing |
151
+ | \`codebase-explorer\` | Gemini Flash | Architecture analysis |
152
+ | \`overthinker\` | Sonnet | 4-phase deep reasoning |
153
+ | \`bug-hunt\` | Sonnet | Bug investigation |
154
+ | \`feature-design\` | Sonnet | Feature โ†’ implementation plans |
155
+ | \`parallel-review\` | Sonnet | Multi-focus code review |
156
+ | \`report-generator\` | Haiku | Synthesize markdown reports |
157
+ | \`test-runner\` | Haiku | Run tests, surface failures |
158
+
159
+ ### Hooks (7 installed)
160
+
161
+ | Hook | Event | Purpose | Parity status |
162
+ |------|-------|---------|---------------|
163
+ | `main-guard.mjs` | PreToolUse | Block edits on master/main | โš ๏ธ xtrm-tools removed from active runtime โ€” evaluate removal (unitAI-o6j) |
164
+ | `beads-edit-gate.mjs` | PreToolUse | Require in_progress bead | โš ๏ธ pre-refactor; sync with xtrm canonical (unitAI-o6j) |
165
+ | `beads-commit-gate.mjs` | PreToolUse | Block commit with open issues | โš ๏ธ pre-refactor; sync with xtrm canonical (unitAI-o6j) |
166
+ | `beads-stop-gate.mjs` | Stop | Block session end with issues | โš ๏ธ pre-refactor; sync with xtrm canonical (unitAI-o6j) |
167
+ | `specialists-complete.mjs` | UserPromptSubmit | Inject completion banners | โœ… specialists-specific |
168
+ | `specialists-session-start.mjs` | SessionStart | Prime context at session start | โœ… specialists-specific |
169
+ | `beads-close-memory-prompt.mjs` | PostToolUse | Nudge knowledge capture | โŒ deprecated โ€” xtrm replaced with `beads-memory-gate.mjs` Stop hook; see unitAI-pjx |
170
+
171
+ **Missing vs xtrm-tools canonical:**
172
+
173
+ | Hook | Event | Purpose | Issue |
174
+ |------|-------|---------|-------|
175
+ | `beads-memory-gate.mjs` | Stop | Hard-block until memory decision | unitAI-pjx |
176
+ | `beads-compact-save.mjs` | Stop | Preserve session context across compaction | unitAI-4az |
177
+ | `beads-compact-restore.mjs` | SessionStart | Restore context post-compaction | unitAI-4az |
178
+ | `beads-claim-sync.mjs` | PostToolUse | Auto-commit on bd close | unitAI-200 |
179
+
180
+ ------|-------|---------|
181
+ | \`main-guard.mjs\` | PreToolUse | Block edits on master/main |
182
+ | \`beads-edit-gate.mjs\` | PreToolUse | Require in_progress bead |
183
+ | \`beads-commit-gate.mjs\` | PreToolUse | Block commit with open issues |
184
+ | \`beads-stop-gate.mjs\` | Stop | Block session end with issues |
185
+ | \`specialists-complete.mjs\` | UserPromptSubmit | Inject completion banners |
186
+ | \`specialists-session-start.mjs\` | SessionStart | Prime context at session start |
187
+ | \`beads-close-memory-prompt.mjs\` | PostToolUse | Nudge knowledge capture |
188
+
189
+ ---
190
+
191
+ ## xtrm-tools Parity Status (as of 2026-03-20)
192
+
193
+ Specialists hooks and session flow must stay in sync with xtrm-tools canonical. Key gaps:
194
+
195
+ | Gap | Issue | Notes |
196
+ |-----|-------|-------|
197
+ | Worktree Dolt bootstrap for spawned Pi sessions | unitAI-lmi (P1) | Background specialists jobs spawn Pi subprocesses; if in worktree context, auto-isolated Dolt breaks all bd commands. Must redirect to canonical Dolt port before subprocess starts. Same trick as xtrm worktrees: `bd dolt stop && echo <main_port> > .beads/dolt-server.port` |
198
+ | Hook sync with xtrm canonical (beads-gate-utils refactor) | unitAI-o6j (P2) | Beads hooks are pre-refactor standalone. Port beads-gate-utils.mjs shared module + updated gate logic. **Replace** `beads-close-memory-prompt.mjs` with `beads-memory-gate.mjs` โ€” do NOT port the old file. |
199
+ | Compact save/restore hooks | unitAI-4az (P1) | Long-running sessions will be compacted; without these hooks context is lost and gates can deadlock |
200
+ | Auto-commit on close | unitAI-200 (P2) | beads-claim-sync.mjs: `<close_reason> (<id>)` commit message on `bd close` |
201
+ | pi-structured-return extension | unitAI-mst (P2) | `nextpi install npm:@robhowley/pi-structured-return` โ€” enables typed output from Pi sessions; may unblock unitAI-iuj |
202
+
203
+ **CLI naming (open decision):** xtrm-tools uses `xtrm` (canonical) / `xt` (alias). The `xt sp` namespace for specialists is planned but not yet implemented in xtrm. Specialists CLI remains `specialists run/status/result/stop` until the wrapper exists.
204
+
205
+ ---
206
+
207
+ ## Open Issues (30 total)
208
+
209
+ ### Priority Summary
210
+
211
+ | Priority | Count | Category |
212
+ |----------|-------|----------|
213
+ | P1 ๐Ÿ”ด | 16 | 1 bug, 15 features (added: unitAI-lmi, unitAI-4az) |
214
+ | P2 ๐ŸŸก | 10 | 2 bugs, 8 features (added: unitAI-200, unitAI-mst) |
215
+ | P3 ๐ŸŸข | 3 | 1 bug, 2 features |
216
+ | P4 โšช | 1 | 1 bug |
217
+
218
+ ---
219
+
220
+ ## Critical Dependency Chain (P1)
221
+
222
+ These issues form a chain โ€” each unblocks the next:
223
+
224
+ \`\`\`
225
+ unitAI-fgy (bead_id at creation)
226
+ โ””โ”€โ”€ unitAI-iuj (pin output to bead)
227
+ โ”œโ”€โ”€ unitAI-750 (context injection)
228
+ โ”œโ”€โ”€ unitAI-6op (Dolt summaries)
229
+ โ”œโ”€โ”€ unitAI-c64 (memory curator)
230
+ โ””โ”€โ”€ unitAI-hos (provenance hook)
231
+ \`\`\`
232
+
233
+ ### unitAI-fgy โ€” Write bead_id at job creation
234
+ - **Problem:** \`bead_id\` only written after run completes
235
+ - **Fix:** Call \`updateStatus({bead_id})\` in \`onBeadCreated\` callback
236
+ - **Verify first:** May already be at \`supervisor.ts:208-209\`
237
+ - **Files:** \`src/specialist/supervisor.ts\`, \`src/specialist/runner.ts\`
238
+
239
+ ### unitAI-iuj โ€” Pin output to bead
240
+ - **Problem:** Output in \`result.txt\` only, never linked to bead
241
+ - **Fix:** \`bd update <bead_id> --notes '<output>'\` after writing result
242
+ - **Files:** \`src/specialist/supervisor.ts:213-227\`
243
+
244
+ ### unitAI-55d โ€” \`specialists run --bead <id>\`
245
+ - **Problem:** Orchestrator writes work twice (beads + prompt)
246
+ - **Fix:** Bead IS the prompt; read via \`bd show <id> --json\`
247
+ - **Key:** \`input_bead_id\` (work item) โ‰  \`tracking_bead_id\` (audit record)
248
+
249
+ ---
250
+
251
+ ## P1 Bugs
252
+
253
+ ### unitAI-0ef โ€” SIGTERM doesn't update job status
254
+ - **Symptom:** \`specialists stop <id>\` kills pi, \`status.json\` stays \`running\` forever
255
+ - **Cause:** EPIPE crash, no parent watcher to update status
256
+ - **Fix:** Keep supervisor alive as thin watcher, trap \`close\` event
257
+ - **Files:** \`src/specialist/supervisor.ts\`, \`src/cli/run.ts\`, \`src/cli/stop.ts\`
258
+
259
+ ---
260
+
261
+ ## P1 Features (non-chain)
262
+
263
+ ### specialists init improvements (4 issues, dependency order)
264
+
265
+ \`\`\`
266
+ unitAI-csu (bd init prerequisite)
267
+ โ””โ”€โ”€ unitAI-aq0 (detect-and-defer beads hooks)
268
+ โ””โ”€โ”€ unitAI-bi6 (install project-local hooks)
269
+ โ””โ”€โ”€ unitAI-7fm (register MCP at project scope)
270
+ \`\`\`
271
+
272
+ **Goal:** Make \`specialists init\` fully replace \`specialists install\`
273
+
274
+ ### Other P1
275
+
276
+ | ID | Title | One-liner |
277
+ |----|-------|-----------|
278
+ | \`unitAI-9re\` | Global live feed | \`specialists feed -f\` tails ALL jobs |
279
+ | \`unitAI-msh\` | Comprehensive docs | 8 deep-dive README sections |
280
+ | \`unitAI-xr1\` | Hook audit | Verify all hooks schema-compliant |
281
+ | \`unitAI-pjx\` | Memory judgment gate | Block \`bd close\` until decision |
282
+
283
+ ---
284
+
285
+ ## P2 Issues (8)
286
+
287
+ | ID | Type | Title |
288
+ |----|------|-------|
289
+ | \`unitAI-hgo\` | bug | \`specialists install\` silent |
290
+ | \`unitAI-kwb\` | bug | Active Jobs hidden when empty |
291
+ | \`unitAI-9xa\` | feat | \`specialists clean\` command |
292
+ | \`unitAI-3n1\` | task | Reduce hook verbosity |
293
+ | \`unitAI-c64\` | feat | Memory curator specialist |
294
+ | \`unitAI-hos\` | feat | Commit/PR provenance hook |
295
+ | \`unitAI-5nm\` | task | Retire \`specialists install\` |
296
+ | \`unitAI-5dj\` | task | Review overstory hooks-deployer |
297
+
298
+ ---
299
+
300
+ ## P3-P4 Issues (3)
301
+
302
+ | ID | Priority | Title |
303
+ |----|----------|-------|
304
+ | \`unitAI-6op\` | P3 | Dolt-backed run summaries |
305
+ | \`unitAI-tv3\` | P3 | \`status --job <id>\` not implemented |
306
+ | \`unitAI-mk5\` | P4 | \`ready/\` markers accumulate |
307
+
308
+ ---
309
+
310
+ ## Recommended Starting Point
311
+
312
+ 1. `bd ready` โ€” see full unblocked queue
313
+ 2. Claim with `bd update <id> --claim`, work in a worktree (`xt worktree create`)
314
+ 3. Top P1: `unitAI-750` (context injection) or `unitAI-9re` (global feed)
315
+
316
+ ---
317
+
318
+ ## Quick Commands
319
+
320
+ \`\`\`bash
321
+ specialists list # discover specialists
322
+ specialists run <name> --prompt "..." # foreground
323
+ specialists run <name> --prompt "..." --background # async
324
+ specialists status # health + active jobs
325
+ specialists result <job-id> # read output
326
+ specialists feed --job <id> --follow # tail events
327
+ specialists doctor # troubleshoot
328
+ \`\`\`
329
+
330
+ ---
331
+
332
+ ## Build & Test
333
+
334
+ \`\`\`bash
335
+ bun install
336
+ bun run build # bun build src/index.ts --target=node --outfile=dist/index.js
337
+ bun run test # bun --bun vitest run (use `bun run test`, NOT `bun test`)
338
+ \`\`\`
339
+
340
+ ---
341
+
342
+ ## Related Docs
343
+
344
+ - \`README.md\` โ€” Full usage guide
345
+ - \`ROADMAP.md\` โ€” Detailed feature specs with file references
346
+ - \`docs/hooks.md\` โ€” Hook reference
347
+ - \`docs/spec-v3.md\` โ€” v3 architecture spec
348
+
349
+ ---
350
+
351
+ *Generated: 2026-03-19 ยท Updated: 2026-03-22 (Phases 0-3 complete; PR #45 merged)*