@bastani/atomic 0.9.13-alpha.2 → 0.9.13-alpha.4
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 +30 -0
- package/README.md +1 -1
- package/dist/builtin/i-have-adhd/package.json +1 -1
- package/dist/builtin/intercom/CHANGELOG.md +14 -0
- package/dist/builtin/intercom/README.md +12 -12
- package/dist/builtin/intercom/incoming-message-delivery.ts +1 -1
- package/dist/builtin/intercom/index.ts +1 -1
- package/dist/builtin/intercom/intercom-tool.ts +1 -1
- package/dist/builtin/intercom/intercom-utils.ts +3 -6
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/intercom/result-renderers.ts +1 -1
- package/dist/builtin/intercom/session-target.ts +1 -15
- package/dist/builtin/intercom/skills/intercom/SKILL.md +6 -6
- package/dist/builtin/intercom/terminal-ordering-barrier.ts +2 -2
- package/dist/builtin/intercom/ui/inline-message.ts +7 -5
- package/dist/builtin/intercom/ui/session-list.ts +23 -10
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +19 -0
- package/dist/builtin/subagents/README.md +29 -73
- package/dist/builtin/subagents/package.json +2 -2
- package/dist/builtin/subagents/prompts/parallel-cleanup.md +1 -1
- package/dist/builtin/subagents/prompts/parallel-review.md +1 -1
- package/dist/builtin/subagents/prompts/review-loop.md +2 -2
- package/dist/builtin/subagents/skills/subagent/SKILL.md +23 -59
- package/dist/builtin/subagents/skills/tmux/SKILL.md +1 -1
- package/dist/builtin/subagents/src/extension/control-notices.ts +2 -3
- package/dist/builtin/subagents/src/extension/doctor.ts +2 -14
- package/dist/builtin/subagents/src/extension/fanout-child.ts +1 -17
- package/dist/builtin/subagents/src/extension/index.ts +9 -70
- package/dist/builtin/subagents/src/extension/notification-content.ts +1 -1
- package/dist/builtin/subagents/src/extension/prompt-guidance.ts +2 -2
- package/dist/builtin/subagents/src/extension/schemas.ts +2 -8
- package/dist/builtin/subagents/src/extension/tool-description.ts +2 -3
- package/dist/builtin/subagents/src/intercom/intercom-bridge.ts +1 -1
- package/dist/builtin/subagents/src/intercom/result-intercom.ts +5 -46
- package/dist/builtin/subagents/src/runs/{background → foreground}/completion-notification.ts +2 -2
- package/dist/builtin/subagents/src/runs/foreground/inprocess-run-sync.ts +25 -88
- package/dist/builtin/subagents/src/runs/{background → foreground}/notify.ts +5 -5
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-context.ts +11 -28
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel-task.ts +3 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel.ts +2 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-runtime.ts +0 -5
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts +30 -20
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-status.ts +4 -4
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-types.ts +0 -13
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor.ts +104 -48
- package/dist/builtin/subagents/src/runs/inprocess/index.ts +1 -1
- package/dist/builtin/subagents/src/runs/inprocess/runner.ts +5 -5
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-api.ts +0 -7
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-core.ts +0 -10
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-projection.ts +3 -108
- package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-sanitize.ts +0 -4
- package/dist/builtin/subagents/src/runs/shared/subagent-control.ts +1 -1
- package/dist/builtin/subagents/src/shared/formatters.ts +3 -5
- package/dist/builtin/subagents/src/shared/model-resolution.ts +78 -0
- package/dist/builtin/subagents/src/shared/status-format.ts +4 -11
- package/dist/builtin/subagents/src/shared/types-config.ts +10 -9
- package/dist/builtin/subagents/src/shared/types-nested.ts +127 -0
- package/dist/builtin/subagents/src/shared/types-results.ts +2 -8
- package/dist/builtin/subagents/src/shared/types-runtime.ts +0 -9
- package/dist/builtin/subagents/src/shared/types.ts +1 -1
- package/dist/builtin/subagents/src/shared/utils.ts +1 -109
- package/dist/builtin/subagents/src/slash/slash-commands.ts +7 -17
- package/dist/builtin/subagents/src/tui/render-event-formatting.ts +2 -252
- package/dist/builtin/subagents/src/tui/render-layout.ts +4 -4
- package/dist/builtin/subagents/src/tui/render-result.ts +0 -9
- package/dist/builtin/subagents/src/tui/render-stable-output.ts +1 -34
- package/dist/builtin/subagents/src/tui/render.ts +0 -2
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +23 -0
- package/dist/builtin/workflows/README.md +3 -3
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/durable/backend.ts +11 -0
- package/dist/builtin/workflows/src/durable/completed-catalog-stage-groups.ts +63 -25
- package/dist/builtin/workflows/src/durable/completed-catalog.ts +166 -25
- package/dist/builtin/workflows/src/durable/dbos-backend.ts +42 -24
- package/dist/builtin/workflows/src/durable/dbos-envelope.ts +2 -1
- package/dist/builtin/workflows/src/durable/run-timing.ts +28 -7
- package/dist/builtin/workflows/src/durable/scoped-backend.ts +4 -0
- package/dist/builtin/workflows/src/durable/targeted-inspection.ts +110 -0
- package/dist/builtin/workflows/src/engine/run-durable-stage-session.ts +2 -2
- package/dist/builtin/workflows/src/engine/runtime.ts +19 -2
- package/dist/builtin/workflows/src/extension/extension-runtime-state.ts +3 -0
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +750 -168
- package/dist/builtin/workflows/src/extension/runtime-durable-resume.ts +6 -0
- package/dist/builtin/workflows/src/extension/ui-surface.ts +4 -0
- package/dist/builtin/workflows/src/extension/workflow-command-registration.ts +6 -1
- package/dist/builtin/workflows/src/extension/workflow-targets.ts +18 -10
- package/dist/builtin/workflows/src/extension/workflow-tool-inspection.ts +31 -16
- package/dist/builtin/workflows/src/extension/workflow-tool-send.ts +75 -3
- package/dist/builtin/workflows/src/extension/workflow-tool.ts +53 -6
- package/dist/builtin/workflows/src/runs/background/run-inspect.ts +5 -1
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-call.ts +94 -60
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-context.ts +1 -1
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-control.ts +7 -7
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-factory.ts +25 -4
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-types.ts +4 -1
- package/dist/builtin/workflows/src/runs/foreground/executor-types.ts +2 -0
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-controller.ts +142 -4
- package/dist/builtin/workflows/src/runs/foreground/stage-runner-types.ts +2 -0
- package/dist/builtin/workflows/src/runs/foreground/stage-session-heartbeat.ts +88 -0
- package/dist/builtin/workflows/src/tui/keybindings-adapter.ts +1 -0
- package/dist/builtin/workflows/src/tui/overlay-adapter.ts +1 -0
- package/dist/builtin/workflows/src/tui/run-detail.ts +25 -12
- package/dist/builtin/workflows/src/tui/stage-chat-view-archive-history.ts +27 -8
- package/dist/builtin/workflows/src/tui/stage-chat-view-input.ts +17 -1
- package/dist/builtin/workflows/src/tui/stage-chat-view.ts +20 -3
- package/dist/builtin/workflows/src/tui/workflow-attach-pane.ts +10 -1
- package/dist/builtin/workflows/src/tui/workflow-resume-selector.ts +1 -0
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +22 -5
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-export.d.ts.map +1 -1
- package/dist/core/agent-session-export.js +2 -1
- package/dist/core/agent-session-export.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +10 -4
- 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-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +68 -0
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-queue-pause.d.ts.map +1 -1
- package/dist/core/agent-session-queue-pause.js +6 -0
- package/dist/core/agent-session-queue-pause.js.map +1 -1
- package/dist/core/agent-session-summary.d.ts +21 -0
- package/dist/core/agent-session-summary.d.ts.map +1 -0
- package/dist/core/agent-session-summary.js +156 -0
- package/dist/core/agent-session-summary.js.map +1 -0
- package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
- package/dist/core/agent-session-tool-registry.js +0 -4
- package/dist/core/agent-session-tool-registry.js.map +1 -1
- package/dist/core/agent-session-transfer.d.ts.map +1 -1
- package/dist/core/agent-session-transfer.js +0 -2
- package/dist/core/agent-session-transfer.js.map +1 -1
- package/dist/core/agent-session-tree.d.ts.map +1 -1
- package/dist/core/agent-session-tree.js +6 -0
- package/dist/core/agent-session-tree.js.map +1 -1
- package/dist/core/agent-session.d.ts +21 -3
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +22 -5
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/atomic-guide-command.js +2 -2
- package/dist/core/atomic-guide-command.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +1 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/index.d.ts +1 -0
- package/dist/core/compaction/index.d.ts.map +1 -1
- package/dist/core/compaction/index.js +1 -0
- package/dist/core/compaction/index.js.map +1 -1
- package/dist/core/compaction/session-summarization.d.ts +41 -0
- package/dist/core/compaction/session-summarization.d.ts.map +1 -0
- package/dist/core/compaction/session-summarization.js +97 -0
- package/dist/core/compaction/session-summarization.js.map +1 -0
- package/dist/core/extensions/ui-types.d.ts +4 -0
- package/dist/core/extensions/ui-types.d.ts.map +1 -1
- package/dist/core/extensions/ui-types.js.map +1 -1
- package/dist/core/keybindings.d.ts +0 -5
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +0 -2
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/session-manager-core.d.ts +3 -1
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +9 -1
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-entries.d.ts +24 -1
- package/dist/core/session-manager-entries.d.ts.map +1 -1
- package/dist/core/session-manager-entries.js +48 -0
- package/dist/core/session-manager-entries.js.map +1 -1
- package/dist/core/session-manager-list.d.ts.map +1 -1
- package/dist/core/session-manager-list.js +10 -0
- package/dist/core/session-manager-list.js.map +1 -1
- package/dist/core/session-manager-types.d.ts +10 -1
- package/dist/core/session-manager-types.d.ts.map +1 -1
- package/dist/core/session-manager-types.js.map +1 -1
- package/dist/core/settings-manager-basic-accessors.d.ts +3 -0
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js +5 -0
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-types.d.ts +4 -0
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/slash-commands.js +2 -2
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/tools/bash.d.ts +0 -15
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +3 -81
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/fetch-url.d.ts +12 -0
- package/dist/core/tools/fetch-url.d.ts.map +1 -1
- package/dist/core/tools/fetch-url.js +76 -10
- package/dist/core/tools/fetch-url.js.map +1 -1
- package/dist/core/tools/index.js +4 -4
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/session-temp-dir.d.ts +2 -2
- package/dist/core/tools/session-temp-dir.d.ts.map +1 -1
- package/dist/core/tools/session-temp-dir.js +6 -7
- package/dist/core/tools/session-temp-dir.js.map +1 -1
- package/dist/core/usage-totals.js +1 -1
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/components/footer.js +1 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/host-session-picker.d.ts.map +1 -1
- package/dist/modes/interactive/components/host-session-picker.js +1 -0
- package/dist/modes/interactive/components/host-session-picker.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +1 -0
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-list.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-list.js +29 -4
- package/dist/modes/interactive/components/session-selector-list.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.js +1 -1
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
- package/dist/modes/interactive/components/transcript-follow-indicator.d.ts +14 -0
- package/dist/modes/interactive/components/transcript-follow-indicator.d.ts.map +1 -0
- package/dist/modes/interactive/components/transcript-follow-indicator.js +36 -0
- package/dist/modes/interactive/components/transcript-follow-indicator.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector-content.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-content.js +6 -0
- package/dist/modes/interactive/components/tree-selector-content.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-custom-ui.js +3 -0
- package/dist/modes/interactive/interactive-extension-custom-ui.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +0 -3
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +7 -1
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +3 -3
- package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +1 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js +2 -5
- package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +6 -0
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-transcript-follow.d.ts +2 -0
- package/dist/modes/interactive/interactive-transcript-follow.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-transcript-follow.js +6 -0
- package/dist/modes/interactive/interactive-transcript-follow.js.map +1 -0
- package/dist/modes/interactive/interactive-tui.d.ts +13 -1
- package/dist/modes/interactive/interactive-tui.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-tui.js +59 -1
- package/dist/modes/interactive/interactive-tui.js.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts +2 -0
- package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-custom-ui.js +1 -0
- package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
- package/dist/modes/interactive-engine/protocol.d.ts +1 -0
- package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
- package/dist/modes/interactive-engine/protocol.js +5 -1
- package/dist/modes/interactive-engine/protocol.js.map +1 -1
- package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-component.js +21 -9
- package/dist/modes/interactive-engine/remote-component.js.map +1 -1
- package/docs/environment-variables.md +1 -1
- package/docs/intercom.md +20 -21
- package/docs/keybindings.md +2 -5
- package/docs/quickstart.md +5 -1
- package/docs/sdk.md +1 -1
- package/docs/session-format.md +15 -0
- package/docs/sessions.md +8 -0
- package/docs/settings.md +6 -0
- package/docs/subagents.md +19 -31
- package/docs/tools.md +3 -5
- package/docs/usage.md +3 -1
- package/docs/windows.md +1 -1
- package/docs/workflows.md +60 -32
- package/npm-shrinkwrap.json +29 -29
- package/package.json +2 -2
- package/dist/builtin/subagents/src/runs/background/async-job-tracker.ts +0 -331
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-async.ts +0 -161
- package/dist/builtin/subagents/src/runs/inprocess/background-single.ts +0 -195
- package/dist/builtin/subagents/src/runs/inprocess/background.ts +0 -90
- package/dist/builtin/subagents/src/shared/types-async.ts +0 -247
- package/dist/builtin/subagents/src/tui/render-widget-graph.ts +0 -217
- package/dist/builtin/subagents/src/tui/render-widget.ts +0 -366
- package/dist/core/async/format.d.ts +0 -3
- package/dist/core/async/format.d.ts.map +0 -1
- package/dist/core/async/format.js +0 -52
- package/dist/core/async/format.js.map +0 -1
- package/dist/core/async/job-manager.d.ts +0 -40
- package/dist/core/async/job-manager.d.ts.map +0 -1
- package/dist/core/async/job-manager.js +0 -293
- package/dist/core/async/job-manager.js.map +0 -1
- package/dist/core/async/session-manager.d.ts +0 -16
- package/dist/core/async/session-manager.d.ts.map +0 -1
- package/dist/core/async/session-manager.js +0 -34
- package/dist/core/async/session-manager.js.map +0 -1
- package/dist/core/async/types.d.ts +0 -23
- package/dist/core/async/types.d.ts.map +0 -1
- package/dist/core/async/types.js +0 -2
- package/dist/core/async/types.js.map +0 -1
- package/dist/core/tools/bash-async-execution.d.ts +0 -27
- package/dist/core/tools/bash-async-execution.d.ts.map +0 -1
- package/dist/core/tools/bash-async-execution.js +0 -81
- package/dist/core/tools/bash-async-execution.js.map +0 -1
- package/dist/core/tools/bash-async-jobs.d.ts +0 -30
- package/dist/core/tools/bash-async-jobs.d.ts.map +0 -1
- package/dist/core/tools/bash-async-jobs.js +0 -87
- package/dist/core/tools/bash-async-jobs.js.map +0 -1
- package/dist/core/tools/bash-async-output.d.ts +0 -13
- package/dist/core/tools/bash-async-output.d.ts.map +0 -1
- package/dist/core/tools/bash-async-output.js +0 -122
- package/dist/core/tools/bash-async-output.js.map +0 -1
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
# @bastani/subagents
|
|
6
6
|
|
|
7
|
-
`@bastani/subagents` lets Atomic delegate work to focused child agents. It is Atomic's bundled adaptation of upstream `pi-subagents`; use it for code review, scouting, implementation, parallel audits,
|
|
7
|
+
`@bastani/subagents` lets Atomic delegate work to focused child agents. It is Atomic's bundled adaptation of upstream `pi-subagents`; use it for code review, scouting, implementation, parallel audits, and anything else that benefits from a second or third set of model eyes.
|
|
8
8
|
|
|
9
|
-
Use subagents selectively for bounded specialist delegation while the parent remains in control: one focused agent or parallel independent tasks. Keep interactive, exploratory, conceptual, and conversation-led work inline. Multiple steps, files, tests, validation, or parallelism alone do not require a workflow. For
|
|
9
|
+
Use subagents selectively for bounded specialist delegation while the parent remains in control: one focused agent or parallel independent tasks. Keep interactive, exploratory, conceptual, and conversation-led work inline. Multiple steps, files, tests, validation, or parallelism alone do not require a workflow. For clearly delegated autonomous jobs that need durable stages, checkpoints, resumability, HIL, gates, retries, or bounded loops, use an appropriate workflow instead. Subagent calls always run in the foreground and return their results to the parent.
|
|
10
10
|
|
|
11
11
|
https://github.com/user-attachments/assets/702554ec-faaf-4635-80aa-fb5d6e292fd1
|
|
12
12
|
|
|
@@ -48,9 +48,9 @@ That is enough to start.
|
|
|
48
48
|
|
|
49
49
|
Pi is the parent session. A subagent is a focused child Pi session with its own job.
|
|
50
50
|
|
|
51
|
-
When you ask for a subagent, Pi starts the child, gives it the task, and brings the result back.
|
|
51
|
+
When you ask for a subagent, Pi starts the child, gives it the task, and brings the result back. Single and parallel runs stream progress in the conversation and return their results before the call completes.
|
|
52
52
|
|
|
53
|
-
Installing the extension does not start an automatic review
|
|
53
|
+
Installing the extension does not start an automatic review. It gives Pi a delegation tool. If you want every implementation reviewed, say that in your prompt or put it in your project instructions:
|
|
54
54
|
|
|
55
55
|
```text
|
|
56
56
|
When you finish implementing, run codebase-analyzer over the diff before summarizing.
|
|
@@ -100,9 +100,9 @@ Those are ordinary Pi requests. Pi decides whether to call `subagent`, which age
|
|
|
100
100
|
| Execute a plan carefully | “Have worker implement this approved plan, then run reviewers and apply the feedback.” |
|
|
101
101
|
| Diagnose a failure | “Use debugger to reproduce this test failure and fix it.” |
|
|
102
102
|
| Simplify after it lands | “Use code-simplifier to clean up the change.” |
|
|
103
|
-
| Run
|
|
103
|
+
| Run a delegated task | “Have worker implement this plan and return the result.” |
|
|
104
104
|
| Browse agents | “Show me the available subagents.” |
|
|
105
|
-
| See
|
|
105
|
+
| See current status | “Show the current subagent status.” |
|
|
106
106
|
| Check setup | “Check whether subagents are configured correctly.” |
|
|
107
107
|
|
|
108
108
|
The extension ships with builtin agents you can use immediately.
|
|
@@ -157,20 +157,16 @@ Any parent chat or workflow stage that orchestrates subagents should omit the ex
|
|
|
157
157
|
|
|
158
158
|
When an agent declares no model or fallback policy, consult `packages/coding-agent/docs/models/model-selection.md`, then call `workflow({ action: "models" })` when available. Use only a catalog-returned `fullId` and only a thinking level listed for that entry. If the catalog tool is unavailable, returns no models, or has no recommended model for the role, leave the child unpinned and report the limitation instead of inventing a model or inspecting credentials.
|
|
159
159
|
|
|
160
|
-
Workflow invocations receive a stable, non-`default` Intercom group automatically. Their stages and delegated children inherit it across single, parallel,
|
|
160
|
+
Workflow invocations receive a stable, non-`default` Intercom group automatically. Their stages and delegated children inherit it across single, parallel, and follow-up calls, so omit `group` unless you intend to create a different coordination subgroup. Outside a workflow, children inherit the launching session's group. `contact_supervisor` remains available across group boundaries.
|
|
161
161
|
|
|
162
162
|
## Where running subagents show up
|
|
163
163
|
|
|
164
|
-
Foreground runs stream progress in the conversation while they run.
|
|
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 retained foreground children.
|
|
165
165
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
The jobs widget shows the live status-watch state and sends one terminal completion notification. Parallel background runs show per-agent progress and retain their grouped task shape in progress and results. There is no detached runner process or PID polling loop.
|
|
169
|
-
|
|
170
|
-
You can also ask naturally:
|
|
166
|
+
You can ask naturally:
|
|
171
167
|
|
|
172
168
|
```text
|
|
173
|
-
Show me the current
|
|
169
|
+
Show me the current subagent status.
|
|
174
170
|
```
|
|
175
171
|
|
|
176
172
|
If something feels misconfigured, run:
|
|
@@ -228,7 +224,7 @@ Most users do not call `intercom` directly. When the intercom companion is avail
|
|
|
228
224
|
Use it for work where the child might need a decision instead of guessing:
|
|
229
225
|
|
|
230
226
|
```text
|
|
231
|
-
Run this implementation
|
|
227
|
+
Run this implementation. If the worker gets blocked or needs a product decision, have it ask me through intercom.
|
|
232
228
|
```
|
|
233
229
|
|
|
234
230
|
```text
|
|
@@ -239,10 +235,10 @@ The child can use one dedicated coordination tool:
|
|
|
239
235
|
|
|
240
236
|
- `contact_supervisor`: the child contacts the parent/supervisor session that delegated the task. Use `reason: "need_decision"` for blocking decisions or clarification, and `reason: "progress_update"` for short non-blocking updates 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.
|
|
241
237
|
|
|
242
|
-
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
|
|
243
|
-
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
|
|
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.
|
|
244
240
|
|
|
245
|
-
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
|
|
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.
|
|
246
242
|
|
|
247
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.
|
|
248
244
|
|
|
@@ -297,21 +293,14 @@ Append `[key=value,...]` to an agent name to override defaults for that step:
|
|
|
297
293
|
|-----|---------|-------------|
|
|
298
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. |
|
|
299
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`. |
|
|
300
|
-
| `reads` | `reads=a.md+b.md` | Read files before executing. `+` separates multiple paths. `/run` forwards these through the same resolver as tool-based foreground
|
|
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. |
|
|
301
297
|
| `model` | `model=anthropic/claude-sonnet-4` | Override model for this step. |
|
|
302
298
|
| `skills` | `skills=planning+review` | Override injected skills. `+` separates multiple skills. |
|
|
303
299
|
| `progress` | `progress` | Enable progress tracking. |
|
|
304
300
|
|
|
305
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.
|
|
306
302
|
|
|
307
|
-
###
|
|
308
|
-
|
|
309
|
-
Add `--bg` to run in the background:
|
|
310
|
-
|
|
311
|
-
```text
|
|
312
|
-
/run codebase-locator "audit the codebase" --bg
|
|
313
|
-
/parallel codebase-locator "scan frontend" -> codebase-locator "scan backend" --bg
|
|
314
|
-
```
|
|
303
|
+
### Forked runs
|
|
315
304
|
|
|
316
305
|
Add `--fork` to start each child from a real branched session created from the parent’s current leaf:
|
|
317
306
|
|
|
@@ -320,22 +309,11 @@ Add `--fork` to start each child from a real branched session created from the p
|
|
|
320
309
|
/parallel codebase-locator "audit frontend" -> codebase-analyzer "audit backend" --fork
|
|
321
310
|
```
|
|
322
311
|
|
|
323
|
-
You can combine them in either order:
|
|
324
|
-
|
|
325
|
-
```text
|
|
326
|
-
/run codebase-analyzer "review this diff" --fork --bg
|
|
327
|
-
/run codebase-analyzer "review this diff" --bg --fork
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
Background runs use the same in-process continuation as foreground detach. A successful acknowledgement means the canonical child path was returned and completion is pending; the live child remains owned by the parent process and the jobs widget tracks it. **`async: true` does not survive parent exit.** If the parent exits, the in-flight run ends; its persisted identity/session can be listed and resumed later.
|
|
331
|
-
|
|
332
312
|
`worker` is designed for an explicit decision loop. A typical pattern is to ask a read-only specialist such as `codebase-analyzer` or `debugger` for diagnosis and a recommended execution prompt, then only run `worker` after the main agent approves that direction.
|
|
333
313
|
|
|
334
314
|
## Non-interactive execution
|
|
335
315
|
|
|
336
|
-
Every supported subagent launch starts immediately without opening a preview/editor prompt or waiting for terminal input. This applies to single, parallel,
|
|
337
|
-
|
|
338
|
-
The human slash commands remain on their separate parsing and event-bridge path, including background and fork flags.
|
|
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, and human-entered `/run` and `/parallel` execution. Gather any needed context and ask the user questions in the parent conversation before launching.
|
|
339
317
|
|
|
340
318
|
## Agents
|
|
341
319
|
|
|
@@ -517,7 +495,7 @@ Missing skills do not fail execution. The result summary shows a warning.
|
|
|
517
495
|
The package bundles a `subagent` skill that is automatically available to the parent agent when the extension is installed. It is for the orchestrating parent only: it is stripped from every child prompt, including fanout-authorized children, and child context is filtered to strip parent-only orchestration instructions. A child may still have the `subagent` tool registered; typed admission policy, not the skill, decides which of its actions are allowed.
|
|
518
496
|
|
|
519
497
|
What the bundled skill covers:
|
|
520
|
-
- **Delegation patterns**: when to launch which agent, whether to use single
|
|
498
|
+
- **Delegation patterns**: when to launch which agent, whether to use single or parallel mode, and whether to use fresh or forked context
|
|
521
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 review, review-loop, parallel research, parallel context-build, parallel handoff-plan, gather-context-and-clarify, and parallel cleanup
|
|
522
500
|
- **Role-agent prompting guidance**: compact contract prompts instead of long scripts, what to include in role-specific meta prompts, and retrieval budgets for researchers
|
|
523
501
|
- **Safety boundaries**: child agents must not run subagents, must not invent intercom targets, and must escalate unapproved decisions
|
|
@@ -615,7 +593,6 @@ Agent definitions are not loaded into context by default. Management actions let
|
|
|
615
593
|
| `worktree` | boolean | false | Create isolated git worktrees for parallel tasks. |
|
|
616
594
|
| `context` | `fresh \| fork` | agent default or `fresh` | `fork` creates real branched sessions from the parent leaf. Packaged `worker` defaults to `fork`; every other builtin runs fresh. |
|
|
617
595
|
| `agentScope` | `user \| project \| both` | `both` | Agent discovery scope. Project wins on collisions. |
|
|
618
|
-
| `async` | boolean | false | Background execution. Programmatic calls start without prompting in either foreground or background mode. |
|
|
619
596
|
| `cwd` | string | runtime cwd | Override working directory. |
|
|
620
597
|
| `maxOutput` | object | 200KB, 5000 lines | Final output truncation limits. |
|
|
621
598
|
| `artifacts` | boolean | true | Write debug artifacts. |
|
|
@@ -639,7 +616,7 @@ subagent({ action: "resume", id: "<run-id>", index: 1, message: "follow-up for c
|
|
|
639
616
|
subagent({ action: "doctor" })
|
|
640
617
|
```
|
|
641
618
|
|
|
642
|
-
`resume` sends the follow-up directly when a child is still reachable. After completion or eviction, it cold-reloads the same canonical child identity from the stored session file.
|
|
619
|
+
`resume` sends the follow-up directly when a child is still reachable. After completion or eviction, it cold-reloads the same canonical child identity from the stored session file. Remembered foreground single or parallel runs can be revived by passing `index` to choose the child; no new OS process is created.
|
|
643
620
|
|
|
644
621
|
## Worktree isolation
|
|
645
622
|
|
|
@@ -669,21 +646,7 @@ After a worktree parallel step completes, per-agent diff stats are appended to t
|
|
|
669
646
|
|
|
670
647
|
Atomic subagents read optional JSON config from `~/.atomic/agent/extensions/subagent/config.json` and still check the legacy `~/.pi/agent/extensions/subagent/config.json` path for compatibility.
|
|
671
648
|
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
```json
|
|
675
|
-
{ "asyncByDefault": true }
|
|
676
|
-
```
|
|
677
|
-
|
|
678
|
-
Makes top-level calls use background execution when the request does not explicitly set `async`. Callers can still force foreground with `async: false` unless `forceTopLevelAsync` is enabled.
|
|
679
|
-
|
|
680
|
-
### `forceTopLevelAsync`
|
|
681
|
-
|
|
682
|
-
```json
|
|
683
|
-
{ "forceTopLevelAsync": true }
|
|
684
|
-
```
|
|
685
|
-
|
|
686
|
-
Forces depth-0 single and parallel runs into background mode. Calls remain non-interactive in both foreground and background mode; nested calls keep their own inherited settings.
|
|
649
|
+
Subagent configuration controls discovery, parallel limits, session storage, depth, control notices, and intercom delivery. There are no execution-mode toggles; every execution request is foreground.
|
|
687
650
|
|
|
688
651
|
### `parallel`
|
|
689
652
|
|
|
@@ -769,9 +732,9 @@ Metadata records timing, usage, typed status, termination cause, final model, at
|
|
|
769
732
|
|
|
770
733
|
Session files are stored under a per-run session directory. With `context: "fork"`, each child starts from the parent’s current leaf through the session manager; this is a real session fork, not an injected summary.
|
|
771
734
|
|
|
772
|
-
|
|
735
|
+
Foreground completions notify the originating session. The in-process status watch emits live lifecycle updates, and the extension consumes the terminal event to render completion notifications.
|
|
773
736
|
|
|
774
|
-
|
|
737
|
+
Foreground runs persist their session and user-facing artifacts beside the parent session:
|
|
775
738
|
|
|
776
739
|
```text
|
|
777
740
|
{parent-session-dir}/subagent-artifacts/
|
|
@@ -782,7 +745,7 @@ Async runs persist their durable session and user-facing artifacts beside the pa
|
|
|
782
745
|
run-history.jsonl
|
|
783
746
|
```
|
|
784
747
|
|
|
785
|
-
The Rust registry and status watch power
|
|
748
|
+
The Rust registry and status watch power `subagent({ action: "status" })` output. Terminal delivery is an in-memory bounded envelope persisted once with typed `status`, `cause`, and `stats`; there is no `status.json`, `events.jsonl`, PID reconciler, result watcher, or claim pipeline.
|
|
786
749
|
|
|
787
750
|
## Completion and output
|
|
788
751
|
|
|
@@ -800,7 +763,7 @@ For existing subagent integrations and agent definitions:
|
|
|
800
763
|
|
|
801
764
|
Foreground runs show compact live progress for single and parallel modes: current tool, recent output, token counts, duration, activity freshness, current-tool duration, and artifact paths when available.
|
|
802
765
|
|
|
803
|
-
File-based tracking and returned telemetry are separate. On a single-agent call, `progress: true` creates a run-scoped `progress.md` under isolated subagent artifact storage and asks the child to maintain it
|
|
766
|
+
File-based tracking and returned telemetry are separate. On a single-agent call, `progress: true` creates a run-scoped `progress.md` under isolated subagent artifact storage and asks the child to maintain it without writing `progress.md` into the child working directory. `progress: false` disables an agent's `defaultProgress`. `includeProgress: true` only adds detailed runtime progress data to the final foreground tool result; it does not enable the file.
|
|
804
767
|
|
|
805
768
|
Press `CTRL+O` to expand the full streaming view with complete output per step.
|
|
806
769
|
|
|
@@ -828,19 +791,13 @@ Configure a lower or equal limit with:
|
|
|
828
791
|
|
|
829
792
|
The depth policy is typed admission state and is not inherited through an environment variable.
|
|
830
793
|
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
Async events:
|
|
834
|
-
|
|
835
|
-
- `subagent:async-started`
|
|
836
|
-
- `subagent:async-complete`
|
|
837
|
-
|
|
838
|
-
Intercom delivery events:
|
|
794
|
+
Completion and intercom events:
|
|
839
795
|
|
|
796
|
+
- `subagent:complete`
|
|
840
797
|
- `subagent:control-intercom`
|
|
841
798
|
- `subagent:result-intercom`
|
|
842
799
|
|
|
843
|
-
|
|
800
|
+
Foreground status/control events are surfaced as visible parent notices, and typed terminal records carry the canonical path, status, cause, and session statistics. With `pi-intercom`, needs-attention notices and grouped parent-side subagent result deliveries can reach the orchestrator over intercom.
|
|
844
801
|
|
|
845
802
|
## Prompt-template integration
|
|
846
803
|
|
|
@@ -889,9 +846,8 @@ The main runtime files are:
|
|
|
889
846
|
| `src/agents/agents.ts` | Agent discovery and frontmatter parsing. |
|
|
890
847
|
| `src/runs/foreground/subagent-executor.ts` | Main execution routing for single, parallel, management, status, interrupt, and doctor actions. |
|
|
891
848
|
| `src/runs/foreground/execution.ts` | Core foreground `runSync` handling. |
|
|
892
|
-
| `src/runs/
|
|
893
|
-
| `src/runs/
|
|
894
|
-
| `src/runs/background/async-status.ts` | Status discovery and formatting for async runs. |
|
|
849
|
+
| `src/runs/foreground/notify.ts` | Completion-notification delivery for a detached Intercom child. |
|
|
850
|
+
| `src/runs/foreground/completion-notification.ts` | Local completion acknowledgement and ordering barrier for detached children. |
|
|
895
851
|
| `src/shared/settings.ts` | Shared task behavior, instructions, and config helpers. |
|
|
896
852
|
| `src/runs/shared/worktree.ts` | Git worktree isolation. |
|
|
897
853
|
| `src/intercom/intercom-bridge.ts` | Runtime intercom bridge instructions and diagnostics. |
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/subagents",
|
|
3
|
-
"version": "0.9.13-alpha.
|
|
3
|
+
"version": "0.9.13-alpha.4",
|
|
4
4
|
"private": true,
|
|
5
|
-
"description": "Atomic extension for delegating tasks to subagents with parallel execution
|
|
5
|
+
"description": "Atomic extension for delegating tasks to subagents with parallel execution. Fork of: https://github.com/nicobailon/pi-subagents",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Norin Lavaee",
|
|
8
8
|
"Alex Lavaee"
|
|
@@ -40,7 +40,7 @@ Both scouts are read-only; `codebase-analyzer` cannot edit. Their reports are re
|
|
|
40
40
|
|
|
41
41
|
Delegate only independent work too large for a handful of tool calls; do not delegate auditing your own work, and prefer one subagent over several. Parallelize independent reads; stay sequential when one result determines the next; synthesize after retrieval. Keep work within the requested scope.
|
|
42
42
|
|
|
43
|
-
In **autofix** mode, an invocation containing the exact word `autofix` uses it as workflow control, not cleanup scope; remove it before identifying the target. After synthesis, launch one
|
|
43
|
+
In **autofix** mode, an invocation containing the exact word `autofix` uses it as workflow control, not cleanup scope; remove it before identifying the target. After synthesis, launch one foreground `code-simplifier` writer with only the fixes-worth-doing-now list as scope. Validate and summarize. Do not apply optional improvements unless explicitly requested; if no fixes are worth doing now, do not edit.
|
|
44
44
|
|
|
45
45
|
Without autofix mode, ask before applying fixes unless I already authorized addressing the cleanup feedback. End that request with a compact numbered menu, including when applicable:
|
|
46
46
|
|
|
@@ -26,7 +26,7 @@ Use `/parallel-cleanup` instead for simplicity, slop, or verbosity angles. Every
|
|
|
26
26
|
|
|
27
27
|
Synthesize fixes worth doing now, optional improvements, and ignored or deferred feedback with a short reason; assess findings rather than applying them blindly. Delegate only independent work too large for a handful of tool calls; do not delegate auditing your own work, and prefer one subagent over several. Parallelize independent reads; stay sequential when one result determines the next; synthesize after retrieval. Keep work within the requested scope.
|
|
28
28
|
|
|
29
|
-
In **autofix** mode, an invocation containing the exact word `autofix` uses it as workflow control, not review scope; remove it before identifying the target. After synthesis, launch one
|
|
29
|
+
In **autofix** mode, an invocation containing the exact word `autofix` uses it as workflow control, not review scope; remove it before identifying the target. After synthesis, launch one foreground writer—`debugger` for correctness/regression fixes or `code-simplifier` for cleanup-shaped feedback—with only the explicit fixes-worth-doing-now list as scope. Validate and summarize. Do not apply optional improvements unless explicitly requested; if no fixes are worth doing now, do not edit.
|
|
30
30
|
|
|
31
31
|
Without autofix mode, ask before applying fixes unless I already authorized addressing review feedback. End that request with a compact numbered menu, including when applicable:
|
|
32
32
|
|
|
@@ -16,7 +16,7 @@ Use the `subagent` tool and specialist roles rather than a generic worker or rev
|
|
|
16
16
|
|
|
17
17
|
Default to at most 3 review rounds unless I set another cap. A round is a fresh-context inspection of the current diff after a writer pass.
|
|
18
18
|
|
|
19
|
-
If the invocation requests implementation, first launch one
|
|
19
|
+
If the invocation requests implementation, first launch one foreground writer for the approved scope: `debugger` for correctness-shaped work or `code-simplifier` for refinement-shaped work. If the current diff is already the target, begin with review. Continue with follow-up runs after each completion. Because launches are non-interactive, resolve questions with me first. Use one writer against the active worktree at a time unless I explicitly request isolated worktrees.
|
|
20
20
|
|
|
21
21
|
Each review round uses fresh context. Reviewers inspect repository instructions, relevant files, and the current diff directly, without main-conversation history, and cannot edit; explicitly put `debugger` in inspect-only mode. Choose angles from the change. Common angles are correctness/regressions, failure modes, and pattern fit; add external-spec or prior-decision coverage when applicable. Prefer three strong reviewers over many vague ones.
|
|
22
22
|
|
|
@@ -24,7 +24,7 @@ Delegate only independent work too large for a handful of tool calls; do not del
|
|
|
24
24
|
|
|
25
25
|
After each round, synthesize blockers or scope/product/architecture decisions needing approval, fixes worth doing now, optional improvements, and feedback to ignore or defer with a short reason. Assess findings rather than applying them blindly. Pause for my approval before a writer acts on any unapproved product, scope, or architecture decision.
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
The implementation writer's handoff transitions into review; it is not final completion unless I requested writer-only work, review-only output, or a stop after implementation. When implementation is authorized and fixes are worth doing now, launch one foreground writer to apply only the synthesized fixes—`debugger` for correctness or `code-simplifier` for cleanup. Require it to preserve approved scope, run focused validation, and report changed files, commands with exit codes, validation evidence, surprises, and unfinished work.
|
|
28
28
|
|
|
29
29
|
Run another review round after a fix only when it made material changes or addressed non-trivial findings. Do not loop for optional polish, speculative improvements, or already deferred findings.
|
|
30
30
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: subagent
|
|
3
3
|
description: |
|
|
4
4
|
Delegate work to builtin or custom subagents with single-agent,
|
|
5
|
-
parallel,
|
|
5
|
+
parallel, forked-context, and intercom-coordinated runs.
|
|
6
6
|
Use for bounded specialist delegation where a single parent agent stays in
|
|
7
7
|
control while subagents contribute locate, analyze, pattern-find, research,
|
|
8
8
|
debug, or simplify passes.
|
|
@@ -22,7 +22,6 @@ Use this skill when bounded specialist delegation adds value and the parent shou
|
|
|
22
22
|
- **Debug and fix**: use `debugger` for actual failures that need reproduction, root-cause diagnosis, and a validated patch; conceptual or exploratory debugging can stay inline.
|
|
23
23
|
- **Refinement**: use `code-simplifier` to clean up recently changed code without altering behavior.
|
|
24
24
|
- **Adversarial review**: compose read-only specialists (`codebase-analyzer`, `codebase-pattern-finder`, `debugger` in inspect-only mode, `codebase-online-researcher`) into a parallel review pass — there is no generic `reviewer` agent.
|
|
25
|
-
- **Long-running bounded delegation**: selectively launch async/background runs when the result is independently useful; otherwise use foreground execution.
|
|
26
25
|
- **Subagent control**: watch needs-attention signals and soft-interrupt only when a delegated run is genuinely blocked.
|
|
27
26
|
- **Agent authoring**: create, update, or override agents for a project.
|
|
28
27
|
|
|
@@ -33,7 +32,7 @@ Humans often use the slash-command layer instead:
|
|
|
33
32
|
|
|
34
33
|
- `/run` — launch a single agent
|
|
35
34
|
- `/parallel` — launch top-level parallel tasks
|
|
36
|
-
- `/subagents-doctor` — diagnose setup,
|
|
35
|
+
- `/subagents-doctor` — diagnose setup, execution paths, current session, and intercom bridge state
|
|
37
36
|
|
|
38
37
|
Prefer the tool when you are writing agent logic. Prefer the slash commands when you are guiding a human through an interactive flow.
|
|
39
38
|
|
|
@@ -57,7 +56,7 @@ Use this when the user wants adversarial review of a diff, plan, issue, file, or
|
|
|
57
56
|
|
|
58
57
|
### Review-loop technique
|
|
59
58
|
|
|
60
|
-
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.
|
|
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.
|
|
61
60
|
|
|
62
61
|
### Parallel research technique
|
|
63
62
|
|
|
@@ -105,8 +104,7 @@ Use this when unresolved requirements and genuinely missing repository context j
|
|
|
105
104
|
|
|
106
105
|
### Parallel cleanup technique
|
|
107
106
|
|
|
108
|
-
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
|
|
109
|
-
|
|
107
|
+
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.
|
|
110
108
|
|
|
111
109
|
## Builtin Agents
|
|
112
110
|
|
|
@@ -202,14 +200,13 @@ subagent({
|
|
|
202
200
|
})
|
|
203
201
|
```
|
|
204
202
|
|
|
205
|
-
Enable file-based progress tracking for foreground
|
|
203
|
+
Enable file-based progress tracking for foreground single-agent runs with `progress: true`. The child maintains a run-scoped `progress.md` under isolated subagent artifact storage without writing it into its effective `cwd`; `progress: false` disables an agent's `defaultProgress`. Omission inherits that default except for read-only tasks, and `artifacts: false` removes foreground storage after the child exits. This is distinct from `includeProgress: true`, which only returns detailed runtime progress data in the final foreground result.
|
|
206
204
|
|
|
207
205
|
```typescript
|
|
208
206
|
subagent({
|
|
209
207
|
agent: "debugger",
|
|
210
208
|
task: "Implement the approved fix and validate it.",
|
|
211
209
|
progress: true,
|
|
212
|
-
async: true
|
|
213
210
|
})
|
|
214
211
|
```
|
|
215
212
|
|
|
@@ -254,39 +251,11 @@ Avoid duplicate output paths in parallel tasks. Concurrent children should not w
|
|
|
254
251
|
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`.
|
|
255
252
|
|
|
256
253
|
|
|
257
|
-
###
|
|
258
|
-
|
|
259
|
-
Choose async/background mode selectively when delegated work is genuinely long-running or independently useful while the parent proceeds. Use foreground execution when the parent needs the result. This applies consistently to read-only specialists, writers, and parallel groups; keep the write path single-threaded in either mode.
|
|
260
|
-
|
|
261
|
-
Async does not mean parallel writes. Do not edit the same active worktree while an async `debugger` or `code-simplifier` is changing it. Parent-side overlap should be reading, validation prep, synthesis, command planning, or review of unaffected context unless the writer is isolated in a separate worktree.
|
|
262
|
-
|
|
263
|
-
Do not end your turn immediately after launching an async child if you promised to keep working. Continue the local inspection, synthesis, or validation prep, then check the async run when its result is needed. If there is no independent work left and you would only be running `sleep` or status polling commands to wait, end your turn instead. Pi will deliver the async completion when it arrives.
|
|
264
|
-
|
|
265
|
-
```typescript
|
|
266
|
-
subagent({
|
|
267
|
-
agent: "debugger",
|
|
268
|
-
task: "Run the full test suite, identify the failing test, and patch the root cause.",
|
|
269
|
-
async: true
|
|
270
|
-
})
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
File-only output mode works for async single runs and top-level parallel task items. A compact saved-file reference is returned instead of the full saved content.
|
|
274
|
-
|
|
275
|
-
For review fanout where the parent continues a local audit:
|
|
276
|
-
|
|
277
|
-
```typescript
|
|
278
|
-
const run = subagent({
|
|
279
|
-
agent: "codebase-analyzer",
|
|
280
|
-
task: "Review the current diff for correctness issues. Inspect files directly. Do not edit.",
|
|
281
|
-
async: true,
|
|
282
|
-
context: "fresh"
|
|
283
|
-
})
|
|
284
|
-
// Continue local inspection, then later call status with the returned id.
|
|
285
|
-
```
|
|
254
|
+
### Foreground execution and resume
|
|
286
255
|
|
|
287
|
-
|
|
256
|
+
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.
|
|
288
257
|
|
|
289
|
-
Use `resume` for follow-up
|
|
258
|
+
Use `resume` for a follow-up on a retained child:
|
|
290
259
|
|
|
291
260
|
```typescript
|
|
292
261
|
subagent({ action: "resume", id: "run-id", message: "Follow up on this point." })
|
|
@@ -295,11 +264,10 @@ subagent({ action: "resume", id: "run-id", index: 1, message: "Continue reviewer
|
|
|
295
264
|
|
|
296
265
|
Resume behavior:
|
|
297
266
|
|
|
298
|
-
- If
|
|
299
|
-
-
|
|
300
|
-
-
|
|
301
|
-
-
|
|
302
|
-
- Revive starts a new child process from the old session context; it does not restart the same OS process.
|
|
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.
|
|
303
271
|
- If the chosen child has no persisted `.jsonl` session file, resume fails and reports that directly.
|
|
304
272
|
|
|
305
273
|
Use diagnostics when setup or child startup looks wrong:
|
|
@@ -308,13 +276,13 @@ Use diagnostics when setup or child startup looks wrong:
|
|
|
308
276
|
subagent({ action: "doctor" })
|
|
309
277
|
```
|
|
310
278
|
|
|
311
|
-
Humans can use `/subagents-doctor` for the same read-only report. It checks runtime paths, discovery counts,
|
|
279
|
+
Humans can use `/subagents-doctor` for the same read-only report. It checks runtime paths, discovery counts, current session context, and intercom bridge state.
|
|
312
280
|
|
|
313
281
|
### Subagent control
|
|
314
282
|
|
|
315
283
|
Subagent control is the runtime visibility and intervention layer for delegated runs. It is separate from lifecycle status. Lifecycle status says whether a child is `queued`, `running`, `paused`, `complete`, or `failed`. 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.
|
|
316
284
|
|
|
317
|
-
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
|
|
285
|
+
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.
|
|
318
286
|
|
|
319
287
|
Use soft interrupt when a child is clearly blocked or drifting and the parent needs to regain control:
|
|
320
288
|
|
|
@@ -347,7 +315,7 @@ If the run already has an active intercom bridge target, needs-attention notific
|
|
|
347
315
|
|
|
348
316
|
## Non-Interactive Execution
|
|
349
317
|
|
|
350
|
-
Every supported subagent launch starts immediately without a preview/editor prompt or terminal input. This applies to single, parallel,
|
|
318
|
+
Every supported subagent launch starts immediately without a preview/editor prompt or terminal input. This applies to single, parallel, forked, fanout, prompt-template, and human-entered `/run` and `/parallel` execution.
|
|
351
319
|
|
|
352
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.
|
|
353
321
|
|
|
@@ -396,9 +364,8 @@ intercom({ action: "pending" })
|
|
|
396
364
|
|
|
397
365
|
Message conventions:
|
|
398
366
|
|
|
399
|
-
- `reason: "need_decision"` waits for the parent reply and returns it to the child.
|
|
400
367
|
- `reason: "progress_update"` is non-blocking and should stay concise.
|
|
401
|
-
- Child-side routine completion handoffs are not expected. With the intercom bridge active, parent-side subagents send grouped completion results through the intercom companion: one grouped message per foreground parent run and one per
|
|
368
|
+
- Child-side routine completion handoffs are not expected. With the intercom bridge active, parent-side subagents send grouped completion results through the intercom companion: one grouped message per foreground parent run and one per detached child completion. Acknowledged delivery returns a compact receipt with artifact/session paths; if unacknowledged, the normal full output is preserved.
|
|
402
369
|
|
|
403
370
|
Most agents should not call generic `intercom` directly unless bridge instructions provide a target and `contact_supervisor` is unavailable. Do not invent a target.
|
|
404
371
|
|
|
@@ -503,9 +470,9 @@ If a prompt-template extension is installed, additional user prompt templates ca
|
|
|
503
470
|
|
|
504
471
|
## Best Practices
|
|
505
472
|
|
|
506
|
-
### Choose foreground
|
|
473
|
+
### Choose foreground intentionally
|
|
507
474
|
|
|
508
|
-
Use foreground runs
|
|
475
|
+
Use foreground runs for every delegated call so the result gates the parent's next action. Do not duplicate a delegated job while waiting.
|
|
509
476
|
|
|
510
477
|
### Keep writes single-threaded by default
|
|
511
478
|
|
|
@@ -578,7 +545,7 @@ clarify when needed → validation contract → optional bounded discovery → o
|
|
|
578
545
|
|
|
579
546
|
The validation contract defines completion before code is written: expected behavior, checks, commands or user flows to exercise, and evidence the writer should return. Keep it lightweight for small tasks, but make it explicit enough that reviewers and validators are checking the intended outcome rather than the writer’s own assumptions. Subagent runs do not carry a structured `acceptance` field, infer acceptance policies, inject acceptance-report prompts, or run acceptance gates; put any evidence requirements directly in the task text. Do not set removed acceptance config fields on `subagent()` calls, parallel task items, or agent frontmatter; move those requirements into the assigned task text instead.
|
|
580
547
|
|
|
581
|
-
The first writer implements the approved change.
|
|
548
|
+
The first writer implements the approved change. The parent waits for its foreground handoff before review, and does not make parallel edits to the same worktree. Treat the writer handoff as the transition into review, not as final completion, unless the user explicitly asked for writer-only work, review-only output, or to stop after implementation. Specialist reviewers inspect the resulting diff from fresh context when warranted. The final fix writer applies synthesized fixes, then the parent looks over the final diff before completing. Ask only needed questions before a non-interactive launch.
|
|
582
549
|
|
|
583
550
|
For complex or risky changes, increase review and validation fanout when user intent or correctness risk materially warrants it rather than automatically trusting one reviewer. Use distinct angles such as correctness/regressions (`codebase-analyzer`), failure-mode hunt (`debugger` inspect-only), pattern fit (`codebase-pattern-finder`), prior-decision conformance (`codebase-research-*`), and external-spec conformance (`codebase-online-researcher`). When reviewers find non-trivial issues or the fix writer touches many lines, consider another focused review round before final validation.
|
|
584
551
|
|
|
@@ -589,10 +556,10 @@ Keep orchestration authority in the parent session. Child subagents should not l
|
|
|
589
556
|
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.
|
|
590
557
|
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.
|
|
591
558
|
3. Plan when useful. For complex work, write a plan doc yourself and get approval before implementation. For simple work, confirm shared understanding and explicitly note why planning is skipped.
|
|
592
|
-
4. Implement with one writer. After approval, launch `debugger` (for correctness-shaped work) or `code-simplifier` (for refinement-shaped work) in the foreground
|
|
559
|
+
4. Implement with one writer. After approval, launch `debugger` (for correctness-shaped work) or `code-simplifier` (for refinement-shaped work) in the foreground with a proper meta prompt that includes clarified requirements, relevant context, plan path or summary, the validation contract, and output expectations. While it runs, prepare validation or inspect adjacent code instead of editing the same worktree.
|
|
593
560
|
5. Require a useful writer handoff. Ask the writer to report changed files, what was implemented, what was left undone, commands run with exit codes, validation evidence, surprises or new risks, decisions made inside approved scope, and decisions needing parent approval.
|
|
594
561
|
6. Review after implementation. After the writer completes, launch bounded fresh-context specialist reviewers when risk or user intent warrants it — `codebase-analyzer` for correctness/regressions, `debugger` (inspect-only) for failure-mode hunts, and `codebase-pattern-finder` for consistency. Add `codebase-online-researcher` for external-spec angles and `codebase-research-*` for prior-decision angles when the work calls for it. Use `output: false` unless review artifacts are explicitly needed.
|
|
595
|
-
7. Synthesize, then run the fix writer when needed. Separate blockers, fixes worth doing now, optional improvements, and feedback to ignore/defer, then launch one foreground
|
|
562
|
+
7. Synthesize, then run the fix writer when needed. Separate blockers, fixes worth doing now, optional improvements, and feedback to ignore/defer, then launch one foreground writer (`debugger` or `code-simplifier`) to apply accepted fixes when implementation is authorized. If reviewers found scope/product/architecture choices that were not approved, ask the user first instead of applying them.
|
|
596
563
|
8. Review again when warranted. If the fix writer made substantial changes or addressed non-trivial findings, run another focused parallel review round before final validation.
|
|
597
564
|
9. Validate and complete. After the fix writer and any follow-up review return, inspect the final diff yourself, run or confirm focused validation, update docs/changelog when relevant, and summarize what changed and why.
|
|
598
565
|
|
|
@@ -602,7 +569,6 @@ Example writer handoff after clarification and optional planning:
|
|
|
602
569
|
subagent({
|
|
603
570
|
agent: "debugger",
|
|
604
571
|
task: "Implement the approved fix.\n\nClarified requirements:\n- ...\n\nPlan: see ~/Documents/docs/...-plan.md\n\nValidation contract:\n- ...\n\nReturn a handoff with changed files, what was implemented, what was left undone, commands run with exit codes, validation evidence, surprises/new risks, and decisions needing parent approval.",
|
|
605
|
-
async: true
|
|
606
572
|
})
|
|
607
573
|
```
|
|
608
574
|
|
|
@@ -617,7 +583,6 @@ subagent({
|
|
|
617
583
|
],
|
|
618
584
|
concurrency: 3,
|
|
619
585
|
context: "fresh",
|
|
620
|
-
async: true
|
|
621
586
|
})
|
|
622
587
|
```
|
|
623
588
|
|
|
@@ -627,7 +592,6 @@ Example fix writer after parallel reviews:
|
|
|
627
592
|
subagent({
|
|
628
593
|
agent: "debugger",
|
|
629
594
|
task: "Apply the synthesized reviewer feedback below. Only apply fixes worth doing now; preserve user-approved scope; ask before unapproved product or architecture changes. Run focused validation and summarize what changed.\n\nReviewer synthesis:\n...",
|
|
630
|
-
async: true
|
|
631
595
|
})
|
|
632
596
|
```
|
|
633
597
|
|
|
@@ -635,7 +599,7 @@ subagent({
|
|
|
635
599
|
|
|
636
600
|
When implementation review is part of the requested shape, do not treat the first review as the final step: synthesize findings against user scope and the validation contract, then launch one writer for accepted fixes when implementation is authorized.
|
|
637
601
|
|
|
638
|
-
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.
|
|
602
|
+
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.
|
|
639
603
|
|
|
640
604
|
For explicit review-loop requests, 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.
|
|
641
605
|
|
|
@@ -664,7 +628,7 @@ subagent({ action: "list" })
|
|
|
664
628
|
|
|
665
629
|
```typescript
|
|
666
630
|
subagent({ action: "doctor" })
|
|
667
|
-
// Check runtime paths,
|
|
631
|
+
// Check runtime paths, execution support, discovery counts, current session, and intercom bridge state.
|
|
668
632
|
```
|
|
669
633
|
|
|
670
634
|
**"Max subagent depth exceeded"**
|
|
@@ -52,7 +52,7 @@ metadata:
|
|
|
52
52
|
|
|
53
53
|
# tmux
|
|
54
54
|
|
|
55
|
-
Use for existing interactive tmux sessions. For one-shot commands, use normal shell.
|
|
55
|
+
Use for existing interactive tmux sessions. For one-shot commands, use normal shell. When a command must outlive a tool call, start it inside an interactive tmux session; Atomic tools do not provide background execution.
|
|
56
56
|
|
|
57
57
|
On Windows, use [psmux](https://github.com/psmux/psmux), the native Windows tmux-compatible multiplexer. psmux automatically provides the `tmux` alias, so keep using the `tmux` commands below; no command changes are needed.
|
|
58
58
|
|
|
@@ -6,8 +6,7 @@ export const SUBAGENT_CONTROL_MESSAGE_TYPE = "subagent_control_notice";
|
|
|
6
6
|
|
|
7
7
|
export interface SubagentControlMessageDetails {
|
|
8
8
|
event: ControlEvent;
|
|
9
|
-
source?: "foreground"
|
|
10
|
-
asyncDir?: string;
|
|
9
|
+
source?: "foreground";
|
|
11
10
|
childIntercomTarget?: string;
|
|
12
11
|
noticeText?: string;
|
|
13
12
|
}
|
|
@@ -52,7 +51,7 @@ function deliverControlNotice(input: {
|
|
|
52
51
|
display: true,
|
|
53
52
|
details: { ...input.details, childIntercomTarget, noticeText },
|
|
54
53
|
},
|
|
55
|
-
{ triggerTurn:
|
|
54
|
+
{ triggerTurn: false },
|
|
56
55
|
);
|
|
57
56
|
}
|
|
58
57
|
|