@bastani/atomic 0.9.15 → 0.9.16-alpha.2
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/CHANGELOG.md +19 -0
- package/dist/builtin/intercom/CHANGELOG.md +10 -0
- package/dist/builtin/intercom/README.md +8 -8
- package/dist/builtin/intercom/contact-supervisor-tool.ts +68 -32
- package/dist/builtin/intercom/index-heavy.ts +1 -0
- package/dist/builtin/intercom/index.ts +21 -15
- package/dist/builtin/intercom/intercom-tool.ts +66 -10
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/intercom/parent-ask-handoff.ts +72 -0
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +26 -0
- package/dist/builtin/subagents/README.md +37 -114
- package/dist/builtin/subagents/agents/worker.md +2 -2
- package/dist/builtin/subagents/package.json +1 -5
- package/dist/builtin/subagents/skills/subagent/SKILL.md +26 -103
- package/dist/builtin/subagents/src/extension/index.ts +5 -30
- package/dist/builtin/subagents/src/extension/notification-content.ts +1 -1
- package/dist/builtin/subagents/src/extension/schemas.ts +2 -14
- package/dist/builtin/subagents/src/extension/tool-description.ts +1 -4
- package/dist/builtin/subagents/src/extension/tool-rendering.ts +53 -0
- package/dist/builtin/subagents/src/intercom/intercom-bridge.ts +1 -54
- package/dist/builtin/subagents/src/intercom/result-intercom.ts +4 -4
- package/dist/builtin/subagents/src/runs/foreground/execution-parent-ask-handoff.ts +78 -0
- package/dist/builtin/subagents/src/runs/foreground/inprocess-run-sync.ts +7 -5
- package/dist/builtin/subagents/src/runs/foreground/notify.ts +5 -6
- package/dist/builtin/subagents/src/runs/foreground/parent-ask-output.ts +48 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-burst-display.ts +46 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-burst.ts +403 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-context.ts +48 -9
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-input.ts +3 -1
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-live-update.ts +11 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel-task.ts +164 -93
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel.ts +36 -29
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parent-ask-projection.ts +11 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts +42 -17
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-status.ts +3 -121
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-types.ts +7 -2
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor.ts +30 -257
- package/dist/builtin/subagents/src/runs/inprocess/control-status.ts +0 -34
- package/dist/builtin/subagents/src/runs/inprocess/index.ts +0 -12
- package/dist/builtin/subagents/src/runs/inprocess/prompt-behavior.ts +1 -1
- package/dist/builtin/subagents/src/runs/inprocess/runner.ts +2 -141
- package/dist/builtin/subagents/src/runs/shared/parallel-utils.ts +8 -0
- package/dist/builtin/subagents/src/shared/status-format.ts +3 -3
- package/dist/builtin/subagents/src/shared/types-config.ts +41 -0
- package/dist/builtin/subagents/src/shared/types-foreground-state.ts +7 -15
- package/dist/builtin/subagents/src/shared/types-results.ts +3 -1
- package/dist/builtin/subagents/src/shared/types-runtime.ts +1 -11
- package/dist/builtin/subagents/src/slash/slash-commands.ts +4 -468
- package/dist/builtin/subagents/src/tui/render-progress.ts +2 -2
- package/dist/builtin/subagents/src/tui/render-result-compact.ts +2 -2
- package/dist/builtin/subagents/src/tui/render-result.ts +38 -14
- package/dist/builtin/subagents/src/tui/render-status-progress.ts +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +16 -0
- package/dist/builtin/workflows/README.md +1 -1
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/skills/bro/LICENSE.txt +21 -0
- package/dist/builtin/workflows/skills/bro/SKILL.md +14 -0
- package/dist/builtin/workflows/skills/how/LICENSE.txt +21 -0
- package/dist/builtin/workflows/skills/how/SKILL.md +162 -0
- package/dist/builtin/workflows/skills/how/references/critic-prompt.md +59 -0
- package/dist/builtin/workflows/skills/how/references/critique-rubric.md +58 -0
- package/dist/builtin/workflows/skills/how/references/explainer-prompt.md +55 -0
- package/dist/builtin/workflows/skills/how/references/explorer-prompt.md +52 -0
- package/dist/builtin/workflows/skills/teach/LICENSE.txt +21 -0
- package/dist/builtin/workflows/skills/teach/SKILL.md +28 -0
- package/dist/builtin/workflows/skills/unslop/LICENSE.txt +21 -0
- package/dist/builtin/workflows/skills/unslop/SKILL.md +87 -0
- package/dist/builtin/workflows/skills/why/LICENSE.txt +21 -0
- package/dist/builtin/workflows/skills/why/SKILL.md +267 -0
- package/dist/builtin/workflows/skills/why/references/epistemics.md +144 -0
- package/dist/builtin/workflows/skills/why/references/investigator-prompt.md +103 -0
- package/dist/builtin/workflows/skills/why/references/source-playbook.md +17 -0
- package/dist/builtin/workflows/skills/why/references/sources/code-archaeology.md +88 -0
- package/dist/builtin/workflows/skills/why/references/sources/databricks.md +70 -0
- package/dist/builtin/workflows/skills/why/references/sources/datadog.md +99 -0
- package/dist/builtin/workflows/skills/why/references/sources/incident-postmortem.md +15 -0
- package/dist/builtin/workflows/skills/why/references/sources/linear.md +48 -0
- package/dist/builtin/workflows/skills/why/references/sources/notion.md +55 -0
- package/dist/builtin/workflows/skills/why/references/sources/sentry.md +100 -0
- package/dist/builtin/workflows/skills/why/references/sources/slack.md +54 -0
- package/dist/builtin/workflows/skills/why/references/synthesizer-prompt.md +135 -0
- package/dist/builtin/workflows/src/durable/dbos-embedded-postgres-root.ts +548 -39
- package/dist/builtin/workflows/src/durable/dbos-embedded-postgres.ts +529 -65
- package/dist/builtin/workflows/src/durable/dbos-lifecycle.ts +30 -8
- package/dist/builtin/workflows/src/durable/dbos-local-postgres.ts +36 -3
- package/dist/builtin/workflows/src/durable/local-command.ts +68 -10
- package/dist/builtin/workflows/src/extension/companions.ts +1 -1
- package/dist/builtin/workflows/src/extension/dispatcher.ts +7 -1
- package/dist/builtin/workflows/src/extension/extension-factory.ts +2 -2
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +1094 -298
- package/dist/builtin/workflows/src/extension/public-types.ts +2 -2
- package/dist/builtin/workflows/src/extension/render-result.ts +16 -2
- package/dist/builtin/workflows/src/extension/runtime.ts +8 -1
- package/dist/builtin/workflows/src/extension/workflow-request-abort.ts +15 -0
- package/dist/builtin/workflows/src/extension/workflow-tool-content.ts +4 -3
- package/dist/builtin/workflows/src/extension/workflow-tool-registration.ts +107 -13
- package/dist/builtin/workflows/src/extension/workflow-tool.ts +22 -12
- package/dist/builtin/workflows/src/tui/widget.ts +25 -6
- package/dist/core/agent-session-auto-compaction.js +10 -10
- package/dist/core/agent-session-auto-compaction.js.map +1 -1
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +11 -13
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +1 -1
- package/dist/core/agent-session-methods.d.ts.map +1 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-models.d.ts.map +1 -1
- package/dist/core/agent-session-models.js +5 -7
- package/dist/core/agent-session-models.js.map +1 -1
- package/dist/core/agent-session-prompt.js +4 -4
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-retry.d.ts +4 -4
- package/dist/core/agent-session-retry.d.ts.map +1 -1
- package/dist/core/agent-session-retry.js +8 -34
- package/dist/core/agent-session-retry.js.map +1 -1
- package/dist/core/agent-session-tool-hooks.js +4 -4
- package/dist/core/agent-session-tool-hooks.js.map +1 -1
- package/dist/core/atomic-guide-command.d.ts.map +1 -1
- package/dist/core/atomic-guide-command.js +3 -10
- package/dist/core/atomic-guide-command.js.map +1 -1
- package/dist/core/event-bus.d.ts.map +1 -1
- package/dist/core/event-bus.js +19 -3
- package/dist/core/event-bus.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +0 -3
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +0 -12
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/modes/interactive-engine/remote-command-catalog.d.ts +1 -1
- package/dist/modes/interactive-engine/remote-command-catalog.js +1 -1
- package/dist/modes/interactive-engine/remote-command-catalog.js.map +1 -1
- package/docs/intercom.md +29 -27
- package/docs/settings.md +2 -2
- package/docs/subagents.md +18 -15
- package/docs/usage.md +0 -9
- package/docs/workflows.md +27 -10
- package/npm-shrinkwrap.json +32 -32
- package/package.json +3 -3
- package/dist/builtin/subagents/prompts/gather-context-and-clarify.md +0 -27
- package/dist/builtin/subagents/prompts/parallel-cleanup.md +0 -61
- package/dist/builtin/subagents/prompts/parallel-context-build.md +0 -43
- package/dist/builtin/subagents/prompts/parallel-handoff-plan.md +0 -47
- package/dist/builtin/subagents/prompts/parallel-research.md +0 -34
- package/dist/builtin/subagents/prompts/parallel-review.md +0 -47
- package/dist/builtin/subagents/prompts/review-loop.md +0 -39
- package/dist/builtin/subagents/src/extension/doctor.ts +0 -188
- package/dist/builtin/subagents/src/runs/inprocess/attempt-handles.ts +0 -104
- /package/dist/builtin/subagents/src/runs/foreground/{subagent-executor-resume.ts → subagent-executor-cwd.ts} +0 -0
|
@@ -127,12 +127,13 @@ There is no generic `reviewer` or `planner` agent; pick the specialist whose ang
|
|
|
127
127
|
|
|
128
128
|
Builtin agents inherit your current Pi default model by default. This keeps new installs from depending on a provider you may not have configured. If you want a role to use a specific model, set an override instead of copying the bundled agent file.
|
|
129
129
|
|
|
130
|
-
For one run,
|
|
130
|
+
For one run, pass `model` on the `subagent` call:
|
|
131
131
|
|
|
132
|
-
```
|
|
133
|
-
|
|
132
|
+
```typescript
|
|
133
|
+
subagent({ agent: "codebase-analyzer", task: "Review this diff", model: "anthropic/claude-sonnet-4:high" })
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
+
|
|
136
137
|
For a persistent override, edit settings. This example pins the codebase-analyzer everywhere, adds a backup model for provider failures, and keeps the other builtins on your normal default model:
|
|
137
138
|
|
|
138
139
|
```json
|
|
@@ -161,7 +162,7 @@ Workflow invocations receive a stable, non-`default` Intercom group automaticall
|
|
|
161
162
|
|
|
162
163
|
## Where running subagents show up
|
|
163
164
|
|
|
164
|
-
Foreground runs stream progress in the conversation while they run. Parallel calls keep their grouped task shape in progress and results, and status/control actions can inspect or interrupt
|
|
165
|
+
Foreground runs stream progress in the conversation while they run. Parallel calls keep their grouped task shape in progress and results, and status/control actions can inspect or interrupt live foreground children.
|
|
165
166
|
|
|
166
167
|
You can ask naturally:
|
|
167
168
|
|
|
@@ -169,18 +170,6 @@ You can ask naturally:
|
|
|
169
170
|
Show me the current subagent status.
|
|
170
171
|
```
|
|
171
172
|
|
|
172
|
-
If something feels misconfigured, run:
|
|
173
|
-
|
|
174
|
-
```text
|
|
175
|
-
/subagents-doctor
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
or ask:
|
|
179
|
-
|
|
180
|
-
```text
|
|
181
|
-
Check whether subagents and intercom are set up correctly.
|
|
182
|
-
```
|
|
183
|
-
|
|
184
173
|
## Recommended orchestration pattern (scaffolding)
|
|
185
174
|
|
|
186
175
|
Use orchestration as parent-agent guidance, not as a runtime workflow mode. For implementation work, the recommended loop is:
|
|
@@ -189,27 +178,13 @@ Use orchestration as parent-agent guidance, not as a runtime workflow mode. For
|
|
|
189
178
|
clarify → gather context → worker → fresh reviewers → worker
|
|
190
179
|
```
|
|
191
180
|
|
|
192
|
-
Use the optional prompt shortcuts below when you want the pattern to be repeatable.
|
|
193
181
|
|
|
194
|
-
Packaged `worker` defaults to forked context when a launch omits `context`; every other builtin runs fresh. Pass `context: "fresh"` when you intentionally want a fresh `worker` run.
|
|
195
|
-
|
|
196
|
-
Child-safety boundaries are enforced at runtime by typed admission policy. In-process child sessions load bundled extensions through normal discovery. The `subagent` tool may therefore be registered when the child's active tool selection permits it, including the default no-allowlist case; an explicit allowlist may omit it. Tool presence does not grant fanout: fanout is authorized only when the resolved builtin `tools` list includes `subagent`. Typed admission policy lets a non-fanout child use only `list`, `get`, `status`, and `doctor`; delegation, `resume`, and `interrupt` receive the fanout refusal. A management-restricted child is also refused `create`, `update`, and `delete`. The bundled `pi-subagents` skill remains parent-only and is stripped from child prompts, including fanout-authorized children. No admitted child may delegate: launches, `resume`, and `interrupt` are refused for every child regardless of its fanout authorization. Children receive boundary instructions that they are not the parent orchestrator and must complete their assigned task directly. Forked child context filtering also removes parent-only subagent artifacts (including old hidden orchestration-instruction messages, slash/status/control messages, and prior parent `subagent` tool-call/tool-result history) while preserving ordinary prose and unrelated tool calls/results.
|
|
197
182
|
|
|
198
|
-
|
|
183
|
+
Packaged `worker` defaults to forked context when a launch omits `context`; every other builtin runs fresh. Pass `context: "fresh"` when you intentionally want a fresh `worker` run.
|
|
199
184
|
|
|
200
|
-
The
|
|
185
|
+
Child-safety boundaries are enforced at runtime by typed admission policy. In-process child sessions load bundled extensions through normal discovery. The `subagent` tool may therefore be registered when the child's active tool selection permits it, including the default no-allowlist case; an explicit allowlist may omit it. Tool presence does not grant fanout: fanout is authorized only when the resolved builtin `tools` list includes `subagent`. Typed admission policy lets a non-fanout child use only `list`, `get`, and `status`; delegation and `interrupt` receive the fanout refusal. A management-restricted child is also refused `create`, `update`, and `delete`. The bundled `pi-subagents` skill remains parent-only and is stripped from child prompts, including fanout-authorized children. No admitted child may delegate or control another child: launches and `interrupt` are refused for every child regardless of its fanout authorization. Children receive boundary instructions that they are not the parent orchestrator and must complete their assigned task directly. Forked child context filtering also removes parent-only subagent artifacts (including old hidden orchestration-instruction messages, slash/status/control messages, and prior parent `subagent` tool-call/tool-result history) while preserving ordinary prose and unrelated tool calls/results.
|
|
201
186
|
|
|
202
|
-
| Prompt | Use it for |
|
|
203
|
-
|--------|------------|
|
|
204
|
-
| `/parallel-review` | Launch fresh-context reviewers with distinct angles, then synthesize what to fix. |
|
|
205
|
-
| `/review-loop` | Run parent-controlled write, review, and fix cycles until clean or capped. `debugger` writes fixes for bugs, `code-simplifier` for cleanup. |
|
|
206
|
-
| `/parallel-research` | Combine `codebase-online-researcher` with local code specialists for external evidence, local context, and practical tradeoffs. |
|
|
207
|
-
| `/parallel-context-build` | Run local code and research specialists in parallel to produce handoff context and meta-prompts. |
|
|
208
|
-
| `/parallel-handoff-plan` | Combine external research with local context passes into an implementation handoff plan and meta-prompt. |
|
|
209
|
-
| `/gather-context-and-clarify` | Locate and analyze first, then ask the user the clarification questions that matter. |
|
|
210
|
-
| `/parallel-cleanup` | Run review-only cleanup passes after implementation. |
|
|
211
187
|
|
|
212
|
-
Add `autofix` to `/parallel-review` or `/parallel-cleanup` to apply only the synthesized fixes worth doing now after reviewers return.
|
|
213
188
|
|
|
214
189
|
## Optional intercom companion
|
|
215
190
|
|
|
@@ -233,87 +208,28 @@ Ask codebase-analyzer to review this plan. If it sees a decision I need to make,
|
|
|
233
208
|
|
|
234
209
|
The child can use one dedicated coordination tool:
|
|
235
210
|
|
|
236
|
-
- `contact_supervisor`: the child contacts the parent/supervisor session that delegated the task. Use `reason: "need_decision"` for blocking
|
|
237
|
-
|
|
238
|
-
Child-side routine completion handoffs are still not expected. With the intercom bridge active, parent-side Atomic sends grouped completion results through `pi-intercom`: one grouped message per foreground parent `subagent` run and one per detached child completion. Intercom-confirmed delivery returns a compact receipt with artifact/session paths; without that confirmation, the normal full output is preserved. Grouped messages include child intercom targets and full child summaries.
|
|
239
|
-
When the companion is enabled and available, the bridge gives eligible children deterministic Intercom identities and coordination tools without connecting them automatically. Parent and child connections remain tool-driven: if a child may need live coordination, the parent model should invoke `intercom({ action: "status" })` before launch, and the child connects when it invokes `contact_supervisor` or `intercom`. Foreground launches and management-only actions do not force Intercom loading or broker startup.
|
|
240
|
-
|
|
241
|
-
For foreground runs, Intercom uses a targeted probe/reservation before delivery: only the exact live child can claim its message. Atomic then commits detach for that child and waits for its acknowledgement before placing claimed asks, sends, decisions, interviews, and progress updates in the parent's model-visible steering queue, so cancellation between phases cannot surface an orphaned request. Blocking calls remain alive for an exact threaded reply and then resume; fire-and-forget calls create no waiter. The retained child later replaces its detached status and artifacts with the real result. Cancellation/replacement invalidates stale handshakes, duplicate delivery cannot recommit, and unmatched messages retain queued-until-idle behavior.
|
|
242
|
-
|
|
243
|
-
If a child appears stalled, needs-attention notices can show up in the parent session with useful next actions, such as checking `subagent({ action: "status" })`, interrupting the run, or nudging the child.
|
|
244
|
-
|
|
245
|
-
If messages do not show up, run:
|
|
246
|
-
|
|
247
|
-
```text
|
|
248
|
-
/subagents-doctor
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
For normal use, you do not need to configure anything. Advanced users can tune the bridge with `intercomBridge` in the configuration section below.
|
|
252
|
-
|
|
253
|
-
At this point, you know enough to use the plugin. The rest of this README is reference material for exact command syntax, custom agents, worktrees, and configuration.
|
|
254
|
-
|
|
255
|
-
## Direct commands
|
|
256
|
-
|
|
257
|
-
Skip this section until you want exact syntax.
|
|
211
|
+
- `contact_supervisor`: the child contacts the parent/supervisor session that delegated the task. Use `reason: "need_decision"` for a blocking decision, `reason: "interview_request"` for structured questions, and `reason: "progress_update"` for a short non-blocking update when a discovery changes the plan. Do not ask for clarification when the only conflict is review-only/no-edit versus progress-writing or artifact-writing instructions; no-edit wins.
|
|
258
212
|
|
|
259
|
-
|
|
260
|
-
|---------|-------------|
|
|
261
|
-
| `/run <agent> [task]` | Run one agent; omit the task for self-contained agents |
|
|
262
|
-
| `/parallel agent1 "task1" -> agent2 "task2"` | Run agents in parallel |
|
|
263
|
-
| `/subagents-doctor` | Show read-only setup diagnostics |
|
|
213
|
+
Child-side routine completion handoffs are still not expected. With the Intercom bridge active, a blocking decision or interview from the exact foreground child ends at the source before broker send or reply-waiter admission. The parent `subagent` call returns the verbatim question, ordered attachments with duplicates preserved, agent identity, terminal run ID, and a dynamic `[TASK_CONTEXT]` handoff. `intercom.ask` does the same only when its resolved target is the launching parent. The parent answers by launching a fresh child with a new run identity and the supervisor answer in its task.
|
|
264
214
|
|
|
265
|
-
|
|
215
|
+
For parallel runs, the claim interrupts every active sibling and prevents queued work from starting or requesting authorization. The sibling set, sessions, and worktrees are not retained for continuation. Any follow-up starts fresh SINGLE or PARALLEL children explicitly. `intercom.send`, progress updates, and asks to siblings or other peers retain the exact-child probe/commit detach and ordinary Intercom delivery paths.
|
|
266
216
|
|
|
267
|
-
|
|
217
|
+
With the Intercom bridge active, the parent may load and connect its Intercom runtime before initial child execution to issue the exact child's broker capability. The child connection remains tool-driven. A claimed `contact_supervisor` decision or interview still yields before child send or reply-waiter admission; `intercom.ask` connects the child to resolve both targets.
|
|
268
218
|
|
|
269
|
-
|
|
219
|
+
Parent-side Atomic still sends grouped completion results through Intercom: one grouped message per foreground parent `subagent` run and one per detached child completion. Intercom-confirmed delivery returns a compact receipt with artifact/session paths; without that confirmation, the normal full output is preserved. Grouped messages include child Intercom targets and full child summaries.
|
|
270
220
|
|
|
271
|
-
|
|
272
|
-
/parallel codebase-pattern-finder "find security issues" -> codebase-analyzer "check code style"
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
Both double and single quotes work. You can also use `--` as a delimiter:
|
|
276
|
-
|
|
277
|
-
```text
|
|
278
|
-
/parallel codebase-locator codebase-analyzer -- check for security issues
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
Tasks without a prompt use the first available task as a fallback.
|
|
282
|
-
|
|
283
|
-
### Inline per-step config
|
|
284
|
-
|
|
285
|
-
Append `[key=value,...]` to an agent name to override defaults for that step:
|
|
286
|
-
|
|
287
|
-
```text
|
|
288
|
-
/run codebase-locator[model=anthropic/claude-sonnet-4] summarize this codebase
|
|
289
|
-
/parallel codebase-analyzer[skills=code-review+security] "review backend" -> codebase-analyzer[model=openai/gpt-5-mini] "review frontend"
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
| Key | Example | Description |
|
|
293
|
-
|-----|---------|-------------|
|
|
294
|
-
| `output` | `output=context.md` | Write results to a file. For `/parallel`, relative paths resolve against the child working directory; for `/run`, relative paths resolve against cwd. |
|
|
295
|
-
| `outputMode` | `outputMode=file-only` | Return only a concise file reference for saved output instead of the full saved content. Requires `output`; default is `inline`. |
|
|
296
|
-
| `reads` | `reads=a.md+b.md` | Read files before executing. `+` separates multiple paths. `/run` forwards these through the same resolver as tool-based foreground launches, so relative paths use the effective child working directory. |
|
|
297
|
-
| `model` | `model=anthropic/claude-sonnet-4` | Override model for this step. |
|
|
298
|
-
| `skills` | `skills=planning+review` | Override injected skills. `+` separates multiple skills. |
|
|
299
|
-
| `progress` | `progress` | Enable progress tracking. |
|
|
300
|
-
|
|
301
|
-
Set `output=false`, `reads=false`, or `skills=false` to disable that behavior explicitly. Do not use `output=false` for file-only returns; use `outputMode=file-only` with an `output` path.
|
|
302
|
-
|
|
303
|
-
### Forked runs
|
|
221
|
+
If a child appears stalled, needs-attention notices can show up in the parent session with useful next actions, such as checking `subagent({ action: "status" })`, interrupting the run, or nudging the child.
|
|
304
222
|
|
|
305
|
-
|
|
223
|
+
If messages do not show up, check the bridge from the intercom side with `intercom({ action: "status" })`.
|
|
306
224
|
|
|
307
|
-
|
|
308
|
-
/run codebase-analyzer "review this diff" --fork
|
|
309
|
-
/parallel codebase-locator "audit frontend" -> codebase-analyzer "audit backend" --fork
|
|
310
|
-
```
|
|
225
|
+
For normal use, you do not need to configure anything. Advanced users can tune the bridge with `intercomBridge` in the configuration section below.
|
|
311
226
|
|
|
312
|
-
|
|
227
|
+
At this point, you know enough to use the plugin. The rest of this README is reference material for custom agents, worktrees, and configuration.
|
|
313
228
|
|
|
314
229
|
## Non-interactive execution
|
|
315
230
|
|
|
316
|
-
Every supported subagent launch starts immediately without opening a preview/editor prompt or waiting for terminal input. This applies to single, parallel, forked, fanout, prompt-template
|
|
231
|
+
Every supported subagent launch starts immediately without opening a preview/editor prompt or waiting for terminal input. This applies to single, parallel, forked, fanout, and prompt-template execution. Gather any needed context and ask the user questions in the parent conversation before launching.
|
|
232
|
+
|
|
317
233
|
|
|
318
234
|
## Agents
|
|
319
235
|
|
|
@@ -405,7 +321,7 @@ interactive: true
|
|
|
405
321
|
Your system prompt goes here.
|
|
406
322
|
```
|
|
407
323
|
|
|
408
|
-
Frontmatter is parsed with a real YAML parser, so it must be valid YAML: a file whose frontmatter does not parse (for example a colon-space inside an unquoted scalar like `description: Deploy: fast`, duplicate keys, or tab-indented block lists) is skipped during discovery.
|
|
324
|
+
Frontmatter is parsed with a real YAML parser, so it must be valid YAML: a file whose frontmatter does not parse (for example a colon-space inside an unquoted scalar like `description: Deploy: fast`, duplicate keys, or tab-indented block lists) is skipped during discovery. Discovery records the parser's message for every skipped file, so a bad file never disappears silently.
|
|
409
325
|
|
|
410
326
|
Important fields:
|
|
411
327
|
|
|
@@ -496,11 +412,11 @@ The package bundles a `subagent` skill that is automatically available to the pa
|
|
|
496
412
|
|
|
497
413
|
What the bundled skill covers:
|
|
498
414
|
- **Delegation patterns**: when to launch which agent, whether to use single or parallel mode, and whether to use fresh or forked context
|
|
499
|
-
- **Prompt workflow recipes**: how to apply the packaged techniques directly with `subagent(...)` when the user describes the workflow in natural language instead of invoking a slash command. This includes parallel
|
|
415
|
+
- **Prompt workflow recipes**: how to apply the packaged techniques directly with `subagent(...)` when the user describes the workflow in natural language instead of invoking a slash command. This includes parallel research, parallel context-build, and parallel cleanup
|
|
500
416
|
- **Role-agent prompting guidance**: compact contract prompts instead of long scripts, what to include in role-specific meta prompts, and retrieval budgets for researchers
|
|
501
417
|
- **Safety boundaries**: child agents must not run subagents, must not invent intercom targets, and must escalate unapproved decisions
|
|
502
418
|
- **Intercom conventions**: when to ask vs send, and how parent-side result delivery works with `pi-intercom`
|
|
503
|
-
- **Control
|
|
419
|
+
- **Control signals**: attention signals, soft interrupts, and status
|
|
504
420
|
|
|
505
421
|
If you are writing an agent that orchestrates subagents, the bundled skill helps it behave correctly without guessing the patterns. If you are a human user, you do not need to read it directly; the README and prompt shortcuts encode the same workflows in user-facing form.
|
|
506
422
|
|
|
@@ -537,6 +453,16 @@ These are the parameters the LLM passes when it calls the `subagent` tool. Most
|
|
|
537
453
|
], worktree: true }
|
|
538
454
|
```
|
|
539
455
|
|
|
456
|
+
### Sibling execution calls
|
|
457
|
+
|
|
458
|
+
If one assistant response emits several sibling execution-mode `subagent` calls, Atomic collects the synchronous burst before any child starts and runs it through one indexed parallel set. Each original tool call receives only its own children in source order, and its live result, progress, control, and artifact updates are projected to that same route without sibling data. The TUI redraws the shared run as one aggregate parallel widget rather than retaining one widget per original call. A solitary call keeps its original mode, sequential awaited calls stay independent, and management actions bypass collection. A call that arrives after a child has started still gets the existing in-progress rejection. Prefer one explicit `{ tasks: [...] }` call when you intend parallel work; burst collection handles model-emitted sibling calls.
|
|
459
|
+
|
|
460
|
+
In a collected burst, a call's top-level `agent` task comes first, followed by its `tasks` array. Duplicates and array order are preserved, and `count` expands in place. The task cap applies after all calls are flattened and counts are expanded, with the same hard maximum of 50. Each call-level `cwd` selects that call's agent-discovery scope and child base directory. A task-level `cwd` stays relative to that base and affects child execution, not agent discovery. This per-origin rule applies only to collected sibling calls; an ordinary explicit `{ tasks: [...] }` call keeps one discovery scope from its top-level `cwd`. Per-call and per-task `group` values also remain attached to their children, and a task-level group wins.
|
|
461
|
+
|
|
462
|
+
For a collected `worktree: true` burst, every call-level `cwd` must resolve to the same path. That common path becomes the shared worktree root; differing origins reject the burst before launch, and any task-level `cwd` must still resolve to that root. Each projected caller result keeps shared worktree diff text and terminal control guidance while its child results and standard child-output sections remain route-local.
|
|
463
|
+
|
|
464
|
+
One parallel run also needs one value for each run-wide option. Sibling calls must agree on `concurrency`, `worktree`, `context`, `share`, `control`, `sessionDir`, `maxOutput`, `artifacts`, `includeProgress`, and `agentScope`. If any value differs, Atomic rejects the full burst before launch and names the field instead of mixing settings.
|
|
465
|
+
|
|
540
466
|
### Management actions
|
|
541
467
|
|
|
542
468
|
Agent definitions are not loaded into context by default. Management actions let the LLM discover, inspect, create, update, and delete agents at runtime.
|
|
@@ -580,7 +506,7 @@ Agent definitions are not loaded into context by default. Management actions let
|
|
|
580
506
|
|-------|------|---------|-------------|
|
|
581
507
|
| `agent` | string | - | Agent name for single mode, or target for management actions. |
|
|
582
508
|
| `task` | string | - | Task string for single mode. |
|
|
583
|
-
| `action` | string | - | `list`, `get`, `create`, `update`, `delete`, `status`,
|
|
509
|
+
| `action` | string | - | `list`, `get`, `create`, `update`, `delete`, `status`, or `interrupt`. |
|
|
584
510
|
| `config` | object/string | - | Agent config for create/update. |
|
|
585
511
|
| `output` | `string \| false` | agent default | Override single-agent output file. |
|
|
586
512
|
| `outputMode` | `"inline" \| "file-only"` | `inline` | Return saved output inline or as a concise saved-file reference. `file-only` requires an `output` path. |
|
|
@@ -611,12 +537,9 @@ Status and control actions:
|
|
|
611
537
|
subagent({ action: "status" })
|
|
612
538
|
subagent({ action: "status", id: "<run-id>" })
|
|
613
539
|
subagent({ action: "interrupt", id: "<run-id>" })
|
|
614
|
-
subagent({ action: "resume", id: "<run-id>", message: "follow-up question" })
|
|
615
|
-
subagent({ action: "resume", id: "<run-id>", index: 1, message: "follow-up for child 2" })
|
|
616
|
-
subagent({ action: "doctor" })
|
|
617
540
|
```
|
|
618
541
|
|
|
619
|
-
|
|
542
|
+
Completed, interrupted, and parent-question children are terminal for continuation. A prior run ID cannot revive a child or parallel sibling set. Start a fresh subagent call with an explicit context handoff for follow-up work.
|
|
620
543
|
|
|
621
544
|
## Worktree isolation
|
|
622
545
|
|
|
@@ -640,7 +563,7 @@ Requirements:
|
|
|
640
563
|
- the main repository's Husky or populated `.git/hooks` directory is shared through `core.hooksPath`
|
|
641
564
|
- gitignored files matched by `.worktreeinclude` are copied into the worktree
|
|
642
565
|
|
|
643
|
-
After a worktree parallel step
|
|
566
|
+
After a worktree parallel step reaches any terminal result, per-agent diff stats are appended to the output and full patch files are written to artifacts. A parent-directed ask terminally ends the active set, captures its staged and unstaged changes in the same handoff result, and then cleans up every worktree and `worktree-*` branch after a brief Git lock-release wait. The same cleanup runs after post-creation setup failures.
|
|
644
567
|
|
|
645
568
|
## Configuration
|
|
646
569
|
|
|
@@ -772,7 +695,7 @@ This is disabled by default. Session data may contain source code, paths, enviro
|
|
|
772
695
|
|
|
773
696
|
## Delegation boundary
|
|
774
697
|
|
|
775
|
-
Delegation is exactly one level deep, and nothing configures it. A top-level session — main chat or a workflow stage — may call `subagent`. A session that was itself admitted as a subagent child may not: every launch
|
|
698
|
+
Delegation is exactly one level deep, and nothing configures it. A top-level session — main chat or a workflow stage — may call `subagent`. A session that was itself admitted as a subagent child may not: every launch and `interrupt` it attempts is refused with guidance to complete its assigned task directly. The observing actions `list`, `get`, and `status` stay available to a child.
|
|
776
699
|
|
|
777
700
|
There is no configuration option, agent frontmatter field, or tool parameter for the delegation level. The rule is enforced twice: the subagent executor refuses a child before any run starts, and the Rust `SubagentControl` admission door refuses a child deeper than the single permitted level. Admitted depth is typed admission state and is not inherited through an environment variable.
|
|
778
701
|
|
|
@@ -829,13 +752,13 @@ The main runtime files are:
|
|
|
829
752
|
|------|---------|
|
|
830
753
|
| `src/extension/index.ts` | Extension registration, tool registration, message/render wiring. |
|
|
831
754
|
| `src/agents/agents.ts` | Agent discovery and frontmatter parsing. |
|
|
832
|
-
| `src/runs/foreground/subagent-executor.ts` | Main execution routing for single, parallel, management, status,
|
|
755
|
+
| `src/runs/foreground/subagent-executor.ts` | Main execution routing for single, parallel, management, status, and interrupt actions. |
|
|
833
756
|
| `src/runs/foreground/execution.ts` | Core foreground `runSync` handling. |
|
|
834
757
|
| `src/runs/foreground/notify.ts` | Completion-notification delivery for a detached Intercom child. |
|
|
835
758
|
| `src/runs/foreground/completion-notification.ts` | Local completion acknowledgement and ordering barrier for detached children. |
|
|
836
759
|
| `src/shared/settings.ts` | Shared task behavior, instructions, and config helpers. |
|
|
837
760
|
| `src/runs/shared/worktree.ts` | Git worktree isolation. |
|
|
838
|
-
| `src/intercom/intercom-bridge.ts` | Runtime intercom bridge instructions
|
|
761
|
+
| `src/intercom/intercom-bridge.ts` | Runtime intercom bridge instructions. |
|
|
839
762
|
| `src/extension/schemas.ts` / `src/shared/types.ts` | Tool schemas, shared types, and event constants. |
|
|
840
763
|
| `test/unit/` / `test/integration/` | Unit and loader-based integration tests. |
|
|
841
764
|
|
|
@@ -20,9 +20,9 @@ Treat an approved handoff or execution plan as the contract. Inspect inherited c
|
|
|
20
20
|
|
|
21
21
|
## Decision and escalation contract
|
|
22
22
|
|
|
23
|
-
Do not silently make a new product, architecture, or scope decision. When implementation reveals an unapproved decision required to continue safely,
|
|
23
|
+
Do not silently make a new product, architecture, or scope decision. When implementation reveals an unapproved decision required to continue safely, use the live coordination route supplied at runtime. Use `contact_supervisor` with `reason: "need_decision"`; a claimed request ends this child and gives the supervisor a fresh-subagent handoff, so do not wait for a reply in this run. Use `reason: "progress_update"` only for a concise, non-blocking update when helpful or explicitly requested. Fall back to `intercom` only when `contact_supervisor` is unavailable.
|
|
24
24
|
|
|
25
|
-
Do not end with a question requiring the supervisor to choose before work can continue. Do not send routine completion handoffs; return the normal task result when coordination is unnecessary. If you sent a
|
|
25
|
+
Do not end with a question requiring the supervisor to choose before work can continue. Do not send routine completion handoffs; return the normal task result when coordination is unnecessary. If you sent a progress update through `contact_supervisor`, keep it short and still provide the full structured result.
|
|
26
26
|
|
|
27
27
|
## Work and validation
|
|
28
28
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/subagents",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.16-alpha.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension for delegating tasks to subagents with parallel execution. Fork of: https://github.com/nicobailon/pi-subagents",
|
|
6
6
|
"contributors": [
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"src/**/*.ts",
|
|
22
22
|
"agents/",
|
|
23
23
|
"skills/**/*",
|
|
24
|
-
"prompts/**/*",
|
|
25
24
|
"README.md",
|
|
26
25
|
"CHANGELOG.md"
|
|
27
26
|
],
|
|
@@ -31,9 +30,6 @@
|
|
|
31
30
|
],
|
|
32
31
|
"skills": [
|
|
33
32
|
"./skills"
|
|
34
|
-
],
|
|
35
|
-
"prompts": [
|
|
36
|
-
"./prompts"
|
|
37
33
|
]
|
|
38
34
|
},
|
|
39
35
|
"peerDependencies": {
|
|
@@ -25,38 +25,16 @@ Use this skill when bounded specialist delegation adds value and the parent shou
|
|
|
25
25
|
- **Subagent control**: watch needs-attention signals and soft-interrupt only when a delegated run is genuinely blocked.
|
|
26
26
|
- **Agent authoring**: create, update, or override agents for a project.
|
|
27
27
|
|
|
28
|
-
## Tool
|
|
28
|
+
## Tool
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
Humans often use the slash-command layer instead:
|
|
30
|
+
Use the `subagent(...)` tool for execution, management, status, and control. There is no bundled slash-command launcher.
|
|
32
31
|
|
|
33
|
-
-
|
|
34
|
-
- `/parallel` — launch top-level parallel tasks
|
|
35
|
-
- `/subagents-doctor` — diagnose setup, execution paths, current session, and intercom bridge state
|
|
32
|
+
When the user asks for research, context-build, or cleanup shapes, apply the same pattern directly with `subagent(...)`.
|
|
36
33
|
|
|
37
|
-
|
|
34
|
+
## Applying Prompt Techniques
|
|
38
35
|
|
|
39
|
-
|
|
36
|
+
If the user provides a URL, issue, PR, plan, local file, screenshot, or freeform target, treat that target as the primary scope: read or fetch it before launching children, then include it explicitly in every child task. Do not depend on the parent conversation history when the recipe calls for fresh context.
|
|
40
37
|
|
|
41
|
-
- `/parallel-review` — fresh-context specialists (analyzer, debugger inspect-only, pattern-finder) with distinct review angles, then parent synthesis
|
|
42
|
-
- `/review-loop` — parent-orchestrated writer (`debugger` or `code-simplifier`) + specialist reviewer cycles until clean or capped
|
|
43
|
-
- `/parallel-research` — combine `codebase-online-researcher` with local locator/analyzer/pattern-finder/research-analyzer specialists
|
|
44
|
-
- `/parallel-context-build` — parallel codebase specialist passes that produce planning handoff context
|
|
45
|
-
- `/parallel-handoff-plan` — external-reference research plus local specialist passes, followed by a parent-side handoff plan and implementation-ready meta-prompt
|
|
46
|
-
- `/gather-context-and-clarify` — locate/analyze/research first, then ask the user clarifying questions with `interview`
|
|
47
|
-
- `/parallel-cleanup` — two read-only specialist scouts (deslop + verbosity) followed by an optional `code-simplifier` writer pass
|
|
48
|
-
|
|
49
|
-
## Applying Prompt Techniques Without Slash Commands
|
|
50
|
-
|
|
51
|
-
The prompt templates in `prompts/` encode workflows the parent agent can run on demand. If the user provides a URL, issue, PR, plan, local file, screenshot, or freeform target, treat that target as the primary scope: read or fetch it before launching children, then include it explicitly in every child task. Do not depend on the parent conversation history when the recipe calls for fresh context.
|
|
52
|
-
|
|
53
|
-
### Parallel review technique
|
|
54
|
-
|
|
55
|
-
Use this when the user wants adversarial review of a diff, plan, issue, file, or implemented work. There is no generic `reviewer` agent — assemble the review from read-only specialists with distinct angles. Common angles: correctness/regressions (`codebase-analyzer`), failure-mode hunt (`debugger` in inspect-only mode), pattern fit (`codebase-pattern-finder`), prior decisions (`codebase-research-locator` + `codebase-research-analyzer`), and external-spec conformance (`codebase-online-researcher`). Specialists inspect files and diffs directly from `git diff`/`git status` and return concise evidence-backed findings with file/line references. They must not edit files — even `debugger`, which can write, must be told to inspect and report only in this pass. The parent synthesizes fixes worth doing now, optional improvements, and feedback to ignore/defer before applying anything.
|
|
56
|
-
|
|
57
|
-
### Review-loop technique
|
|
58
|
-
|
|
59
|
-
Use this when the user wants implementation or current diff review to continue until reviewers stop finding fixes worth doing now. Keep the loop in the parent session: one writer (`debugger` for correctness-shaped work or `code-simplifier` for refinement-shaped work), fresh-context specialist reviewers inspect the actual repo and diff, the parent synthesizes accepted fixes, and one writer applies them. Run each bounded call in the foreground so the parent receives the result before the next step. Programmatic runs are non-interactive, so resolve only material unanswered questions before launching. Treat a writer handoff as an intermediate state, not final completion, unless the user explicitly asked for writer-only work, review-only output, or to stop after implementation. Stop when reviewers find no blockers or fixes worth doing now, remaining feedback is optional or deferred, an unapproved product/scope/architecture decision appears, or the max review-round cap is reached. Default to 3 review rounds unless I set another cap. Do not loop for optional polish, and do not let children launch subagents or decide the loop outcome.
|
|
60
38
|
|
|
61
39
|
### Parallel research technique
|
|
62
40
|
|
|
@@ -79,29 +57,6 @@ subagent({
|
|
|
79
57
|
})
|
|
80
58
|
```
|
|
81
59
|
|
|
82
|
-
### Parallel handoff-plan technique
|
|
83
|
-
|
|
84
|
-
Use this when the user needs a solution brief or implementation-ready handoff from an external reference plus local code context. Run one top-level parallel discovery call; the parent synthesizes the final handoff afterward. The discovery group usually includes `codebase-online-researcher` for external projects/docs/prompt guidance, `codebase-locator` and `codebase-analyzer` for local code, and optionally `codebase-pattern-finder` and `codebase-research-*` for transferable conventions and prior decisions. Use distinct output paths under `handoff/`, then write `handoff/final-handoff-plan.md` yourself with the recommended approach, likely files, constraints, non-goals, validation, risks, unresolved questions, and final compact implementation-ready meta-prompt.
|
|
85
|
-
|
|
86
|
-
Example shape:
|
|
87
|
-
|
|
88
|
-
```typescript
|
|
89
|
-
subagent({
|
|
90
|
-
tasks: [
|
|
91
|
-
{ agent: "codebase-online-researcher", task: "Research the external reference and transferable implementation ideas for: ...", output: "handoff/external-reference.md" },
|
|
92
|
-
{ agent: "codebase-locator", task: "Map local files that would change for: ...", output: "handoff/local-files.md" },
|
|
93
|
-
{ agent: "codebase-analyzer", task: "Trace current behavior of those files: ...", output: "handoff/local-flow.md" },
|
|
94
|
-
{ agent: "codebase-pattern-finder", task: "Find analogous local patterns for: ...", output: "handoff/local-patterns.md" }
|
|
95
|
-
],
|
|
96
|
-
context: "fresh"
|
|
97
|
-
})
|
|
98
|
-
// Parent then writes handoff/final-handoff-plan.md from the outputs.
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### Gather-context-and-clarify technique
|
|
102
|
-
|
|
103
|
-
Use this when unresolved requirements and genuinely missing repository context justify a discovery pass. Launch `codebase-locator` and `codebase-analyzer` for local context, `codebase-pattern-finder` when conventions matter, `codebase-research-locator` + `codebase-research-analyzer` when prior docs likely apply, and `codebase-online-researcher` only when external docs would materially improve understanding. Ask children for concise findings plus remaining clarification questions. Then synthesize what is known and use `interview` to ask the unresolved questions needed for shared understanding before planning or implementing.
|
|
104
|
-
|
|
105
60
|
### Parallel cleanup technique
|
|
106
61
|
|
|
107
62
|
Use this after implementation when the user wants cleanup review or when a final pass would reduce AI-slop. Launch two fresh-context `codebase-analyzer` scouts with `output: false` and `progress: false`: one deslop pass and one verbosity pass. If the `deslop` or `verbosity-cleaner` skills are available, pass the relevant skill to that scout; otherwise inline the criteria. Both scouts are read-only and should flag concrete issues with severity, file/line references, and smallest safe fixes. Phrase the constraint as “Do not modify project/source files; returning findings through the configured output artifact is allowed” when you use `output` or `outputMode: "file-only"`. The parent decides what to apply and asks before making changes unless cleanup was already authorized. When the user opts to autofix, the parent launches one foreground `code-simplifier` writer with the synthesized fixes as its explicit scope.
|
|
@@ -124,10 +79,11 @@ Builtin agents load at the lowest priority. Project agents override user agents,
|
|
|
124
79
|
|
|
125
80
|
Each builtin declares an explicit `model` and `fallbackModels` sequence (typically `github-copilot/<same>`, then `anthropic/claude-opus-4-8`, then `github-copilot/claude-opus-4.7`). The current user-selected model is automatically appended as the last fallback and de-duplicated. Override per run with inline config:
|
|
126
81
|
|
|
127
|
-
```
|
|
128
|
-
|
|
82
|
+
```typescript
|
|
83
|
+
subagent({ agent: "codebase-analyzer", task: "Trace the auth flow", model: "anthropic/claude-sonnet-4" })
|
|
129
84
|
```
|
|
130
85
|
|
|
86
|
+
|
|
131
87
|
For persistent tweaks, edit `subagents.agentOverrides` in user or project settings. User overrides apply everywhere. Project overrides apply only in that repo and win over user overrides.
|
|
132
88
|
|
|
133
89
|
The builtin `debugger` and `worker` agents declare both `intercom` and `contact_supervisor`, so they can send progress or ask the parent for a decision when the bridge is active. Other builtin specialists finish their pass and return without live coordination. Custom agents can coordinate when they declare `intercom` or when the runtime bridge injects `contact_supervisor`; see [Subagent + Intercom Coordination](#subagent--intercom-coordination).
|
|
@@ -251,36 +207,21 @@ Avoid duplicate output paths in parallel tasks. Concurrent children should not w
|
|
|
251
207
|
Concurrent writers conflict. `code-simplifier` and `debugger` change files. Do not run two writers in parallel against the same worktree unless you isolate them with `worktree: true`.
|
|
252
208
|
|
|
253
209
|
|
|
254
|
-
### Foreground execution and
|
|
210
|
+
### Foreground execution and fresh follow-ups
|
|
255
211
|
|
|
256
212
|
All subagent execution runs in the foreground and returns its result to the parent call. Parallel tasks may still run concurrently within one foreground invocation, and forked context still creates branched child sessions.
|
|
257
213
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
```typescript
|
|
261
|
-
subagent({ action: "resume", id: "run-id", message: "Follow up on this point." })
|
|
262
|
-
subagent({ action: "resume", id: "run-id", index: 1, message: "Continue reviewer 2." })
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
Resume behavior:
|
|
266
|
-
|
|
267
|
-
- If a child is still running and reachable, `resume` sends the follow-up through its intercom route when available.
|
|
268
|
-
- Completed foreground single and parallel runs can be revived by `index` while their run metadata remains in extension state.
|
|
269
|
-
- A revived child starts a new in-process attempt from its persisted session file.
|
|
270
|
-
- Multi-child runs require `index` unless only one child is selectable.
|
|
271
|
-
- If the chosen child has no persisted `.jsonl` session file, resume fails and reports that directly.
|
|
272
|
-
|
|
273
|
-
Use diagnostics when setup or child startup looks wrong:
|
|
214
|
+
Completed, interrupted, and parent-question children are terminal for continuation. Do not address a prior child or sibling set by run ID. Start follow-up work with the normal launch form and an explicit handoff:
|
|
274
215
|
|
|
275
216
|
```typescript
|
|
276
|
-
subagent({
|
|
217
|
+
subagent({ agent: "worker", task: "[TASK_CONTEXT] Continue with this supervisor answer: ..." })
|
|
277
218
|
```
|
|
278
219
|
|
|
279
|
-
|
|
220
|
+
A parent-ask handoff supplies the original question, ordered attachments, previous agent identity, and dynamic task context. The fresh launch receives a new run identity.
|
|
280
221
|
|
|
281
222
|
### Subagent control
|
|
282
223
|
|
|
283
|
-
Subagent control is the runtime visibility and intervention layer for delegated runs.
|
|
224
|
+
Subagent control is the runtime visibility and intervention layer for delegated runs. Lifecycle status distinguishes queued and running children from terminal completed, failed, or interrupted results. Activity reporting is factual: it tracks the last observed activity time and the current tool when known. It does not pretend to know that a child is truly stuck.
|
|
284
225
|
|
|
285
226
|
Default behavior is intentionally conservative. When no activity has been observed past the configured threshold, the run emits a `needs_attention` control event. Foreground runs push this as a `subagent:control-event` event, and notification-worthy control events are inserted into the visible transcript so both the user and the parent agent can see them, with a proactive hint plus concrete `nudge`, `status`, and `interrupt` options. Visible notifications fire once per child run and attention state.
|
|
286
227
|
|
|
@@ -296,7 +237,7 @@ Pass `id` when targeting a specific controllable run:
|
|
|
296
237
|
subagent({ action: "interrupt", id: "abc123" })
|
|
297
238
|
```
|
|
298
239
|
|
|
299
|
-
A soft interrupt cancels the current child turn and
|
|
240
|
+
A soft interrupt cancels the current child turn and terminally records the child as interrupted. It does not mean the delegated task succeeded. Decide the next explicit action: launch a fresh child with the relevant task context, replace the task, ask the user, or stop the workflow.
|
|
300
241
|
|
|
301
242
|
Per-run control thresholds can be overridden when a task legitimately runs without observable output for longer than usual:
|
|
302
243
|
|
|
@@ -315,9 +256,10 @@ If the run already has an active intercom bridge target, needs-attention notific
|
|
|
315
256
|
|
|
316
257
|
## Non-Interactive Execution
|
|
317
258
|
|
|
318
|
-
Every supported subagent launch starts immediately without a preview/editor prompt or terminal input. This applies to single, parallel, forked, fanout, prompt-template
|
|
259
|
+
Every supported subagent launch starts immediately without a preview/editor prompt or terminal input. This applies to single, parallel, forked, fanout, and prompt-template execution.
|
|
260
|
+
|
|
261
|
+
Resolve questions in the parent conversation before launching children. Use `interview` when the user must answer a question, then put the resolved scope and validation contract in the child task.
|
|
319
262
|
|
|
320
|
-
Resolve questions in the parent conversation before launching children. Use `interview` when the user must answer a question, then put the resolved scope and validation contract in the child task. Human slash commands retain their separate parsing and event-bridge path.
|
|
321
263
|
|
|
322
264
|
## Worktree Isolation
|
|
323
265
|
|
|
@@ -339,7 +281,7 @@ subagent({
|
|
|
339
281
|
|
|
340
282
|
Atomic subagents work without intercom. When Atomic's bundled intercom companion or upstream `pi-intercom` is installed and enabled, the bridge can give eligible child agents a private coordination tool back to the parent session without connecting either session automatically. If a child may need live coordination, invoke `intercom({ action: "status" })` in the parent before launching it; the child connects when it first invokes `contact_supervisor` or `intercom`.
|
|
341
283
|
|
|
342
|
-
The builtin `debugger` and `worker` agents declare `intercom` and `contact_supervisor`. With an active bridge route, they can send progress or
|
|
284
|
+
The builtin `debugger` and `worker` agents declare `intercom` and `contact_supervisor`. With an active bridge route, they can send progress or terminally hand a parent-directed question back to the supervisor. Other builtin specialists finish their pass and return without live coordination; use a custom agent with bridge tools when another role needs that ability.
|
|
343
285
|
|
|
344
286
|
Custom agents that do have the bridge tool can ask the parent for a decision:
|
|
345
287
|
|
|
@@ -369,7 +311,7 @@ Message conventions:
|
|
|
369
311
|
|
|
370
312
|
Most agents should not call generic `intercom` directly unless bridge instructions provide a target and `contact_supervisor` is unavailable. Do not invent a target.
|
|
371
313
|
|
|
372
|
-
If intercom messages do not show up,
|
|
314
|
+
If intercom messages do not show up, check the bridge from the intercom side with `intercom({ action: "status" })`.
|
|
373
315
|
|
|
374
316
|
## Management Mode
|
|
375
317
|
|
|
@@ -451,18 +393,15 @@ That is only a starting point. Omit `package` for the traditional unqualified ru
|
|
|
451
393
|
|
|
452
394
|
For many customizations, builtin overrides in settings are lower-friction than copying a full builtin file.
|
|
453
395
|
|
|
454
|
-
|
|
396
|
+
If a prompt-template extension is installed, additional user prompt templates can delegate into subagents.
|
|
455
397
|
|
|
456
|
-
The package includes prompt shortcuts for common workflows: `/parallel-review`, `/review-loop`, `/parallel-research`, `/parallel-context-build`, `/parallel-handoff-plan`, `/gather-context-and-clarify`, and `/parallel-cleanup`. Use them when the user wants repeatable review, review/fix loops, research, context handoff, implementation handoff, clarification, or cleanup-review patterns. `/parallel-review autofix` launches a `debugger` or `code-simplifier` writer (depending on feedback shape) to apply the synthesized fixes worth doing now. `/parallel-cleanup autofix` launches one `code-simplifier` writer to apply the synthesized cleanup fixes. Parent agents can also apply the same recipes directly with `subagent(...)` when the user describes the workflow in natural language instead of invoking a slash command.
|
|
457
|
-
|
|
458
|
-
If a prompt-template extension is installed, additional user prompt templates can delegate into subagents. This is useful when a slash command should always run through a particular agent or with forked context.
|
|
459
398
|
|
|
460
399
|
## Important Constraints
|
|
461
400
|
|
|
462
401
|
- **Forking requires a persisted parent session.** If the current session does not have a persisted session file, forked runs fail.
|
|
463
402
|
- **Forked runs inherit parent history.** They are branched threads, not fresh filtered contexts. Use fresh context for adversarial review unless the user explicitly asks for forked context.
|
|
464
|
-
- **Delegation is one level deep and not configurable.** A subagent cannot call `subagent`: every launch
|
|
465
|
-
- **Attention signals are not lifecycle state.** `needs_attention` means no activity has been observed past the configured threshold. `
|
|
403
|
+
- **Delegation is one level deep and not configurable.** A subagent cannot call `subagent`: every launch and `interrupt` from inside a child is refused. Only `list`, `get`, and `status` stay available to a child.
|
|
404
|
+
- **Attention signals are not lifecycle state.** `needs_attention` means no activity has been observed past the configured threshold. `interrupted` means the child turn ended before completion; it is terminal for continuation and is not the same as `failed`.
|
|
466
405
|
- **Builtin coordination varies by agent.** `debugger` and `worker` declare `intercom` and `contact_supervisor`; the other builtin specialists do not. For agents without bridge tools, decide the task up front or use a custom agent when mid-run coordination is required.
|
|
467
406
|
- **Intercom asks are blocking.** A session can only maintain one pending outbound ask wait state at a time.
|
|
468
407
|
- **Keep conversational authority clear.** Advisory specialists should not silently become second decision-makers.
|
|
@@ -522,19 +461,10 @@ await subagent({ agent: "debugger", task: "Reproduce the failure and patch the r
|
|
|
522
461
|
|
|
523
462
|
### Clarify → Discover → Implement → Review (self-orchestrated workflow)
|
|
524
463
|
|
|
525
|
-
When the user requests
|
|
526
|
-
|
|
527
|
-
Keep builtin agent defaults unless the user explicitly asks for a different model, thinking level, skills, output behavior, context mode, or other override. Do not add overrides just because you are orchestrating; the defaults encode the intended role behavior.
|
|
464
|
+
When the user requests a bounded orchestration shape, apply it through the `subagent` tool. Keep builtin agent defaults unless the user explicitly asks for a different model, thinking level, skills, output behavior, context mode, or other override.
|
|
528
465
|
|
|
529
466
|
When the user approves launching a subagent to carry out a workflow, treat that as approval to generate a proper role-specific meta prompt for that subagent. Include the approved plan path or summary, clarified requirements, non-goals, relevant context, role boundaries, files or areas to inspect, completion criteria, expected output, and validation expectations. Do not pass vague instructions like "implement the change fully" or "review this" by themselves.
|
|
530
467
|
|
|
531
|
-
- `/gather-context-and-clarify` maps to: launch locator/analyzer/research specialists; synthesize findings; then use `interview` to ask every clarification question needed for shared understanding.
|
|
532
|
-
- `/parallel-review` maps to: launch fresh-context specialist reviewers with distinct review angles; synthesize the feedback before applying anything.
|
|
533
|
-
- `/review-loop` maps to: keep the parent in charge of writer → fresh specialist reviewers → synthesized fix writer cycles until no fixes worth doing now remain, an unapproved decision appears, or the review-round cap is reached.
|
|
534
|
-
- `/parallel-research` maps to: combine local locator/analyzer/pattern-finder/research-analyzer context with external `codebase-online-researcher` evidence when current docs, ecosystem behavior, or API details matter.
|
|
535
|
-
- `/parallel-context-build` maps to: run a top-level parallel group of codebase specialists with distinct output paths, then synthesize their context and meta-prompt sections.
|
|
536
|
-
- `/parallel-handoff-plan` maps to: run external `codebase-online-researcher` plus local locator/analyzer/pattern-finder/research passes, then synthesize the final handoff plan and implementation-ready meta-prompt yourself.
|
|
537
|
-
- `/parallel-cleanup` maps to: read-only `codebase-analyzer` scouts (deslop + verbosity) followed by an optional `code-simplifier` writer when the user authorizes autofix.
|
|
538
468
|
|
|
539
469
|
For feature work, use this sequence as scaffolding for parent-agent behavior:
|
|
540
470
|
|
|
@@ -550,7 +480,7 @@ For complex or risky changes, increase review and validation fanout when user in
|
|
|
550
480
|
|
|
551
481
|
For very large work, split into serial milestones instead of launching a swarm of writers. Each milestone gets one writer, a validation contract, fresh-context review, a fix pass, and parent approval before the next milestone starts. Use parallel subagents inside a milestone for read-only context, research, and review only.
|
|
552
482
|
|
|
553
|
-
Keep orchestration authority in the parent session. Child subagents cannot launch more subagents or run their own orchestration loops: delegation is one level deep and nothing configures it. This skill is parent-only and is stripped from every child prompt. A child may still have the `subagent` extension tool registered, because bundled extensions load through normal discovery; registration is not authority. Typed admission policy lets a child use only `list`, `get`,
|
|
483
|
+
Keep orchestration authority in the parent session. Child subagents cannot launch more subagents or run their own orchestration loops: delegation is one level deep and nothing configures it. This skill is parent-only and is stripped from every child prompt. A child may still have the `subagent` extension tool registered, because bundled extensions load through normal discovery; registration is not authority. Typed admission policy lets a child use only `list`, `get`, and `status`, and refuses delegation and `interrupt`. Spawned children also do not receive parent-only status/control/slash messages or prior parent `subagent` tool-call/tool-result artifacts, and child context filtering strips old hidden orchestration-instruction messages when they appear in inherited history. Every child also receives a boundary instruction that says the parent owns orchestration, that the `subagent` tool refuses every launch and `interrupt` from inside a subagent, and that writer children must call real edit/write tools instead of printing pseudo tool calls. Pass children concrete role-specific work instead.
|
|
554
484
|
|
|
555
485
|
1. Clarify only when needed. Use existing context first; gather missing code or research context selectively, then ask only unresolved questions that materially affect scope, completion criteria, constraints, or non-goals.
|
|
556
486
|
2. Define the validation contract. State completion expectations before implementation: expected behavior, checks to run, user flows to exercise, and evidence required in the writer handoff. For UI, CLI, integration, or workflow changes, include at least one validator angle that uses the product the way a user would rather than only reading code.
|
|
@@ -600,7 +530,7 @@ When implementation review is part of the requested shape, do not treat the firs
|
|
|
600
530
|
|
|
601
531
|
When a writer completes, treat its handoff as an intermediate state when review is part of the requested shape. The next parent action is bounded review, then synthesis, then a fix writer if reviewers found fixes worth doing now. Keep these calls in the foreground so each handoff is available before the next action.
|
|
602
532
|
|
|
603
|
-
|
|
533
|
+
When the user explicitly asks to keep reviewing until the work is clean, repeat writer → fresh-specialist-reviewers → synthesized-fix-writer cycles until reviewers find no blockers or fixes worth doing now, remaining feedback is optional or intentionally deferred, an unapproved product/scope/architecture decision needs the user, or the max review-round cap is reached. Default to 3 review rounds unless the user sets a different cap.
|
|
604
534
|
|
|
605
535
|
### Parallel non-conflicting analysis
|
|
606
536
|
|
|
@@ -623,13 +553,6 @@ subagent({ action: "list" })
|
|
|
623
553
|
// Check available agents, then confirm scope and precedence.
|
|
624
554
|
```
|
|
625
555
|
|
|
626
|
-
**Setup, discovery, or intercom confusion**
|
|
627
|
-
|
|
628
|
-
```typescript
|
|
629
|
-
subagent({ action: "doctor" })
|
|
630
|
-
// Check runtime paths, execution support, discovery counts, current session, and intercom bridge state.
|
|
631
|
-
```
|
|
632
|
-
|
|
633
556
|
**"Subagent delegation is not available inside a subagent"**
|
|
634
557
|
|
|
635
558
|
```typescript
|
|
@@ -666,7 +589,7 @@ subagent({ action: "doctor" })
|
|
|
666
589
|
**Child fails before starting**
|
|
667
590
|
|
|
668
591
|
```typescript
|
|
669
|
-
// Inspect `subagent({ action: "status", id: "..." })
|
|
592
|
+
// Inspect `subagent({ action: "status", id: "..." })` plus artifact metadata and output logs. Extension loader errors usually appear in child output logs.
|
|
670
593
|
```
|
|
671
594
|
|
|
672
595
|
## Suffix-first reasoning levels
|