andrewbrown-usda/aigb-skills-usda/wave-orchestration
Claude Code and agent skill by andrewbrown-usda/aigb-skills-usda
- community
Checking that the SKILL.md file is still in the repository.
Decomposes a large implementation plan into small-model-sized tasks executed by supervised worker agents in dependency-ordered parallel waves, with a plan-first approval gate inside every task, file-based state for context compaction, and a hard escalation ladder. Use when a master plan or multi-workstream feature is too large for one session and should be executed cheaply by many small agents under frontier-model supervision.
Install
npx vskill@latest install andrewbrown-usda/aigb-skills-usda/wave-orchestrationSKILL.md
The same SKILL.md was published earlier as andrewbrown-usda/aigb-skills-usda/wave-orchestration.
Wave Orchestration (plan-gated, small-model workers)
An architecture for executing a large, multi-workstream plan as a pipeline of small, cheap worker agents supervised by one frontier-model orchestrator. Three ideas do all the work:
- Waves over a task DAG -- tasks grouped into coherent work clusters; tasks within a wave touch disjoint files and can run in parallel; waves are sequential and depend on prior waves. Every orchestration (planning-file set) can contain multiple waves.
- Plan-first inside every task -- a worker may not write code or run state-changing commands until its micro-plan is approved. The approval gate is the orchestrator, not the human, so the loop stays autonomous.
- State on disk, not in context -- a
STATE.mdfile is the single resume point. Worker context never enters the orchestrator; the orchestrator's own context is disposable after every wave (compact or clear freely).
For repository state, branch selection, focused local commits, and remote-action boundaries, follow git-workflow-standards. An approved task plan and micro-plan authorize focused local commits after logical work units pass verification; neither authorizes remote actions.
Key terms
- Orchestration: one planning-file set (EXECUTION_PLAN_N, PROMPT_TEMPLATE_N, STATE_N). Each orchestration has a unique number; wave numbers reset to 1 for each new orchestration.
- Wave: a logical work cluster of tasks sequenced together. All tasks in a wave touch disjoint files and run in parallel.
- Task: a single coherent change unit, <=12 micro-plan steps, executed by one worker. File format:
tasks/N.W.id.todo.md(e.g.,tasks/5.2.3.todo.md= Orchestration 5, Wave 2, Task 3).
Roles
| Role | Model | Responsibilities | Never does | |
|---|---|---|---|---|
| Orchestrator | frontier (one session) | inspect Git repository/branch/worktree state; decompose plan into waves; spawn workers; gate plans; verify diffs/tests; integrate and record commits; maintain STATE_N.md | write feature code | |
| Worker | small/cheap (one per task) | read scoped context, produce micro-TODO, stop, execute after approval, run targeted tests, commit verified logical task work locally, report commit IDs | pick its own scope, run shared/global test suites, work off-plan, perform remote actions |
Artifacts (all under planning/ in the target repo)
Each orchestration (planning-file set) is numbered. Use the next available number:
- `EXECUTION_PLAN_N.md` -- the task directed acyclic graph (DAG): wave table + one spec per task (N = orchestration number).
- `PROMPT_TEMPLATE_N.md` -- the fill-in-the-slots worker prompt (below).
- `STATE_N.md` -- baseline record, wave board, and appended worker reports.
- `tasks/N.W.id.todo.md` -- each worker's approved micro-TODO; N = orchestration number, W = wave number within that orchestration, id = task ID (e.g.,
tasks/5.2.3.todo.mdfor Orchestration 5, Wave 2, Task 3).
Example: Orchestration 5 has EXECUTION_PLAN_5.md, PROMPT_TEMPLATE_5.md, STATE_5.md with tasks named 5.1.1.todo.md, 5.1.2.todo.md, 5.2.1.todo.md, etc. When Orchestration 6 starts, it has EXECUTION_PLAN_6.md, STATE_6.md, and tasks 6.1.1.todo.md, 6.1.2.todo.md, etc.
A fresh orchestrator session resumes from the highest-numbered EXECUTION_PLAN_N.md in planning/. That is the contract that makes compaction safe. To start a new orchestration, create the next numeric set; do not reuse or overwrite prior orchestrations.
[Orchestrator] Decomposition
Break the master plan into tasks sized for a small model. A task is right-sized when all of these hold:
- One coherent change cluster; a micro-plan for it fits in <=12 checkbox steps.
- Files in scope is an explicit list: must edit (existing files the task changes), can create (output files, build dirs). Temp/scratch goes in an untracked folder per repo conventions (e.g.,
.development/); everything else is off-limits. - Acceptance criteria are mechanically checkable (named test file + command).
- Large files are entered via grep anchors (symbol names, approximate line numbers), never "read the whole file" -- multi-thousand-line files are where small models drown.
- Reference implementations are named explicitly ("port the pattern in X").
Each task spec records: id, repo, files in scope (with temp folder location), depends-on, spec prose, anchors, acceptance + targeted test command.
Before planning Git operations, determine whether each target workspace is a Git repository and record its current branch/worktree state. If there is no repository, ask whether the user wants one initialized and do not initialize without explicit approval. Reuse a branch identified by the user or task context; if the intended branch is unclear, ask the user before choosing or creating one. Do not switch branches in a way that risks existing changes.
Use the planning-artifact tracking choice recorded in the approved plan. If none is recorded, ask the user whether to track or ignore the orchestration artifacts before creating them. When tracked, make planning-only docs(planning): commits separate from task code. When ignored, ensure the applicable planning/ and other planning paths are ignored and never stage or commit those artifacts.
Building the wave table
Cluster tasks by logical work phase, not just parallelism. Tasks in a wave are sequenced together and run in parallel (file scopes are disjoint):
- Group by feature tier: "API layer", "migrations", "frontend UI" as separate waves, even if they could run in parallel.
- Keep tightly coupled work (schema, backfill, validation) in one wave; testing is clearer when phases advance together.
- Same-file tasks: sequence them, never parallelize (UI shells collide in same files; backend and frontend rarely do).
- Monolithic waves risk: >8 tasks -> split into 2-3 waves by theme. A 10-task wave hides dependencies and complicates review.
Record the green baseline (all suites, all repos) in STATE_N.md before wave 1; "no regressions" is meaningless without it.
[Orchestrator] Templating
Every worker gets the same skeleton with slots filled from its task spec:
Spawn with the cheapest capable model; use worktree isolation when a wave has more than one task in the same repo.
[Orchestrator] Wave execution
Read the current orchestration's STATE_N.md. Repeat until the wave board is all done:
- Read
STATE_N.md; pick the next wave whose dependencies are all done. - Spawn one worker per task in the wave (parallel).
- Plan review -- inspect the micro-TODO for: in-scope files only, acceptance criteria mapped, <=12 steps, no re-work vs. dependencies (check STATE_N.md), spot-check code claims. Approve or request revisions.
- Unblock worker -- use SendMessage or equivalent to send
APPROVED -- execute the plan as written. [Answers to any questions from their plan.]to the agent. This message is mandatory and unblocks Phase 3 execution; the worker reads it as the execution trigger. - Inform user -- tell the user you've sent the approval and what the agent will do next (reference the task id and goal).
- Verify -- inspect diff, re-run targeted tests. At wave end, run full suites serially (shared resources flake under concurrency).
- Commit and record -- after each task passes its targeted verification, ensure its implementation is committed locally in a focused Conventional Commit; do not defer all commits until the end of the wave or orchestration. Before integrating a worktree, verify its in-scope implementation is committed. Preserve and record code commit IDs in STATE_N.md. If planning artifacts are tracked, commit coherent plan/state updates separately with
docs(planning):; if ignored, never stage them. Mark the task done only after its verified work and required planning-state update are recorded. Fail: escalation ladder. - Distill Decisions (optional / milestone) -- run adr-distillation to extract enduring architectural decisions from
EXECUTION_PLAN_N.mdandSTATE_N.mdintodocs/decisions/before compacting or archiving planning state. - Wave done -- update wave board in STATE_N.md, then
/compactor/clearorchestrator.
Escalation ladder (hard limits -- small models must not loop)
- Micro-plan off-spec twice => orchestrator writes the micro-TODO itself and hands it to the worker as fixed input.
- Acceptance fails after one retry (retry = failure output fed back with
FAILED VERIFICATION: ...) => stop the worker; re-run the task on a mid-tier model. Never a third small-model attempt. - Worker doesn't produce completion report or produces malformed report => send feedback describing what is missing or incorrect (e.g., "report did not include file changes" or "test output truncated"); allow one retry. If the worker still fails to produce a valid completion report, stop and re-run the task on a mid-tier model.
- Worker needs out-of-scope edits => that is a decomposition bug: re-scope the task spec in EXECUTION_PLAN.md; don't widen the worker's permissions ad hoc.
Why each piece exists
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/wave-orchestration/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/andrewbrown-usda/aigb-skills-usda/wave-orchestration)