ABSOLUTE RULES:
- ALL operations MUST be concurrent/parallel in a single message
- NEVER save working files, text/mds and tests to the root folder
- ALWAYS organize files in appropriate subdirectories
MANDATORY PATTERNS:
- TodoWrite: ALWAYS batch ALL todos in ONE call (5-10+ todos minimum)
- Task tool: ALWAYS spawn ALL agents in ONE message with full instructions
- File operations: ALWAYS batch ALL reads/writes/edits in ONE message
- Bash commands: ALWAYS batch ALL terminal operations in ONE message
- Memory operations: ALWAYS batch ALL memory store/retrieve in ONE message
NEVER save to root folder. Use these directories:
/src- Source code files/tests- Test files/docs- Documentation and markdown files/config- Configuration files/scripts- Utility scripts/examples- Example code
This project uses SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) methodology with Claude-Flow orchestration for systematic Test-Driven Development.
npx claude-flow sparc modes- List available modesnpx claude-flow sparc run <mode> "<task>"- Execute specific modenpx claude-flow sparc tdd "<feature>"- Run complete TDD workflownpx claude-flow sparc info <mode>- Get mode details
npx claude-flow sparc batch <modes> "<task>"- Parallel executionnpx claude-flow sparc pipeline "<task>"- Full pipeline processingnpx claude-flow sparc concurrent <mode> "<tasks-file>"- Multi-task processing
npm run build- Build projectnpm run test- Run testsnpm run lint- Lintingnpm run typecheck- Type checking
- Specification - Requirements analysis (
sparc run spec-pseudocode) - Pseudocode - Algorithm design (
sparc run spec-pseudocode) - Architecture - System design (
sparc run architect) - Refinement - TDD implementation (
sparc tdd) - Completion - Integration (
sparc run integration)
- Modular Design: Files under 500 lines
- Environment Safety: Never hardcode secrets
- Test-First: Write tests before implementation
- Clean Architecture: Separate concerns
- Documentation: Keep updated
coder, reviewer, tester, planner, researcher
hierarchical-coordinator, mesh-coordinator, adaptive-coordinator, collective-intelligence-coordinator, swarm-memory-manager
byzantine-coordinator, raft-manager, gossip-coordinator, consensus-builder, crdt-synchronizer, quorum-manager, security-manager
perf-analyzer, performance-benchmarker, task-orchestrator, memory-coordinator, smart-agent
github-modes, pr-manager, code-review-swarm, issue-tracker, release-manager, workflow-automation, project-board-sync, repo-architect, multi-repo-swarm
sparc-coord, sparc-coder, specification, pseudocode, architecture, refinement
backend-dev, mobile-dev, ml-developer, cicd-engineer, api-docs, system-architect, code-analyzer, base-template-generator
tdd-london-swarm, production-validator
migration-planner, swarm-init
- File operations (Read, Write, Edit, MultiEdit, Glob, Grep)
- Code generation and programming
- Bash commands and system operations
- Implementation work
- Project navigation and analysis
- TodoWrite and task management
- Git operations
- Package management
- Testing and debugging
- Coordination and planning
- Memory management
- Neural features
- Performance tracking
- Swarm orchestration
- GitHub integration
KEY: MCP coordinates, Claude Code executes.
# Add Claude Flow MCP server
claude mcp add claude-flow npx claude-flow@alpha mcp startswarm_init, agent_spawn, task_orchestrate
swarm_status, agent_list, agent_metrics, task_status, task_results
memory_usage, neural_status, neural_train, neural_patterns
github_swarm, repo_analyze, pr_enhance, issue_triage, code_review
benchmark_run, features_detect, swarm_monitor
1️⃣ BEFORE Work:
npx claude-flow@alpha hooks pre-task --description "[task]"
npx claude-flow@alpha hooks session-restore --session-id "swarm-[id]"2️⃣ DURING Work:
npx claude-flow@alpha hooks post-edit --file "[file]" --memory-key "swarm/[agent]/[step]"
npx claude-flow@alpha hooks notify --message "[what was done]"3️⃣ AFTER Work:
npx claude-flow@alpha hooks post-task --task-id "[task]"
npx claude-flow@alpha hooks session-end --export-metrics true[BatchTool]:
// Initialize swarm
mcp__claude-flow__swarm_init { topology: "mesh", maxAgents: 6 }
mcp__claude-flow__agent_spawn { type: "researcher" }
mcp__claude-flow__agent_spawn { type: "coder" }
mcp__claude-flow__agent_spawn { type: "tester" }
// Spawn agents with Task tool
Task("Research agent: Analyze requirements...")
Task("Coder agent: Implement features...")
Task("Tester agent: Create test suite...")
// Batch todos
TodoWrite { todos: [
{id: "1", content: "Research", status: "in_progress", priority: "high"},
{id: "2", content: "Design", status: "pending", priority: "high"},
{id: "3", content: "Implement", status: "pending", priority: "high"},
{id: "4", content: "Test", status: "pending", priority: "medium"},
{id: "5", content: "Document", status: "pending", priority: "low"}
]}
// File operations
Bash "mkdir -p app/{src,tests,docs}"
Write "app/src/index.js"
Write "app/tests/index.test.js"
Write "app/docs/README.md"Message 1: mcp__claude-flow__swarm_init
Message 2: Task("agent 1")
Message 3: TodoWrite { todos: [single todo] }
Message 4: Write "file.js"
// This breaks parallel coordination!- 84.8% SWE-Bench solve rate
- 32.3% token reduction
- 2.8-4.4x speed improvement
- 27+ neural models
- Auto-assign agents by file type
- Validate commands for safety
- Prepare resources automatically
- Optimize topology by complexity
- Cache searches
- Auto-format code
- Train neural patterns
- Update memory
- Analyze performance
- Track token usage
- Generate summaries
- Persist state
- Track metrics
- Restore context
- Export workflows
- 🚀 Automatic Topology Selection
- ⚡ Parallel Execution (2.8-4.4x speed)
- 🧠 Neural Training
- 📊 Bottleneck Analysis
- 🤖 Smart Auto-Spawning
- 🛡️ Self-Healing Workflows
- 💾 Cross-Session Memory
- 🔗 GitHub Integration
- Start with basic swarm init
- Scale agents gradually
- Use memory for context
- Monitor progress regularly
- Train patterns from success
- Enable hooks automation
- Use GitHub tools first
- Documentation: https://github.com/ruvnet/claude-flow
- Issues: https://github.com/ruvnet/claude-flow/issues
Remember: Claude Flow coordinates, Claude Code creates!