/work-orchestrator:orchestrating-subagent-workfrom work-orchestrator
Orchestrates multi-file implementation and review work by dispatching subagents with explicit model/reasoning, fencing writes, and confirming load-bearing results with independent workers.
Ships in work-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.
The session is the orchestrator: it owns specs, triage, adjudication, git, and write authority — and it conserves its own context by not re-doing worker verification. Workers never write by default; a worker writes only inside a write scope its checkpoint explicitly fences, and every worker-written change is diff-reviewed by an independent worker before it stands. Dispatched workers (codex, sonnet/haiku subagents) are stateless specialists that receive self-contained prompts; their results are confirmed by a second, independent worker, not by the orchestrator. A result confirmed by two workers (codex counts as a worker) is final — the orchestrator verifies something itself only when a deviation routes it there. No worker is dispatched before the workflow below reaches "Execute next strategy step". Sibling sessions are not dispatched workers: distributing work across sessions is work-orchestrator:orchestrating-session-work's domain, and this skill governs the work executed inside a session.
The workflow below can be extended by content earlier in context. Two shapes are recognized:
## Pre-<position>. If it does, execute its content as additional instructions, then continue with the node. After the node, do the same check for ## Post-<position>. On a looping node, both checks run on every pass.`project.gates`). When such a name appears, check whether earlier context assigns a value to it. If yes, use the assigned value; otherwise use the inline default.| Position name | Node |
|---|---|
Preflight | Run codex pre-flight |
Strategy | Build task strategy in conversation |
Dispatch | Execute next strategy step |
Adapt | Adapt strategy and announce the delta |
Report | Verify and report |
Every other node takes no position, and no named value exists for the verification shape, the consent gate, or dual-confirmation closure. Every list-shaped named value appends to its universal list and never shortens it.
Both checks default to no-op. When earlier context contains no matching section or assignment, the workflow runs entirely on the defaults documented inline. Extension content may cite project files by path; hand a cited path to a worker as required reading rather than reading it into the session, unless a node the session executes itself needs its content.
digraph orchestrating_subagent_work {
"Task needs dispatched workers" [shape=doublecircle];
"Run codex pre-flight" [shape=box];
"codex available?" [shape=diamond];
"codex_bias = codex-less requested?" [shape=diamond];
"Codex-less consent on record in this conversation?" [shape=diamond];
"Ask user: proceed without codex, or halt?" [shape=box];
"User consents to codex-less run?" [shape=diamond];
"HALT: blocked on codex" [shape=octagon, style=filled, fillcolor=red];
"Build task strategy in conversation" [shape=box];
"Derive worker-prompt rules for the assigned families" [shape=box];
"Execute next strategy step" [shape=box];
"Deviation or unforeseen problem?" [shape=diamond];
"Adapt strategy and announce the delta" [shape=box];
"Adaptation drops codex from a checkpoint?" [shape=diamond];
"Adaptation restores codex to a checkpoint?" [shape=diamond];
"All checkpoints closed?" [shape=diamond];
"Verify and report" [shape=box];
"Task complete" [shape=doublecircle];
"Task needs dispatched workers" -> "Run codex pre-flight";
"Run codex pre-flight" -> "codex available?";
"codex available?" -> "codex_bias = codex-less requested?" [label="yes"];
"codex_bias = codex-less requested?" -> "Codex-less consent on record in this conversation?" [label="yes"];
"codex_bias = codex-less requested?" -> "Build task strategy in conversation" [label="no"];
"codex available?" -> "Codex-less consent on record in this conversation?" [label="no"];
"Codex-less consent on record in this conversation?" -> "Build task strategy in conversation" [label="yes"];
"Codex-less consent on record in this conversation?" -> "Ask user: proceed without codex, or halt?" [label="no"];
"Ask user: proceed without codex, or halt?" -> "User consents to codex-less run?";
"User consents to codex-less run?" -> "Build task strategy in conversation" [label="yes"];
"User consents to codex-less run?" -> "HALT: blocked on codex" [label="no"];
"Build task strategy in conversation" -> "Derive worker-prompt rules for the assigned families";
"Derive worker-prompt rules for the assigned families" -> "Execute next strategy step";
"Execute next strategy step" -> "Deviation or unforeseen problem?";
"Deviation or unforeseen problem?" -> "All checkpoints closed?" [label="no"];
"Deviation or unforeseen problem?" -> "Adapt strategy and announce the delta" [label="yes"];
"Adapt strategy and announce the delta" -> "Adaptation drops codex from a checkpoint?";
"Adaptation drops codex from a checkpoint?" -> "Codex-less consent on record in this conversation?" [label="yes"];
"Adaptation drops codex from a checkpoint?" -> "Adaptation restores codex to a checkpoint?" [label="no"];
"Adaptation restores codex to a checkpoint?" -> "Run codex pre-flight" [label="yes"];
"Adaptation restores codex to a checkpoint?" -> "Execute next strategy step" [label="no"];
"All checkpoints closed?" -> "Execute next strategy step" [label="no"];
"All checkpoints closed?" -> "Verify and report" [label="yes"];
"Verify and report" -> "Task complete";
}
Run this node at task entry before any planning or dispatch, and again whenever an adaptation proposes restoring codex to a checkpoint. Ping codex as a fresh non-implementer dispatch per references/codex-dispatch.md, on the cheapest codex tier the routing table names at low effort, with the prompt Reply with pong. Codex is available when the dispatch exits zero; otherwise it is unavailable, and the report names the error line. Do not use codex login status as the check: it can report Not logged in while codex requests work. Report the pre-flight result in one line before continuing.
Search the current conversation for an explicit user statement authorizing work without codex. It counts only when it names this task or is an unqualified general authorization; when it is unclear whether an earlier, narrower statement covers the current task, the answer is no. Only statements in this conversation count — memory files, prior sessions, and inferred preferences never do.
If routing.codex_bias is codex-less, route to the codex-less consent check even when codex is available. Otherwise continue to strategy.
Use AskUserQuestion. Present exactly two options: proceed without codex (name the substitutions from the routing table that will apply), or halt (restore codex, or drop the codex-less bias). Dispatch nothing — including claude-only workers for "independent" parts of the task — while this question is open. Partial dispatch before consent is a violation.
Report the pre-flight evidence verbatim (command, exit code, error line) and stop the task. Do not start reduced-scope work as a substitute.
Read references/model-routing.md and apply it. State the strategy as a compact chat message — never write it to a file. One line per checkpoint; no explanations, no justifications. It covers:
Consult routing.codex_bias (unset = session decides per the table) when assigning actors, and declare the active bias among the named assumptions.
Dispatch immediately after stating the strategy; do not wait for approval or acknowledgement. The first arrival at this node always produces the full strategy message — including when it was reached through the consent gate. Only on re-entry after a mid-task adaptation does the announced delta serve as the strategy amendment; update the affected checkpoints and do not restate the rest.
Invoke llm-author:prompt-engineering in Ruleset mode once, after the strategy has named its actors. One invocation covers every family the strategy assigned. State all three inputs it resolves so it asks for none:
gpt-6.1-sol / gpt-6.1-terra are GPT-6.1 and gpt-6-luna is GPT-6; the sonnet alias resolves to Sonnet 5.5, a later Claude 5 release whose effort names are recalibrated against Sonnet 5's; opus spawns resolve to Opus 5.5, a later Claude 5 release whose effort names are not calibrated the same way Opus 5's are; the haiku alias resolves to Haiku 5.5, a Claude 5 release, by default; where the environment maps an alias to an older model, treat that actor as the family it resolves to.references/worker-prompts.md.Require of the ruleset:
references/worker-prompts.md and the agent definition.Write the returned ruleset to a non-permanent file outside the repository and state its path in one line. The file is session-scoped: never committed, never placed under a project path, never reused across tasks.
Dispatch the current checkpoint's worker per the strategy.
Read references/worker-prompts.md before the first dispatch of any checkpoint and build the prompt from it. It governs every worker — codex and subagent alike — and a codex-less run keeps every block; skipping it dispatches implementers with no fence and no gates.
Adjudicate on the worker's final verdict — per-item status, deviations, the not-verified list, anything the designs did not account for, and any reach outside the fence.
Read the derived ruleset file before building each worker prompt, and phrase the prompt per its rules for the family this checkpoint's actor belongs to. The blocks and their content do not change with the family.
references/codex-dispatch.md for invocation hygiene and the re-validation loop. Codex runs through the CLI only (codex exec); never through an MCP transport.subagent_type to the duty definition the routing table names (work-orchestrator:<definition>), and pass the row's effective model and effort as the spawn's model and effort arguments on every spawn — the definitions pin neither, so an omitted argument runs on whatever the session supplies. Spawn the worker without a name — a named worker's final message does not arrive on its own. A checkpoint that genuinely needs a named worker states sending the final message as that worker's last action, inside its prompt's output contract (REPORT for implementers, OUT otherwise). When a worker finishes and its final message has not arrived, extract only the final assistant block from that worker's persisted transcript under ~/.claude/projects/<project-slug>/<session-id>/subagents/; never read such a transcript whole. A worker's claim to have sent its final message never substitutes for the message itself. Every subagent dispatch carries the nested-subagent directive per that reference's §Nested subagents — the strategy's per-checkpoint declaration picks the form, and absent a declaration the form is spawn-none. Include the honesty and fail-hard directives the worker must follow; workers inherit nothing from the session. The orchestrator stays the sole file writer unless a checkpoint explicitly fences a worker's write scope.Check after every dispatch returns and whenever new information arrives between dispatches. Deviation triggers: dispatch failure or timeout; codex auth/quota loss; results contradicting a named strategy assumption; scope larger than decomposed; gate failure; a worker returning empty, off-profile, or out-of-scope output; a worker finishing without its final message arriving; a worker having written files it was not fenced to write; the user's time or budget constraint no longer fitting the remaining strategy; codex availability regained (a user statement or restored access) during a codex-less run; producer and confirmer disagreeing about a result; a result unable to obtain its second confirmation; orchestrator-observed evidence of a defect in a result already marked final.
deviation.additional_triggers adds project triggers to this list; default if not otherwise stated: the triggers above only. Assignments append — no assignment removes a listed trigger.
Revise the affected checkpoint assignments (actor, model, effort, order, scope) against the routing table. Announce the delta in the conversation — what changed, why, and what stays — before the next dispatch. Never continue silently on a changed plan. For a disputed or unconfirmable result, the escalation ladder is: a third worker, then direct orchestrator verification of that item — the only route by which the orchestrator verifies anything itself. Time pressure adapts scope, never verification: shrinking a checkpoint is announced like any other delta; skipping verification is not an available adaptation. Adaptation may also restore codex to remaining checkpoints; announce a proposed restoration as conditional on its pre-flight, which runs next. If results contradict the task's own premise, stop and surface to the user instead of adapting around it.
A result confirmed by two workers — producer plus an independent confirmer (codex counts as a worker) — is final; the orchestrator must not verify it again. Before closing, check the confirmation ledger: every load-bearing result is dual-confirmed or was resolved through the deviation path — labeling never substitutes for either; only non-load-bearing results may close as labeled single-source or unverified. Finding verdicts use the vocabulary confirmed / mechanism confirmed / adjudicated / not verified / disputed. The orchestrator's own closing work is adjudication and reporting: merge confirmed results, resolve accepted-decision triage, close checkpoints. Reporting to the user counts as acting: every reported item carries its confirmation status. Report the outcome, per-checkpoint results, and any consent decisions taken.
What SKILL.md sets; muted values are Claude Code's defaults
2 skills in this plugin
npx claudepluginhub it-bens/ai-tools --plugin work-orchestratorOther plugins' skills for the same job