@jaggerxtrm/specialists 3.0.2 → 3.2.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.
package/README.md CHANGED
@@ -1,304 +1,113 @@
1
1
  # Specialists
2
2
 
3
- **One MCP Server. Many Specialists. Real AI Agents.**
3
+ **One MCP server. Many specialists. Bead-first orchestration.**
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@jaggerxtrm/specialists.svg)](https://www.npmjs.com/package/@jaggerxtrm/specialists)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue.svg)](https://www.typescriptlang.org/)
8
8
 
9
- **Specialists** is a **Model Context Protocol (MCP) server** that lets Claude discover and delegate to specialist agents each a full autonomous coding agent powered by [pi](https://github.com/mariozechner/pi), scoped to a specific task.
9
+ **Specialists is a universal framework for defining and running specialist agents.** You can invoke the same specialist from the terminal, through MCP inside coding agents, inside autonomous multi-agent runtimes, or from scripts and CI/CD pipelines. Each run can explicitly define the model, tool access, system prompt, task input, permission level, timeout, output format, tracking behavior, memory sources, and dependency context.
10
10
 
11
- **Designed for agents, not users.** Claude autonomously routes heavy tasks (code review, bug hunting, deep reasoning, session init) to the right specialist. In v3, specialists run as **background CLI processes** zero polling overhead, notifications on completion.
11
+ Specialists is built on top of the **[pi coding agent](https://github.com/Jaggerxtrm/pi-coding-agent)** as its base execution technology. That gives Specialists access to a broad provider surface across many OAuth and API-backed models, a richer lifecycle event stream for tracking session progress and tool execution, and a usable RPC protocol for orchestrating specialist runs as a stable subprocess boundary.
12
12
 
13
- ---
14
-
15
- ## How it works
16
-
17
- ```
18
- ┌──────────────────────────────────────────────┐
19
- │ Claude Code │
20
- │ │
21
- │ MCP (control plane) CLI (execution plane) │
22
- │ ───────────────────── ──────────────────── │
23
- │ specialist_init specialists run \ │
24
- │ list_specialists <name> --background│
25
- │ use_specialist specialists result \ │
26
- │ specialist_status <id> │
27
- └──────────────────────────────────────────────┘
28
- ↓ file-based job state
29
- .specialists/jobs/<id>/
30
- status.json result.txt events.jsonl
31
- ```
32
-
33
- Specialists are `.specialist.yaml` files discovered across two scopes:
34
-
35
- | Scope | Location | Purpose |
36
- |-------|----------|---------|
37
- | **project** | `./specialists/` | Per-project specialists |
38
- | **user** | `~/.agents/specialists/` | Built-in defaults (copied on install) + your own |
39
-
40
- When a specialist runs, the server spawns a `pi` subprocess with the right model, tools, and system prompt injected. For background jobs, a **Supervisor** writes job state to disk — status, events, and final output — so Claude gets a one-shot notification on completion instead of polling.
41
-
42
- ---
43
-
44
- ## Background Jobs (v3)
45
-
46
- The primary workflow for long-running specialists:
47
-
48
- ```bash
49
- # Start in background — returns immediately
50
- specialists run overthinker --prompt "Refactor strategy?" --background
51
- # → Job started: a1b2c3
52
-
53
- # Check progress
54
- specialists status
55
- # → Active Jobs
56
- # a1b2c3 overthinker running 1m12s tool: bash
57
-
58
- # Stream events live
59
- specialists feed --job a1b2c3 --follow
60
-
61
- # Get result when done
62
- specialists result a1b2c3
63
-
64
- # Cancel
65
- specialists stop a1b2c3
66
- ```
67
-
68
- When a background job completes, Claude's next prompt automatically receives a banner:
69
-
70
- ```
71
- [Specialist 'overthinker' completed (job a1b2c3, 87s). Run: specialists result a1b2c3]
72
- ```
73
-
74
- Job files live in `.specialists/jobs/<id>/` (gitignored by `specialists init`):
75
-
76
- | File | Contents |
77
- |------|---------|
78
- | `status.json` | id, specialist, status, model, backend, pid, elapsed_s, bead_id, error |
79
- | `events.jsonl` | thinking\_start, toolcall\_start, tool\_execution\_end, agent\_end |
80
- | `result.txt` | Final assistant output |
81
-
82
- ---
83
-
84
- ## MCP Tools (8)
85
-
86
- | Tool | Description |
87
- |------|-------------|
88
- | `specialist_init` | Session bootstrap: init beads if needed, return available specialists |
89
- | `list_specialists` | Discover all available specialists across scopes |
90
- | `use_specialist` | Run a specialist synchronously and return the result |
91
- | `specialist_status` | Circuit breaker health + background job summary |
92
- | `start_specialist` | *(deprecated v3)* Async job via in-memory registry — use CLI instead |
93
- | `poll_specialist` | *(deprecated v3)* Poll in-memory job — use CLI instead |
94
- | `stop_specialist` | *(deprecated v3)* Kill in-memory job — use `specialists stop <id>` |
95
- | `run_parallel` | *(deprecated v3)* Concurrent in-memory jobs — use CLI `--background` |
96
-
97
- For production use: `use_specialist` for short synchronous tasks, CLI `--background` for anything that takes more than a few seconds.
98
-
99
- ---
100
-
101
- ## Built-in Specialists
102
-
103
- | Specialist | Model | Purpose |
104
- |-----------|-------|---------|
105
- | `init-session` | Haiku | Analyse git state, recent commits, surface relevant context |
106
- | `codebase-explorer` | Gemini Flash | Architecture analysis, directory structure, patterns |
107
- | `overthinker` | Sonnet | 4-phase deep reasoning: analysis → critique → synthesis → output |
108
- | `parallel-review` | Sonnet | Concurrent code review across multiple focus areas |
109
- | `bug-hunt` | Sonnet | Autonomous bug investigation from symptoms to root cause |
110
- | `feature-design` | Sonnet | Turn feature requests into structured implementation plans |
111
- | `auto-remediation` | Gemini Flash | Apply fixes to identified issues automatically |
112
- | `report-generator` | Haiku | Synthesise data/analysis results into structured markdown |
113
- | `test-runner` | Haiku | Run tests, parse results, surface failures |
114
-
115
- ---
116
-
117
- ## Permission Tiers
118
-
119
- | Tier | pi tools | Use case |
120
- |------|---------|----------|
121
- | `READ_ONLY` | read, bash, grep, find, ls | Analysis, exploration |
122
- | `LOW` | read, bash, edit, write, grep, find, ls | Code modifications |
123
- | `MEDIUM` | read, bash, edit, write, grep, find, ls | Code modifications + git |
124
- | `HIGH` | read, bash, edit, write, grep, find, ls | Full autonomy |
125
-
126
- Permission is enforced at spawn time via `pi --tools`, not just in the system prompt.
13
+ Specialists is intended to run inside the **xt/xtrm architecture** provided by **[xtrm-tools](https://github.com/Jaggerxtrm/xtrm-tools)**. xtrm-tools provides the worktree isolation, execution boundaries, session model, and surrounding workflow environment that Specialists expects. Specialists handles specialist execution; xtrm-tools owns the broader operator workflow and beads enforcement hooks. For tracking and coordination Specialists uses **beads** by **Steven Yegge** as the issue, dependency, and communication layer. I built a similar issue system for Mercury AACS and Terminal back in November, but Beads is already widely used and actively maintained, so xt/Specialists is built around Beads instead of carrying a separate workflow stack. When a specialist run originates from a bead, its output is written back to that same bead, so the task spec, dependency context, coordination state, and result stay inside one tight, controlled loop.
127
14
 
128
- ---
129
-
130
- ## Beads Integration
131
-
132
- Specialists with write permissions automatically create a [beads](https://github.com/beads/bd) issue and close it on completion. Control this per-specialist:
133
-
134
- ```yaml
135
- beads_integration: auto # default — create for LOW/MEDIUM/HIGH
136
- beads_integration: always # always create
137
- beads_integration: never # never create
138
- ```
139
-
140
- The `bead_id` is written to `status.json` so you can link issues for follow-up.
15
+ A specialist is a reusable execution spec: model, allowed tools, skills, system prompt, task prompt, timeout, permission level, output format, and background-job behavior. It can run from a plain prompt, from a system+task prompt pair, or directly from an **issue/bead ID as the task source**. Dependency chains can be injected as context, centralized memory can be reused across runs, and jobs can execute in the foreground or as background processes with status, events, and results exposed through the CLI and MCP surfaces.
141
16
 
142
17
  ---
143
18
 
144
- ## Installation
145
-
146
- ### Recommended
19
+ ## Quick start
147
20
 
148
21
  ```bash
149
22
  npm install -g @jaggerxtrm/specialists
150
- specialists install
23
+ specialists init
24
+ specialists list
151
25
  ```
152
26
 
153
- Installs: **pi** (`@mariozechner/pi-coding-agent`), **beads** (`@beads/bd`), **dolt**, registers the `specialists` MCP at user scope, scaffolds `~/.agents/specialists/`, copies built-in specialists, and installs five Claude Code hooks:
154
-
155
- | Hook | Event | Enforces |
156
- |------|-------|---------|
157
- | `specialists-main-guard.mjs` | `PreToolUse` | No direct edits/commits on `main`/`master` |
158
- | `beads-edit-gate.mjs` | `PreToolUse` | No file edits without an `in_progress` beads issue |
159
- | `beads-commit-gate.mjs` | `PreToolUse` | No `git commit` while issues are `in_progress` |
160
- | `beads-stop-gate.mjs` | `Stop` | Agent cannot stop with unresolved issues |
161
- | `specialists-complete.mjs` | `UserPromptSubmit` | Injects background job completion banners |
162
-
163
- After running, **restart Claude Code** to load the MCP. Re-run `specialists install` at any time to update or repair.
164
-
165
- ### One-time (no global install)
27
+ Tracked work:
166
28
 
167
29
  ```bash
168
- npx --package=@jaggerxtrm/specialists install
30
+ bd create "Investigate auth bug" -t bug -p 1 --json
31
+ specialists run bug-hunt --bead <id> --background
32
+ specialists feed -f
33
+ bd close <id> --reason "Done"
169
34
  ```
170
35
 
171
- ---
36
+ Ad-hoc work:
172
37
 
173
- ## Writing a Specialist
174
-
175
- Create a `.yaml` file in `./specialists/` (project scope) or `~/.agents/specialists/` (user scope):
176
-
177
- ```yaml
178
- specialist:
179
- metadata:
180
- name: my-specialist
181
- version: 1.0.0
182
- description: "What this specialist does."
183
- category: analysis
184
- tags: [analysis, example]
185
- updated: "2026-03-11"
186
-
187
- execution:
188
- mode: tool
189
- model: anthropic/claude-haiku-4-5
190
- fallback_model: google-gemini-cli/gemini-3-flash-preview
191
- timeout_ms: 120000
192
- response_format: markdown
193
- permission_required: READ_ONLY
194
-
195
- prompt:
196
- system: |
197
- You are a specialist that does X.
198
- Produce a structured markdown report.
199
-
200
- task_template: |
201
- $prompt
202
-
203
- # Inject a single skill file into the system prompt
204
- skill_inherit: ~/.agents/skills/my-domain-knowledge.md
205
-
206
- communication:
207
- output_to: .specialists/my-specialist-result.md # optional file sink
208
-
209
- skills:
210
- # Run scripts before/after the specialist
211
- scripts:
212
- - path: ./scripts/health-check.sh
213
- phase: pre # runs before the task prompt
214
- inject_output: true # output available as $pre_script_output
215
- - path: ./scripts/cleanup.sh
216
- phase: post
217
-
218
- # Inject multiple skill/context files into the system prompt (v3)
219
- paths:
220
- - ~/skills/domain-context.md
221
- - ./specialists/shared/conventions.md
38
+ ```bash
39
+ specialists run codebase-explorer --prompt "Map the CLI architecture"
222
40
  ```
223
41
 
224
- **Model IDs** use the full provider/model format: `anthropic/claude-sonnet-4-6`, `google-gemini-cli/gemini-3-flash-preview`, `anthropic/claude-haiku-4-5`.
42
+ ## What `specialists init` does
225
43
 
226
- ---
44
+ - creates `specialists/`
45
+ - creates `.specialists/` runtime dirs (`jobs/`, `ready/`)
46
+ - adds `.specialists/` to `.gitignore`
47
+ - injects the canonical Specialists Workflow block into `AGENTS.md` and `CLAUDE.md`
48
+ - registers the Specialists MCP server at project scope
227
49
 
228
- ## CLI
229
-
230
- | Command | Description |
231
- |---------|-------------|
232
- | `specialists install` | Full-stack installer: pi, beads, dolt, MCP, hooks |
233
- | `specialists init` | Scaffold `./specialists/`, `.specialists/`, update `.gitignore`, inject `AGENTS.md` block |
234
- | `specialists list` | List discovered specialists with model, description, scope |
235
- | `specialists models` | List models available on pi with capability flags |
236
- | `specialists edit <name> --<field> <value>` | Edit a specialist field in-place |
237
- | `specialists run <name>` | Run a specialist (foreground by default) |
238
- | `specialists run <name> --background` | Start as background job, print job ID |
239
- | `specialists result <id>` | Print result of a completed background job |
240
- | `specialists feed --job <id> [--follow]` | Tail events.jsonl; `--follow` streams live |
241
- | `specialists stop <id>` | Send SIGTERM to a running background job |
242
- | `specialists status` | System health + active background jobs |
243
- | `specialists version` | Print installed version |
244
- | `specialists help` | Show command reference |
245
-
246
- ### specialists run
50
+ Verify bootstrap state:
247
51
 
248
52
  ```bash
249
- # Foreground — streams output to stdout
250
- specialists run init-session --prompt "What changed recently?"
251
-
252
- # Background — returns job ID immediately
253
- specialists run overthinker --prompt "Refactor?" --background
254
-
255
- # Background with model override, no beads
256
- specialists run bug-hunt --prompt "TypeError in auth" --background \
257
- --model anthropic/claude-sonnet-4-6 --no-beads
258
-
259
- # Pipe from stdin
260
- echo "Analyse the architecture" | specialists run codebase-explorer
53
+ specialists status
54
+ specialists doctor
261
55
  ```
262
56
 
263
- ### specialists status
264
-
57
+ ## Documentation map
58
+
59
+ `docs/` is the source of truth for detailed documentation. Start with the page that matches your task:
60
+
61
+ | Need | Doc |
62
+ |---|---|
63
+ | Install and bootstrap a project | [docs/bootstrap.md](docs/bootstrap.md) |
64
+ | Bead-first workflow and semantics | [docs/workflow.md](docs/workflow.md) |
65
+ | CLI commands and flags | [docs/cli-reference.md](docs/cli-reference.md) |
66
+ | Background jobs, feed, result, stop | [docs/background-jobs.md](docs/background-jobs.md) |
67
+ | Write or edit a `.specialist.yaml` | [docs/authoring.md](docs/authoring.md) |
68
+ | Current built-in specialists | [docs/specialists-catalog.md](docs/specialists-catalog.md) |
69
+ | MCP registration details | [docs/mcp-servers.md](docs/mcp-servers.md) |
70
+ | Hook behavior | [docs/hooks.md](docs/hooks.md) |
71
+ | Skills shipped in this repo | [docs/skills.md](docs/skills.md) |
72
+ | xtrm / worktree integration | [docs/worktree.md](docs/worktree.md) |
73
+ | RPC mode notes | [docs/pi-rpc.md](docs/pi-rpc.md) |
74
+
75
+ ## Project structure
76
+
77
+ ```text
78
+ specialists/ project specialist definitions (.specialist.yaml)
79
+ .specialists/ runtime data (jobs/, ready/) — gitignored
80
+ hooks/ bundled hook scripts
81
+ skills/ repo-local skills used by specialists
82
+ src/ CLI, server, loader, runner, tools
265
83
  ```
266
- specialists status
267
84
 
268
- ── Specialists ───────────────────────────
269
- ✓ 9 found (9 project)
85
+ ## Core workflow rules
270
86
 
271
- ── pi (coding agent runtime) ────────────
272
- v0.57.1 — 4 providers active (anthropic, google-gemini-cli, qwen, zai)
87
+ - **Use `--bead` for tracked work.** The bead is the prompt source.
88
+ - **Use `--prompt` for ad-hoc work only.**
89
+ - `--context-depth` controls how many completed blocker levels are injected.
90
+ - `--no-beads` does **not** disable bead reading.
91
+ - specialists are **project-only**. User-scope specialist discovery is deprecated.
273
92
 
274
- ── beads (issue tracker) ────────────────
275
- ✓ bd installed v0.59.0
276
- ✓ .beads/ present in project
93
+ ## Deprecated commands
277
94
 
278
- ── MCP ───────────────────────────────────
279
- ✓ specialists binary installed /usr/local/bin/specialists
95
+ These commands are still recognized for migration guidance but are no longer onboarding paths:
280
96
 
281
- ── Active Jobs ───────────────────────────
282
- a1b2c3 overthinker running 1m12s tool: bash
283
- g7h8i9 init-session done 0m08s
284
- ```
97
+ - `specialists setup`
98
+ - `specialists install`
285
99
 
286
- ---
100
+ Use `specialists init` instead.
287
101
 
288
102
  ## Development
289
103
 
290
104
  ```bash
291
- git clone https://github.com/Jaggerxtrm/specialists.git
292
- cd specialists
293
- bun install
294
- bun run build # bun build src/index.ts --target=node --outfile=dist/index.js
295
- bun test # bun --bun vitest run
105
+ bun run build
106
+ bun test
107
+ specialists help
108
+ specialists quickstart
296
109
  ```
297
110
 
298
- See [CLAUDE.md](CLAUDE.md) for the full architecture guide.
299
-
300
- ---
301
-
302
111
  ## License
303
112
 
304
113
  MIT