@jaggerxtrm/specialists 3.5.0 → 3.6.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.
Files changed (37) hide show
  1. package/README.md +12 -1
  2. package/config/hooks/specialists-session-start.mjs +105 -0
  3. package/config/nodes/research-multi.node.json +11 -0
  4. package/config/nodes/research.node.json +27 -0
  5. package/config/presets.json +26 -0
  6. package/config/skills/specialists-creator/SKILL.md +323 -145
  7. package/config/skills/specialists-creator/scripts/scaffold-specialist.ts +228 -0
  8. package/config/skills/using-nodes/SKILL.md +333 -0
  9. package/config/skills/using-specialists/SKILL.md +843 -173
  10. package/config/specialists/debugger.specialist.json +74 -0
  11. package/config/specialists/executor.specialist.json +117 -0
  12. package/config/specialists/explorer.specialist.json +82 -0
  13. package/config/specialists/memory-processor.specialist.json +65 -0
  14. package/config/specialists/node-coordinator.specialist.json +64 -0
  15. package/config/specialists/overthinker.specialist.json +65 -0
  16. package/config/specialists/parallel-review.specialist.json +65 -0
  17. package/config/specialists/planner.specialist.json +93 -0
  18. package/config/specialists/researcher.specialist.json +65 -0
  19. package/config/specialists/reviewer.specialist.json +60 -0
  20. package/config/specialists/specialists-creator.specialist.json +68 -0
  21. package/config/specialists/sync-docs.specialist.json +80 -0
  22. package/config/specialists/test-runner.specialist.json +67 -0
  23. package/config/specialists/xt-merge.specialist.json +60 -0
  24. package/dist/index.js +13818 -2743
  25. package/package.json +6 -3
  26. package/config/specialists/debugger.specialist.yaml +0 -121
  27. package/config/specialists/executor.specialist.yaml +0 -257
  28. package/config/specialists/explorer.specialist.yaml +0 -85
  29. package/config/specialists/memory-processor.specialist.yaml +0 -154
  30. package/config/specialists/overthinker.specialist.yaml +0 -76
  31. package/config/specialists/parallel-review.specialist.yaml +0 -75
  32. package/config/specialists/planner.specialist.yaml +0 -94
  33. package/config/specialists/reviewer.specialist.yaml +0 -142
  34. package/config/specialists/specialists-creator.specialist.yaml +0 -90
  35. package/config/specialists/sync-docs.specialist.yaml +0 -68
  36. package/config/specialists/test-runner.specialist.yaml +0 -65
  37. package/config/specialists/xt-merge.specialist.yaml +0 -159
@@ -2,10 +2,11 @@
2
2
  name: specialists-creator
3
3
  description: >
4
4
  Use this skill when creating or fixing a specialist definition. It guides the
5
- agent through writing a valid `.specialist.yaml`, choosing supported models,
5
+ agent through writing a valid `.specialist.json`, choosing supported models,
6
6
  validating against the schema, and avoiding common specialist authoring
7
7
  mistakes.
8
- version: 1.0
8
+ version: 1.1
9
+ synced_at: 236ca5e6
9
10
  ---
10
11
 
11
12
  # Specialist Author Guide
@@ -16,7 +17,7 @@ version: 1.0
16
17
 
17
18
  ## ACTION REQUIRED BEFORE ANYTHING ELSE
18
19
 
19
- Run these commands **right now**, before reading further, before writing any YAML, before doing anything else:
20
+ Run these commands **right now**, before reading further, before writing any JSON, before doing anything else:
20
21
 
21
22
  ```bash
22
23
  pi --list-models
@@ -145,45 +146,47 @@ specialists models # confirm assignments look balanced
145
146
 
146
147
  ### For a new specialist (single model selection)
147
148
 
148
- > **See [⛔ MANDATORY FIRST STEP](#-mandatory-first-step--verify-models-before-writing-any-yaml) at the top of this skill.**
149
- > Use `pi --list-models` (not `specialists models`) to discover models, ping both before writing YAML.
149
+ > **See [⛔ MANDATORY FIRST STEP](#-mandatory-first-step--verify-models-before-writing-any-json) at the top of this skill.**
150
+ > Use `pi --list-models` (not `specialists models`) to discover models, ping both before mutating config.
150
151
 
151
152
  ```bash
152
153
  # 1. pi --list-models — see exactly what's available on pi right now
153
154
  # 2. Pick tier + pick highest version in family
154
155
  # 3. pi --model <primary> --print "ping" — must return "pong"
155
156
  # 4. pi --model <fallback> --print "ping" — must return "pong"
156
- # 5. Write YAML with verified model strings
157
+ # 5. Run scaffold-specialist.ts first (pre-script already wired in specialists-creator)
158
+ # 6. Use sp edit for field-by-field mutations
157
159
  ```
158
160
 
159
161
  **Rule:** Never hardcode a model without pinging it. If ping fails, try the next best in that tier.
160
162
 
161
163
  ---
162
164
 
163
- ## Quick Start: Minimal Skeleton
165
+ ## Quick Start: Scaffold + `sp edit`
164
166
 
165
- ```yaml
166
- specialist:
167
- metadata:
168
- name: my-specialist # kebab-case, required
169
- version: 1.0.0 # semver, required
170
- description: "One sentence." # required
171
- category: workflow # required (free text)
167
+ ```bash
168
+ # 1. Create/normalize the specialist JSON with all schema sections present
169
+ node config/skills/specialists-creator/scripts/scaffold-specialist.ts config/specialists/my-specialist.specialist.json
172
170
 
173
- execution:
174
- model: anthropic/claude-sonnet-4-6 # run model setup workflow above to choose + verify
175
- permission_required: READ_ONLY
171
+ # 2. Apply a preset for common model/thinking defaults (optional but preferred)
172
+ sp edit my-specialist --preset standard
176
173
 
177
- prompt:
178
- task_template: |
179
- $prompt
174
+ # 3. Set individual fields via dot.path (primary mutation workflow)
175
+ sp edit my-specialist specialist.metadata.name my-specialist
176
+ sp edit my-specialist specialist.metadata.version 1.0.0
177
+ sp edit my-specialist specialist.execution.model anthropic/claude-sonnet-4-6
178
+ sp edit my-specialist specialist.execution.fallback_model google-gemini-cli/gemini-3.1-pro-preview
179
+ sp edit my-specialist specialist.execution.permission_required READ_ONLY
180
180
 
181
- Working directory: $cwd
182
- ```
181
+ # 4. Use --file only for multiline prompt fields
182
+ sp edit my-specialist specialist.prompt.system --file .tmp/system.prompt.txt
183
+ sp edit my-specialist specialist.prompt.task_template --file .tmp/task-template.prompt.txt
183
184
 
184
- Validate before committing:
185
- ```bash
186
- bun skills/specialist-author/scripts/validate-specialist.ts specialists/my-specialist.specialist.yaml
185
+ # 5. Verify materialized JSON
186
+ sp view my-specialist
187
+
188
+ # 6. Validate schema
189
+ bun skills/specialist-author/scripts/validate-specialist.ts config/specialists/my-specialist.specialist.json
187
190
  ```
188
191
 
189
192
  ---
@@ -214,6 +217,7 @@ bun skills/specialist-author/scripts/validate-specialist.ts specialists/my-speci
214
217
  | `stall_timeout_ms` | number | — | kill if no event for N ms |
215
218
  | `interactive` | boolean | `false` | enable multi-turn keep-alive by default |
216
219
  | `response_format` | enum | `text` | `text` \| `json` \| `markdown` |
220
+ | `output_type` | enum | `custom` | `codegen` \| `analysis` \| `review` \| `synthesis` \| `orchestration` \| `workflow` \| `research` \| `custom` |
217
221
  | `permission_required` | enum | `READ_ONLY` | see tier table below |
218
222
  | `thinking_level` | enum | — | `off` \| `minimal` \| `low` \| `medium` \| `high` \| `xhigh` |
219
223
 
@@ -244,26 +248,110 @@ bun skills/specialist-author/scripts/validate-specialist.ts specialists/my-speci
244
248
  | `task_template` | string | yes | Template string with `$variable` substitution |
245
249
  | `system` | string | no | System prompt / agents.md content |
246
250
  | `skill_inherit` | string | no | Single skill folder/file injected via `pi --skill` (Agent Forge compat) |
247
- | `output_schema` | object | no | JSON schema for structured output |
251
+ | `output_schema` | object | no | JSON schema for structured output — injected into system prompt by runner; post-run validation is warn-only |
248
252
  | `examples` | array | no | Few-shot examples |
249
253
 
254
+ **Output contract precedence (runner-injected):** `response_format` → `output_type` → `output_schema`.
255
+
256
+ **`response_format` behavior**
257
+ - `text`: no report template is injected (raw behavior)
258
+ - `json`: specialist must return one parseable JSON object
259
+ - `markdown`: specialist must use canonical report sections when applicable:
260
+ - `## Summary`
261
+ - `## Status`
262
+ - `## Changes`
263
+ - `## Verification`
264
+ - `## Risks`
265
+ - `## Follow-ups`
266
+ - `## Beads`
267
+ - Optional: `## Architecture`, `## Acceptance Criteria`, `## Machine-readable block`
268
+
269
+ **`output_type` (semantic archetype)**
270
+ - `codegen`: implementation/change manifests
271
+ - `analysis`: architecture/exploration reports
272
+ - `review`: compliance/review verdicts
273
+ - `synthesis`: decision summaries across multiple findings
274
+ - `orchestration`: coordinator actions/state handoffs
275
+ - `workflow`: procedural/operational run outputs
276
+ - `research`: source-backed findings with confidence
277
+ - `custom`: no built-in extension (schema still includes base contract fields in structured modes)
278
+
279
+ **`output_schema` guidance**: Add when output must be machine-readable by downstream consumers (beads notes, feed, orchestrators). The schema is injected into the system prompt and validated post-run with warn-only behavior (never hard-fail in v1).
280
+
281
+ **Mandatory markdown+schema rule:** if `response_format: markdown` and `output_schema` is present, the output must include `## Machine-readable block` containing exactly one JSON object in a single ` ```json ` fenced block. That JSON object is canonical and must match the schema.
282
+
283
+ Standard schemas by specialist type (shown as the `output_schema` object value):
284
+
285
+ executor — change manifest:
286
+ ```json
287
+ {
288
+ "type": "object",
289
+ "properties": {
290
+ "status": { "enum": ["success", "partial", "failed"] },
291
+ "files_changed": { "type": "array", "items": { "type": "string" } },
292
+ "symbols_modified": { "type": "array", "items": { "type": "string" } },
293
+ "lint_pass": { "type": "boolean" },
294
+ "tests_pass": { "type": "boolean" },
295
+ "issues_closed": { "type": "array", "items": { "type": "string" } },
296
+ "follow_ups": { "type": "array", "items": { "type": "string" } }
297
+ }
298
+ }
299
+ ```
300
+
301
+ explorer — analysis report:
302
+ ```json
303
+ {
304
+ "type": "object",
305
+ "properties": {
306
+ "summary": { "type": "string" },
307
+ "key_files": { "type": "array", "items": { "type": "string" } },
308
+ "architecture_notes": { "type": "string" },
309
+ "recommendations": { "type": "array", "items": { "type": "string" } }
310
+ }
311
+ }
312
+ ```
313
+
314
+ planner — epic result:
315
+ ```json
316
+ {
317
+ "type": "object",
318
+ "properties": {
319
+ "epic_id": { "type": "string" },
320
+ "children": { "type": "array", "items": { "type": "string" } },
321
+ "test_issues": { "type": "array", "items": { "type": "string" } },
322
+ "first_task": { "type": "string" }
323
+ }
324
+ }
325
+ ```
326
+
250
327
  ### `specialist.skills` (optional)
251
328
 
252
- ```yaml
253
- skills:
254
- paths: # passed as pi --skill; folder (reads SKILL.md inside) or direct file
255
- - skills/my-skill/ # folder — pi loads SKILL.md from inside
256
- - ~/.agents/skills/domain/ # same
257
- - skills/notes.md # direct file also accepted
258
- scripts:
259
- - run: ./scripts/pre-check.sh # file path OR shell command
260
- phase: pre # "pre" or "post"
261
- inject_output: true # true = stdout available as $pre_script_output
262
- - run: "bd ready" # inline command — runs via shell
263
- phase: pre
264
- inject_output: true
265
- - run: ./scripts/cleanup.sh
266
- phase: post
329
+ ```json
330
+ {
331
+ "skills": {
332
+ "paths": [
333
+ "skills/my-skill/",
334
+ "~/.agents/skills/domain/",
335
+ "skills/notes.md"
336
+ ],
337
+ "scripts": [
338
+ {
339
+ "run": "./scripts/pre-check.sh",
340
+ "phase": "pre",
341
+ "inject_output": true
342
+ },
343
+ {
344
+ "run": "bd ready",
345
+ "phase": "pre",
346
+ "inject_output": true
347
+ },
348
+ {
349
+ "run": "./scripts/cleanup.sh",
350
+ "phase": "post"
351
+ }
352
+ ]
353
+ }
354
+ }
267
355
  ```
268
356
 
269
357
  `run` accepts either a **file path** (`./scripts/foo.sh`, `~/scripts/foo.sh`) or a **shell command** (`bd ready`, `git status`). Pre-run validation checks that file paths exist and shell commands are on `PATH`. Shebang typos (e.g. `pytho` instead of `python`) are caught and reported as errors before the session starts.
@@ -274,29 +362,44 @@ skills:
274
362
 
275
363
  Informational declarations used by pre-run validation and future tooling (e.g. `specialists doctor`).
276
364
 
277
- ```yaml
278
- capabilities:
279
- required_tools: [bash, read, grep, glob] # pi tools this specialist needs
280
- external_commands: [bd, git, gh] # CLI binaries validated on PATH before run
365
+ ```json
366
+ {
367
+ "capabilities": {
368
+ "required_tools": ["bash", "read", "grep", "glob"],
369
+ "external_commands": ["bd", "git", "gh"]
370
+ }
371
+ }
281
372
  ```
282
373
 
283
374
  `external_commands` causes a hard failure if any binary is not found on `PATH` — the session will not start.
284
375
 
285
376
  ### `specialist.output_file` (optional, top-level)
286
377
 
287
- ```yaml
288
- output_file: .specialists/my-specialist-result.md
378
+ ```json
379
+ {
380
+ "output_file": ".specialists/my-specialist-result.md"
381
+ }
289
382
  ```
290
383
 
291
384
  Writes the final session output to this file path after the session completes. Relative to the working directory.
292
385
 
293
386
  ### `specialist.communication` (optional)
294
387
 
295
- ```yaml
296
- communication:
297
- next_specialists: planner # single specialist to chain after completion
298
- # or an array:
299
- next_specialists: [planner, test-runner]
388
+ ```json
389
+ {
390
+ "communication": {
391
+ "next_specialists": "planner"
392
+ }
393
+ }
394
+ ```
395
+
396
+ Or as an array:
397
+ ```json
398
+ {
399
+ "communication": {
400
+ "next_specialists": ["planner", "test-runner"]
401
+ }
402
+ }
300
403
  ```
301
404
 
302
405
  `next_specialists` declares which specialist(s) should receive this specialist's output as `$previous_result`. Chaining is executed by the caller (e.g. `run_parallel` pipeline) — this field is declarative metadata.
@@ -319,16 +422,21 @@ Drives the staleness detection shown in `specialists status` and `specialists li
319
422
  | `STALE` | A watched file's mtime > `metadata.updated` |
320
423
  | `AGED` | STALE + days since `updated` > `stale_threshold_days` |
321
424
 
322
- ```yaml
323
- specialist:
324
- metadata:
325
- updated: "2026-03-01"
326
-
327
- validation:
328
- files_to_watch:
329
- - src/specialist/schema.ts
330
- - src/specialist/runner.ts
331
- stale_threshold_days: 30
425
+ ```json
426
+ {
427
+ "specialist": {
428
+ "metadata": {
429
+ "updated": "2026-03-01"
430
+ },
431
+ "validation": {
432
+ "files_to_watch": [
433
+ "src/specialist/schema.ts",
434
+ "src/specialist/runner.ts"
435
+ ],
436
+ "stale_threshold_days": 30
437
+ }
438
+ }
439
+ }
332
440
  ```
333
441
 
334
442
  This specialist goes STALE the moment `schema.ts` or `runner.ts` is modified after March 1st, and AGED if that condition persists for more than 30 days.
@@ -368,11 +476,15 @@ These are **always available** in `task_template` — no configuration needed:
368
476
 
369
477
  Files listed under `skills.paths` are read and appended to the system prompt at runtime:
370
478
 
371
- ```yaml
372
- skills:
373
- paths:
374
- - skills/specialist-author/SKILL.md
375
- - .claude/agents.md
479
+ ```json
480
+ {
481
+ "skills": {
482
+ "paths": [
483
+ "skills/specialist-author/SKILL.md",
484
+ ".claude/agents.md"
485
+ ]
486
+ }
487
+ }
376
488
  ```
377
489
 
378
490
  Each file is appended as:
@@ -393,15 +505,23 @@ Missing files are silently skipped (no error).
393
505
 
394
506
  Scripts run **locally** (not inside the agent session):
395
507
 
396
- ```yaml
397
- skills:
398
- scripts:
399
- - path: scripts/gather-context.sh
400
- phase: pre
401
- inject_output: true # stdout -> $pre_script_output in task_template
402
- - path: scripts/notify.sh
403
- phase: post
404
- inject_output: false # runs after session, output discarded
508
+ ```json
509
+ {
510
+ "skills": {
511
+ "scripts": [
512
+ {
513
+ "run": "scripts/gather-context.sh",
514
+ "phase": "pre",
515
+ "inject_output": true
516
+ },
517
+ {
518
+ "run": "scripts/notify.sh",
519
+ "phase": "post",
520
+ "inject_output": false
521
+ }
522
+ ]
523
+ }
524
+ }
405
525
  ```
406
526
 
407
527
  - `pre` scripts run before the agent session starts; use `inject_output: true` to surface their stdout.
@@ -413,62 +533,107 @@ skills:
413
533
 
414
534
  ## Annotated Full Example
415
535
 
416
- ```yaml
417
- specialist:
418
- metadata:
419
- name: code-reviewer
420
- version: 1.0.0
421
- description: "Reviews a PR diff for correctness, style, and security issues."
422
- category: code-quality
423
- author: team@example.com
424
- updated: "2026-03-22"
425
- tags: [review, code-quality, security]
426
-
427
- execution:
428
- mode: tool
429
- model: anthropic/claude-sonnet-4-6
430
- fallback_model: google-gemini-cli/gemini-3.1-pro-preview
431
- timeout_ms: 300000
432
- stall_timeout_ms: 60000
433
- interactive: true # default keep-alive; supports resume flows
434
- response_format: markdown
435
- permission_required: READ_ONLY # not READ_WRITE
436
-
437
- prompt:
438
- system: |
439
- You are an expert code reviewer. Focus on correctness, maintainability, and security.
440
- Do NOT modify any files -- output a markdown review only.
441
-
442
- task_template: |
443
- Review the following changes:
444
-
445
- $prompt
446
-
447
- $pre_script_output
448
-
449
- Working directory: $cwd
450
-
451
- Output a structured markdown review with sections: Summary, Issues, Suggestions.
452
-
453
- skill_inherit: skills/code-review/guidelines.md
454
-
455
- skills:
456
- paths:
457
- - skills/code-review/
458
- scripts:
459
- - run: scripts/get-diff.sh
460
- phase: pre
461
- inject_output: true
462
-
463
- capabilities:
464
- required_tools: [bash, read]
465
- external_commands: [git]
466
-
467
- communication:
468
- next_specialists: [sync-docs]
469
-
470
- output_file: .specialists/review.md
471
- beads_integration: auto
536
+ ```json
537
+ {
538
+ "specialist": {
539
+ "metadata": {
540
+ "name": "code-reviewer",
541
+ "version": "1.0.0",
542
+ "description": "Reviews a PR diff for correctness, style, and security issues.",
543
+ "category": "code-quality",
544
+ "author": "team@example.com",
545
+ "updated": "2026-03-22",
546
+ "tags": ["review", "code-quality", "security"]
547
+ },
548
+ "execution": {
549
+ "mode": "tool",
550
+ "model": "anthropic/claude-sonnet-4-6",
551
+ "fallback_model": "google-gemini-cli/gemini-3.1-pro-preview",
552
+ "timeout_ms": 300000,
553
+ "stall_timeout_ms": 60000,
554
+ "interactive": true,
555
+ "response_format": "markdown",
556
+ "permission_required": "READ_ONLY"
557
+ },
558
+ "prompt": {
559
+ "system": "You are an expert code reviewer. Focus on correctness, maintainability, and security.\nDo NOT modify any files -- output a markdown review only.\n",
560
+ "task_template": "Review the following changes:\n\n$prompt\n\n$pre_script_output\n\nWorking directory: $cwd\n\nOutput a structured markdown review with sections: Summary, Issues, Suggestions.\n",
561
+ "skill_inherit": "skills/code-review/guidelines.md"
562
+ },
563
+ "skills": {
564
+ "paths": [
565
+ "skills/code-review/"
566
+ ],
567
+ "scripts": [
568
+ {
569
+ "run": "scripts/get-diff.sh",
570
+ "phase": "pre",
571
+ "inject_output": true
572
+ }
573
+ ]
574
+ },
575
+ "capabilities": {
576
+ "required_tools": ["bash", "read"],
577
+ "external_commands": ["git"]
578
+ },
579
+ "communication": {
580
+ "next_specialists": ["sync-docs"]
581
+ },
582
+ "output_file": ".specialists/review.md",
583
+ "beads_integration": "auto"
584
+ }
585
+ }
586
+ ```
587
+
588
+ ---
589
+
590
+ ## Context Window & Lifecycle Design
591
+
592
+ Specialists run as long-lived Pi sessions. Context management is not optional — ignoring it causes silent quality degradation before any hard limit is hit.
593
+
594
+ ### Context rot starts before the window fills
595
+
596
+ Quality degrades as the context grows — compressed early context causes inconsistency, missed facts, and instruction drift. Design for bounded, coherent runs rather than arbitrarily long ones.
597
+
598
+ **Rules when authoring a specialist:**
599
+ - Set `stall_timeout_ms` explicitly for any specialist that may idle between turns (keep-alive/interactive). Without it, a stuck session holds resources indefinitely.
600
+ - Use `thinking_level: low` for orchestration/coordinator specialists that emit structured JSON output — thinking tokens cost context budget without improving structured output quality.
601
+ - For research/explorer specialists: bounded scope per session + `handoff_summary` in `output_schema` > one unbounded session.
602
+ - `interactive: true` specialists must define what "done" looks like in their system prompt — otherwise they drift.
603
+
604
+ ### Context metrics are always available
605
+
606
+ `status.json` exposes `metrics.token_usage` (cumulative input+output tokens) and `metrics.turns` on every turn. These are written by 08zd Phase 1 and available to any caller (NodeSupervisor, orchestrator, human).
607
+
608
+ **context_pct formula**: `(cumulative_input_tokens / model_context_window) * 100`
609
+
610
+ Approximate context windows:
611
+ | Model family | Window |
612
+ |-------------|--------|
613
+ | `claude-opus-4-6`, `claude-sonnet-4-6`, `claude-haiku-4-5` | 200k tokens |
614
+ | `gemini-3.1-pro-preview` | 1M tokens |
615
+ | `qwen3.5-plus`, `dashscope/qwen3.5-plus` | 128k tokens |
616
+ | `zai/glm-5`, `zai/glm-5-turbo` | 128k tokens |
617
+
618
+ ### For Node members specifically
619
+
620
+ NodeSupervisor injects `member_health` into the coordinator resume prompt on **every turn** — not just at warning thresholds. This is by design: the coordinator needs continuous data to make proactive rotation decisions before quality degrades.
621
+
622
+ When authoring a specialist intended to run as a Node member:
623
+ - Include a `handoff_summary` field in `output_schema` so context can be transferred on rotation
624
+ - Keep system prompts concise — the NodeSupervisor will inject additional context on each resume
625
+ - `thinking_level: low` or `off` for coordinator-class specialists; higher levels for deep analysis members
626
+
627
+ ### Design checklist for long-running specialists
628
+
629
+ Before finalising a specialist that uses `interactive: true` or is expected to run many turns:
630
+
631
+ ```
632
+ [ ] stall_timeout_ms set (not relying on timeout_ms alone)
633
+ [ ] thinking_level set appropriately for the output type
634
+ [ ] output_schema includes handoff_summary or equivalent for rotation
635
+ [ ] system prompt has explicit termination condition ("you are done when...")
636
+ [ ] task_template doesn't inject large static blobs that could be fetched on demand
472
637
  ```
473
638
 
474
639
  ---
@@ -478,15 +643,15 @@ specialist:
478
643
  | Zod Error | Cause | Fix |
479
644
  |-----------|-------|-----|
480
645
  | `Must be kebab-case` | `name` has uppercase or spaces | Use `my-specialist` not `MySpecialist` |
481
- | `Must be semver` | `version: "v1.0"` | Use `version: 1.0.0` (no `v` prefix) |
646
+ | `Must be semver` | `version: "v1.0"` | Use `"version": "1.0.0"` (no `v` prefix) |
482
647
  | `Invalid enum value ... 'READ_WRITE'` | Wrong permission value | Use `READ_ONLY`, `LOW`, `MEDIUM`, or `HIGH` |
483
648
  | `Invalid enum value ... 'auto'` on permission_required | Using `auto` for permission_required | `auto` is only valid for `beads_integration` |
484
- | `Required` on `task_template` | `task_template` missing from `prompt:` | Add `task_template` (even if just `$prompt`) |
485
- | `Required` on `model` | `model` missing from `execution:` | Add a model string |
649
+ | `Required` on `task_template` | `task_template` missing from `prompt` | Add `task_template` (even if just `"$prompt"`) |
650
+ | `Required` on `model` | `model` missing from `execution` | Add a model string |
486
651
  | `Required` on `description` | Missing `description` in `metadata` | Add description string |
487
652
  | `Required` on `category` | Missing `category` in `metadata` | Add category string |
488
- | Silently ignored / no output | YAML valid but `task_template` doesn't use `$prompt` | Add `$prompt` to `task_template` |
489
- | `defaults` key unrecognized | Using `defaults:` top-level key | Remove it; use `--variables` at invocation or built-ins |
653
+ | Silently ignored / no output | JSON valid but `task_template` doesn't use `$prompt` | Add `$prompt` to `task_template` |
654
+ | `defaults` key unrecognized | Using `defaults` top-level key | Remove it; use `--variables` at invocation or built-ins |
490
655
 
491
656
  ---
492
657
 
@@ -494,11 +659,11 @@ specialist:
494
659
 
495
660
  Specialists are discovered from three scopes (highest priority first):
496
661
 
497
- 1. **Project**: `<project-root>/specialists/*.specialist.yaml`
498
- 2. **User**: `~/.agents/specialists/*.specialist.yaml`
662
+ 1. **Project**: `<project-root>/specialists/*.specialist.json`
663
+ 2. **User**: `~/.agents/specialists/*.specialist.json`
499
664
  3. **System**: package-bundled specialists
500
665
 
501
- Name your file `<metadata.name>.specialist.yaml`.
666
+ Name your file `<metadata.name>.specialist.json`.
502
667
 
503
668
  ---
504
669
 
@@ -512,15 +677,28 @@ pi --list-models
512
677
  pi --model <provider>/<primary-model-id> --print "ping" # must return "pong"
513
678
  pi --model <provider>/<fallback-model-id> --print "ping" # must return "pong"
514
679
 
515
- # 2. Write the YAML with the verified model
680
+ # 2. Scaffold first (fills missing schema sections/fields)
681
+ node config/skills/specialists-creator/scripts/scaffold-specialist.ts config/specialists/my-specialist.specialist.json
682
+
683
+ # 3. Mutate with sp edit (dot.path + presets)
684
+ sp edit my-specialist --preset standard
685
+ sp edit my-specialist specialist.execution.model <provider>/<primary-model-id>
686
+ sp edit my-specialist specialist.execution.fallback_model <provider>/<fallback-model-id>
687
+
688
+ # 4. Use --file only for multiline prompt fields
689
+ sp edit my-specialist specialist.prompt.system --file .tmp/system.prompt.txt
690
+ sp edit my-specialist specialist.prompt.task_template --file .tmp/task-template.prompt.txt
691
+
692
+ # 5. Verify rendered config
693
+ sp view my-specialist
516
694
 
517
- # 3. Validate schema with the bundled helper
518
- bun skills/specialist-author/scripts/validate-specialist.ts specialists/my-specialist.specialist.yaml
695
+ # 6. Validate schema with the bundled helper
696
+ bun skills/specialist-author/scripts/validate-specialist.ts config/specialists/my-specialist.specialist.json
519
697
 
520
- # 4. List to confirm discovery
698
+ # 7. List to confirm discovery
521
699
  specialists list
522
700
 
523
- # 5. Smoke test
701
+ # 8. Smoke test
524
702
  specialists run my-specialist --prompt "ping" --no-beads
525
703
  ```
526
704