--- argument-hint: "[task] [agent or model preference]" compatibility: Requires native subagents in Claude Code or Codex, or shell execution with the selected authenticated CLI. The Codex runner requires Git, /bin/bash, and Python 3. The Claude CLI route requires jq. metadata: install-targets: claude-code codex name: orchestration skill-dependencies: - agents-brain - code-polish - commit description: Orchestrate delegated research or implementation with Claude or Codex agents. Default to Claude in Claude Code and Codex in every other harness. Follow an explicit user choice of agent or model. Plan and launch without a separate plan approval step. --- # Orchestration This skill delegates read-only investigation or plans and implements requested work within the current session. Task-handoff writes a decision-complete file for a fresh, separate session. Use it when work continues later or elsewhere. Use this skill to implement requested work now. If a slash or dollar invocation already supplied these instructions in the conversation, follow them directly. In that case, do not invoke this skill again through a skill tool. Follow the shared contract below. Select the worker family separately from the host that runs this conversation. ## Host and Worker Selection Identify the host from its callable tools. Codex exposes `spawn_agent`, `wait_agent`, `send_message`, and `followup_task`. Claude Code exposes Agent and Bash. Do not infer the host from environment variables, process ancestry, or a requested worker name. If neither surface identifies the host, classify it as another harness and use a CLI route. Default to Claude workers in Claude Code. Default to Codex workers in Codex and every other harness. An explicit user choice overrides this default. Apply that choice to research and implementation unless the user limits its scope. A named model also selects its family: Sonnet or Opus selects Claude, and a GPT model selects Codex. Preserve an exact requested model, custom agent name, or effort instead of replacing it with a default tier. Select the route from the actual host and requested worker family. Read the selected reference completely before launch: | Host | Worker family | Route | | ------------- | ------------------------ | ------------------------------------------------ | | Claude Code | Claude (default) | [Native Claude](references/native-claude.md) | | Codex | Codex (default) | [Native Codex](references/native-codex.md) | | Claude Code | Codex (explicit choice) | [Claude to Codex](references/claude-to-codex.md) | | Codex | Claude (explicit choice) | [Codex to Claude](references/codex-to-claude.md) | | Other harness | Codex (default) | [Codex CLI](references/claude-to-codex.md) | | Other harness | Claude (explicit choice) | [Claude CLI](references/codex-to-claude.md) | For CLI routes, require shell execution and the selected authenticated CLI. Report missing execution or coordination prerequisites separately from worker selection. An unrecognized harness alone is not a blocker. Never invent a supported host identity to satisfy a coordination requirement. Use one adapter per worker for launch, permissions, progress, results, and continuation. Load another only when the user explicitly requests different worker families for different scopes. Record each route in that worker's manifest brief. Adapters specialize runtime mechanics. They cannot weaken the shared contract or host restrictions. Before launching each new research or implementation brief, follow [Jev configuration routing](references/jev-routing.md). Use Jev through Vercel to choose only unconstrained model and effort dimensions from the selected adapter's allowed candidates. Route all new briefs of a wave in one helper call. Keep the adapter's existing task tiers as the local fallback. If all dimensions are fixed, skip the network request. Any routing failure, uncertainty, or dubious selection uses that fallback without retry, approval, or interruption. Record the selection source and a concise confidence or fallback reason in the worker's manifest brief. If a requested agent or model cannot run through the available route, report the exact incompatibility. Ask before using a different agent or model. Do not change the worker family because a preferred tool is unavailable. ## Contract - Run when the user requests delegation or a selected companion skill requires it. Classify a task research-only when its requested outcome is findings, evidence, or an assessment, with no repository changes or plan requested. All handoffs may run in any host mode. Implementation handoffs must pass through the Plan Phase, then launch without a separate user approval step. - Treat the implementation request as authorization to plan, delegate, and complete that outcome. Reuse an existing plan when the outcome and material constraints are unchanged. Explicit user instructions take precedence over skill defaults. Preserve host Plan Mode restrictions and confirmation requirements imposed outside this skill. Ask only when required input is missing or an action exceeds existing authorization. - The parent owns decisions, the final plan, and orchestration. Delegate investigation to read-only research agents only when task and repository evidence make it useful before planning. - Research agents gather evidence and report findings only. They never edit files, make design decisions, or return plans. - Implementation agents inspect, edit, and validate their assigned part of the finalized plan. They never redesign or return another plan. - Use the smallest effective implementation team. One agent is valid. Add agents only when decomposition materially improves latency, correctness, or verification. Never exceed eight implementation agents total. - Before finalizing the team, estimate each brief's wall-clock time. Split any brief likely to exceed roughly 25-30 minutes into parallel disjoint scopes or dependency waves instead of using one monolithic agent. Add an integration agent if needed. - Use at most three research agents, stable IDs `R1`-`R3`, counted separately from the eight implementation agents. - Keep the parent's own implementation work to orchestration, integrity checks, failure handling, and conditional polish passes. - Treat an explicit user model preference as an orchestration constraint on every research and implementation agent unless scoped narrower. Within that scope, do not substitute the adapter's usual model selection. If the host cannot launch that model, report the incompatibility and ask before falling back. - Treat the requested outcome as the authorization boundary, rather than the initial manifest or its write scopes. When implementation reveals a related in-repository fix or evidence change required for that outcome, the parent may extend the handoff. For that newly discovered scope, the parent may launch follow-on agents without asking again. The worker that discovered the need still stops at its assigned scope and returns evidence. The parent owns scope expansion, repository coordination, and delegation. - Size verification to the requested outcome. Never add validation machinery (gates, manifests, checkpoints, hash pins, journals, receipts) unless the finalized plan explicitly calls for it. An explicit user request to hurry or wrap up overrides optional repeat checks and required polish passes. In that case, commit the validated work and report what was skipped or left unverified. When present, use `$ARGUMENTS` as the task. Otherwise use the active user request. A task naming another skill follows Companion Skills. ## Companion Skills A task that names another skill alongside this handoff — for example, `run $fresh-eyes-sweep and delegate the implementation` — is a composition. The companion skill defines the work. This handoff owns delegation mechanics. - Load the companion skill and run its discovery, judgment, and planning phases in the parent. Route read-only discovery through this skill's research agents when materially faster. Then incorporate the companion's method, findings, and constraints into the handoff plan. A companion missing from the host's skill list may be installed but hidden by `disable-model-invocation: true`. Read its `SKILL.md` directly from the host skill root (`~/.claude/skills//SKILL.md` in Claude Code, `~/.agents/skills//SKILL.md` in Codex) before concluding it is absent. - When the companion's discovery is most of the work, the parent maps and divides the scope instead of reading it inline. Examples include an audit or sweep over a whole repository or large file set. After planning, each implementation agent audits and fixes its own slice under the companion's rules, inlined in its brief. - This contract overrides the companion's overlapping plan approval, agent limits and stable IDs, single validation owner, and result fields. It also overrides failure classification, commit ownership, and completion reporting. These overrides apply even when the companion prescribes its own subagent, validation, or commit mechanics. Its substantive user-decision gates still bind when existing instructions do not settle them. Do not repeat a companion's routine plan approval step. A plan-only companion implements only when the combined invocation requested implementation and the host permits writes. - Agents cannot load skills. Never brief one to "use skill X" by name. Inline the specific companion instructions, conventions, or excerpts it needs. - A companion requirement to run `$code-polish` or `$agents-brain maintain` marks that pass required in the Plan Phase. The pass still runs once, per Completion. Companion commit instructions never add commits. - Satisfy both contracts at Completion: produce the companion's required report artifacts (ledgers, tables, verdicts) alongside the selected adapter's completion report. ## Research Phase For a research-only task, launch one to three research agents and stop after returning the consolidated investigation. For that task, never enter the Plan Phase or launch implementation agents. For an implementation handoff, trigger research when scope is uncertain, the task crosses multiple or unfamiliar subsystems, or gathering the needed evidence serially would be materially slower for the parent. Zero research agents is the default for implementation handoffs. The parent alone decides the research count from task and repository evidence. Never ask the user to opt in or name agents. Either launch the research wave immediately or proceed straight to planning. When research is triggered, assign up to three agents stable IDs `R1`-`R3`. Launch them immediately through the selected adapter's read-only mechanism. Give each agent a self-contained prompt containing: - the open questions and exact investigation scope. - relevant repository constraints and known concurrent-work boundaries. - a strict read-only authority boundary. - the stopping rule that it must return evidence rather than a plan or design. - its time budget, with the instruction to use it. An early `blocked` return citing only time is not a valid stop. - exact result fields: `status`, `findings`, `open_questions`, `evidence`, and `blockers`. A research agent has not settled its scope if it returns `blocked` citing only time while most of its budget is unused and no concrete obstacle is named. Nor has it settled if it returns `completed` while its evidence still lists uninspected scope paths. For either case, use the adapter's same-agent mechanism once when it supports continuation. Name the uncovered files and remaining budget. This continuation is not a new research agent. For one-shot research agents, carry missing evidence into the consolidated open questions or blockers. When every required research agent settles, incorporate its findings and evidence into the implementation plan or the research-only response. Surface open questions or blockers through the host's user-question mechanism only when they change scope or approach. Do not reconcile the working tree. Research agents change nothing. Any reported edit is a contract violation. For a research-only task, synthesize the evidence and finish with `### 🔎 Research handoff — `, the agent count, findings, evidence, open questions, and blockers. This replaces the Plan Phase and the selected adapter's implementation completion report. If the investigation shows that changes are needed, report them as findings and stop. In that case, do not produce an implementation plan or begin edits. ## Plan Phase Enter this phase only for an implementation handoff. When research — delegated or the parent's own — contradicts a fact the user stated explicitly (quantities, which items, which accounts), ask through the host's user-question mechanism before writing the plan. In that case, never widen the plan's default scope to fit the research. Produce a decision-complete plan with this section and the selected adapter's exact manifest table: ```markdown ## Orchestration - Workers: `` — `` - Research: `` - Companion skills: `` - Strategy: `` - Agents: `<1-8>` — `` - Validation owner: `` — `` - Code polish: `` — `` - Agent-context maintenance: `` — `` ``` While finalizing the plan, record the union of every manifest write scope with `ai-coord draft --name '