plugins-claude/session/skills/orchestrate/SKILL.md
Multi-phase, multi-agent feature workflow: spec → plan → refine → divide → execute → review
npx skillsauth add st0nefish/claude-toolkit orchestrateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run a complex feature through a structured multi-agent workflow with explicit model tiering, user gates, and an automated review pass. Use this when work is non-trivial — multiple files, design ambiguity, cross-cutting concerns, or correctness-critical paths. For small fixes, prefer /session:start directly.
The workflow has seven phases. Two have hard user gates (Refine and Execute). The Review phase auto-loops on blockers up to a cap.
CRITICAL: You MUST drive every phase to completion. Do NOT collapse the workflow into a single in-line plan. Sub-agent dispatch is the point — the user is paying for parallelism and model tiering, not for you to do everything serially in the main session.
$ARGUMENTS — optional initial description. If empty and no context inherited from /session:start, ask the user to describe the feature before starting Phase 1./session:start's escalation, the branch is already created and the issue/description is known. Do not re-ask for a description.Before starting Phase 1, check whether prior phases of this workflow have already run on this branch:
Run bash ${CLAUDE_PLUGIN_ROOT}/scripts/catchup to gather branch state.
Inspect the most recent commit messages and any wip/, feat/, enhancement/, chore/, bug/ branch names for evidence of prior work — recent commits referencing the spec/plan, multiple commits since the default branch, or a checkpoint comment on the linked issue.
If any signal of prior orchestrate work is present, ask via AskUserQuestion:
Otherwise proceed to Phase 1 with a fresh run.
Goal: turn the user's description into a richer rough spec by dispatching cheap, parallel research agents.
Identify 2-4 distinct exploration angles based on the description. Common angles:
Dispatch all angles in parallel in a single message, using the Agent tool with:
subagent_type: research (read-only)model: haiku by defaultmodel: sonnet for an angle if: codebase is unfamiliar, the angle requires synthesizing patterns rather than locating code, or the description hints at subtle cross-file relationshipsmodel: opus: rarely; only for deeply tangled architecturesCollect findings into a rough spec the parent session can hold:
Do NOT present this rough spec to the user yet — Phase 2 will refine it into a plan first.
Goal: produce an initial implementation plan plus an explicit list of gaps and open questions.
Dispatch a single planning sub-agent using the Agent tool with:
subagent_type: Plan (architect agent)model: sonnet by defaultmodel: opus if: cross-system design tradeoffs, significant ambiguity in the spec, novel pattern with no clear precedent in the codebase, correctness-critical (security, data integrity, concurrency, migrations)haiku — planning needs reasoning headroomThe plan agent's prompt MUST include:
Receive and hold the plan. Do not yet present to user — Phase 3 is the discussion gate.
Goal: iterate with the user until the spec and plan are agreed.
Present to the user, in the main session output:
Loop with the user in plain conversation:
Gate: when the user signals approval (or after refinements you believe complete), use AskUserQuestion with options:
Do NOT proceed to Phase 4 without explicit approval via this gate.
Goal: break the approved plan into discrete chunks that can be dispatched to execution agents.
Detect test infrastructure — before deciding whether tests are mandatory, run a quick check:
# Probes: test directories, test files, CI test step, manifest test scripts
ls test tests __tests__ 2>/dev/null
git ls-files | grep -E '_test\.(go|py|rs)$|\.test\.(ts|tsx|js|jsx)$' | head -5
git ls-files .github/workflows/ 2>/dev/null | head -5
git ls-files | grep -E '^(package\.json|Cargo\.toml|pyproject\.toml|go\.mod)$' | head -5
If any positive signal — test directories, conventional test files, CI workflows referencing tests, or a test/check script in package manifests — record tests_required=true. Otherwise tests_required=false.
Chunk the plan into discrete tasks. For each chunk record:
tests_required=true AND the chunk is not purely cosmetic, add a paired test chunk OR include test work in the chunk's scope. Skip if cosmetic-only or tests_required=false.Identify parallelization — group chunks into waves. A wave is a set of chunks with no dependencies on each other (within the wave); they will be dispatched in parallel. Waves run serially, with each later wave allowed to depend on completed earlier waves.
Hold the chunk plan for the Phase 5 gate. Do not present yet — present at the gate.
Goal: dispatch sub-agents to execute the chunk plan, with failure escalation.
Present the chunk plan to the user. Use AskUserQuestion with options:
Dispatch each wave:
Agent calls in a single message. Each Agent call uses:
subagent_type: general-purposemodel: <tier from chunk plan>prompt: a self-contained brief including the user description, the agreed plan, this chunk's scope/files/test requirements, success criteria, and the convention "report what you did and any issues encountered; if blocked, describe the blocker rather than guessing"Per-chunk failure escalation (cap 3 attempts per chunk):
After all waves complete, proceed to Phase 6.
Goal: validate the executed work with reviewer sub-agents and auto-loop on blockers.
Dispatch Sonnet bulk reviewers in parallel, one per executed chunk (or one per logical group if chunks are tightly coupled). Each reviewer uses:
subagent_type: general-purposemodel: sonnetprompt covering: codebase conventions (naming, file layout, imports, idioms), lint/type checks pass, test suite passes if tests_required=true, spec compliance (does it implement what the divide phase asked for?), obvious pitfalls (error paths, null/empty handling, dead code, stale TODOs, leftover debug), no regressions touching unrelated code. Reviewer must tag findings as blocker, concern, or nit.Dispatch Opus selective reviewer in parallel with the bulk reviewers, ONLY when at least one of these warrants apply:
Use subagent_type: general-purpose, model: opus. The Opus reviewer's prompt scopes to ONLY the warranted subset (don't have it review trivial chunks).
Consolidate findings in the parent session:
Auto-loop policy (cap: 2 review iterations per execution batch):
AskUserQuestion:
Goal: summarize and route to the appropriate finalization flow.
Produce a final summary for the user covering:
Offer hand-off via AskUserQuestion:
/git-tools:ship to commit, push, open PR, watch CI/session:end for the review-then-PR flowDo NOT auto-commit, push, or open a PR — always go through the user's choice in this final gate.
/session:start instead before kicking off Phase 1.AskUserQuestion. The auto-loop in Phase 6 is the only place the workflow advances without an explicit gate.Agent call's prompt must include enough context that the agent can succeed without seeing the parent conversation.Agent calls in a single message so they run concurrently.development
Start work from your description — explore the codebase and plan
data-ai
Multi-phase, multi-agent feature workflow: spec → plan → refine → divide → execute → review. Invoke when the user escalates a session-start/session-issue flow to orchestration, or asks to run a non-trivial feature (multiple files, design ambiguity, cross-cutting concerns, correctness-critical paths) through the full multi-agent workflow. For small fixes, prefer session-start.
tools
Browse open issues, pick one, and start work on it
tools
Interact with GitHub and Gitea issue trackers and CI systems. List and show issues, file bugs, comment on issues or PRs, list and show pull requests, and fetch CI run logs — all from any repo context without leaving the session.