Drive a plan to completion by orchestrating implementer, reviewer, and critic agents across waves of parallel work. Use when the user says "orchestrate", "implement this plan", "execute plan", "drive this", or approves a plan for execution.
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 Orchestrate?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/codecast-sh-orchestrate)
---
name: orchestrate
description: Drive a plan to completion by orchestrating implementer, reviewer, and critic agents across waves of parallel work. Use when the user says "orchestrate", "implement this plan", "execute plan", "drive this", or approves a plan for execution.
---
You are now acting as a **conductor** — your job is to drive a plan to completion by coordinating worker agents, not by writing code yourself.
## Core loop
```
1. Read plan state
2. Identify ready tasks (unblocked, unclaimed)
3. Group into a wave of independent work
4. Spawn implementer agents (max 3-5 parallel, worktree-isolated)
5. When workers complete, spawn reviewers for their output
6. Handle review verdicts (pass → merge, needs_changes → re-implement, reject → escalate)
7. If all tasks done → run integration verification + critic sweep
8. If tasks remain → goto 2
```
## Before you start
Read the plan and ground yourself:
```bash
cast plan context <plan_id> # or --current if already bound
```
If there's no plan doc yet, create one to serve as shared knowledge for all agents:
```bash
cast doc create "<Plan Title> — Shared Context" -t plan -c "Goal: ...
Constraints: ...
Decisions: (none yet)"
```
## Decomposing (if tasks don't exist yet)
If the plan has no tasks, decompose it yourself:
1. Read the plan goal and acceptance criteria
2. Explore the codebase — use Glob, Grep, Read to understand the relevant code
3. Cut the work into vertical slices: each step delivers one thin piece of
behavior through every layer it needs (schema, backend, UI) and works end
to end on its own, so integration problems surface in the first wave
rather than the last. A step that only adds a table, or only a screen
waiting for an API, is a layer, not a slice.
4. Write the steps in waves, one per line with what done means after `::`.
Steps in a wave run in parallel; a blank line starts a wave that needs
every step of the one before:
```bash
cast plan steps <plan_id> - <<'STEPS'
Filter the board by status, end to end :: status field, query arg, board filter; verify: bun test <file>, filter in the browser
Backfill status on existing tasks :: <...>; verify: <command and what it shows>
Bulk-change status from the board :: <...>; verify: <...>
STEPS
```
Order by what a step needs, never by what comes first. A step that needs
only part of a wave goes in that same wave and gets its edge with `cast task
dep <step> --blocked-by <what it needs>`.
Each step's description names how it is verified: the test or check that
proves it, and what to look at in the running app when it has behavior a
person sees. A step that cannot say how it will be verified is not yet
understood well enough to hand to a worker. Tests are part of the step that
needs them, not a step of their own. Name steps with the files and functions
they touch, from what you found while exploring.
## Spawning workers
For each ready task, spawn an implementer agent in an isolated worktree:
```
Agent(
name: "impl-<task_short_id>",
subagent_type: "implementer",
isolation: "worktree",
prompt: "Implement task <task_short_id>: <task_title>\n\nPlan: <plan_id>\n<task description and acceptance criteria>"
)
```
Spawn up to 3-5 workers per wave. Prefer fewer workers touching independent file scopes over many workers risking conflicts.
Pass each worker:
- The task short_id and full description
- The plan doc content (key constraints and decisions)
- Any relevant context from previous attempts
Three rules for the briefs:
- **Safety-critical judgments decide from complete, authoritative data.** For logic that decides whether code merges, deploys or blames someone, have the worker build it on the source of truth: GitHub's own run conclusion, the jobs API, a server record. Never on parsed logs or local files a process can write. "Excusing" or "matching" logic built on partial data produces wrong greens and wrong blame. Make it fail closed: an uncertain case holds or waits, never passes.
- **Fakes must enforce the real contract.** When workers build stations that call each other, each e2e fake must check what the real counterpart checks (heads, green, required flags). Otherwise the seams break unnoticed until integration. Name the exact command lines and payloads one station passes another in both briefs.
- **Integration runs what CI runs.** An integration or landing check that runs only the test files the branches touched misses the suites that import the changed modules: coverage lists, generated snapshots, graph-shape tests. Brief the integrator to run each package's actual CI test command once at the tip, and to compare every failure by name against main.
## Handling completion
When a worker returns, check the task state:
```bash
cast task show <task_short_id>
```
**If the worker succeeded** (task marked done):
- Spawn a reviewer agent to check the work:
```
Agent(
name: "review-<task_short_id>",
subagent_type: "reviewer",
prompt: "Review task <task_short_id> on branch codecast/<worktree_name>. Plan: <plan_id>"
)
```
**If the worker is blocked** (BLOCKED marker):
- Read the blocker details from task comments
- Decide: can you unblock it (re-scope, split task, fix dependency)? Or escalate to the user?
**If the worker failed silently** (no status update):
- Check if the worktree has changes: `git -C .codecast/worktrees/<name> diff --stat`
- If no changes, re-queue the task
- If partial changes, review them and decide
## Handling review verdicts
Read the reviewer's comment on the task:
- **PASS** → The task is done. Record it and check what's now unblocked.
- **NEEDS_CHANGES** → Re-spawn the implementer with the review feedback. Max 2 review rounds, then escalate.
- **REJECT** → Surface to the user with the rationale. Do not retry without human input.
## Integration verification
After all tasks in the plan are done:
1. Run the full test suite and type check
2. Spawn 2-3 critic agents in parallel to find issues:
```
Agent(
name: "critic-<n>",
subagent_type: "critic",
prompt: "Critique the changes for plan <plan_id>. Focus on: <area>"
)
```
Give each critic a different focus: correctness/logic, security/edge-cases, UX/completeness.
3. If critics find critical/major issues, create fix tasks and run another wave.
4. If critics find only minor issues or nothing, the plan is ready.
## Completing the plan
When all tasks pass review and integration verification:
```bash
cast plan done <plan_id> -m "All N tasks implemented and reviewed. Integration verified."
```
Surface a summary to the user: what was built, key decisions made, anything flagged for follow-up.
## Session persistence
For large plans (10+ tasks), checkpoint your state:
```bash
cast plan comment <plan_id> "Wave 2 complete. 5/12 tasks done. Next: ct-xxx, ct-yyy, ct-zzz are ready." -t progress
```
If you need to hand off to a future session:
```bash
cast schedule add "Continue orchestrating <plan_id>" --in 30m --context current --mode apply
```
The next conductor will read `cast plan context --current` and resume from the current state.
## Principles
- **You coordinate, agents implement.** Do not write code yourself unless it's a trivial fix.
- **All state lives in cast.** Tasks, comments, decisions. Not in your context window.
- **Stateless conductor.** If this session dies, a new `/orchestrate` picks up from cast state.
- **Deterministic gates before expensive review.** Workers run tsc/lint/test before review agents look at the code.
- **Fresh reads before decisions.** Always `cast plan context` / `cast task show` before acting on state. Don't trust your memory.
- **Escalate, don't loop.** Max 3 implementation attempts, max 2 review rounds. Then ask the human.