Systematic Test-Driven Development using SPARC methodology (Specification, Pseudocode, Architecture, Refinement, Completion) with Claude-Flow orchestration for concurrent agent execution and advanced code generation.
A comprehensive skill for systematic Test-Driven Development using SPARC methodology with Claude-Flow orchestration. Enables concurrent agent execution, parallel file operations, and advanced coordination patterns for complex software development tasks.
This skill enables you to:
**ABSOLUTE REQUIREMENTS:**
1. ALL operations MUST be concurrent/parallel in a single message
2. NEVER save files to the root folder
3. ALWAYS organize files in appropriate subdirectories (`/src`, `/tests`, `/docs`, `/config`, `/scripts`, `/examples`)
4. USE CLAUDE CODE'S TASK TOOL as the primary execution mechanism
**Mandatory Batching Patterns:**
1. **Add Claude-Flow MCP Server** (if not already installed):
```bash
claude mcp add claude-flow npx claude-flow@alpha mcp start
```
2. **Verify Available Tools**:
- Claude Code Task tool (primary execution)
- MCP tools for coordination (optional for complex tasks)
- File operation tools (Read, Write, Edit, Glob, Grep)
3. **Create Project Structure**:
```bash
mkdir -p {src,tests,docs,config,scripts,examples}
```
Execute SPARC phases using Claude-Flow commands:
**1. Specification Phase** - Requirements Analysis:
```bash
npx claude-flow sparc run spec-pseudocode "<task description>"
```
**2. Pseudocode Phase** - Algorithm Design:
```bash
npx claude-flow sparc run spec-pseudocode "<detailed requirements>"
```
**3. Architecture Phase** - System Design:
```bash
npx claude-flow sparc run architect "<architecture requirements>"
```
**4. Refinement Phase** - TDD Implementation:
```bash
npx claude-flow sparc tdd "<feature to implement>"
```
**5. Completion Phase** - Integration:
```bash
npx claude-flow sparc run integration "<integration requirements>"
```
**Step 1: Optional Coordination Setup** (for complex multi-agent tasks):
```javascript
[Single Message - MCP Coordination]:
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" }
```
**Step 2: Parallel Agent Spawning via Claude Code Task Tool**:
```javascript
[Single Message - All Agents + Todos + Files]:
// Spawn ALL agents concurrently
Task("Research Agent", "Analyze requirements and best practices. Store findings in memory.", "researcher")
Task("Architect Agent", "Design system architecture. Document decisions.", "system-architect")
Task("Backend Agent", "Implement core backend logic with Express. Use coordination hooks.", "backend-dev")
Task("Frontend Agent", "Build UI components with React. Coordinate via memory.", "coder")
Task("Database Agent", "Design and implement schema. Store schema in memory.", "code-analyzer")
Task("Test Agent", "Create comprehensive test suite with 90% coverage.", "tester")
Task("DevOps Agent", "Setup CI/CD and Docker. Document infrastructure.", "cicd-engineer")
Task("Reviewer Agent", "Review code quality and security. Report findings.", "reviewer")
// Batch ALL todos together (8-10+ items)
TodoWrite { todos: [
{id: "1", content: "Research and requirements analysis", status: "in_progress"},
{id: "2", content: "Architecture design and documentation", status: "in_progress"},
{id: "3", content: "Database schema implementation", status: "in_progress"},
{id: "4", content: "Backend API development", status: "pending"},
{id: "5", content: "Frontend UI components", status: "pending"},
{id: "6", content: "Authentication system", status: "pending"},
{id: "7", content: "Unit test suite", status: "pending"},
{id: "8", content: "Integration tests", status: "pending"},
{id: "9", content: "CI/CD pipeline setup", status: "pending"},
{id: "10", content: "Security audit and review", status: "pending"}
]}
// Batch ALL file operations
Bash "mkdir -p src/{api,models,utils} tests/{unit,integration} docs config"
Write "src/api/server.js"
Write "src/models/schema.sql"
Write "tests/unit/server.test.js"
Write "docs/ARCHITECTURE.md"
Write "config/database.js"
```
Each agent spawned via Task tool MUST execute coordination hooks:
**Before Work**:
```bash
npx claude-flow@alpha hooks pre-task --description "[task description]"
npx claude-flow@alpha hooks session-restore --session-id "swarm-[id]"
```
**During Work**:
```bash
npx claude-flow@alpha hooks post-edit --file "[filepath]" --memory-key "swarm/[agent]/[step]"
npx claude-flow@alpha hooks notify --message "[progress update]"
```
**After Work**:
```bash
npx claude-flow@alpha hooks post-task --task-id "[task-id]"
npx claude-flow@alpha hooks session-end --export-metrics true
```
**NEVER save to root folder. Use these directories:**
**Core Development**: `coder`, `reviewer`, `tester`, `planner`, `researcher`
**Swarm Coordination**: `hierarchical-coordinator`, `mesh-coordinator`, `adaptive-coordinator`, `collective-intelligence-coordinator`, `swarm-memory-manager`
**Performance**: `perf-analyzer`, `performance-benchmarker`, `task-orchestrator`, `memory-coordinator`
**GitHub**: `github-modes`, `pr-manager`, `code-review-swarm`, `issue-tracker`, `release-manager`, `workflow-automation`
**SPARC**: `sparc-coord`, `sparc-coder`, `specification`, `pseudocode`, `architecture`, `refinement`
**Specialized**: `backend-dev`, `mobile-dev`, `ml-developer`, `cicd-engineer`, `api-docs`, `system-architect`
**Testing**: `tdd-london-swarm`, `production-validator`
**Batch Processing**:
```bash
npx claude-flow sparc batch <modes> "<task>"
npx claude-flow sparc pipeline "<task>"
npx claude-flow sparc concurrent <mode> "<tasks-file>"
```
**Monitoring & Metrics**:
```bash
npx claude-flow@alpha hooks session-end --export-metrics true
mcp__claude-flow__swarm_status
mcp__claude-flow__agent_metrics
```
**Build & Test**:
```bash
npm run build
npm run test
npm run lint
npm run typecheck
```
1. **Start with basic swarm init for simple tasks**
2. **Scale agents gradually for complex workflows**
3. **Use memory for cross-agent context sharing**
4. **Monitor progress regularly with metrics**
5. **Train patterns from successful workflows**
6. **Enable hooks automation for coordination**
7. **Always batch operations in single messages**
8. **Never hardcode secrets - use environment variables**
9. **Write tests before implementation (TDD)**
10. **Keep files modular (under 500 lines)**
```javascript
// Single message with complete workflow setup
[All Operations Batched]:
// Agent spawning via Claude Code Task tool
Task("Backend Dev", "Build REST API with Express, PostgreSQL. Auth required.", "backend-dev")
Task("Frontend Dev", "Create React SPA. Integrate with backend API.", "coder")
Task("DB Architect", "Design normalized schema. Store in memory.", "code-analyzer")
Task("Test Engineer", "Write Jest tests. 90% coverage target.", "tester")
Task("DevOps", "Docker + CI/CD pipeline setup.", "cicd-engineer")
Task("Security", "Audit auth, validate inputs, check OWASP.", "reviewer")
// Complete todo list (10 items)
TodoWrite { todos: [...10 todos...] }
// All file operations in parallel
Bash "mkdir -p src/{api,models,middleware} tests/{unit,integration} config docs"
Write "src/api/server.js"
Write "src/models/user.js"
Write "src/middleware/auth.js"
Write "tests/unit/api.test.js"
Write "tests/integration/auth.test.js"
Write "config/database.js"
Write "docs/API.md"
Write "package.json"
Write "Dockerfile"
Write ".github/workflows/ci.yml"
```
**Claude Code Handles ALL EXECUTION**:
**MCP Tools ONLY COORDINATE** (optional for complex tasks):
**Remember**: MCP coordinates the strategy, Claude Code's Task tool executes with real agents.
---
**Core Philosophy**: Claude-Flow coordinates, Claude Code creates. Always execute concurrently, always batch operations, always organize files properly.
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/sparc-development-with-claude-flow/raw