swarm
Parallel agents with SDLC pipeline per story
What this skill does
# Swarm Mode
**Recommended model tier:** smart (opus) - this skill requires complex reasoning
Launch parallel agents, each working on a story through SDLC stages.
## NON-NEGOTIABLE REQUIREMENTS
1. **SDLC Pipeline is MANDATORY** - Every story MUST go through all 5 stages: DESIGN → TEST → DEV → VERIFY → DOCS
2. **Git Worktrees are MANDATORY** - Each story agent MUST work in an isolated worktree
3. **VERIFY failures trigger BUILD-FIX loop** - If VERIFY fails, invoke `/aide:build-fix` and re-verify until passing
4. **Swarm MUST conclude with `/aide:worktree-resolve`** - All story branches must be merged before completion
## Activation
```
swarm 3 → 3 story agents (SDLC mode)
swarm stories "Auth" "Payments" → Named stories
swarm 2 --flat → Flat task mode (legacy)
```
## Architecture
```
┌─────────────────────────────────────────────────────────────────────────┐
│ ORCHESTRATOR (you) │
│ 1. Decompose work into stories │
│ 2. Create worktree per story │
│ 3. Spawn story agent per worktree (subagent_type: general-purpose) │
│ 4. Monitor progress via TaskList (DO NOT create tasks yourself!) │
│ 5. Call /aide:worktree-resolve when all stories complete │
└─────────────────────────────────────────────────────────────────────────┘
│
┌──────────────────────┼──────────────────────┐
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Story A Agent │ │ Story B Agent │ │ Story C Agent │
│ (worktree-a) │ │ (worktree-b) │ │ (worktree-c) │
├─────────────────┤ ├─────────────────┤ ├─────────────────┤
│ SDLC Pipeline: │ │ SDLC Pipeline: │ │ SDLC Pipeline: │
│ [DESIGN] │ │ [DESIGN] │ │ [DESIGN] │
│ [TEST] │ │ [TEST] │ │ [TEST] │
│ [DEV] │ │ [DEV] │ │ [DEV] │
│ [VERIFY] │ │ [VERIFY] │ │ [VERIFY] │
│ [DOCS] │ │ [DOCS] │ │ [DOCS] │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
└─────────────────────┼─────────────────────┘
▼
┌─────────────────────────────────────────────────────────────────────────┐
│ SHARED NATIVE TASKS (Claude Code TaskList) │
│ All agents can see, create, and update tasks │
│ Dependencies via blockedBy auto-manage stage ordering │
└─────────────────────────────────────────────────────────────────────────┘
```
## Workflow
### 1. Story Decomposition
**First, check for an existing plan** from `/aide:plan-swarm`:
```
mcp__plugin_aide_aide__decision_get with topic="swarm-plan"
```
If a plan exists, use its stories directly — skip ad-hoc decomposition. The plan has already been validated for independence and acceptance criteria.
If no plan exists, break the work into independent stories/features:
```markdown
## Stories
1. **Auth Module** - User authentication with JWT
2. **Payment Processing** - Stripe integration for subscriptions
3. **User Dashboard** - Profile management UI
```
Each story should be:
- Independent (can be developed in parallel)
- Complete (has clear boundaries)
- Testable (has acceptance criteria)
### 2. Create Git Worktrees
Each story agent gets an isolated workspace. Create worktrees using git commands:
```bash
git worktree add .aide/worktrees/story-auth -b feat/story-auth
git worktree add .aide/worktrees/story-payments -b feat/story-payments
git worktree add .aide/worktrees/story-dashboard -b feat/story-dashboard
```
**Automatic Integration:**
- Worktrees in `.aide/worktrees/` are **auto-discovered** by AIDE hooks
- When agents spawn, their worktree path is **auto-injected** into context
- When agents complete, worktrees are marked as **"agent-complete"** (ready for merge)
- Worktree state is tracked in `.aide/state/worktrees.json`
**Naming Convention:**
- Use `story-<name>` as worktree directory name
- Use matching `agent-<name>` as agent_id when spawning
- Example: `story-auth` worktree → spawn with `agent_id` containing "auth"
**If worktree creation fails:**
1. Check if branch exists: `git branch -a | grep feat/story-auth`
2. Remove stale worktree: `git worktree remove .aide/worktrees/story-auth --force`
3. Prune refs: `git worktree prune`
4. Retry creation
### 3. Spawn Story Agents
Launch agents using the Task tool with `subagent_type: "general-purpose"` (required for Edit/Write access).
**IMPORTANT: Task Ownership**
- The ORCHESTRATOR does NOT create SDLC tasks
- Each SUBAGENT creates and manages its OWN tasks
- Orchestrator only monitors via `TaskList`
Each agent manages its own SDLC pipeline.
```typescript
Task({
subagent_type: "general-purpose",
prompt: `You are a story agent working on: Auth Module
Worktree: /path/to/.aide/worktrees/story-auth
Story ID: story-auth
Agent ID: agent-auth
## Your Mission
Implement the Auth Module through the full SDLC pipeline.
## SDLC Pipeline
You will create and execute these stages IN ORDER:
### Stage 1: DESIGN
Use the /aide:design skill (or follow its workflow).
Output: Technical design with interfaces, decisions, acceptance criteria.
### Stage 2: TEST
Use the /aide:test skill.
Write failing tests based on acceptance criteria from DESIGN.
### Stage 3: DEV
Use the /aide:implement skill.
Make all tests pass with minimal implementation.
### Stage 4: VERIFY
Use the /aide:verify skill.
Run full test suite, lint, type check. Must all pass.
**IF VERIFY FAILS:**
1. Invoke /aide:build-fix to address failures
2. Re-run /aide:verify
3. Repeat until VERIFY passes
4. Only then proceed to DOCS
### Stage 5: DOCS
Use the /aide:docs skill.
Update documentation to match implementation.
## Task Management
Use native Claude Code task tools to track your progress:
1. Create all stage tasks upfront:
TaskCreate: "[story-auth][DESIGN] Design auth module"
TaskCreate: "[story-auth][TEST] Write auth tests" (blockedBy: DESIGN task)
TaskCreate: "[story-auth][DEV] Implement auth" (blockedBy: TEST task)
TaskCreate: "[story-auth][VERIFY] Verify auth" (blockedBy: DEV task)
TaskCreate: "[story-auth][DOCS] Document auth" (blockedBy: VERIFY task)
2. As you start each stage:
TaskUpdate: taskId=X, status=in_progress, owner=agent-auth
3. As you complete each stage:
TaskUpdate: taskId=X, status=completed
## Coordination
**Messaging (MCP tools):**
- Send status: \`message_send\` with from=agent-auth, type="status", content="[DESIGN] complete"
- Send blocker: \`message_send\` with from=agent-auth, type="blocker", content="Need API schema"
- Check inbox: \`message_list\` with agent_id=agent-auth
- Acknowledge: \`message_ack\` with message_id=N, agent_id=agent-auth
**At each stage transition:**
1. Check messages via \`message_list\`
2. Acknowledge and act on any requests
3. Send \`status\` message with new stage
**Shared state (MCP + CLI):**
- Check decisions: \`mcp__plugin_aide_aide__decision_get\` (MCP read)
- Record decisions: \`./.aide/bin/aide decision set <topic> "<decision>"\` (CLI write)
- Share discoveries: \`./.aide/bin/aide memory add --category=discovery --tags=project:<name>,session:\${AIDE_SESSION_ID},source:discovered "<finding>"\` (CLI write)
**Binary location:** The aide binary is at \`.aide/bin/aide\`. If it's on your \`$PATH\`, you can use \`aide\` directly.
## Completion
When all 5 stages are complete:
1. Verify all tasks show completed
2. Ensure all changes are committed
3. Send completion message: \`message_send\` with from=agent-auth, type="completion"
4. Report: "Story complete: Auth Module"
\`
});
```
### Mid-flight control
Once stories are launched, you can intRelated 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.