home / skills / willsigmon / sigstack / spawn-swarm

This skill helps you orchestrate parallel agents to maximize throughput by running multiple tasks simultaneously and aggregating results.

npx playbooks add skill willsigmon/sigstack --skill spawn-swarm

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
3.0 KB
---
name: Spawn Swarm
description: Spawn multiple agents in parallel for maximum throughput
allowed-tools: Task, Read, Bash
model: sonnet
---

# Spawn Swarm

**Parallel agents for parallel work.**

## The Pattern

```
Single message → Multiple Task calls → Parallel execution → Collected results
```

One message with 5-20 Task tool invocations.
All run simultaneously.
Results come back together.

## Swarm Templates

### Bug Hunt (5-10 agents)
```
"Find bugs across the codebase"

Spawn per module:
- auth-agent
- payment-agent
- user-agent
- api-agent
- data-agent
```

### PR Review (3-4 agents)
```
"Review PR #123"

Spawn specialists:
- security-reviewer
- performance-reviewer
- style-reviewer
- test-coverage-reviewer
```

### Feature Build (4 agents)
```
"Build [feature]"

Spawn workers:
- ui-agent
- logic-agent
- test-agent
- docs-agent
```

### Codebase Exploration (5 agents)
```
"Understand how [thing] works"

Spawn explorers:
- entry-point-finder
- flow-tracer
- dependency-mapper
- pattern-identifier
- edge-case-hunter
```

## Invocation

### Single Message, Multiple Tasks
```
[Task: Search auth/ for security issues]
[Task: Search payment/ for security issues]
[Task: Search api/ for security issues]
[Task: Search data/ for security issues]
[Task: Search user/ for security issues]
```

All in ONE message.

### Use run_in_background
```
For long-running work:
run_in_background: true

Continue other work.
Check results with TaskOutput later.
```

## Agent Types

### Explore (subagent_type: Explore)
```
Fast file/code search
Pattern finding
Codebase questions
```

### General (subagent_type: general-purpose)
```
Multi-step implementation
Complex changes
Autonomous work
```

### Specialists
```
code-reviewer
debugger
security-reviewer
performance-reviewer
```

## Sizing Guidelines

| Task | Agents | Why |
|------|--------|-----|
| Small search | 3-5 | Quick coverage |
| Full codebase | 5-10 | One per major area |
| Deep analysis | 10-15 | Thorough exploration |
| Massive refactor | 15-20 | Maximum parallelism |

## Token Efficiency

### Agents Have Narrow Context
```
Main conversation: Full codebase
Each agent: Only its target area

5 agents searching 5 areas:
- Same tokens as 1 agent doing all 5
- 5x faster
- Each has focused context
```

### Agent Summary Pattern
```
Agent explores extensively.
Returns: "Found issue in auth.swift:142"

You get 1-line summary.
Not the full exploration trace.
```

## Anti-Patterns

### ❌ Don't
```
- Spawn for simple reads (just use Read tool)
- Spawn with dependencies (race conditions)
- Spawn 50 agents (chaos)
- Wait on each before spawning next
```

### ✓ Do
```
- One message, all agents
- Independent targets
- 5-20 agents max
- Background for long work
```

## Example Prompt

```
Spawn a bug-hunting swarm:

1. Search src/auth/ for security vulnerabilities
2. Search src/payment/ for data handling issues
3. Search src/api/ for input validation bugs
4. Search src/user/ for permission issues
5. Search src/data/ for race conditions

Return findings ranked by severity.
```

Use when: Any parallel work opportunity

Overview

This skill spawns multiple agents in parallel to maximize throughput on tasks like bug hunts, PR reviews, feature builds, and codebase exploration. It runs 5–20 focused subagents from a single instruction and collects concise summaries of results. Use it to split independent targets into concurrent workstreams and retrieve ranked, actionable findings quickly.

How this skill works

You submit one message containing multiple Task invocations; each Task becomes a focused agent working on a specific area. All agents run concurrently, return short summaries, and their outputs are aggregated so you get a ranked or collated result. For long-running jobs you can mark tasks run_in_background and poll TaskOutput later.

When to use it

  • Parallel code searches across modules or folders
  • Concurrent PR reviews by specialist reviewers
  • Building feature components in parallel (UI, logic, tests, docs)
  • Deep codebase exploration where multiple perspectives help
  • Long-running analyses that can run in background while you continue other work

Best practices

  • Send one message with all Task calls so all agents spawn at once
  • Keep agent targets independent to avoid race conditions
  • Limit swarms to 5–20 agents for manageability and token efficiency
  • Use narrow contexts per agent — give each agent only the files or module it needs
  • Use run_in_background for long tasks and check results asynchronously

Example use cases

  • Bug Hunt: spawn agents per major module (auth, payment, api, data, user) and return ranked issues
  • PR Review: spawn security, performance, style, and test-coverage reviewers for the same pull request
  • Feature Build: spawn ui-agent, logic-agent, test-agent, and docs-agent to parallelize delivery
  • Codebase Exploration: spawn explorers for entry points, flows, dependencies, patterns, and edge cases
  • Long Analysis: run 10–15 agents for deep research, mark run_in_background and aggregate concise summaries

FAQ

How many agents should I spawn?

Aim for 5–20 agents. Fewer than 5 may not gain much parallelism; more than 20 risks coordination chaos and token overhead.

What do agents return?

Agents return short, one-line summaries or ranked findings rather than full exploration traces to save tokens and make aggregation easy.

When should I use run_in_background?

Use it for long-running or expensive tasks so you can continue work and check TaskOutput later without blocking the main flow.