swarm
# Swarm Execution Skill
What this skill does
# Swarm Execution Skill
This skill orchestrates parallel agent workflows for complex, multi-step tasks. It decomposes work into dependency-mapped waves and executes them with autonomous agents while maintaining quality through automated auditing.
## When to Use
Invoke this skill when:
- User runs `/swarm` command
- Task requires decomposition into multiple parallel sub-tasks
- User mentions "swarm", "parallel execution", "wave-based", or "multi-agent"
- Complex refactoring or migration with many interdependent steps
## Roles
The swarm system has five agent roles:
| Role | Purpose | When Spawned |
|------|---------|--------------|
| **Architect** | Plan generation, task decomposition, dependency mapping | Start of swarm, re-planning phases |
| **Worker** | Execute individual tasks, write reports to files | During wave execution |
| **Reviewer (ultrathink)** | MANDATORY wave review, reads ALL reports | End of EVERY wave |
| **Reviewer (opus)** | Optional task-scoped review | Complex tasks (optional) |
| **Fixer** | Auto-fix HIGH priority issues | When review returns HIGH |
## Worker Agents
Worker agents are defined in `./agents/` and run in **parallel with separate context windows**:
| Agent | Model | Purpose | Use For |
|-------|-------|---------|---------|
| `swarm-worker-haiku` | haiku | Fast, cheap tasks | Deletions, renames, config, boilerplate |
| `swarm-worker-opus` | opus | Standard tasks | Implement, integrate, fix bugs |
| `swarm-worker-ultrathink` | opus | Complex tasks | Architecture, algorithms, edge cases |
## Review Agents
| Agent | Model | Purpose | When Used |
|-------|-------|---------|-----------|
| `swarm-reviewer-ultrathink` | opus | Wave review (ALL tasks) | MANDATORY end of every wave |
| `swarm-reviewer-opus` | opus | Task review (single task) | Optional for complex tasks |
**Review Output**: `{priority}|{action}|{review-path}` where priority is HIGH/MED/LOW.
## Spawning Pattern (Fire-and-Forget)
All agents MUST be spawned with `run_in_background: true`:
```
# Workers - include report path in prompt
Task(subagent_type="swarm-worker-haiku",
prompt="Task 1.1: ... Report: .swarm/reports/plan/wave-1/task-1.1.md",
run_in_background=true)
→ Returns: agentId (store mapping taskId→agentId)
# DO NOT POLL - wait at end of wave only
TaskOutput(task_id=lastAgentId, block=true)
# Ignore output content - workers wrote to files
```
**ZERO-POLLING**: Orchestrator never reads worker output. Communication via files only.
## CRITICAL: Orchestrator Context Isolation
**The orchestrator (you) NEVER uses Explore or general-purpose agents for assessment.**
Why? Because agent output returns to your context, defeating the purpose. Instead:
| Need | WRONG | CORRECT |
|------|-------|---------|
| Get TypeScript errors | `Task(Explore, "run tsc")` | `Bash("npx tsc --noEmit")` |
| Read a file | `Task(Explore, "read X")` | `Read("X")` |
| Find files | `Task(Explore, "find...")` | `Glob("pattern")` |
| Search code | `Task(Explore, "grep...")` | `Grep("pattern")` |
**Workers are for IMPLEMENTATION, not exploration.** You explore directly, then spawn workers to implement in parallel.
## Orchestrator Responsibilities
The main Claude (you) acts as orchestrator:
- Delegates planning to Architect agent
- Launches Worker agents in parallel within waves
- Coordinates Auditor agents after each wave
- Manages the master plan file (sole writer)
- Handles user checkpoints and confirmations
- Decides on escalation and retries
## Reference Files
Load these based on current phase:
| Phase | Load Reference |
|-------|----------------|
| Planning | [architect-protocol.md](references/architect-protocol.md) |
| Execution | [worker-protocol.md](references/worker-protocol.md), [escalation-rules.md](references/escalation-rules.md) |
| Validation | [auditor-protocol.md](references/auditor-protocol.md) |
| All phases | [orchestrator-protocol.md](references/orchestrator-protocol.md), [plan-format.md](references/plan-format.md) |
## Quick Start
1. **Receive task** (description, file path, or "resume")
2. **Spawn Architect** (run_in_background: true) → wait with TaskOutput(block: true)
3. **Confirm with user** (checkpoints, model assignments)
4. **Execute waves** (ZERO-POLLING):
- SPAWN all workers with report paths in prompts
- Store taskId→agentId mapping (NOT output)
- WAIT at end of wave only: TaskOutput(lastAgentId, block: true)
- Ignore output content - workers wrote to files
5. **MANDATORY wave review**: spawn swarm-reviewer-ultrathink
- Returns: `{priority}|{action}|{review-path}`
- HIGH → spawn fixers, wait, re-review
- MED → note in plan, continue
- LOW → proceed
6. **Optional task review**: spawn swarm-reviewer-opus for complex tasks
7. **Checkpoint with user** at agreed points
8. **Update plan** with file paths only (not content)
9. **Repeat** until complete
## Plan File Location
Plans are stored in `.swarm/{task-slug}.md` in project root.
This file is both the plan definition AND execution state (checkboxes).
## Mode Behavior
| Mode | Behavior |
|------|----------|
| **Plan mode** | Generate plan only, no execution |
| **Auto-edit** | Execute with minimal pauses (major milestones only) |
| **Default** | Wave-by-wave checkpoints |
## Future: GitHub Actions
Design notes for CI/CD migration:
- Tasks are stateless with explicit inputs/outputs
- Plan format supports workflow generation
- Checkpoints map to approval gates
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.