@jaggerxtrm/specialists 3.13.0 → 3.14.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.
@@ -9,7 +9,9 @@ description: >
9
9
  output immediately, or when the work is a single LLM call with structured
10
10
  input/output. Do NOT use for tracked agent work — that belongs to
11
11
  `using-specialists-v2`.
12
- version: 1.0
12
+ version: 1.1.0
13
+ updated: 2026-05-06
14
+ synced_at: a0e54d0c
13
15
  ---
14
16
 
15
17
  # Script-Class Specialists
@@ -54,7 +56,7 @@ A spec is rejected at request time (`specialist_load_error`) if any of:
54
56
  - `execution.interactive` is `true`
55
57
  - `execution.requires_worktree` is `true`
56
58
  - `execution.permission_required` is anything other than `READ_ONLY`
57
- - `skills.scripts` is non-empty
59
+ - `skills.scripts` is non-empty (always rejected; no `--allow-local-scripts` bypass)
58
60
  - `prompt.task_template` is missing
59
61
  - a referenced `$var` in the chosen template is not supplied (`template_variable_missing`)
60
62
 
@@ -101,9 +103,9 @@ sp script <specialist-name> \
101
103
  Behaviour:
102
104
 
103
105
  - Loads the spec via `SpecialistLoader` (same loader as `sp run`).
104
- - Renders `prompt.task_template` (or named template) with `--vars`.
105
- - Spawns `pi --mode json --no-session --no-extensions --no-tools` with the
106
- resolved model.
106
+ - Renders `prompt.task_template` (or named template) with `--vars`, then feeds the rendered prompt via stdin.
107
+ - `--db-path /path/to/observability.db` is an exact SQLite file path; omit it to use the project default `.specialists/db/observability.db`.
108
+ - Spawns `pi` in JSON mode with no session, no extensions, no tools, and offline; forwards the resolved model, optional `--thinking`, and `--system-prompt` when `prompt.system` is set (full override, not append).
107
109
  - Returns the final assistant text on stdout. With `--json`, returns the full
108
110
  `ScriptGenerateResult` envelope.
109
111
  - Writes one row to `.specialists/db/observability.db` (same writer as `sp run`).
@@ -14,6 +14,146 @@ You are the orchestrator. Turn user intent into a strong bead contract, choose r
14
14
 
15
15
  Keep skill practical. Core behavior belongs here; volatile detail stays in live commands.
16
16
 
17
+ > **MANDATORY — Run on skill load and before every new substantial task or epic:**
18
+ > ```bash
19
+ > specialists list --full
20
+ > ```
21
+ > Do not rely on remembered roles, models, or permissions. The registry is the source of truth.
22
+ > Run it again before dispatching any new chain or starting any epic — specialists change between sessions.
23
+
24
+ ## Specialist File Locations
25
+
26
+ Specialists live in three layers. Know which layer you are reading or editing:
27
+
28
+ | Layer | Path | Purpose |
29
+ |-------|------|---------|
30
+ | Package (shipped) | `config/specialists/*.specialist.json` | Canonical role definitions; versioned with the repo |
31
+ | User override | `.specialists/user/*.specialist.json` | Per-project customizations; wins over package layer for same name |
32
+ | Default mirror | `.specialists/default/*.specialist.json` | Repo-managed mirror of package defaults; overrides package fallback |
33
+
34
+ The loader resolves in priority order: user → default-mirror → package. A same-name file in `.specialists/user/` fully replaces the package version for that specialist. When creating or editing a specialist, use `config/specialists/` for shipped roles and `.specialists/user/` for project-specific overrides. Never edit `.specialists/default/` by hand — it is managed by `update-specialists`.
35
+
36
+ `specialists list --full` shows the resolved set (which layer each specialist comes from) so you always know what will actually run.
37
+
38
+ ### Editing Specialist Fields: `sp edit` Is Required
39
+
40
+ Direct JSON editing is error-prone and bypasses schema validation. Use `sp edit` for all field changes — it validates dot-paths, handles array append/remove, and writes to the correct layer.
41
+
42
+ ```bash
43
+ # Read a field
44
+ sp edit executor --get specialist.execution.model
45
+
46
+ # Set a field (schema-validated)
47
+ sp edit executor specialist.execution.model <model-id>
48
+
49
+ # Set prompt.system or task_template from a file (required for multi-line content)
50
+ sp edit executor --set specialist.prompt.system _ --file ./my-system-prompt.txt
51
+
52
+ # Append or remove tags
53
+ sp edit executor --set specialist.metadata.tags review,security --append
54
+ sp edit executor --set specialist.metadata.tags old-tag --remove
55
+
56
+ # Apply a named preset (run sp edit --list-presets for current options)
57
+ sp edit executor --preset power
58
+ sp edit executor --preset cheap --dry-run # preview first
59
+
60
+ # Target a specific scope when name exists in multiple layers
61
+ sp edit executor --scope user --set specialist.execution.model <model-id>
62
+
63
+ # Bulk read across all specialists
64
+ sp edit --all --get specialist.execution.model
65
+ ```
66
+
67
+ **When `sp edit` is required vs. direct JSON edit:**
68
+ - Model, thinking level, timeout, tags, permission, description → always `sp edit`
69
+ - `prompt.system` or `task_template` longer than one line → `sp edit --file`
70
+ - Structural schema fields (execution flags, output_schema) → `sp edit` with dot-path
71
+ - Net-new specialist creation → `specialists-creator` skill, then `sp edit` for tuning
72
+ - Bulk cross-specialist reads → `sp edit --all --get <path>`
73
+ - Available presets → `sp edit --list-presets` (do not hardcode; varies by install)
74
+
75
+ ## Orchestration Discipline (Paranoid Mode)
76
+
77
+ You are an orchestrator, not a hero. Move slowly enough to be correct.
78
+
79
+ - Run `specialists list --full` and `sp help` again at the start of every new substantial task. Do not skip because "you remember." Roles, models, and flags drift between sessions.
80
+ - Re-read the bead before dispatch. If you cannot defend each contract field out loud, the bead is not ready.
81
+ - Never dispatch a chain you cannot describe end-to-end (which specialist, which bead, which workspace, which merge target).
82
+ - Verify worktree and job state before and after each dispatch with `sp ps` and `git worktree list`. Drift is silent until merge.
83
+ - Treat reviewer `PARTIAL` and code-sanity `FINDINGS` as mandatory fix loops, not advisory noise.
84
+ - When unsure, prefer extra explorer/debugger passes over an over-eager executor. Wrong code merged is more expensive than slow research.
85
+
86
+ ## Project-Specific Specialists
87
+
88
+ Users define their own specialists in `.specialists/user/*.specialist.json` to fit project shape (domain knowledge, language, framework, conventions). These override package defaults and may not match generic role descriptions.
89
+
90
+ - Always run `specialists list --full` to see the resolved set, including project-specific roles, before choosing.
91
+ - Read `sp help` and the specialist's description/tags to confirm fit. Do not assume a name maps to its package-default behavior — a `.specialists/user/` override may have a different prompt, model, or scope.
92
+ - Pick the project-specific specialist when its role matches the task shape. Do not fall back to a generic role just because it is more familiar.
93
+ - If the task does not match any project-specific role, use the package default and consider whether a new project-specific specialist would help (use `specialists-creator` skill).
94
+
95
+ ## Security-Auditor and Code-Sanity Are Part of the Chain
96
+
97
+ These are not optional. For any substantive diff (auth, secrets, input handling, dependency changes, control-flow rewrites, type-risky changes, agent/config surfaces), include them between executor and reviewer.
98
+
99
+ - `code-sanity` — cheap simplification and type-safety screen. Run when diff smells overcomplicated, brittle, or duplicates logic. Output is advisory; reviewer still gates merge.
100
+ - `security-auditor` — scan-only risk surface review. Run when diff touches auth, secrets, input handling, dependency logic, or agent/config. Output is advisory; executor applies fixes if any.
101
+ - Both run with their own bead and `--job <exec-job>` so they enter the executor workspace.
102
+ - Order: executor → code-sanity (if smell) → security-auditor (if risk surface) → reviewer.
103
+ - Never skip security-auditor on auth/secrets/input changes "because the diff looks small." Small diffs hide the worst regressions.
104
+
105
+ ## Monitoring Long-Running Jobs: Sleep Timers Are Mandatory
106
+
107
+ Specialists run async. You will lose the chain if you do not actively monitor it.
108
+
109
+ **Required pattern after every dispatch:**
110
+
111
+ ```bash
112
+ sp run <role> --bead <id> --background ... # dispatch
113
+ sleep 10 && sp ps # confirm started
114
+ ```
115
+
116
+ Then cycle sleeps based on average completion time per role, checking `sp ps` each cycle:
117
+
118
+ | Role | Typical duration | Initial sleep cycle |
119
+ |------|------------------|---------------------|
120
+ | sync-docs, changelog-keeper | 60–180s | `sleep 60` then `sleep 60` |
121
+ | code-sanity, security-auditor | 60–180s | `sleep 60` then `sleep 60` |
122
+ | reviewer | 90–240s | `sleep 90` then `sleep 60` |
123
+ | explorer, debugger, planner, overthinker | 120–300s | `sleep 120` then `sleep 90` |
124
+ | executor | 180–600s+ | `sleep 180` then `sleep 120` |
125
+ | test-runner | varies with suite | start at `sleep 120`, adjust |
126
+
127
+ Rules:
128
+ - After dispatch, **always** `sleep 10 && sp ps` first to confirm the job is `running`, not stuck in `queued` or already `failed`.
129
+ - Then sleep again per the table; check `sp ps` each cycle.
130
+ - Do not poll faster than every 30s after the initial check — it wastes context.
131
+ - When status flips to `completed`, run `sp result <job-id>` immediately to consume output before context grows.
132
+ - If a job exceeds 2× its typical duration without completing, inspect with `sp feed <job-id>` before assuming hang.
133
+
134
+ You are not "done" until every dispatched job is `completed` or `failed` and consumed.
135
+
136
+ ## Worktree Cleanup After Merge
137
+
138
+ `sp merge` and `sp epic merge` clean up automatically when they succeed. If you fall back to manual `git merge` (e.g., doc-only chains), you own cleanup.
139
+
140
+ After every merge, verify:
141
+
142
+ ```bash
143
+ git worktree list # any orphaned worktrees from this session?
144
+ sp ps # any leftover jobs?
145
+ git worktree prune # drop stale worktree metadata
146
+ ```
147
+
148
+ If a feature/epic worktree remains after merge, remove it explicitly:
149
+
150
+ ```bash
151
+ git worktree remove <path>
152
+ git branch -d <merged-branch> # only after confirming merged
153
+ ```
154
+
155
+ `sp ps` must be empty (or only contain jobs you intentionally kept alive) before session close. Stale worktrees and stale jobs both block future dispatches via the stale-base guard.
156
+
17
157
  ## When To Delegate
18
158
 
19
159
  Use specialists for substantial work: codebase exploration, debugging, implementation, review, test execution, planning, documentation sync, security/config audit, release publication, and multi-chain epics.