claude-memory/graph/workflows/agent-swarm-workflow-for-parallel-rust-implementation-tasks-3227a9.md
2026-02-27 23:06:34 -06:00

58 lines
2.2 KiB
Markdown

---
id: 3227a923-84c4-4fe3-8574-dbf74d6e8b37
type: workflow
title: "Agent swarm workflow for parallel Rust implementation tasks"
tags: [sba-scout, rust, swarm, claude-code, workflow, parallelism, agent, tmux]
importance: 0.5
confidence: 0.8
created: "2026-02-27T01:18:38.159503+00:00"
updated: "2026-02-28T05:06:34.191031+00:00"
relations:
- target: 99f4462b-91eb-4243-99cf-7a74a3afadbf
type: BUILDS_ON
direction: outgoing
strength: 0.7
edge_id: d5c4c47f-9b6c-4016-ab15-42c6bbfe5f25
- target: 3ecd877b-de73-4afd-b328-b3ee99f5a1e3
type: RELATED_TO
direction: incoming
strength: 0.9
edge_id: 391f6718-4f2f-49d0-acb8-659b04ed8c51
- target: 0e484de1-cb92-479c-95ec-06fa9e886c0c
type: BUILDS_ON
direction: incoming
strength: 0.85
edge_id: 173a8645-ab54-4247-822b-9fb9e2ca23fd
---
# Agent Swarm Workflow for Parallel Rust Implementation
## Context
Used during SBA Scout Rust rewrite Phase 1 to parallelize implementation across multiple files.
## Workflow Pattern
1. **Create team** — spin up tmux-backed swarm with named agents
2. **Create tasks with dependencies** — map out which tasks are unblocked vs. blocked
3. **Fan out unblocked tasks** to `swarm-coder` agents (bypassPermissions mode)
4. **Send completed work to `swarm-reviewer` agents** for code review
5. **Fix issues found by reviewers** before proceeding
6. **Dispatch newly-unblocked tasks** after dependencies complete
## Critical Rule: File Contention
When multiple tasks write to the **same file** (e.g., all query functions going into `queries.rs`), batch them into **one coder agent** to avoid merge conflicts.
Tasks touching **different files** (e.g., `main.rs` vs `queries.rs` vs `schema.rs`) can safely run in parallel.
## Agent Configuration
- Model: Sonnet (per Cal's preference for sub-agents)
- Mode: `bypassPermissions` for coder agents
- Reviewer agents: separate agent instances, no bypass needed
## Outcome
Phase 1 completed faster than sequential implementation. Reviewer caught a missing `UNIQUE` constraint on `lineups.name` that was fixed before commit — review step proved valuable.
## Applicable Projects
Any multi-file Rust (or other language) implementation where tasks can be decomposed by file/module ownership.