@jaggerxtrm/specialists 3.2.0 → 3.3.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 +83 -254
- package/bin/install.js +152 -329
- package/dist/index.js +2531 -921
- package/package.json +3 -2
- package/hooks/beads-close-memory-prompt.mjs +0 -47
- package/hooks/beads-commit-gate.mjs +0 -58
- package/hooks/beads-edit-gate.mjs +0 -53
- package/hooks/beads-stop-gate.mjs +0 -52
- package/hooks/specialists-complete.mjs +0 -60
- package/hooks/specialists-main-guard.mjs +0 -90
- package/hooks/specialists-session-start.mjs +0 -105
- package/specialists/auto-remediation.specialist.yaml +0 -70
- package/specialists/bug-hunt.specialist.yaml +0 -94
- package/specialists/codebase-explorer.specialist.yaml +0 -79
- package/specialists/feature-design.specialist.yaml +0 -88
- package/specialists/init-session.specialist.yaml +0 -60
- package/specialists/overthinker.specialist.yaml +0 -63
- package/specialists/parallel-review.specialist.yaml +0 -61
- package/specialists/report-generator.specialist.yaml +0 -59
- package/specialists/test-runner.specialist.yaml +0 -58
package/README.md
CHANGED
|
@@ -1,304 +1,133 @@
|
|
|
1
1
|
# Specialists
|
|
2
2
|
|
|
3
|
-
**One MCP
|
|
3
|
+
**One MCP server. Many specialists. Bead-first orchestration.**
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@jaggerxtrm/specialists)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
[](https://www.typescriptlang.org/)
|
|
8
8
|
|
|
9
|
-
**Specialists
|
|
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
|
-
|
|
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:
|
|
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.
|
|
34
14
|
|
|
35
|
-
|
|
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.
|
|
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.
|
|
41
16
|
|
|
42
17
|
---
|
|
43
18
|
|
|
44
|
-
##
|
|
45
|
-
|
|
46
|
-
The primary workflow for long-running specialists:
|
|
19
|
+
## Quick start
|
|
47
20
|
|
|
48
21
|
```bash
|
|
49
|
-
|
|
50
|
-
specialists
|
|
51
|
-
|
|
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.
|
|
127
|
-
|
|
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
|
|
22
|
+
npm install -g @jaggerxtrm/specialists
|
|
23
|
+
specialists init
|
|
24
|
+
specialists list
|
|
138
25
|
```
|
|
139
26
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
## Installation
|
|
145
|
-
|
|
146
|
-
### Recommended
|
|
27
|
+
`sp` is a shorter alias for `specialists` — both commands are identical:
|
|
147
28
|
|
|
148
29
|
```bash
|
|
149
|
-
|
|
150
|
-
|
|
30
|
+
sp list
|
|
31
|
+
sp run bug-hunt --bead <id> --background
|
|
151
32
|
```
|
|
152
33
|
|
|
153
|
-
|
|
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)
|
|
34
|
+
Tracked work:
|
|
166
35
|
|
|
167
36
|
```bash
|
|
168
|
-
|
|
37
|
+
bd create "Investigate auth bug" -t bug -p 1 --json
|
|
38
|
+
specialists run bug-hunt --bead <id> --background
|
|
39
|
+
specialists feed -f
|
|
40
|
+
bd close <id> --reason "Done"
|
|
169
41
|
```
|
|
170
42
|
|
|
171
|
-
|
|
43
|
+
Ad-hoc work:
|
|
172
44
|
|
|
173
|
-
|
|
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
|
|
45
|
+
```bash
|
|
46
|
+
specialists run codebase-explorer --prompt "Map the CLI architecture"
|
|
222
47
|
```
|
|
223
48
|
|
|
224
|
-
|
|
49
|
+
## What `specialists init` does
|
|
225
50
|
|
|
226
|
-
|
|
51
|
+
- creates `specialists/`
|
|
52
|
+
- creates `.specialists/` runtime dirs (`jobs/`, `ready/`)
|
|
53
|
+
- adds `.specialists/` to `.gitignore`
|
|
54
|
+
- injects the canonical Specialists Workflow block into `AGENTS.md` and `CLAUDE.md`
|
|
55
|
+
- registers the Specialists MCP server at project scope
|
|
227
56
|
|
|
228
|
-
|
|
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
|
|
57
|
+
Verify bootstrap state:
|
|
247
58
|
|
|
248
59
|
```bash
|
|
249
|
-
|
|
250
|
-
specialists
|
|
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
|
|
60
|
+
specialists status
|
|
61
|
+
specialists doctor
|
|
261
62
|
```
|
|
262
63
|
|
|
263
|
-
|
|
264
|
-
|
|
64
|
+
## Documentation map
|
|
65
|
+
|
|
66
|
+
`docs/` is the source of truth for detailed documentation. Start with the page that matches your task:
|
|
67
|
+
|
|
68
|
+
| Need | Doc |
|
|
69
|
+
|---|---|
|
|
70
|
+
| Install and bootstrap a project | [docs/bootstrap.md](docs/bootstrap.md) |
|
|
71
|
+
| Bead-first workflow and semantics | [docs/workflow.md](docs/workflow.md) |
|
|
72
|
+
| CLI commands and flags | [docs/cli-reference.md](docs/cli-reference.md) |
|
|
73
|
+
| Background jobs, feed, result, stop | [docs/background-jobs.md](docs/background-jobs.md) |
|
|
74
|
+
| Write or edit a `.specialist.yaml` | [docs/authoring.md](docs/authoring.md) |
|
|
75
|
+
| Current built-in specialists | [docs/specialists-catalog.md](docs/specialists-catalog.md) |
|
|
76
|
+
| MCP registration details | [docs/mcp-servers.md](docs/mcp-servers.md) |
|
|
77
|
+
| Hook behavior | [docs/hooks.md](docs/hooks.md) |
|
|
78
|
+
| Skills shipped in this repo | [docs/skills.md](docs/skills.md) |
|
|
79
|
+
| xtrm / worktree integration | [docs/worktree.md](docs/worktree.md) |
|
|
80
|
+
| RPC mode notes | [docs/pi-rpc.md](docs/pi-rpc.md) |
|
|
81
|
+
| Pi subprocess isolation and extensions | [docs/pi-session.md](docs/pi-session.md) |
|
|
82
|
+
|
|
83
|
+
## Project structure
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
config/
|
|
87
|
+
├── specialists/ canonical specialist definitions (.specialist.yaml)
|
|
88
|
+
├── hooks/ bundled hook scripts
|
|
89
|
+
├── skills/ repo-local skills used by specialists
|
|
90
|
+
└── extensions/ pi extensions (future)
|
|
91
|
+
.specialists/
|
|
92
|
+
├── default/ canonical assets (from init)
|
|
93
|
+
│ ├── specialists/
|
|
94
|
+
│ ├── hooks/
|
|
95
|
+
│ └── skills/
|
|
96
|
+
├── user/ custom additions
|
|
97
|
+
│ ├── specialists/
|
|
98
|
+
│ ├── hooks/
|
|
99
|
+
│ └── skills/
|
|
100
|
+
├── jobs/ runtime — gitignored
|
|
101
|
+
└── ready/ runtime — gitignored
|
|
102
|
+
src/ CLI, server, loader, runner, tools
|
|
265
103
|
```
|
|
266
|
-
specialists status
|
|
267
104
|
|
|
268
|
-
|
|
269
|
-
✓ 9 found (9 project)
|
|
105
|
+
## Core workflow rules
|
|
270
106
|
|
|
271
|
-
|
|
272
|
-
|
|
107
|
+
- **Use `--bead` for tracked work.** The bead is the prompt source.
|
|
108
|
+
- **Use `--prompt` for ad-hoc work only.**
|
|
109
|
+
- `--context-depth` controls how many completed blocker levels are injected.
|
|
110
|
+
- `--no-beads` does **not** disable bead reading.
|
|
111
|
+
- specialists are **project-only**. User-scope specialist discovery is deprecated.
|
|
273
112
|
|
|
274
|
-
|
|
275
|
-
✓ bd installed v0.59.0
|
|
276
|
-
✓ .beads/ present in project
|
|
113
|
+
## Deprecated commands
|
|
277
114
|
|
|
278
|
-
|
|
279
|
-
✓ specialists binary installed /usr/local/bin/specialists
|
|
115
|
+
These commands are still recognized for migration guidance but are no longer onboarding paths:
|
|
280
116
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
g7h8i9 init-session done 0m08s
|
|
284
|
-
```
|
|
117
|
+
- `specialists setup`
|
|
118
|
+
- `specialists install`
|
|
285
119
|
|
|
286
|
-
|
|
120
|
+
Use `specialists init` instead.
|
|
287
121
|
|
|
288
122
|
## Development
|
|
289
123
|
|
|
290
124
|
```bash
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
bun test # bun --bun vitest run
|
|
125
|
+
bun run build
|
|
126
|
+
bun test
|
|
127
|
+
specialists help
|
|
128
|
+
specialists quickstart
|
|
296
129
|
```
|
|
297
130
|
|
|
298
|
-
See [CLAUDE.md](CLAUDE.md) for the full architecture guide.
|
|
299
|
-
|
|
300
|
-
---
|
|
301
|
-
|
|
302
131
|
## License
|
|
303
132
|
|
|
304
133
|
MIT
|