Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component...
npx skills add TheSimpleApp/agent-skills --skill "parallel-swarm"
Install specific skill from multi-skill repository
# Description
Spawn and coordinate multiple parallel agents for maximum throughput. Optimized for 64-core systems. Includes safety rules, coordination patterns, and swarm templates.
# SKILL.md
name: parallel-swarm
description: Spawn and coordinate multiple parallel agents for maximum throughput. Optimized for 64-core systems. Includes safety rules, coordination patterns, and swarm templates.
license: MIT
metadata:
author: thesimpleapp
version: "1.0"
Parallel Agent Swarm
Unleash multiple agents working in parallel. Optimized for high-core systems.
Hardware Profile
YOUR SYSTEM:
βββ CPU: 64 cores β Up to 10+ parallel agents
βββ RAM: 128GB β Large context windows per agent
βββ GPU: 3090 β Available for local model fallback
βββ Network: Fast β Parallel API calls
Core Principle
Sequential (Old Way):
Task 1 β Task 2 β Task 3 β Task 4 β Task 5
β
Total: 50 min
Parallel Swarm (New Way):
Task 1 ββ
Task 2 ββΌββ All complete
Task 3 ββ€ β
Task 4 ββ€ Total: 10 min
Task 5 ββ
Swarm Patterns
Pattern 1: Feature Blast
Build multiple features simultaneously:
SPAWN 5 AGENTS:
Agent-1: "Build user profile component"
ββ Files: src/features/profile/*
Agent-2: "Build settings page"
ββ Files: src/features/settings/*
Agent-3: "Build notification system"
ββ Files: src/features/notifications/*
Agent-4: "Build dashboard widgets"
ββ Files: src/features/dashboard/*
Agent-5: "Build search functionality"
ββ Files: src/features/search/*
SAFETY: Each agent owns different /features/* folder
Pattern 2: Test Blitz
Generate tests for entire codebase:
SPAWN 4 AGENTS:
Agent-1: "Write tests for /components/*"
ββ Output: __tests__/components/*
Agent-2: "Write tests for /hooks/*"
ββ Output: __tests__/hooks/*
Agent-3: "Write tests for /services/*"
ββ Output: __tests__/services/*
Agent-4: "Write tests for /utils/*"
ββ Output: __tests__/utils/*
SAFETY: Each agent writes to different test folder
Pattern 3: Codebase Analysis
Analyze entire codebase in parallel:
SPAWN 5 AGENTS:
Agent-1: "Analyze architecture and patterns"
ββ Output: docs/analysis/architecture.md
Agent-2: "Find security vulnerabilities"
ββ Output: docs/analysis/security.md
Agent-3: "Identify performance issues"
ββ Output: docs/analysis/performance.md
Agent-4: "Document API contracts"
ββ Output: docs/analysis/api.md
Agent-5: "Catalog technical debt"
ββ Output: docs/analysis/tech-debt.md
SAFETY: Read-only analysis, separate output files
Pattern 4: Bulk Refactor
Refactor many files with same pattern:
FILES TO REFACTOR: 50 components
BATCH INTO 5 AGENTS (10 files each):
Agent-1: Files 1-10
Agent-2: Files 11-20
Agent-3: Files 21-30
Agent-4: Files 31-40
Agent-5: Files 41-50
PATTERN: "Convert class components to functional"
SAFETY: No file overlap, same transformation
Pattern 5: Documentation Sprint
Document everything simultaneously:
SPAWN 3 AGENTS:
Agent-1: "Generate API documentation"
ββ Output: docs/api/*
Agent-2: "Generate component storybook"
ββ Output: docs/components/*
Agent-3: "Generate architecture diagrams"
ββ Output: docs/architecture/*
SAFETY: Different doc folders, no overlap
Safety Rules
NEVER Parallel
β Same file from multiple agents
β Shared config files (package.json, etc.)
β Database migrations
β Core type definitions
β Shared utilities being modified
β Git operations
SAFE to Parallel
β Different feature folders
β Independent test files
β Separate documentation
β Non-overlapping modules
β Read-only analysis
β Different output destinations
File Locking
# Conceptual file lock tracking
locked_files = set()
def can_agent_modify(agent_id, file_path):
if file_path in locked_files:
return False
locked_files.add(file_path)
return True
def release_lock(agent_id, file_path):
locked_files.discard(file_path)
Coordination Patterns
Handoff Files
When agents need to share information:
Agent-1 completes β Writes HANDOFF_1.md
Agent-2 waits β Reads HANDOFF_1.md β Continues
# HANDOFF_1.md
## Completed by Agent-1
- Created user types at src/types/user.ts
- Export: User, UserProfile, UserSettings
## For Agent-2
- Import types from src/types/user.ts
- User type has id, email, name fields
Dependency Order
When tasks have dependencies:
BATCH 1 (Parallel):
βββ Agent-1: Create data models
βββ Agent-2: Create API client
βββ Agent-3: Create UI components
WAIT FOR BATCH 1...
BATCH 2 (Parallel):
βββ Agent-4: Connect UI to API
βββ Agent-5: Add error handling
WAIT FOR BATCH 2...
BATCH 3 (Sequential):
βββ Agent-6: Integration tests
Merge Strategy
After parallel work:
1. Each agent commits to feature branch
2. Review all changes
3. Resolve any conflicts
4. Merge to main
5. Run full test suite
Execution Templates
Quick Parallel (3 Agents)
Launch 3 agents for:
- Agent A: [specific task and files]
- Agent B: [specific task and files]
- Agent C: [specific task and files]
Wait for all to complete.
Verify no conflicts.
Full Swarm (10 Agents)
Analyze codebase β Divide into 10 modules
Spawn 10 agents β Each handles 1 module
Coordinate via handoff files
Merge results
Run verification
Claude Code Integration
Using the Task tool for parallel agents:
# Spawn parallel agents
[Use Task tool with run_in_background=true for each]
Agent 1: Task(prompt="...", subagent_type="general-purpose", run_in_background=true)
Agent 2: Task(prompt="...", subagent_type="general-purpose", run_in_background=true)
Agent 3: Task(prompt="...", subagent_type="general-purpose", run_in_background=true)
# Check progress
TaskOutput(task_id="agent-1-id", block=false)
# Wait for completion
TaskOutput(task_id="agent-1-id", block=true)
Performance Benchmarks
TASK: Analyze 100-file codebase
Sequential (1 agent): ~25 minutes
Parallel (5 agents): ~5 minutes
Parallel (10 agents): ~3 minutes
TASK: Generate tests for 50 components
Sequential: ~2 hours
Parallel (5 agents): ~25 minutes
TASK: Refactor 100 files
Sequential: ~3 hours
Parallel (10 agents): ~20 minutes
Error Handling
If agent fails:
1. Log the error
2. Do NOT retry automatically (might conflict)
3. Notify user
4. Continue with other agents
5. Manual intervention for failed task
If conflict detected:
1. Stop both conflicting agents
2. Show diff of changes
3. User resolves manually
4. Resume remaining agents
Integration
/parallel-swarm β Spawn multiple agents
β
/auto-model β Each agent gets optimal model
β
/orchestrator β Coordinates the swarm
β
/full-access β Agents have all permissions
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.