Dynamically decompose complex work into adaptive agent swarms with shared context, topology selection, and convergence gates.
From workflow-orchestrationnpx claudepluginhub mikecubed/agent-orchestration --plugin workflow-orchestrationThis skill uses the workspace's default tool permissions.
Delivers DB-free sandbox API regression tests for Next.js/Vitest to catch AI blind spots in self-reviewed code changes like API routes and backend logic.
Implements Clean Architecture in Android and Kotlin Multiplatform projects: module layouts, dependency rules, UseCases, Repositories, domain models, and data layers with Room, SQLDelight, Ktor.
Provides process, architecture, review, hiring, and testing guidelines for engineering teams relying on AI code generation.
Use this skill when a developer needs to execute work that is too large, too structurally uncertain, or too interdependent for a fixed parallel-implementation pattern. Swarm orchestration differs from parallel-implementation-loop in one critical way: the task decomposition and agent topology are decided at runtime by a coordinator, not pre-defined by a plan.
This is an escalation skill. Reach for it only after simpler patterns — scout-then-implement, parallel tracks, or wave/batch execution — have proven insufficient. The coordinator must justify the escalation to the developer before spawning the swarm.
Persistent team, squad, or fleet-style long-lived orchestration is out of scope for this skill. Use a separate orchestration layer if persistent coordination is needed.
Activate when the developer asks for things like:
Also activate when:
Do not activate for work that already has a clear task list, fixed boundaries, and no cross-agent dependencies — use parallel-implementation-loop or planning-orchestration instead.
Before you start, identify:
docs/ or .copilot/swarm/);minimal, standard, or deep);SWARM.md) during execution;If any of those inputs are missing, stop and get them before spawning any agents.
Use separate roles for:
The coordinator shares the SWARM.md factual brief with all agents. The coordinator does not share one agent's conclusions or assessments with another agent before synthesis; only factual context (file lists, task boundaries, validation commands, known dependencies) flows between roles.
| Mode | Relative cost | When to use |
|---|---|---|
minimal | 1x | Well-scoped work, narrow goal, few agents |
standard | 2–2.5x | Normal swarm; 3-5 domain agents + review |
deep | 3x+ | Architectural unknowns, full-system impact |
Always confirm the budget mode with the developer before starting standard or deep runs.
Resolve the active model for each role using this priority chain:
Project config — look for the runtime-specific config file in the current project root:
.copilot/models.yaml.claude/models.yamlRead the coordinator, scout, domain, synthesizer, and reviewer keys directly. Absent keys fall back to baked-in defaults.
Session cache — if models were confirmed earlier in this session, reuse them without prompting.
Baked-in defaults — show defaults, confirm once, cache for the session.
coordinator: <model-name>
scout: <model-name>
domain: <model-name>
synthesizer: <model-name>
reviewer: <model-name>
| Runtime | Role | Default model |
|---|---|---|
| Copilot CLI | Coordinator | claude-sonnet-4.6 |
| Copilot CLI | Scout | claude-haiku-4.5 |
| Copilot CLI | Domain | claude-opus-4.6 |
| Copilot CLI | Synthesizer | claude-opus-4.6 |
| Copilot CLI | Reviewer | gpt-5.4 |
| Claude Code | Coordinator | claude-sonnet-4.6 |
| Claude Code | Scout | claude-haiku-4.5 |
| Claude Code | Domain | claude-opus-4.6 |
| Claude Code | Synthesizer | claude-opus-4.6 |
| Claude Code | Reviewer | claude-opus-4.6 |
Use the cheapest capable model for scout and coordinator (navigation/routing). Reserve the most capable model for domain agents working on architecture or security tasks, and for the synthesizer integrating their outputs.
Before spawning any domain agent, the coordinator creates a SWARM.md file in the repository-appropriate scratch location (e.g., .copilot/swarm/SWARM.md or a temp path). This file is the single shared source of factual context for the entire swarm run.
Goal: <one-sentence description of the overall objective>
Mode: minimal | standard | deep
Budget: <token budget confirmation or 'pending'>
Integration branch: <branch name>
Validation commands: <command>, <command>
Artifact sink: <path where durable artifacts are written>
## Agent Registry
| Agent ID | Domain | Owned files/modules | Status |
|----------|--------------|---------------------|----------|
| agent-01 | <domain> | <files> | pending |
## Shared Facts
<Factual context from the scout: relevant files, interfaces, known dependencies, open questions>
## Topology
<Chosen topology: coordinator-worker | pipeline | wave | hierarchical | mesh>
<Justification for the topology choice>
## Convergence Log
<Round-by-round notes: what converged, what diverged, what was escalated>
Update SWARM.md after every convergence check. Delete or archive it after the swarm run completes successfully. Do not leave SWARM.md as a permanent repository artifact.
The coordinator must read the repository's actual state before deciding on domain boundaries. Do not copy a pre-existing plan's task list directly into the swarm topology — scout first, then decompose based on what is actually there.
Each domain agent must:
If two domain agents discover they share a boundary mid-run, the coordinator must adjudicate before either agent proceeds.
Integration of domain agent outputs must go through a dedicated synthesizer role. Do not allow domain agents to merge their own work. The synthesizer is responsible for:
Each domain agent that writes code must:
Do not allow implementation-first drift in domain agents.
The coordinator runs at most the number of convergence rounds specified in Project-Specific Inputs (default: 2). Each round:
If full convergence is not reached within the maximum rounds, escalate to the developer with a summary of remaining gaps before proceeding.
Before doing any work:
Dispatch the scout to produce a factual brief covering:
Create SWARM.md with the output. Do not proceed until the developer resolves any open questions flagged by the scout.
Based on the scout brief and the goal shape, choose one topology:
| Topology | Use when |
|---|---|
| Coordinator-worker | Independent domains, no cross-agent dependencies |
| Pipeline | Strict ordering; output of one agent feeds the next |
| Wave/batch | Dependency graph known; parallel execution by wave |
| Hierarchical | Sub-coordinators needed for large domains |
| Mesh (emergent) | Only when inter-agent communication is unavoidable |
Record the topology choice and justification in SWARM.md. Prefer the simplest topology that achieves the goal.
Decompose the goal into domain agents. For each agent, record in SWARM.md:
pending, active, complete, blocked, stopped).For each domain agent:
If a domain agent stalls before completing:
stopped in SWARM.md, record partial results and unresolved items, and flag the gap for the convergence check.Do not re-spawn a failed domain agent with the same scope. Narrow first, retry once, escalate if still blocked.
After all domain agents complete or stop:
At this gate (per topology phase, after convergence is reached or escalated), write
.agent/SESSION.md. Record:
current-task: the overall swarm goal descriptioncurrent-phase: "phase-[N]-converged" (substitute the phase name or number)next-action: "begin next topology phase or run swarm completion gate"workspace: the active branch or PR referencelast-updated: current ISO-8601 datetime## Decisions: convergence decisions — resolved gaps, escalated conflicts, topology adjustments## Files Touched: files touched by domain agents in this phase## Open Questions: interface conflicts or gaps escalated to the developer## Blockers: active blockers (empty if none)## Failed Hypotheses: hypotheses tried and ruled out during reconciliationIf the write fails: log a warning and continue. Do not block convergence completion.
Dispatch the synthesizer with:
The synthesizer must produce:
Send only the synthesized result to the reviewer. The reviewer must not see domain agent intermediate outputs or the SWARM.md convergence log — only the final synthesis and the original goal statement.
Ask the reviewer for only substantive issues:
If the reviewer finds real issues, return them to the synthesizer as a targeted resend:
Limit resend to one round. If the same issue survives one resend, escalate to the developer rather than continuing the loop.
After the synthesis is accepted:
/workflow-orchestration:final-pr-readiness-gate on the stable diff;Goal: <original goal statement>
Topology used: <topology>
Mode: <minimal | standard | deep>
Domain agents: <count>
Convergence rounds: <count>
Agents stopped: <count with reason>
Rescue attempts: <count>
Synthesis gaps resolved: <count>
Review issues: <count unresolved>
Validation: <pass | fail | skipped>
Final outcome: <merged | blocked | abandoned | partially delivered>
Residual follow-ups: <items requiring future work>
Write this artifact to the repository-appropriate durable sink — PR description, committed doc, issue comment, or task tracker entry. Chat-only memory is not sufficient.
A domain agent is not complete until:
The swarm is not ready for synthesis until:
The synthesis is not complete until:
The swarm run is not complete until:
Before declaring the swarm run done, confirm ALL of the following.
If any item is FAIL: surface the failing item, state what must be resolved, and do not advance to "done."
When stopping, record partial results, resolved sub-problems, unresolved gaps, and the reason for stopping in the swarm summary artifact before releasing any work surfaces.
Goal: Audit and harden the authentication subsystem across API, session management, and token validation.
Mode: standard
Topology: coordinator-worker (3 independent domains)
Scout brief: auth/ contains 12 files, 3 clear domain boundaries (api-auth, session, token). Shared interface: UserCredential type in src/auth/types.ts.
Domain agents:
agent-01 api-auth src/auth/api/ npm test -- test/auth/api/
agent-02 session-mgmt src/auth/session/ npm test -- test/auth/session/
agent-03 token-validation src/auth/token/ npm test -- test/auth/token/
Convergence round 1: agent-01 and agent-03 both modified UserCredential. Coordinator adjudicated — agent-01 owns the type, agent-03 imports. One targeted reconciliation agent spawned.
Convergence round 2: all gaps resolved. Proceeding to synthesis.
Synthesis: unified result with 0 interface conflicts, 1 residual gap (refresh token edge case) flagged for follow-up.
Review: 2 substantive issues found, both resolved in one resend.
Final validation: passes. PR opened.