Spawn Agent Farm for parallel issue execution. Mayor orchestrates crew via tmux + MCP Agent Mail. Replaces /crank for multi-agent work. Triggers: "farm", "spawn agents", "parallel work", "multi-agent".
View on GitHubFebruary 1, 2026
Select agents to install to:
npx add-skill https://github.com/boshu2/agentops/blob/main/skills/farm/SKILL.md -a claude-code --skill farmInstallation paths:
.claude/skills/farm/# Farm Skill
**YOU MUST EXECUTE THIS WORKFLOW. Do not just describe it.**
Spawn an Agent Farm to execute multiple issues in parallel with witness monitoring.
## Architecture
```
Mayor (this session)
|
+-> ao farm start --agents N
| |
| +-> Pre-flight validation
| +-> Spawn agents in tmux (serial, 30s stagger)
| +-> Spawn witness in separate tmux session
|
+-> ao inbox (poll for updates)
|
+-> Witness sends "FARM COMPLETE" message
|
+-> /post-mortem (extract learnings)
```
## Execution Steps
Given `/farm [--agents N] [epic-id]`:
### Step 1: Pre-Flight Validation
**Run pre-flight checks before spawning any agents:**
```bash
ao farm validate 2>/dev/null
```
If not available, perform manual checks:
1. **Verify beads exist:**
```bash
ls .beads/issues.jsonl 2>/dev/null || echo "ERROR: No beads found. Run /plan first."
```
2. **Check ready issues:**
```bash
bd ready 2>/dev/null | wc -l
```
If 0 ready issues, STOP: "No ready issues. Check dependencies or run /plan."
3. **Detect circular dependencies:**
```bash
bd validate --check-cycles 2>/dev/null
```
If cycle detected, STOP with error listing the cycle.
4. **Verify disk space:**
```bash
df -h . | awk 'NR==2 {print $4}'
```
If < 5GB, warn user.
### Step 2: Determine Agent Count
**Default:** `N = min(5, ready_issues)`
**If --agents specified:** Use that value, but cap at ready_issues count.
```bash
READY_COUNT=$(bd ready 2>/dev/null | wc -l | tr -d ' ')
AGENTS=${N:-5}
AGENTS=$((AGENTS < READY_COUNT ? AGENTS : READY_COUNT))
```
If AGENTS = 0, STOP: "No work available for agents."
### Step 3: Spawn Agent Farm
**Start the farm with serial agent spawn (30s stagger):**
```bash
ao farm start --agents $AGENTS --epic <epic-id> 2>&1
```
This command:
1. Creates tmux session `ao-farm-<project>`
2. Spawns agents one at a time with 30s delay
3. Spawns witness in separate session `ao-farm-witness-<project>`
4. Writes `.farm.meta` with PIDs and