Orchestrate a plan or work-item list via scope-fenced worker subagents (capped waves, direct-evidence verification, main-side build/test). Use when the plan routes phases to workers, the session runs autonomously, or the user asks for workers ('dispatch to workers', 'run with subagents', 'in parallel'). Not for inline: /implementation:implement.
34 stars
0 votes
0 copies
3 views
Added September 2, 2026
ai-agentsrustgobashawstestinggitapisecurity
Works with
claude code
terminal
cli
api
Security analysis
B75/100
criticalSends environment variables or credentials to an external URL
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Implement Dispatch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/melodic-software-implement-dispatch)
---
description: "Orchestrate a plan or work-item list via scope-fenced worker subagents (capped waves, direct-evidence verification, main-side build/test). Use when the plan routes phases to workers, the session runs autonomously, or the user asks for workers ('dispatch to workers', 'run with subagents', 'in parallel'). Not for inline: /implementation:implement."
argument-hint: "[phase] [--unattended] [--items <path>] [--base <ref>] [--wave-cap <N>]"
user-invocable: true
disable-model-invocation: false
metadata:
workflow-stage: implement
summary: Orchestrate worker subagents to execute an approved plan
---
# Implement dispatch
**Arguments.** `[phase] [--unattended] [--items <path>] [--base <ref>] [--wave-cap <N>]`. e.g., /implementation:implement-dispatch phase-2 --wave-cap 3, /implementation:implement-dispatch --items findings.md --base origin/integration/billing
## Purpose
The orchestrated variant of `/implementation:implement`: same stage and plan, but the main window dispatches scope-fenced workers and verifies their returns instead of editing.
## Gates
- **One git writer per worktree, under either authority.** A worktree has one index and one HEAD, so two workers staging or committing in it at once collide. Under `worker`, where every worker stages and commits, rows that share a worktree run one at a time, whatever `--wave-cap` allows. Concurrent rows in one worktree need `orchestrator`, where the orchestrator is the only git writer (see Concurrency). (A linked worktree shares "everything except per-worktree files such as HEAD, index", per [git-worktree: description](https://git-scm.com/docs/git-worktree#_description).)
- **Verify before accepting.** Verify the return against direct evidence before accepting edits. Never accept a worker's green claim as the build signal; the orchestrator runs the build or `/toolchain:check` (if enabled).
- **Verify each phase before marking it `[DONE]`:** in every mode, dispatch the fresh-context `phase-verifier` for any phase beyond a mechanical, behavior-preserving change. A mechanical, behavior-preserving phase is the carve-out: with `verify_mechanical_phases` resolved `false` (the default), the orchestrator verifies it from the diff plus the build/test signal, and its fresh-context verdict is the PR's verify stage. Resolved `true` from any layer, the carve-out is off and the verifier runs for every phase. An orchestrator source commit made after the last phase's `[DONE]` is verified in every mode, with no mechanical exemption, before it is pushed or a PR is created. Both are defined under Phase boundaries. The `verification` level changes both dispatches: resolve it once before the first phase boundary with `bash "${CLAUDE_PLUGIN_ROOT}/lib/read-verification.sh" --plugin implementation --skill implement-dispatch --file docs/conventions/implementation.yaml` and report its line ([levels](https://github.com/melodic-software/claude-code-plugins/blob/main/docs/contracts/verification-level/README.md)). `strict` resolves `verify_mechanical_phases` `true`. `light`, and `off`, which acts as `light` here, dispatch neither verifier and write `verification: skipped (<level>)` where the verdict would go (the plan mark, the `DEVIATIONS.md` entry), never verifying inline in its place; `verify_mechanical_phases` resolved `true` overrides that and keeps the verifier on every phase.
- **Major divergence (fundamental assumption wrong) still STOPS even autonomously.** Park the run with a handoff rather than improvising a new design.
- **An `INCONCLUSIVE` return, the `phase-verifier` contract's answer when it could not decide every criterion, is not a verdict:** the phase stays unmarked, and the orchestrator re-dispatches a *fresh* verifier against the gap the return named (narrower criteria, or the specific files it could not reach), never accepting the partial coverage and never marking `[DONE]` on it; a second inconclusive return on the same criteria is an escalation, handled like a divergence report. Surface subagent results in the response before ending the turn.
## When this skill applies (vs `/implementation:implement`)
**Orchestration mode detection**. A goal/loop harness driving turns with no human in the cycle, a plan that declares itself autonomous-ready, or an explicit orchestration instruction means **autonomous**; a human reviewing each turn means **interactive**.
**Autonomous:** the main window is orchestrator only. Orchestrated cadence is the **default** even when the plan routes every phase to the main window: synthesize per-phase worker rows from the plan. A **wave** is a batch of worker rows dispatched together, each an independent brief with its own disjoint fence; it holds the current phase's rows plus the rows of any phase independent of it (see Independent phases), and rows beyond the cap run as sequential waves. Cap each wave at 3–5 concurrent rows by default, overridden by `--wave-cap` or the operator option (see Arguments), and pilot one row before a wave wider than about 4 (Dispatch cadence step 2). Rows that share a worktree are further limited by the one-writer rule (Gates).
**Interactive:** read the plan's execution-shape/routing table. Worker rows present (any surface other than main-window) → this skill's cadence for those phases. Routing table absent or all main-window → `/implementation:implement`'s inline cadence, unless `code_writing` resolves `dispatch`.
**`code_writing: dispatch`:** the interactive run writes worker rows for every phase the plan leaves to the main session, as the Autonomous rule does, and dispatches each phase in order; it never hands a phase back to the inline cadence. A written row has no plan routing, so it dispatches as `implementation:implementer` at its frontmatter binding (Dispatch cadence step 2). Chained from `/implementation:implement` Step 0, the value it reported applies; invoked directly, resolve it here (Settings) and report one line, for example `code_writing: dispatch (user option)`.
`/implementation:implement` shares this detection at its Step 0 and chains here; invoking this skill directly with a worker-routed plan is equivalent.
## Settings
Each key below resolves once per run from three layers, lowest first: the default; the user's option (a literal, unexpanded placeholder means unset); and the key in the repository's `docs/conventions/implementation.yaml`, which wins when set. Read the repository file only when the repository root (`CLAUDE_PROJECT_DIR`, else `git rev-parse --show-toplevel`) is inside a git working tree and is neither `$HOME` nor an ancestor of it; otherwise skip that layer and say so. A value outside the key's values is named with its file or option, the key and the value, and that layer is dropped: a valid higher layer still wins, otherwise the key takes its default, never a lower layer's value. Check each key on its own. Report one line per key with its layer, for example `drain_cadence: batched (user option)` or `competing_attempt_count: 3 (default)`. Rules and schema: [`${CLAUDE_PLUGIN_ROOT}/reference/config.md`](${CLAUDE_PLUGIN_ROOT}/reference/config.md), [`${CLAUDE_PLUGIN_ROOT}/schemas/implementation.schema.json`](${CLAUDE_PLUGIN_ROOT}/schemas/implementation.schema.json).
| Key | User option | Values (default first) | Used in |
|---|---|---|---|
| `code_writing` | `${user_config.code_writing}` | `inline`, `dispatch` | When this skill applies |
| `drain_cadence` | `${user_config.drain_cadence}` | `on-arrival`, `batched` | Dispatch cadence step 2 |
| `competing_attempts` | `${user_config.competing_attempts}` | `suggest`, `off`, `auto` | Competing attempts |
| `competing_attempt_count` | `${user_config.competing_attempt_count}` | `3`, or a whole number from 2 to 5 | Competing attempts |
| `verify_mechanical_phases` | `${user_config.verify_mechanical_phases}` | `false`, `true` | Gates, Phase boundaries |
| `native_suggestions` | `${user_config.native_suggestions}` | `on`, `off` | Routing |
**`verify_mechanical_phases` is a floor**, not a later-layer-wins value: `true` in any layer resolves `true`, so a repository `false` never switches off a user's `true` and a user `false` never switches off a repository's `true`. Read the repository layer from the checkout and, when it resolves, from the default branch's committed copy (`git show origin/HEAD:docs/conventions/implementation.yaml`). An invalid value in either layer counts as unset, so with no other `true` it falls back to `false`. Resolve it before the first phase boundary and report the value and the layer that supplied `true`, or `default`, for example `verify_mechanical_phases: true (docs/conventions/implementation.yaml)`.
## Boundary, the bundled `batch` skill
Both fan work out to parallel agents in isolated worktrees, so "run this in parallel" can reach for either.
- **`/batch` (bundled skill)**: takes an `<instruction>`, decomposes the change into independent units, and once the person approves its plan, spawns one background agent per unit in its own worktree; how a unit ends is read live from the `/batch` row in [reference/native-batch.md](reference/native-batch.md). Reserved for the person to run; the model does not invoke it.
- **This skill (marketplace plugin).** Executes an already-approved plan's phases, or a spec'd item list: scope-fenced briefs, capped waves, return verification against direct evidence, the main-side build gate, the phase-verifier, and divergence routing.
**Lever check before a fan-out.** Before composing worker rows that apply one change across several units, and before the `/batch` offer below, invoke `/discipline:script-the-deterministic-work lever-check <block summary>` (if enabled) via the Skill tool, and ask it whether one run of the lever covers every unit. When it is not available, apply its `deterministic` rule (a lever only when each unit's edit follows from that unit's text alone) and say in one line that the check ran on `deterministic` because the discipline skill was unavailable. `build-a-lever` with `one-pass: yes` replaces the per-unit rows with one worker row that builds the lever, makes the change in one unit by hand, diffs the lever's result on that unit against the hand edit, runs the lever again on its own output for that unit and expects no diff (a lever that changes its own output cannot be rerun safely after a partial run), then runs the lever over every unit; no `/batch` offer is made for that change. `edit-by-hand`, or `one-pass: no` for the units it names, keeps one row per unit for those units.
When `native_suggestions` (Settings) resolves `off`, skip the offer below and write nothing in its place, not even a note that it was skipped or why, `--unattended` included.
**Routing.** When no approved plan or item list exists and the work is a large mechanical change that splits into independent units, offer it to the person at the prerequisite check, before any brief: If /batch is available in your session (gate basis: which settings hide it and what it needs to run are read live from the records in [reference/native-batch.md](reference/native-batch.md)) and native suggestions are on (`native_suggestions`, [Configuration](../../README.md#configuration)), you can run `/batch <instruction>` instead of or alongside this skill. With an approved plan or an item list, this skill runs. When the caller passes `--unattended`, omit the offer, write `Withheld suggestion (unattended): /batch` in the output, and do not ask; without that flag it asks. This skill never triggers `/batch` on its own behalf.
**Availability is never assumed.** Project settings can hide it, and it has requirements to run, both read live from the records named next; this section states what to do when it resolves, never that it is present. The four-part records live in [reference/native-batch.md](reference/native-batch.md).
## Arguments
`$ARGUMENTS`, an optional phase selector, `--items <path>`, `--base <ref>` and `--wave-cap <N>`, in any order. `--unattended`, anywhere in the arguments, is the caller declaring that nobody is present, consumed before the rest; it governs the `/batch` offer under "Routing".
The **phase selector** (e.g. `phase-2`) scopes the cadence to that plan phase; it does not combine with `--items`. Otherwise walk the remaining phases in order, never dispatching a later worker-routed phase past an incomplete earlier phase it is not independent of. In interactive mode with `code_writing` resolved `inline`, at the first inline-routed phase hand back by invoking `/implementation:implement` via the Skill tool, and re-enter here when a later worker-routed phase becomes current. Under autonomous mode and `code_writing: dispatch`, every remaining phase dispatches in order, independent phases together, synthesizing worker rows when the routing table lacks them.
`--items <path>`. Item-list mode: run the spec'd work items in that file instead of a plan's phases, in dependency order (tracker blocked-by edges read through the tracker seam, edges the list declares, and shared targets) rather than phase order. Each ready item is one worker row, verified against its own acceptance checks. The list shape, the order rules and the return table: [reference/item-list.md](reference/item-list.md).
`--base <ref>`. The ref every worker worktree is cut from, brought current with, and checked against before the first edit (Dispatch cadence item 10, and Commit authority's assigned worktree), such as an integration branch. Pass a remote-tracking ref so a fetch refreshes it. Absent, `<base>` is `<remote>/<default>`. A passed ref, and every branch name an item list supplies, is spliced into command text, so before any use it must consist only of `A-Z a-z 0-9 . _ / -`, must not start with `-`, and must pass `git check-ref-format --branch <value>`; STOP and report one that fails. A non-default `<base>` leaves landing to the caller, since the PR-creation route this skill hands off to targets the default branch.
`--wave-cap <N>`. An optional ceiling on **worker rows in flight at once**, counting rows from every phase in the wave. Passed, it replaces the internal 3–5 default; omitted, the operator option below applies, else the internal default. It is the single enforcement point for a caller-configured ceiling: `/work-items:work` (if enabled) passes its resolved `${user_config.work_dispatch_concurrency_cap}` here, and nothing when that key is unset. Floor a fractional value to `⌊N⌋` (`2.5` → `2`) and treat `< 1` as `1`.
**Operator wave cap.** With no `--wave-cap`, read `${user_config.implement_dispatch_wave_cap}`. A positive number there is the cap, floored and clamped the same way. The key has no manifest default, so an unset key renders as the literal `${user_config.…}` placeholder or, defensively, an empty value; either means unset and the internal default applies, never `0` and never a hard `1`. Basis: <https://code.claude.com/docs/en/plugins/manifest-reference#reference-a-saved-value>, `${user_config.KEY}` entry, which does not document how an unset key renders.
## Prerequisites (before any dispatch)
Apply `/implementation:implement`'s "Step 1: Prerequisite Check" criteria here, enumerated in place rather than by invoking that skill (its Step 0 chains back here): approved plan present (under `--items`, an approved item list; an entry missing its targets or acceptance checks is stopped on its own while the rest run, per [reference/item-list.md](reference/item-list.md)), branch correct (never the default branch), no unrelated dirty-tree changes. Chained in from `/implementation:implement` Step 0, this is already done; a direct invocation runs it before the first brief.
**Exception when edits land in a dedicated worktree the brief names** (worker-side provisioning, the autonomous work-lane, or an assigned worktree under either commit authority; see Commit authority): the *branch correct* check governs where the worker's **edits land**, not the orchestrator's checkout. The orchestrator never edits source, so it legitimately **remains on the default branch**. Under worker-side provisioning each worker discharges the invariant by materializing its branch as its **first step** (item 10) before any edit; under an assigned worktree, including every `orchestrator` run, that worktree's branch discharges it. A default-branch start therefore does not stop this preflight; only the plan-or-list-present and no-unrelated-dirty-tree checks apply to the orchestrator's own session.
Because the orchestrator stays on the default branch, **every source-touching operation it runs targets the returned worktree, never its own checkout**: return verification (step 3), the build/test gate (step 4: `main-side` means the *orchestrator* runs it, not that it runs in the orchestrator's checkout), and the phase-boundary commit (committed on the worker's branch and pushed per the commit authority) each run via `git -C <path>` or from that directory. In the default checkout they would inspect the wrong tree, or land the commit on the local default branch, off the PR branch.
## Dispatch cadence (per worker-routed phase)
1. **Compose the brief**. A worker that knows only its boundaries resolves every in-bounds ambiguity toward the literal brief instead of the outcome, so the reason (items 5 and 6) is as required as the fence. Every brief carries:
1. An explicit scope fence: ALLOWED files/actions and FORBIDDEN files/actions, enumerated. **Compose a wave's fences together before dispatching any row of it.** The rows of one wave hold mutually disjoint ALLOWED sets, measured on the file path written, not the worktree it is written from: two rows in separate worktrees writing one path still collide, at integration. Each row's FORBIDDEN list carries the paths the other rows of its wave own, since the divergence clause fires only on a FORBIDDEN touch. The brief lists the paths, never which row or worker owns them. Rows that will not split into disjoint fences run in sequential waves.
2. The divergence-escalation clause, verbatim: "if an assumption in this brief proves wrong or the task requires touching anything FORBIDDEN, STOP and report. Do not improvise", followed by "STOP means stop crossing the fence, not stop working: finish everything the fence allows, then report." This item is the clause's only owner; other text points here.
3. The project invariants the task touches, from the project's `CLAUDE.md` / rules, and the run's resolved `integration_posture` line as `/implementation:implement` Step 0 reported it (`plan governs` when an approved plan exists).
4. The phase's acceptance criteria.
5. **The reason the phase exists**: the goal it serves and what the output enables, plus the PLAN.md's absolute path in the orchestrator's checkout, where the Brief lives (none under `--items`, or when holdout tests fence the memory slice).
6. **The Brief the phase serves, verbatim from PLAN.md**: the `## Brief` section's `### Problem`, its `### Goal` (not the plan's own Goal) with the `- Intent (why, in the user's words):`, `- Vision (where this heads):`, `- When goals conflict, prefer:` and `- Finish line:` lines, its `### Out-of-scope` list, and the rows of the plan's `### Load-bearing assumptions` table the phase depends on, quoted, never paraphrased. A section the plan lacks is written `none in plan`, not treated as a gap. Under `--items` the item's own fields stand in: its `title` here and its `spec` under item 12.
7. Its **commit authority**: `worker` by default, or `orchestrator` (Commit authority says which of items 9 to 11 change under it).
8. Any model routing the plan specifies.
9. **When the worker edits in a dedicated worktree** (an out-of-tree sibling or any checkout other than the session's default): that worktree's absolute path, written literally, plus the anchoring rule in the Gotchas bullet "A worker's worktree cwd does not persist across tool calls". The interactive default is a pre-existing worktree path the brief supplies.
10. **When provisioning is worker-side** (the autonomous work-lane; see Commit authority): materializing that isolated worktree is the worker's **first step**, because the orchestrator cannot invoke `/source-control:worktree create` (if enabled), whose `EnterWorktree` terminal would transition the orchestrator's session. The worker invokes `/source-control:worktree` (if enabled) via the Skill tool for its non-entering creation seam, or a plain `git worktree add` otherwise, then runs the consumer's Workspace environment `setup` for it through the Bash tool, read from the fetched default branch and skipped when the item's input is untrusted (contract: `docs/contracts/workspace-environment/README.md` in this plugin's marketplace repository), and works in it under the item 9 anchoring, never entering it. The brief tells the worker, before its first edit, to fetch and confirm the new branch starts from the intended base (`git -C <path> merge-base HEAD <base>` equals `<base>`, with `<base>` written literally: the `--base` ref, else `<remote>/<default>`, where `<remote>` is the remote provisioning based the branch on, not always `origin`), and on a mismatch to STOP and report. Provision **once per item, on the first dispatched phase**: the worktree persists, so every **later** phase of the item is handed that same path. Never re-provision the already-checked-out item branch (`git worktree add -b <name>` and attaching the branch both fail while it is checked out). The first phase's brief also has the worker bring the branch current with `<base>`, commit, and push before returning, then **return the worktree's absolute path plus the branch name** so the orchestrator can open the PR. A worker that cannot provision an isolated worktree STOPs and reports rather than editing the default checkout.
11. **The four hygiene clauses, front-loaded**: the Gotchas bullets on bounded commands, issue-number comments, new shebang files and early push, the last two under `worker`.
12. **The phase's design excerpt**: the part of PLAN.md's `## Design` section the phase touches (its module layout, contracts, variation verdicts, and the conventions they cite), quoted verbatim, never paraphrased; the worker's worktree holds no memory slice. With no `## Design` section, or none the phase touches, the brief says `Design: none`.
13. **Existing test and check files are FORBIDDEN unless the brief sanctions the edit.** Both terms are the `phase-verifier` agent's, quoted so the brief carries them. A test or check file is "a test file, snapshot or fixture, a runner configuration or test setup file (a manifest's test script entries or runner configuration section included), a lint or hook configuration, a check script, a CI workflow, or an eval case or grader", plus any list of check files the project declares. "A change that modifies, deletes or skips an existing file of these kinds, or adds a runner configuration, setup file, check script or workflow, is sanctioned only when the dispatch explicitly authorizes it: it names that file or that change, or names changing existing tests as the phase's work. A dispatch that says only that the phase writes new tests sanctions new test files, not edits to existing ones." So when the plan names a test file as changing with the behavior it pins, or names changing existing tests as the phase's work, the brief names that file or that work. New test files stay allowed under the TDD cadence. An unsanctioned change is a verifier FAIL, not a finding; a sanctioned runner configuration or test setup change is still a finding. A worker that finds an existing test must change to pass STOPs per item 2. This fence is partial cover: read-only tests stop agents modifying tests but not special-casing the tested inputs (ImpossibleBench, arXiv 2510.20270), so the holdout option and the phase-verifier remain the rest.
14. **The no-suppression rule**: the worker fixes what a linter or type checker reports instead of adding a suppression. Only a false positive the worker has shown to be one may be suppressed, on a line that names the rule id (where the tool can name one) and gives the reason. The project's own instructions override this where they say otherwise.
15. **The structure the logic is built on**: one `Structure:` line naming the data structure the worker organizes the phase's new logic around, from the design excerpt when it names one, otherwise chosen by the orchestrator before dispatch (for refund tracking, an enum of statuses plus a table of the moves allowed between them; for regional pricing, a lookup keyed by region). A phase that adds no logic says `Structure: none`.
16. **The scratch-file rule**, because parallel workers share one session scratchpad: name each scratch file `<branch>-<purpose>`, and never run a scratch script this worker did not write in this task.
17. **The model and effort pick**, as one `Model and effort:` line. When the plan's routing row names a model, that model still wins (item 8 and step 2), the line says so, and it carries `effort: pin` (the agent definition's pin, no per-spawn `effort`). With no routing row, the orchestrator picks the effort, and a model only within step 2's cases, from the complexity stated in the Brief that item 6 quotes verbatim (under `--items`, the item's own fields), and the line names the model, the effort, and the docs row matched: the row of the model-selection matrix (its "When you need..." column) plus the row of the effort-levels table (its "Typical use case" column), the effort page's per-model recommendations winning where they differ from its table. When the Brief (or the item) states no complexity, the line carries `effort: pin` with the docs row `none`; that is not a gap under the rule below. The line invents no workload or class name and copies no table from the docs. `/multi-agent:route` (if enabled) keeps supplying each role's default, and the pick sits under the existing rules: step 2's concurrent-wave rule (no frontier tier), the route floor under Competing attempts, and the trail verifier's no per-call `effort` rule all stay in force above it. The model pick never goes below the implementer binding (step 2): only the effort may vary, plus the upward model step 2 already allows (a security-surface or plan-declared frontier routing, or a session model above the binding); complexity alone never raises the model. The orchestrator passes a per-spawn `model` only where step 2 already passes one, and a per-spawn `effort` only when the picked effort differs from the agent definition's pin, since a per-spawn `effort` overrides the `effort` pin in the `implementer` and `scoped-implementer` agent definitions.
- **Pointer**: for the model choice, see <https://platform.claude.com/docs/en/about-claude/models/choosing-a-model#model-selection-matrix>; for the effort choice, see <https://platform.claude.com/docs/en/build-with-claude/effort#effort-levels>; for the per-spawn `effort` setting and how it relates to the agent's own pin, see <https://code.claude.com/docs/en/sub-agents#choose-an-effort-level>.
18. **The test-first line**, as one `Test-first:` line: for each behavior the phase adds or changes, write one failing test, run it and see it fail for the expected reason, then write the smallest correct code that makes it pass, one test at a time (`/implementation:implement` Step 2's cadence), and return the failing run's output beside the passing run. When the project declares another testing cadence, the line names that cadence instead; a phase with no testable logic (docs, config, pure wiring) says `Test-first: none (<reason>)`.
19. **The review criteria the phase is built to**, as one `Review criteria:` line: the paths of the review-criteria files the phase's paths match, read from the plan's "Standards grounding" table, else from the repository's review-criteria index (`docs/review/README.md` at the resolution root, as the standards contract's "Review-criteria index" paragraph directs, [Resolution ladder](https://github.com/melodic-software/claude-code-plugins/blob/main/docs/contracts/standards/README.md#resolution-ladder)), so the worker reads them before its first edit. With no index, or no row the phase's paths match, the line says `Review criteria: none`.
20. **The observability line**, as one `Observability:` line: when the phase adds or changes code that runs at runtime (a service, handler, worker, CLI, hook or script), the absolute path of [`${CLAUDE_PLUGIN_ROOT}/reference/observability.md`](${CLAUDE_PLUGIN_ROOT}/reference/observability.md), which the worker reads before its first edit and writes the phase's logging, telemetry and error handling by. A phase with no runtime code says `Observability: none (<reason>)`.
21. **The language idioms line**, as one `Language idioms:` line: when the phase declares or changes a type, the worker resolves that language's idioms by `/implementation:implement` Step 2's "Language idioms (type decisions)" rule, reading the absolute path of [`${CLAUDE_PLUGIN_ROOT}/reference/ecosystem-resolution.md`](${CLAUDE_PLUGIN_ROOT}/reference/ecosystem-resolution.md), and returns each `language idioms:` line that rule requires, verbatim. A phase that declares or changes no type says `Language idioms: none (<reason>)`.
**One recipe, one file.** When several workers apply one recipe (one change, its check and its do-not-touch rules, fanned out across units), the recipe lives in one file outside every worker's ALLOWED set and on each brief's FORBIDDEN list, and each brief points at that file's absolute path instead of copying it. A copy per brief drifts as briefs are edited one at a time, and a worker that can edit the recipe changes it for every other worker mid-wave. The test that applies it: two or more briefs in a wave would carry the same steps (pstack's `build-the-lever` principle).
**Do not dispatch a brief with a gap.** When the plan, the Brief and the design give no answer for an item above and none can be derived, hold that row back, never sending it with the item blank or guessed. Report the unit as unscoped, naming each item you could not fill, and route it as a divergence (step 5). An item that does not apply, such as item 9 with no dedicated worktree or item 12 as `Design: none`, is not missing.
2. **Dispatch** each worker by its phase's routing row, the `Model` column. Never rely on root inheritance, and never dispatch source-editing work through a generic subagent type, a no-commit plan included. A worker runs where this session runs; this skill starts no worker on another host (cloud placement is chosen per work item before this skill starts, by the execution-target contract, `docs/contracts/execution-target/README.md` in this plugin's marketplace repository).
- **No row, no `Model` value, `opus`, or any value not listed here**: `implementation:implementer`. Its `model` frontmatter binds the strong tier's current alias, so an unqualified dispatch needs no per-call `model`. For how the harness resolves that binding, see [sub-agents: choose a model](https://code.claude.com/docs/en/sub-agents#choose-a-model) and [run every subagent on one model](https://code.claude.com/docs/en/sub-agents#run-every-subagent-on-one-model).
- **`sonnet`**: first read the provider with `printenv | grep -E '^(CLAUDE_CODE_USE_(BEDROCK|VERTEX|FOUNDRY|ANTHROPIC_AWS|MANTLE)|ANTHROPIC_DEFAULT_SONNET_MODEL)='`. When a `CLAUDE_CODE_USE_BEDROCK`, `CLAUDE_CODE_USE_VERTEX`, `CLAUDE_CODE_USE_FOUNDRY`, `CLAUDE_CODE_USE_ANTHROPIC_AWS` or `CLAUDE_CODE_USE_MANTLE` value is non-empty and `ANTHROPIC_DEFAULT_SONNET_MODEL` is unset or empty, the unpinned `sonnet` alias is not trusted on that provider: dispatch `implementation:implementer` instead. Otherwise dispatch `implementation:scoped-implementer` with an explicit per-invocation `model: sonnet`, so a caller's standing per-spawn model rule (a "pass `model: opus` on every spawn" rule) cannot apply. Downward routing happens only this way.
- **`frontier`, or security-surface work whatever the row says** (scope: `docs/contracts/loop-lane/README.md` §3 in this plugin's marketplace repository): `implementation:implementer` at the frontier tier's current alias, per the next rule.
Pass `implementation:implementer` a per-invocation `model` only to route **upward**: security-surface work or plan-declared frontier routing dispatches at the frontier tier's current alias, and a run that cannot resolve that alias STOPs (autonomously: escalates) rather than dispatching lower; a session whose own model resolves above the binding may pass that model to a single dispatch. Never pass a `model` that undercuts the frontmatter binding for source-editing work.
**A concurrent wave never runs on the frontier tier.** When more than one `implementer` or `phase-verifier` will run at once and the session model or the upward route resolves to the frontier tier (`fable`, or `best` where the running Claude Code resolves it to Fable), every agent in that wave runs at `opus`: pass `model: opus` explicitly, or keep the `opus` frontmatter pin and pass no raise. The frontier tier is allowed only on a single, sequential dispatch: one security-surface or frontier-routed implementer at a time with its one verifier, and a single final verification. A phase that needs the frontier tier runs alone, as a wave of one; a security-surface row leaves its wave and runs alone rather than dropping to `opus`, and never raises the rest of the wave. Alone means no other frontier-tier agent is in flight; the wave's `opus` rows may run beside it. This follows rule 2 of the marketplace's `docs/plugin-philosophy.md` "Capability tiers". For generic (unnamed-agent) dispatch routing and a configurable fan-out guard, invoke `/multi-agent:route` (if enabled); without it, this rule stands on its own. **Pointer**: when checking which Claude Code releases resolve `best` to Fable, fetch [model config: version history](https://code.claude.com/docs/en/model-config#version-history) live.
- **Pointer**: for the subagent model resolution order, see <https://code.claude.com/docs/en/sub-agents#choose-a-model>; for what the `sonnet` alias resolves to per provider, see <https://code.claude.com/docs/en/model-config#model-aliases>; for the provider variables, see <https://code.claude.com/docs/en/env-vars#variables>. When an operator override from the resolution-order section is set, report it in the run summary: it is an operator choice, not a reason to refuse dispatch.
**Pilot a wide wave.** Before a wave wider than about 4 rows, dispatch one row alone, wait for its return, and confirm plan usage remains (the return carries no usage-limit error, and any usage reading the session has shows room for the rest) before dispatching the others. A usage limit hit mid-wave stops every worker at once.
Dispatch a wave, up to the cap's rows from the current phase and the phases independent of it, and keep working while it runs: verify returns as they arrive, compose the next brief, and run the build/test gate on accepted returns, except under commit authority `orchestrator` in a shared worktree, where the gate runs after the wave settles (see Concurrency). Rows in a shared worktree dispatch one per wave unless commit authority is `orchestrator` (Gates). Intervene when a worker goes off track or is missing context. Do not block on the slowest worker before starting orchestrator-side work that does not depend on it.
**`drain_cadence`** (Settings) decides when a return is read. `on-arrival` is the paragraph above. `batched` is for long programs of many waves: a return that arrives while the orchestrator is composing a wave's fences, running a build/test gate, or making a phase-boundary commit waits in a queue until that step ends; read all of the queue at phase end, before the phase is marked `[DONE]`. A queued return is unread, not accepted: once read it goes through item 3 and the build gate like any other. The cadence never changes the wave size.
3. **Verify the return against direct evidence before accepting edits**. Worker returns are synthesis, not ground truth; promote their claims to direct evidence (diff read, grep, file Read) before building on them. Under commit authority `orchestrator` the return is an uncommitted tree; read it as Commit authority describes. A return whose diff makes a change to a test or check file that item 13 does not sanction fails verification: list the touched paths from the diff yourself (`git -C <path> diff --name-status <phase-start>` plus the untracked files `git -C <path> status --porcelain --untracked-files=all` shows, where `<phase-start>` is the previous phase-boundary commit on that branch, or for its first phase the commit the branch was created from, so earlier phases' sanctioned edits are not graded again), and revert or re-brief, never accept and build on it. This check runs on every return, mechanical phases included; the `phase-verifier` applies the same rule again at the phase boundary (Phase boundaries). For an unattended run, recommend the operator enable the `testing` plugin's `test_guards_enabled` option. Its hook adds a note to the agent's context when an Edit or Write to a test file removes test blocks or assertions, adds a skip, or changes an expected literal; with `rules: {test-weaken-block: error}` in the testing config it also denies an added skip or a removed test block unless the new text adds a `test-change: <reason>` marker, which the agent can write itself. It never asks. Record the recommendation in the run's output when the option is off
4. **Build/test main-side**. Invoke `/toolchain:check` (if enabled) via the Skill tool from the main window, otherwise run the project's own build/test command main-side; never accept a worker's green claim as the build signal. When edits land in a dedicated worktree, run it against that worktree (`git -C <path>` or from that directory), not the orchestrator's checkout. Inside a span the plan declares with a `**Planned breakage:**` line (`/implementation:implement` Step 2, Execution cadence item 5), the gate passes only when every failure beyond those recorded at the span's start lies in the declared paths or test filter, and only for the declared kind; any other failure fails the gate. Brief the worker with the declaration verbatim, and grade its return against it, never against a wider reading
5. **Route worker divergence reports into `/implementation:implement`'s "Step 3: Divergence Detection"** ladder. A worker STOPping per the divergence clause is a divergence signal, severity-assessed the same way; the orchestrator revises the brief or routes back to planning (`/planning:plan review` (if enabled)). Record what does not stop the worker as well: every `problems:` entry that is not a STOP, every `open_questions:` entry (a request to widen the fence), and every `discoveries:` entry. An autonomous run appends each to `DEVIATIONS.md`, typed per "Divergence in non-interactive runs": a discovery as `discovery`, an `assumption-confirmed` discovery as `plan-confirmed`. An interactive run brings them to the user through `/implementation:implement` Step 3.5. A discovery that falsifies a load-bearing assumption is a divergence, assessed on the Step 3 ladder
### Independent phases
Two phases are **independent** when the approved plan's Execution shape puts them in the same parallel wave (its Recommended shape, derived from no edge between them in its dependency graph and no overlap in its file-overlap matrix). Independent worker-routed phases dispatch in one wave by default, without the user asking: the user approved that shape with the plan. A plan whose shape is sequential, or that records none, runs its phases in order, and a phase selector still scopes the run to one phase. In interactive mode an inline-routed phase never joins a wave; it runs when it becomes current.
Every rule that binds one phase's wave binds a cross-phase wave, counted over all its rows:
- **Fences.** Compose every row's fence together (item 1.1). A row whose ALLOWED set overlaps another phase's row contradicts the plan's file-overlap matrix: the later phase leaves the wave and runs after, and a non-interactive run logs that as a deviation.
- **One writer.** Rows of different phases that share a worktree follow Gates. Under worker-side provisioning an item's phases share its one persisted worktree and writer, so they run in order: provisioning cannot combine with commit authority `orchestrator`.
- **Cap, pilot and tier.** The wave cap, the wide-wave pilot and the frontier-tier wave rule count every row in the wave.
- **Per-phase gates.** Each phase keeps its own brief contents (acceptance criteria, reason, design excerpt), build/test gate, `phase-verifier` and phase-boundary commit, run as soon as that phase's rows settle, without waiting for siblings. Under `orchestrator` in a shared worktree, the gate runs after the wave settles, each phase's `phase-verifier` gets only the diff and untracked files inside that phase's fences, and the orchestrator commits each phase separately, attributing paths by fence.
- **Residency.** A phase boundary reached while another phase's rows are in flight is resident: any clear that Resident-vs-clear calls for waits until the whole wave settles and its returns are verified.
- **Divergence.** A Major divergence in one phase stops further dispatch (Gates); rows already in flight finish and are verified before the run parks.
- **Competing attempts.** A phase that runs competing attempts runs alone in its waves, because its chosen attempt lands by fast-forward from the commit the phase started at; its independent phases run before or after it.
**Agent teams.** A phase not routed to a team never runs as one, so a sub-agent row is dispatched without a `name`: with teams enabled, a named call can launch a teammate. A phase whose routing row's surface is an agent team: read [reference/agent-teams.md](reference/agent-teams.md) before dispatching it.
### Operator hold
An operator instruction to stop writing, whatever its wording (hold, pause, stand down), binds the whole run: the main window and each worker, attempt and verifier it dispatched.
When such an instruction arrives, read [reference/operator-hold.md](reference/operator-hold.md) and follow it at once.
### Commit authority
Every brief states **commit authority**: `worker` (the default, and what an absent field means) or `orchestrator`. Declare `orchestrator` when the plan's worker fence forbids staging, committing, or pushing, when the orchestrator owns a commit-subject gate, or when the plan has a push-once rule. Write the field into the brief; the worker never infers it from a fence. A worker handed a fence that forbids those writes with no declared mode STOPs and reports the conflict; a fence that forbids only a narrow action (a force-push, opening the PR) leaves the mode at `worker`. A no-commit plan therefore needs no fenced generic subagent: the implementer honors the mode and keeps its tier binding.
Worktree sharing follows the one-writer rule in Gates. This skill provisions no per-row worktrees except competing attempts, which hold `worker` authority, commit locally and never push; a phase whose rows must run concurrently under `worker` is a plan question, not a dispatch-time split.
Under `orchestrator`:
- **Worktree.** The brief carries an assigned worktree path. Worker-side provisioning cannot combine with this mode, because a provisioning worker must commit and push before returning; a brief asking for both makes the worker STOP. The orchestrator creates the worktree itself from `<base>` (a non-entering `git worktree add`, or the project's own tool), confirms its base as item 10 states, and hands over the path.
- **Brief.** Omit the commit-and-push-early clause, and shrink the exec-bit clause to `chmod +x <path>` plus listing the file in the return. The worker never runs `git add`, `git commit`, `git push`, `git stash`, or any other index or ref write; it returns `git -C <path> status --porcelain --untracked-files=all` output in place of a commit sha.
- **Verification.** Step 3 reads the uncommitted tree with `git -C <path> status --porcelain --untracked-files=all`, `git -C <path> diff HEAD`, and `git -C <path> ls-files --others --exclude-standard`; a plain `git diff` misses untracked files. The build/test gate runs on that tree. The phase-verifier gets the worktree path plus the base ref and is told the changes are uncommitted, so it reads untracked files with `status --porcelain --untracked-files=all` or `ls-files --others --exclude-standard` as well as `git diff <base>`, or gets the diff itself: `diff HEAD` output plus the content of every file `ls-files --others --exclude-standard` lists (plain `status --porcelain` collapses a new directory to one entry).
- **Commit.** The orchestrator commits in the assigned worktree via `git -C <path>`, never in its own checkout, at the phase boundary: the phase's source in one commit, under the project's commit convention and gate, staging each listed shebang file in the order the Gotchas bullet "New shebang files need `chmod`" gives. It pushes per the plan's push rule, and as under `worker` when the plan states none. Commit as soon as the phase is accepted: until then the work exists only on local disk. When the commit gate is one only the user can pass, follow `/implementation:implement` Step 4 item 3: plan marks and status summary first, then hand the commit to the user, and write the handoff last.
- **Concurrency.** The orchestrator is the only git writer, so this is the one mode where several rows may share a worktree. Prefer one worker per worktree at a time. When several must share one, up to the wave cap, give them disjoint fences, let none stage, attribute returned paths by fence, and run the build/test gate only after the wave settles.
### Competing attempts
A phase the plan marks `multi-shape` in its routing table's `Attempts` column has more than one plausible shape the design left open; its body lists one constraint per attempt and a selection rule. Competing attempts build several of those shapes in separate worktrees and keep the one the rule picks. An unmarked phase gets one attempt under every setting. `competing_attempts` and `competing_attempt_count` resolve per Settings.
When a marked phase is about to dispatch and `competing_attempts` is not `off`, read [reference/competing-attempts.md](reference/competing-attempts.md): the modes, wave cap, model, worktrees and briefs, verdict and selection, landing and cleanup.
### Holdout acceptance tests (opt-in)
Off unless the plan's execution shape or the user turns it on for the run; never enable it on your own. When on, read [reference/holdout-tests.md](reference/holdout-tests.md) before the phase's first wave and follow it.
## Divergence in non-interactive runs
With no human to escalate to, stop-and-escalate on Moderate divergence deadlocks the run. There: pick the conservative option, the one truest to the plan's intent (the Brief's `- Intent (why, in the user's words):` line) with the smallest blast radius, log it to a `DEVIATIONS.md` beside the plan artifact at deviation time (what was planned, what was done instead, why, blast radius), and keep going; the log is the escalation, reviewed at PR time.
A non-interactive run, or an interactive one that opts into the log, reads [reference/non-interactive-divergence.md](reference/non-interactive-divergence.md) before its first `DEVIATIONS.md` entry: the log's rules and its entry types. Every run, with or without an entry, reads its **Trail review** paragraph before Step 5.
## Phase boundaries
**The ritual scales with residency.** A boundary where the orchestrator clears, where a model or domain switch is pending, or where the run ends runs `/implementation:implement`'s "Step 4: Task Tracking and Phase-Boundary Handoff" ritual in full: plan marks, status summary, the commit, then the handoff entry with its resume prompt, last. A resident boundary (see Resident-vs-clear) runs only the durable part: the acceptance verdict and plan marks (Step 4 item 1), a `DEVIATIONS.md` entry for the boundary when the run keeps that log (every non-interactive run does), and the commit (item 3). The handoff entry, status summary and resume prompt exist for a session that restarts cold; the plan marks plus the deviations log are what a crashed run resumes from.
**The phase-boundary commit carries source only**: the plan and the deviations log are self-ignored memory-slice files and never enter a commit. A worker that already committed and pushed its source early leaves the boundary with nothing to commit, only plan marks to update in place. Under commit authority `orchestrator` the boundary commit carries the source and is pushed per the plan's push rule. Under worker-side provisioning the phase's commits land on the worker's branch, committed in the returned worktree via `git -C <path>` **and pushed**, never in the orchestrator's default checkout; the push keeps the worktree tip in sync with the remote, which the HEAD-equals-remote precondition of `/source-control:pull-request create --pushed` (if enabled) requires. When marking changes the plan, refresh its paste in the pull request body or the linked issue, before the next push or after the last push's CI run has finished, never right after a push (`/implementation:implement` Step 4 says why).
**Phase-boundary review before the verifier.** A phase tagged `Review: architecture`, `security`, `code-design` or `concurrency` runs `/implementation:implement` Step 4 "Phase-boundary review, before the ritual" (its tag-to-mode table and sequence) once its returns pass the build/test gate and before its `phase-verifier`, which stays last, and before the boundary commit. Each tag runs `/review:quality-gate <mode> --worktree <returned worktree path> --base <previous phase-boundary commit on that branch, or for its first phase the commit the branch was created from> --report-only` (if enabled); otherwise a fresh-context subagent handed only the phase diff against the same `--base`, the tag and the gate's CRITICAL, IMPORTANT and SUGGESTION scale reviews it, so the sequence runs unchanged, and a `DEVIATIONS.md` entry and Step 5's report say the `review` plugin would run that review. The gate run adds `--quality-bar <value>` when the plan has a `Quality bar:` line; the mode is the tag's own name, except `concurrency`, which runs `slice concurrency`. The fix goes out as one fix brief under the phase's own fence (Gotchas "Dispatch one fix brief per head"), its return verified and gated like any other. The gate's `git -C <worktree>` reads run under the same permission posture this skill already relies on for its own `git -C <path>` reads of worker worktrees; no allow rule is added for them. When an unattended run's permission mode denies those reads, the review did not run: append a `discovery` entry marked `unverified` naming the phase and tag to `DEVIATIONS.md`, list that phase and tag as not reviewed in Step 5's report, continue to the `phase-verifier`, and never retry the review in another shape.
**Fresh-context verifier before marking a phase `[DONE]`:** in orchestrated runs the Step 4 item 1 verdict is *dispatched*. Dispatch this plugin's `phase-verifier` agent (subagent type `implementation:phase-verifier`; its `model` frontmatter binds it at least as capable as the implementer it checks) to check the phase's acceptance criteria against the actual diff, handed binary criteria and the diff with your rationale withheld, plus the brief's item 13 sanctions verbatim (the files or changes it names, or that changing existing tests is the phase's work; `none` when it names none), plus, when holdout tests are on, their path and run command. Create a throwaway worktree for it, never a worker's, removed after the verdict, holding the full phase state, uncommitted and untracked changes included (under commit authority `orchestrator` the phase is an uncommitted tree): `git -C <path> worktree add --detach <tmp> HEAD`, then `git -C <path> diff --binary HEAD | git -C <tmp> apply`, then `git -C <path> ls-files -z --others --exclude-standard | tar -C <path> --null -T - -cf - | tar -C <tmp> -xf -`. Hand over its path whenever holdout tests are on or the phase diff touches a test or check file item 13 fences (an existing one, or an added runner configuration, setup file, check script or workflow): the verifier re-runs the affected checks there with those paths restored from base, and with no throwaway worktree it can only report that the re-run was not possible. Frontmatter binds a floor and cannot follow a phase routed upward, so when the phase's implementer ran above that binding (the frontier alias for security-surface work, or a session model above it), pass that one verifier a per-invocation `model` at or above the model the implementer ran on (the checked-work row of the ladder in the marketplace's `docs/plugin-philosophy.md` "Capability tiers"). Upward only. Inside a wave held at `opus` the verifier's `opus` binding already meets this rule; a phase that needs a frontier verifier runs alone. Where the phase's outcome is high-stakes and correlated blind spots are the risk, prefer a cross-vendor advisor for that verifier **when one is enabled and set up** (e.g. the OpenAI Codex plugin, when its documented surface can take this artifact, invoked per its own docs), with the fresh-context same-vendor verifier as the stated fallback, never a route to a command that may not resolve (`docs/plugin-philosophy.md` "Fresh-eyes checkpoints"). It applies in every mode: dispatch it for any phase beyond a mechanical, behavior-preserving change, and, unless `verify_mechanical_phases` resolves `true`, verify a mechanical, behavior-preserving phase from the diff plus the build/test signal. A `light` or `off` verification level skips this dispatch as Gates says. The verifier does not substitute for implement Step 5's end gate. When the phase lies inside a declared planned breakage span, hand the verifier the `**Planned breakage:**` line with the criteria: a red step passes that criterion only when every failure lies in the declared paths or test filter, any other failure is a FAIL, and the phase that closes the span (Phase `<M>`) must show the declared failures green. An inconclusive return is not a verdict (Gates).
**A verdict holds for one head SHA.** Record each phase verdict, the verifier's or the orchestrator's mechanical-phase one, with the head SHA it judged, in the plan mark and in the boundary's `DEVIATIONS.md` entry when the run keeps that log. Under `orchestrator` the verifier judged an uncommitted tree, so record the verdict against the phase-boundary commit that captures that tree unchanged. A rebase, restack or any other new commit on the branch before the phase is marked `[DONE]` voids the verdict: rerun the build/test gate, verify again on the new head SHA, and mark `[DONE]` only on a verdict recorded against the current head.
**Fresh-context verifier for a post-phase source commit:** an orchestrator source commit made after the last numbered phase's `[DONE]` and before the push or PR gets the same `phase-verifier` dispatch, with no worker. The diff is the commit against the last phase-boundary commit; the binary criteria are the commit's stated purpose plus any Brief outcome criteria it touches. Rationale is withheld, the model binding and `INCONCLUSIVE` handling are as above, and it applies in every mode. The verdict comes back before the commit is pushed or a PR is created. Docs-only commits are exempt. A `light` or `off` verification level skips this dispatch as Gates says.
### Resident-vs-clear at phase boundaries
The orchestrator stays resident across phase boundaries by default. Clear and resume from the emitted prompt only when one of these holds:
- **(a) The harness or operator signals a heavy window**: a compaction notice, a context-usage line, or the user saying the session is heavy. Route the next step with `/session-flow:workflow` (if enabled), handing it the PLAN.md path and the next phase; clear and resume from the emitted prompt when it routes there. Do not poll your own context statistics; a budget reading is not a decay signal (see `/implementation:implement` Step 4, "Mid-phase")
- **(b) The next phase is inline-routed** per the routing table (it wants a fresh window for its own reads)
- **(c) A model/domain switch is pending** for the next phase
A clear gets the full Step 4 ritual, ending in the resume prompt; a resident boundary gets the plan marks, the deviations entry, and the commit. In autonomous mode a boundary is not a stopping point: unless (a), (b), or (c) calls for a clear, dispatch the next phase in the same turn. Otherwise stop only on Major divergence, when blocked on something only the human can supply, or before a destructive, hard-to-undo, or outward action the plan does not cover. Without session-flow, see the pointer below.
- **Pointer**: for what to do when the window fills, see <https://code.claude.com/docs/en/context-window#when-your-context-fills-up>.
## Integration with workflow
| Condition | Action |
|-----------|--------|
| Phase is inline-routed (main-window), interactive mode | Hand back by invoking `/implementation:implement` via the Skill tool (classic cadence) |
| Phase is inline-routed or routing table absent, autonomous mode | Synthesize a worker row with no `Model` value (so `implementation:implementer`) and dispatch; the orchestrator never does volume edits |
| Worker divergence report | Severity-assess per `/implementation:implement`'s "Step 3: Divergence Detection"; Major → `/planning:plan review` (if enabled) via the Skill tool |
| Every worker return | Verify against direct evidence, then invoke `/toolchain:check` (if enabled) via the Skill tool main-side (else the project's own build) |
| Phase sanity check passes | A `Review:`-tagged phase first gets its phase-boundary review (Phase boundaries); then `/implementation:implement`'s "Step 4" ritual (its item-1 verifier gate applies in every mode; orchestrated runs dispatch it, see Phase boundaries) |
| All phases complete | Invoke `/implementation:implement` via the Skill tool for its "Step 5: Completion and Handoff", handing it the PLAN.md path (none under `--items`; outcome verification is that step's `/verification:confirm` (if enabled) route) and each `language idioms:` line a worker returned, which its completion reply repeats. A source commit made after the last phase's `[DONE]` first gets the post-phase verifier; an autonomous run then gets the trail review |
This skill does not edit inline (the inline cadence, commit discipline and mode context files are `/implementation:implement`'s) and does not create or revise plans.
## Next
- Coverage of the change not yet planned: `/testing:plan`.
- Tests written during the work, their quality unchecked: `/testing:audit`.
- A runtime-affecting change (UI, API, service, hook, script): `/testing:run-e2e`.
- Tests planned, checked and green: `/review:quality-gate`.
## Related
- Interactive inline implementation: /implementation:implement.
- Major divergence requiring replan: /planning:plan.
- Role model and effort routing: /multi-agent:route.
- Main-side build and test gate: /toolchain:check.
- Outcome verification after review: /verification:confirm.
## Gotchas
- **Before acting on a gate result, decide whether the worker or the check is at fault.** When correct code fails the check, or a criterion contradicts the plan, the check is the defect: fix it in a separate change reviewed by itself, and do not let the phase that tripped it relax it or let any worker diff route around it. When the check is sound but the return passed without doing the work, reject the return. Typical shapes: the exact values the check feeds in are special-cased in the code, an exact assertion was loosened, or a criterion's words are met while its intent is not. Brief the phase again with the criterion restated so that shortcut no longer passes
- **A worker STOP is a divergence signal, not a failure.** Route it through `/implementation:implement`'s Step 3 ladder; revising the brief is the cheap fix, a plan review the escalation
- **A worker's worktree cwd does not persist across tool calls.** Brief every dedicated-worktree worker to anchor every command, edits and git status/add/commit/diff/log, on the worktree's literal absolute path: `git -C <literal path>` for git, absolute paths for every other command, one plain command per call. No `VAR=` prefixes, loops, `$( )` or `cd` (a `cd` into the worktree itself included): a one-time `cd` does not persist, and those shapes leave the permission fast path, where a headless worker is blocked (Basis: <https://code.claude.com/docs/en/permissions#read-only-commands>). A command that reads its configuration from the working directory runs through its own directory flag with the literal path or by the wrapper's absolute path when the wrapper finds the repository from its own location; a command with neither is left to the orchestrator's main-side gate
- **Bound every command that can block.** Brief every worker to prefix each command that can block (tests, scripts, a nested `claude -p`, network calls) with a timeout such as `timeout <secs>`, to record a timeout as a FAIL, and never to run an interactive command. Nothing else in a brief bounds command time
- **No issue-number back-references in code comments.** Brief every worker that a comment citing an issue number (`# Issue #NNN ...`, `(issue #NNN obs #N)`) trips a comment-hygiene check where the project runs one, such as this marketplace's `comment-hygiene`; `TODO(#issue)` is the sanctioned exception
- **New shebang files need `chmod`, then `git add`, then `git update-index --chmod=+x`. In that order.** Brief every `worker`-authority worker (for `orchestrator`, see Commit authority): `chmod +x <path>`, then `git add <path>` (`git update-index --chmod=+x` fails on a path not yet staged), then `git update-index --chmod=+x <path>` to force the index mode (skip symlinks, staged `120000`, which fail the same command). A shebang file staged non-executable trips an executable-bit check where the project runs one, such as this marketplace's `exec-bit`
- **Push early, before waiting on CI. But never the PR.** Brief every `worker`-authority worker to commit and push as early as practical, so a mid-session death never orphans unpushed work. This is a source-only checkpoint commit; the phase-boundary ritual still runs orchestrator-side once the acceptance criteria are verified. PR creation stays out of every worker brief: it happens in the orchestrator's post-verification flow (`/implementation:implement` Step 5). The early push holds only before the pull request exists: brief a worker dispatched onto an open pull request (a later phase, a fix) to commit as it goes and push once, after its whole change set passes its checks (what a push starts or cancels: [control workflow concurrency](https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/control-workflow-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run)). Commit authority `orchestrator` forgoes the early push. Inside a declared planned breakage span the early push may carry a red commit only before the pull request exists, and its check is "passes except the declared failures"; once the pull request is open, push only a green tree. A worker that waits on CI waits with `run_in_background` or Monitor, never a foreground `sleep` or `until` loop or `--watch`. Never wait with `pgrep -f` on a pattern the waiting command itself contains; poll the PID with `kill -0` or use Monitor, and brief the worker to stop its own background waits before it returns. Brief it to read the wait's time-limit rules live from the pointer below, set each wait's timeout explicitly, sized to how long that CI run usually takes, and never read the end of a wait as a CI result: it checks the run's state and waits again while CI is still going (Pointer: <https://code.claude.com/docs/en/tools-reference#time-limit-for-background-commands> and <https://code.claude.com/docs/en/tools-reference#monitor-tool>).
- **Dispatch one fix brief per head, after everything on that head has finished.** On an open pull request, do not dispatch a fix brief while a check or review lane on the current head is pending. Wait (a bounded background wait, per `/source-control:pull-request` (if enabled) monitor, otherwise on the head's checks and threads directly, saying once that the `source-control` plugin would run that monitor), then collect every finding at once: failing checks with log excerpts, all unresolved review threads, and the verifier's failed criteria. Send one brief that lists them together, have the worker push once, and dispatch another only if the new head produces new findings
- **Scope-fence drift applies to agent returns.** Every worker return is a decision boundary. Classify proposed follow-ups per `/implementation:implement` "Step 3.5: Scope-fence drift detector (run at every decision boundary)" before announcing them
- **The capability-tier binding lives in agent frontmatter. Don't undercut it.** Workers dispatch as `implementation:implementer`, or as `implementation:scoped-implementer` for a plan-routed `sonnet` phase, and phase verifiers as `implementation:phase-verifier`; a generic subagent type inherits the orchestrator's model, which under a fast orchestrator root silently runs implementers at orchestrator strength. Where `CLAUDE_CODE_SUBAGENT_MODEL` sits against the per-invocation parameter and the frontmatter is read live from the subagent model resolution order (record in Dispatch cadence step 2). An operator override from that resolution-order section can still win over the binding; report it when it is set rather than refusing to dispatch