/task-orchestrator:run-wave [ancestorId | itemIds] [--method A|B] [--mode shared|per-item] [--worktree <path> --branch <name>] [--resume <runId>] [--altitude-safe]from task-orchestrator
Executes a multi-item wave of MCP work items through a generated run plan. Resolves ready/resumed items, derives per-item seat stages from schemas, opens a server run, and dispatches via Workflow or direct Agent. Use when told to run/launch a wave or resume a run.
Ships in task-orchestrator. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill resolves a frontier of ready (and resumable) MCP work items into a run plan —
a deterministic set of per-item seat stages derived from each item's resolved schema — opens a
server run over those items, and executes the plan either through the Workflow tool
(Method A) or through direct Agent dispatch (Method B, the fallback when Workflow is
unavailable or the server doesn't yet serve enough capability data for Method A). Both methods
execute the same run plan and the same seat prompts — Method B reuses the Method A core
byte-for-byte (see references/method-b.md).
The skill itself does no planning arithmetic. All frontier resolution, edge classification, stage
derivation and the exact server ops are produced by a pure Node helper (scripts/run-planner.mjs
/ run-planner-lib.mjs / run-exec-lib.mjs). This skill's job is: call the helper with the right
inputs, show the human the plan, send the ops the helper renders, launch, and drive post-run
verification and advancement. Side effects (MCP calls, token files, git worktree add,
Workflow/Agent dispatch) stay in this prose, never in the helper. The Workflow runtime has no
MCP access: every runs_write, runs_read and coordinator advance call is yours.
Do not attempt to replicate the helper's algorithm in your head. If a helper call fails or its output looks wrong, report the raw stderr/stdout rather than improvising a plan by reading MCP responses directly — the whole point of the helper split is that frontier/edge/stage logic is fixture-tested, not reasoned about fresh each run.
A run-wave run is a server run (current/docs/api-reference.md → "Category: Runs"). Two ids name it:
runId (r-…), from plan: the scratchpad directory, the plan document's
args.runId, the provenance run= field and the run's label;runs_write open: bound into the plan with bind-run as
args.serverRunId and passed as runId to every runs_write/runs_read call.The run view (runs_read get, frontier, seats) is the run's state: there is no plan or state
document on the server. The local scratch files (<scratchpad>/run-wave/<runId>/plan.json,
state.json, result.json) hold what the helper reads.
Tokens. open answers a coordinatorToken once (a keyed replay omits it); assign answers each
seat's seatToken once. Write each seat token, and nothing else, as one line to the token file
run-ops assign names (<scratchpad>/run-wave/<runId>/tokens/<short>.<seat>.token); the seat prompt
names that path and the seat reads it. Write the coordinator token the same way, as one line to the
tokenFile that run-ops --phase open names (tokens/coordinator.token), so a restart, --resume
or compaction can read it back; pass it as seatToken from that file, and delete tokens/ at close. Never put a token in a prompt, a note, a log line, a commit, the plan or a helper
input, and never echo one back to the user. A lost coordinator token (no file, or the file's token is
refused) cannot be recovered: close the run on the director connection (no seatToken) or with a
human credential, and open another.
A seat envelope is stripped before it is persisted: any seatToken or coordinatorToken key is removed at any depth in both methods, and Method B's stage-result also redacts every value read from the run's token files. Method A strips by key only (the Workflow sandbox cannot read token files), so a token echoed under another key is not caught there. The coordinator token file sits in the same tokens/ directory, so Method B redacts its value too.
Which token goes on a call. Every coordinator call (update, assign, close, the coordinator
advance calls, withdraw of a decision this run raised, and every notes_write upsert to an
orchestrator-seat key of a run member while the run is open: post-run Step 3 and the Step 5 pointer)
carries the coordinator token as the top-level seatToken; end_seat carries the seat's own token; open carries none.
RESULTS. A write tool answers data.results[i], one entry per ops[] element: read each
element's own ok and data.results[i].error (code, detail, fix). A call-level
partial_failure only means "an element failed, look per element" and carries no detail. The
exception is an atomic batch (atomic: true): it answers only the failing element's own error with
error.index, and nothing was written.
Retry classes the coordinator meets.
| Answer | What to do |
|---|---|
run_paused {pauseReason, pauseDecisionId} | never retry. Save the answer as paused.json and send a paused report with --paused paused.json (see Reporting). The run pauses on an attempt-cap decision, or on a manual pause. A director or a human answers an attempts decision (allow_one, skip_item or stop); it cannot be withdrawn, so answering it or closing the run is the only way out. A manual pause has no decision: a director or a human resumes it. A coordinator token can neither answer nor resume |
run_at_capacity {active, max} | transient: back off until a seat ends (maxActiveSeats), then re-send the same assign; no decision to answer (Method B and every post-run reviewer assign; a Method A launch assign: see Step 5a) |
unavailable (kind shedding) | retry once after retryAfterMs |
unauthenticated "The seat token is not accepted." | the token is unknown, ended, superseded or the run closed: a seat stops (seat-token-rejected); a lost coordinator token means close and re-open |
note_owned_by_other {ownerSeat}, seat_forbidden, not_claim_holder, decision_closed {decisionId, status}, forbidden (detail.required), not_found (detail.kind seat or decision), invalid_run_state, run_closed | permanent: never retry unchanged; read error.fix |
Decisions. A writing seat that needs a ruling raises runs_write raise {class: "deviation", block: true, dedupeKey, question, options, recommended, itemId} under its own token and stops with
reason: "awaiting_decision" and the decisionId. A raise with block: true blocks the item; an
answer never resumes it, and a blocked item allows only resume and cancel. The coordinator
withdraws (runs_write withdraw {decisionId}, coordinator token as seatToken) only decisions it or its seats
raised that went stale — never a server-raised attempt-cap decision. A stall is
never a reason to raise: see Stalled seats below. Answered decisions are resumed here, at Step 2 (before the snapshot) and at post-run Step 6, by the rule in status-progression/references/decisions.md: never while the decision is open.
Reporting. A coordinator reports to the director (or shows the user, when none runs this skill) on
exactly four events: planned (end of Step 5a; for a tier-2 coordinator, its return), decision (a
stage stopped awaiting_decision, or this skill raised one), paused (run_paused, or a stalled seat whose re-assign hit the attempt cap) and closed
(any close). Send only the block node "<helper>" report --plan <plan.json> --event <e> [--result F] [--run F] [--close F] [--paused F] [--needs TEXT] prints, never a hand-written one and never note text, diffs or a
token. Contract, addressing and the brief: skills/director/references/coordinator-tiers.md. After
decision or paused, wait for the answer; never answer a decision yourself.
Every helper call in this skill (and in the references) is of the form:
node "<helper>" <cmd> --in <scratchpad>/run-wave/<runId>/<file>
Resolve <helper> once, at the start of Step 0, and reuse the same resolved path for every
later call in this run (record it as state.helper):
${CLAUDE_PLUGIN_ROOT}/scripts/run-planner.mjs. ${CLAUDE_PLUGIN_ROOT} substitutes
inside plugin skill bodies (the same mechanism the code-modernization plugin's commands
rely on) — confirm the literal string ${CLAUDE_PLUGIN_ROOT} did not survive into the
command you are about to run, and that probe (see F0 below) exits 0.probe exits non-zero, fall back to the dev-checkout path
<git toplevel>/claude-plugins/task-orchestrator/scripts/run-planner.mjs, when that path
exists. Set state.helperFallback: true and add helper-fallback to meta.degradations —
under this fallback, probe's phase0Hooks reflects the checkout, not the installed plugin
cache, so Step 0 F4 will read entryMode: pre-entered even when the installed cache actually
has Phase 0 hooks. Report this degradation rather than silently trusting the pre-entered path.claude-plugins/CLAUDE.md → "Plugin Discovery and Cache Refresh") — do not attempt a manual
plan. While the plugin version is unchanged, every plugin file (workflows, skills,
references, hooks, agents) reaches the installed cache only through the forced refresh in
claude-plugins/CLAUDE.md "Plugin Discovery and Cache Refresh".Run every check below before touching MCP state. Each row's fallback is a rule for THIS run —
re-probe every invocation (capabilities can change between sessions). F3 and F7 need a rootId
before Step 1 runs, so resolve it first by Step 1's rule (session context, then the Config: file,
then .taskorchestrator/config.yaml).
| # | Check | How | Fallback |
|---|---|---|---|
| F0 | Helper resolvable | node "<helper>" probe exits 0 | dev-checkout path (see Helper resolution above); else stop with the cache-refresh pointer |
| F1 | Workflow tool callable | Workflow already in your tool list, or ToolSearch("select:Workflow") resolves it | Method B (pass --method B to plan in Step 3 so the plan document's meta.method is "B") |
| F2 | Server is 4.x with seats; features cover seats, dispatchBySeat, rules | probe.serverCompat first: non-null is the server-compat warning (a 3.x server, or one without the seats feature); plan also refuses (exit 3, server incompatible: ...) when the snapshot's probe carries it. Then the first items_read(select:"schema") response's features field — probe reports plugin/hook capability, never the server's schema features | probe.serverCompat non-null → stop, both methods, and show its line (upgrade the server or the plugin). Missing features/seats → stop as well (runs and seat tokens need them). Missing rules → stop, both methods (the server cannot serve the protocol rules, and promptRules in the shared prompt core marks the protocol key fatal for Method B too) |
| F3 | Protocol rules served | config(ops:[{op:"rules", rootId}]) — its keys are the snapshot's rulesServed — includes protocol.entry-seat, protocol.in-phase-seat, protocol.read-only-agent; not probe, which carries no rulesServed field at all | stop, both methods, with: "protocol rules not served for this root". The reason: promptRules (workflows/implement-wave.js) marks the protocol key fatal, and Method B renders its seat prompts from that same core, so Method B cannot proceed either. Repair, then re-probe F3. (a) REST URL configured: start a new session; config-sync pushes the plugin's bundled-rules/ at SessionStart to any initialized root that does not provide them. (b) No REST URL: run the /task-orchestrator:init rule seeding, or for each missing key docs_write(ops:[{op:"upsert", rootId, kind:"rule", slug:"<key>", body:<${CLAUDE_PLUGIN_ROOT}/bundled-rules/<key>.md verbatim>}]), then confirm the config rules get's rulesVersion is a hash listed for that key in bundled-rules/manifest.json; on a mismatch re-upsert once, then report |
| F4 | Phase 0 hooks present | probe.phase0Hooks (plugin 3.8.0 or later, the subagent-start workflow-subagent skip, and the phase-guard-record seatToken filter) | entryMode: 'pre-entered' (pass --entry pre-entered to plan in Step 3, rather than only noting it in prose) — the front door advances each item queue→work itself before launch, under the coordinator token, instead of the entry seat sending advance transition start |
| F5 | Size guideline | probe.workflowSizeGuideline compared against the plan's meta.estAgents (medium: warn above ~10 agents; large: warn above ~50) | advisory line only — never blocks the run |
| F6 | Allow rules present | probe.allow ({workflow, mcp, bashGit, bashNode}) | warn: "this run will pause at the first un-allowed seat tool call in manual/accept-edits mode"; list the specific missing allow entries; never edit .claude/settings.json yourself |
| F7 | Open run already exists | runs_read(select:"list", rootId, status:"open") (and status:"paused"), keeping the runs whose hints.plan is a plan id (r-…) of this skill; or the target's (parent or single item's) pointer line run-wave: <runId> run=<uuid8> (in its run-pointers note, else its session-tracking) | an open or paused run found → runs_read get, frontier and seats for it, then go straight to the Resume matrix below instead of Steps 1–3 |
Report every fallback you took (F0/F1/F2/F3/F6) once, as run-level friction (post-run Step 3: the
Step 7 report and the feature parent's session-tracking), not on each item — a silent fallback is a
degradation the user should be able to see later.
Each argument-hint flag maps to a plan CLI flag one-for-one, except the two rows that never
reach plan at all:
| Argument | plan flag | Notes |
|---|---|---|
ancestorId | itemIds | — | Scopes Step 2's snapshot calls; never passed to plan itself |
--method A|B | --method A|B | Forces the method instead of the server-capability default |
--mode shared|per-item | --mode shared|per-item | |
--worktree <path> --branch <name> | --worktree <path> --branch <name> | shared mode only; both or neither, else plan exits 3. Reuses an already-created feature worktree/branch (e.g. /implement Step 2's) instead of assembleArgs deriving a fresh one |
--resume <runId> | — | Routes straight to the Resume matrix below instead of Steps 1–3 |
--altitude-safe | --altitude-safe | Sets args.altitudeSafe: true: implement-wave returns the altitude-safe result (rollup counts, statuses, SHAs, file lists, note keys, reasons cut to 120 characters, no seat prose). Post-run Step 0 saves and verifies it like a full result |
Step 0 F4's fallback also maps to a plan flag, not just a prose note: when probe.phase0Hooks
is false, pass --entry pre-entered to plan in Step 3. Likewise, when F1 selects Method B,
pass --method B to plan so meta.method is "B" — the Method B prompt addendum and the blind
test-author default key on it.
Director tier 2. (Needs a director entered through the /task-orchestrator:director skill in a normal session: the hardened claude --agent director entry has neither Workflow nor start_session, so it probes tier 3 or 4.) When a director session drives the run, it does not run these steps itself (its
guard denies the node helper, and the snapshot reads note bodies). It dispatches one named
background coordinator agent (run_in_background: true, model set) for Steps 0-5a with
--altitude-safe --method A. The coordinator records run phase planned (not launched), writes
tokens/coordinator.token, and returns the planned report plus {runId, serverRunId, args}. The
director makes the one Workflow call, then sends the coordinator launched with the call's task id,
run id and script path; only then does the coordinator record phase launched and those keys in
state.json. On the task notification the director sends the result JSON verbatim; the coordinator writes
result.json and runs post-run, then reports. plan refuses --method A (exit 3) when runBudget.maxActiveSeats is below the schema-seat count; the coordinator returns that refusal instead of a planned report, and the director raises maxActiveSeats or drives tier 3. Decisions land between runs. See
skills/director/references/coordinator-tiers.md.
| Step | Action |
|---|---|
| 1 Scope | Resolve the target: ancestorId (a parent feature/container UUID) or explicit item ids from $ARGUMENTS. Resolve rootId in this order: (1) session context, the Active project: line or the Personal root: line the SessionStart hook injects; (2) else project.rootId from the file on that context's Config: line; (3) else .taskorchestrator/config.yaml → project.rootId. A personal root is anchor-only: it is the rootId for config rules, docs_* and runs_write open, never the snapshot's ancestorId (scope by the target). If no rootId resolves, stop and point at /task-orchestrator:init (or --user). |
| 2 Snapshot | First read items_read(select:"blocked", ancestorId). Resume each awaiting_decision entry with resumable: true, token-less, and carry the ruling into a fix-decisions-<n> note (decisions.md section 5); a seat_forbidden reply means the item is in another open run: skip it and report it. List what was resumed at Checkpoint 1. Then make the snapshot calls (items_read(select:"next") ready + role:"work" resume candidates, plus every non-terminal item in the target scope that items_read(select:"blocked") reports as blocked only by other candidates (add these to candidates with source:"ready"; next does not return them, and without this the planner defers them as not projected; under --entry pre-entered those in-run edges defer the item cross-run), items_read(select:"blocked"), items_read(select:"overview"), items_read(select:"schema") per candidate, config(ops:[{op:"rules", rootId}]), items_read(select:"context") per distinct parent, notes_read(select:"list", itemId, keys:[...]) for work-role candidates, and, for each pair of candidates with one parent that an unsatisfied blocked dependency edge joins, notes_read(select:"get", itemId:<id>, key:<planner queue note key>) per item, plus the summary of both items (from items_read(select:"get", itemId:<id>) or the overview) (projected into scopes: files is every repo path the note or summary names as a file to edit, including Shared file, lock-serialized: lines; dependsOn is the ids on Depends on <id>: lines), per candidate notes_read(select:"list", itemId) with no keys filter, following page.next until it is absent, to find carry-in-* keys (when any exist, dispositions = the carry-in-dispositions note body via notes_read(select:"get", itemId, key:"carry-in-dispositions"), else the ## Carry-in dispositions section of the planner queue note, else null; projected into carryIns), git rev-parse --show-toplevel + git fetch origin + git rev-parse origin/main + git worktree list --porcelain). Assemble run-wave/snapshot-v1 (field reference: references/snapshot.md; projected fields only — no note bodies, no guidance text; the exceptions are scopes and carryIns (the dispositions body is the one place a note body enters), see references/snapshot.md) and write it to <scratchpad>/run-wave/snapshot.json — no runId exists yet, so this path carries no <runId>/ segment |
| 3 Plan | node "<helper>" plan --in <scratchpad>/run-wave/snapshot.json --scratchpad <scratchpad> (add --method B whenever F1 selected Method B, so meta.method is "B"; without --method, the plan may still pick B when runBudget.maxActiveSeats is below the schema-seat count, F1 notwithstanding: Steps 5a and 6 follow the plan's meta.method) — --scratchpad is mandatory here, not optional: the project profile's verify/searchScope entries may carry a literal <scratchpad> placeholder that only this flag substitutes, plan refuses (exit 3) rather than silently shipping the un-substituted literal, and seat token files live under the project.scratchDir it sets. Once plan returns a runId, copy the snapshot and the returned plan document to <scratchpad>/run-wave/<runId>/snapshot.json and <scratchpad>/run-wave/<runId>/plan.json — every step from here on reads from that <runId>/ pair, never from the pre-runId snapshot path. Then, for each meta.lateCarryIns entry (a carry-in key on an item with no planner stage and no disposition line), write one disposition line (`: in scope (AC n) |
| 4 Worktrees | git worktree add for each entry in meta.worktreesToCreate. On resume, reuse an existing branch/worktree rather than recreating it (mirrors /implement Step 2, WORKTREE.md) |
| 5 Open | node "<helper>" run-ops --plan <scratchpad>/run-wave/<runId>/plan.json --phase open renders {tool: "runs_write", ops: [{op: "open", rootId, items, scopeId?, label: <runId>, title, hints: {plan, method, worktreeMode}, budget?}]} (budget only when the profile sets its opt-in runBudget.attemptsPerSeat or runBudget.maxActiveSeats); send it as rendered, with no token. From the result keep data.results[0].runId (the server run UUID) and the coordinatorToken (write it to the tokenFile per Tokens). A duplicate element means an item is already in another open run: stop and report it (F7 should have caught it). Then node "<helper>" bind-run --in <scratchpad>/run-wave/<runId>/plan.json --server-run <uuid> and overwrite plan.json with its output (exit 2 on anything but a full UUID). Run the Parent check below, then append the pointer line (under the coordinator token when the target is a run member; a non-member parent stays token-less). The pointer goes to the target's run-pointers note when the target's resolved schema declares that key (items_read schema or context of the target), else to its session-tracking note. run-pointers is orchestrator-owned and never a stage note, so it is always written; the skip below applies only to the session-tracking fallback: when a stage of that item owns session-tracking on a seat-less schema, skip the pointer write, since a pre-launch note would block the implementer's own write, and rely on the runs_read list + hints.plan path of F7. Never write an undeclared run-pointers key. Write run-wave: <runId> run=<first 8 hex of the uuid> parent=<skipped|started|blocked:<key,...>|blocked:<errorCode>|<role>> to the parent's (else the single item's) run-pointers note (fallback session-tracking) with notes_write upsert (the whole body, the line appended). Parent check: the target parent is the item the pointer line goes on, and only when it is not itself a run item and not the run's rootId item; on every skip path (single-item run; the parent is the rootId item; the parent is itself a run item) write parent=skipped so the field is always present. items_read(select:"context", itemId:<parent>): role queue and gateStatus.canAdvance → advance(ops:[{op:"transition", itemId:<parent>, trigger:"start"}]) with the coordinator token and write parent=started; role queue and canAdvance false → tell the user the gateStatus.missing keys before launch, record them under Friction in session-tracking, write parent=blocked:<key,...> and continue (a gate block never stops the launch); an element error that is not a note-gate block (for example dependency_unmet or resource_unavailable) → write parent=blocked:<errorCode> and continue; any other role → no-op, write parent=<role>. Why: the server's start cascade moves only the immediate parent queue→work and not at all when that parent's queue notes are missing, so a target two levels up, resumed work-role items or a gate-blocked cascade would otherwise leave it in queue |
| 5a Assign | Under entryMode: pre-entered, first move every queue-role run item to work: one advance call with one transition start element per such item, under the coordinator token (read each element; an item that did not enter is excluded from the launch and reported). Then: Method A — node "<helper>" run-ops --plan <plan> --phase assign renders one assign element per schema-seat stage of every item (inserted stages such as declarations-extractor are not schema seats and run token-less, read-only) plus the aligned tokenFiles list; send it in ONE runs_write call under the coordinator token and write each successful data.results[i].seatToken to tokenFiles[i] (create the tokens/ directory first). Any failed element means do not launch: its seat has no token file. run_at_capacity here means seats from an earlier attempt are still active (end them via post-run Step 0b, then re-send that element); run_paused: stop and send a paused report (see Reporting). Method A pre-assigns at launch, so stalledSeats reads every seat as assigned from the start and stays advisory until each seat's first call; plan already guarantees maxActiveSeats covers every schema seat, or picks Method B. Follow the plan's meta.method. Method B assigns per dispatch batch (see references/method-b.md). Method A: adopt the pre-filled planner notes (Method B adopts per batch, see references/method-b.md; post-plan-workflow pre-fills them token-less, so the planner seat is otherwise refused note_owned_by_other): for every item with a planner stage, notes_read get each of that stage's note keys token-less (an absent key is skipped), save the answers as a JSON object keyed by item id, render node "<helper>" run-ops --plan <plan> --phase adopt-notes --notes <observed.json> and send each op as its own notes_write call under its tokenFiles entry (none when null), reading each element. A version_conflict on a delete means the note changed since the get: skip that note and report it, never re-create it. Any other failed delete leaves the note as is: report it and do not launch that item's planner seat; a failed upsert after a good delete: re-upsert the held body token-less, report it and do not launch that seat. Then run-ops --phase update --run-phase launched and send it under the coordinator token (the hints replace); a tier-2 coordinator sends --run-phase planned instead and waits for the director's launched message. Then send the planned report (report --event planned; tier 2: it is the return value) |
| 6a Launch A | Workflow({name: "task-orchestrator:implement-wave", args: <the bound plan's args object, passed as a real object — never a JSON-encoded string>}). Record the returned taskId and the Workflow runtime's own run identifiers — state.wfRunId and state.wfScriptPath — from that call's result in <scratchpad>/run-wave/<runId>/state.json; these are distinct from the TO plan id (r-…) and the server run id, and are what a later resume needs to reattach to this exact Workflow run. End the turn here — the result arrives later as an async task notification; say so explicitly to the user |
| 6b Launch B | Run the Method B loop — see references/method-b.md |
| 7 Post-run | Runs only when triggered by the Method A notification, or by Method B's own loop reaching next → {complete: true}. See references/post-run.md: the end-seats sweep, verify, the notes audit, the batched advance, review hand-off, then close (no usage report is sent) |
| 8 Review | Method B generic review (F-9 in the design) unless the project's run-profile.json sets review: "handoff", in which case the run stays open, a reviewer seat is assigned per item, and control passes to the project's own review step (this repo: /implement Step 5); the run closes after that review returns (post-run Step 5, then Step 7) |
| 8a Wave red-proofs | Once the wave's PRs have merged: the decision-point budget mutations for every item in the wave, batched in one scratch worktree at the merged SHA, each scoped to the test classes its test-manifest maps to, recorded once on the wave parent's red-proof-results. Background; never a merge gate. See references/post-run.md Step 7a |
| 8b Feature closure | A parent with 2+ children and a review phase: once every child is terminal, one feature reviewer over the merged range, every finding disposed in orchestrator-confirmation, then the parent completes. See references/post-run.md Step 7b |
| 9 Loop | Re-run from Step 2 without waiting for 8a. Items surfaced in the last coordinator advance answer's unblocked[] join the next frontier automatically |
Steps 1–5a are the planning half of a run; Steps 6–9 are the execution half. A run can span many orchestrator turns — see turn-boundary discipline below.
runs_read(select:"frontier", runId) lists inFlight[] with stalled per seat (quiet strictly
longer than the run's stallAfterSeconds); the run view's stalledSeats counts them. A stalled
seat is handled like an interrupted one, never by raising a decision: snapshot its worktree's
uncommitted changes to refs/wip/<short> (as in the Resume matrix), re-assign the seat under the
coordinator token (this supersedes the old token and counts attempt n+1), write the new token to the
same token file, and re-dispatch the seat; its INTERRUPTED-ATTEMPT CHECK continues from the
snapshot. Past the run's attempt cap the assign answers run_paused (an attempt-cap decision):
stop and surface it.
This skill's loop is a protocol across turns, not a single-shot script:
hints.phase (run-ops --phase update --run-phase <phase>, coordinator token) and the local
state.json must reflect where you actually are, not where you expect to be next. Phases:
planned, launched, notified, post-run, review. A turn that ends without recording it is
a turn that resume (F7) cannot recover.turns in state.json once per orchestrator turn in which you act for this run —
this feeds the orchestrator-turns field of the provenance line (references/post-run.md).runId/serverRunId matches no open run is reported, never acted on.
If a notification or Method B envelope references a run this session has no record of (already
closed, or from a different session), surface it to the user as informational and stop —
do not retroactively advance items based on it.One wave runs per project root at a time: F7 resumes an open or paused run rather than opening a second.
When Step 0 F7 finds an open run, read runs_read get (status, hints.phase, pauseReason),
frontier (inFlight, ready, waiting) and seats for it, and dispatch on the phase. A
paused run is surfaced first (its pause decision is a director's or a human's to answer); a run
whose coordinator token is lost cannot be updated, assigned or closed with it. Check the token first:
if tokens/coordinator.token is present, use it; if it is absent, or a call on an open run answers
unauthenticated, close the run abandoned (run-ops --phase close --reason abandoned) on the
director connection (no seatToken) or with a human credential, then re-plan from Step 2. An
unauthenticated answer on a closed run means it is finished: send the closed report and finish
post-run token-less.
For a member of this still-open run whose decision is answered (resumable: true), resume it under the coordinator token and carry the ruling (decisions.md), then re-dispatch its seat.
| phase | Resume action |
|---|---|
planned | Re-validate with node "<helper>" validate --in <scratchpad>/run-wave/<runId>/plan.json, re-run the Step 5 parent check (idempotent) and REWRITE the pointer's parent= field, in whichever note holds the line (run-pointers or the session-tracking fallback), with the current value (for example parent=work once the parent is already in work) rather than appending a second pointer line, then continue at Step 5a |
launched (Method A) | Notification not yet seen — check /workflows or the task's status first. Before relaunching, protect interrupted work: for each run worktree that has uncommitted changes and no commit for the seat that was in flight (no [<short>] commit with a Seat: trailer in <baseSha>..HEAD), snapshot the changes to refs/wip/<short> without touching the index or the tree (temporary GIT_INDEX_FILE: read-tree HEAD, add -A, write-tree, commit-tree -p HEAD, update-ref refs/wip/<short>) and leave the tree as it is; the re-dispatched seat's INTERRUPTED-ATTEMPT CHECK continues from it. Re-assign every seat frontier.inFlight lists as stalled, or whose token file is missing, and rewrite its token file. If the session was itself restarted and the run is gone but state.wfRunId/state.wfScriptPath were recorded (Step 6a), stop the stale task (TaskStop) and relaunch with Workflow({scriptPath: state.wfScriptPath, resumeFromRunId: state.wfRunId}) (a director session never makes this call, its guard denies a scriptPath or resumeFromRunId Workflow call: a tier-2 director sends the resume to the coordinator, which makes it); if those keys are missing, close the run (--reason abandoned) and re-plan from Step 2 instead (seats are rerun-safe — re-dispatching an already-entered seat is not destructive) |
launched (Method B) | Before relaunching, protect interrupted work: for each run worktree that has uncommitted changes and no commit for the seat that was in flight (no [<short>] commit with a Seat: trailer in <baseSha>..HEAD), snapshot the changes to refs/wip/<short> without touching the index or the tree (temporary GIT_INDEX_FILE: read-tree HEAD, add -A, write-tree, commit-tree -p HEAD, update-ref refs/wip/<short>) and leave the tree as it is; the re-dispatched seat's INTERRUPTED-ATTEMPT CHECK continues from it. Then resume next from the saved local state.json; any in-flight stage with no recorded stage-result is re-assigned and re-dispatched (rerun-safe) |
notified / post-run | Continue references/post-run.md at the first step not yet recorded in state.json |
review | Continue at Step 8 above. A recorded review-wave launch (reviewWave.taskId, reviewWave.wfRunId, reviewWave.wfScriptPath in state.json) is awaited or relaunched like the launched row |
Warning on re-plans: an unblockAt: work in-run edge holds for the first launch only. Once the blocker has entered work, a re-plan reads the edge as satisfied and admits the dependents with no wait. Finish the blocker in its own run before re-planning its dependents.
A closed run is finished — runs_read list with status: "open" never returns it, and a stale
pointer line in run-pointers (or session-tracking) pointing at a closed run is stale prose, not a live run.
references/snapshot.md — the run-wave/snapshot-v1 field reference Step 2 fills.references/method-b.md — the direct-Agent-dispatch execution loop used when Workflow is
unavailable or Step 0 selects Method B, including scheduling, per-batch seat assignment,
envelope handling, the declarations scan, and the degradations Method B declares relative to
Method A.references/post-run.md — the post-run protocol shared by both methods: the end-seats
sweep, result verification, the notes audit, note-filling, the batched advance call, review
hand-off, close, and the human checkpoints that close out a run./status-progression — for a single item's own advance/gate state outside a run plan./ralph — for headless, unattended queue draining instead of an interactive run plan./session-retrospective --run <runId> — the retrospective scoped to this run's members (pass the
server run id)./implement — the project-specific workflow this skill is invoked from for Parallel-tier and
multi-item Delegated-tier waves.What SKILL.md sets; muted values are Claude Code's defaults
20 skills in this plugin
/adopt-project-scopeMigrates an already-populated, unscoped Task Orchestrator database in place to the project-scoping convention — creates a project anchor root, re-parents existing work trees under it, and writes rootId back to config.yaml. Use when a user says: adopt project scope, migrate this database to project scoping, make this DB multi-project, project-scope this workspace, adopt existing database, or set up project scoping for an existing DB./batch-completeCompletes or cancels many items at once, closing out a feature subtree or cleaning up old work; use when a user says: close out this feature, complete everything under X, cancel this workstream, clean up old items, bulk complete, finish this feature, or archive completed work./npx claudepluginhub jpicklyk/task-orchestrator --plugin task-orchestratorOther plugins' skills for the same job