| name | parallel-work |
| description | Fan-out/fan-in patterns for parallel agent work. Writer/reviewer pattern, conflict resolution, quality verification across parallel sessions. Use when working on multi-file changes or large migrations. Triggers: "parallel", "fan-out", "migration", "batch", "multi-file".
|
| category | agent-patterns |
Skill: parallel-work
What This Covers
Patterns for distributing work across multiple parallel agent sessions. Useful for large migrations, multi-file changes, and codebase-wide refactoring.
Fan-Out Pattern
For large migrations or multi-file changes:
1. Generate Task List
find src/ -name "*.js" > files.txt
wc -l files.txt
2. Loop Through Tasks
for file in $(cat files.txt); do
bun run agent:check "$file"
done
3. Test on a Few First
head -3 files.txt | while read file; do
echo "Processing: $file"
done
4. Run at Scale
cat files.txt | while read file; do
echo "Processing: $file"
done
Writer/Reviewer Pattern
| Session A (Writer) | Session B (Reviewer) |
|---|
| Implement feature | Review diff for edge cases |
| Address feedback | Re-review after fixes |
| Commit when green | Verify quality gates |
Writer Session
bun vitest run
bash scripts/quality-gate.sh
Reviewer Session
git diff
Conflict Resolution
When parallel sessions modify the same files:
- Detect:
git status shows conflicts
- Analyze: Read both versions
- Merge: Combine logically (not just concatenation)
- Test: Run
bun vitest run
- Verify: Run
bash scripts/quality-gate.sh
Quality Verification Across Parallel Work
bash scripts/quality-gate.sh
bash scripts/roast-scorer.sh
bash scripts/doctor.sh
When to Use Parallel Work
| Scenario | Pattern |
|---|
| Large migration (100+ files) | Fan-out |
| Code review | Writer/Reviewer |
| Multi-feature development | Fan-out with coordination |
| Refactoring | Fan-out with verification |
Rules
- Test on a few files first, then run at scale
- Always run quality gates after parallel work
- Use
--allowedTools to scope permissions for batch operations
- Detect and resolve conflicts before committing