Systematic SPARC methodology (Specification, Pseudocode, Architecture, Refinement, Completion) with Claude-Flow orchestration for concurrent agent-based development and Test-Driven workflows
A systematic development methodology combining SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) with Claude-Flow orchestration for concurrent agent-based development.
This skill enables Test-Driven Development using the SPARC methodology with concurrent agent execution. Claude Code's Task tool handles all execution while MCP tools optionally coordinate complex multi-agent topologies.
1. **ALL operations MUST be concurrent/parallel in a single message**
2. **NEVER save working files, text/mds and tests to the root folder**
3. **ALWAYS organize files in appropriate subdirectories**
4. **USE CLAUDE CODE'S TASK TOOL for spawning agents concurrently**
**Mandatory Patterns:**
**NEVER save to root folder. Use these directories:**
Execute these phases systematically:
1. **Specification** - Analyze requirements and define clear specifications
- Command: `npx claude-flow sparc run spec-pseudocode "<task>"`
- Output: Requirements analysis and functional specifications
2. **Pseudocode** - Design algorithms and logic flow
- Command: `npx claude-flow sparc run spec-pseudocode "<task>"`
- Output: Step-by-step algorithmic design
3. **Architecture** - Design system architecture and structure
- Command: `npx claude-flow sparc run architect "<task>"`
- Output: System design, component diagrams, data flows
4. **Refinement** - Implement with Test-Driven Development
- Command: `npx claude-flow sparc tdd "<feature>"`
- Output: Tests + implementation with TDD cycle
5. **Completion** - Integration and final validation
- Command: `npx claude-flow sparc run integration "<task>"`
- Output: Integrated system with validation
1. **Optional**: Use MCP tools to set up coordination topology (for complex tasks)
2. **Required**: Use Claude Code's Task tool to spawn agents that do actual work
3. **Required**: Each agent runs hooks for coordination
4. **Required**: Batch all operations in single messages
**Core Development**: `coder`, `reviewer`, `tester`, `planner`, `researcher`
**SPARC Methodology**: `sparc-coord`, `sparc-coder`, `specification`, `pseudocode`, `architecture`, `refinement`
**Specialized Development**: `backend-dev`, `mobile-dev`, `ml-developer`, `cicd-engineer`, `api-docs`, `system-architect`, `code-analyzer`
**Testing**: `tdd-london-swarm`, `production-validator`
**GitHub**: `github-modes`, `pr-manager`, `code-review-swarm`, `issue-tracker`, `release-manager`
**Performance**: `perf-analyzer`, `performance-benchmarker`, `task-orchestrator`
**Swarm Coordination**: `hierarchical-coordinator`, `mesh-coordinator`, `adaptive-coordinator`, `collective-intelligence-coordinator`
1. Create organized directory structure in ONE message:
```bash
Bash "mkdir -p {src,tests,docs,config}"
```
2. Run appropriate SPARC mode:
```bash
Bash "npx claude-flow sparc run <mode> '<task description>'"
```
3. Review output and implement changes with batched file operations
1. **Setup Phase** - Single message with all setup:
```javascript
Bash "mkdir -p {src,tests,docs,config,scripts,examples}"
TodoWrite { todos: [
{content: "Run specification phase", status: "pending", activeForm: "Running specification phase"},
{content: "Design pseudocode", status: "pending", activeForm: "Designing pseudocode"},
{content: "Create architecture", status: "pending", activeForm: "Creating architecture"},
{content: "Implement with TDD", status: "pending", activeForm: "Implementing with TDD"},
{content: "Complete integration", status: "pending", activeForm: "Completing integration"},
{content: "Run validation tests", status: "pending", activeForm: "Running validation tests"},
{content: "Generate documentation", status: "pending", activeForm: "Generating documentation"},
{content: "Build final package", status: "pending", activeForm: "Building final package"}
]}
```
2. **Specification & Pseudocode** - Run analysis:
```bash
Bash "npx claude-flow sparc run spec-pseudocode '<task>'"
```
3. **Architecture Phase** - Design system:
```bash
Bash "npx claude-flow sparc run architect '<task>'"
```
4. **Concurrent Agent Execution** - Single message spawning all agents:
```javascript
Task("Specification Agent", "Analyze requirements for <feature>. Document in docs/specifications.md. Use hooks for coordination.", "specification")
Task("Architecture Agent", "Design system architecture for <feature>. Store decisions in memory. Output to docs/architecture.md.", "architecture")
Task("Coder Agent", "Implement <feature> following TDD. Coordinate via hooks. Save to src/.", "sparc-coder")
Task("Tester Agent", "Create comprehensive test suite with 90% coverage. Save to tests/.", "tester")
Task("Reviewer Agent", "Review code quality, architecture alignment, and test coverage. Document in docs/review.md.", "reviewer")
```
5. **TDD Implementation** - Test-driven refinement:
```bash
Bash "npx claude-flow sparc tdd '<feature>'"
```
6. **Integration & Validation** - Complete and validate:
```bash
Bash "npx claude-flow sparc run integration '<task>' && npm run build && npm run test"
```
Execute with batched concurrent operations:
```javascript
// Single message - spawn all feature agents
Task("Feature A Developer", "Implement authentication. TDD approach. Save to src/auth/. Coordinate via memory.", "backend-dev")
Task("Feature B Developer", "Build REST API. TDD approach. Save to src/api/. Check memory for auth patterns.", "coder")
Task("Feature C Developer", "Create UI components. Save to src/components/. Coordinate with API agent.", "coder")
Task("Integration Tester", "Test feature integration. Save to tests/integration/.", "tester")
Task("Documentation Agent", "Generate API docs. Save to docs/api/.", "api-docs")
// Batch all todos
TodoWrite { todos: [...10+ todos for all features...] }
// Batch all directory creation
Bash "mkdir -p src/{auth,api,components} tests/{unit,integration} docs/{api,guides}"
```
Every agent spawned via Task tool MUST follow this protocol:
**Before Work:**
```bash
npx claude-flow@alpha hooks pre-task --description "[task]"
npx claude-flow@alpha hooks session-restore --session-id "swarm-[id]"
```
**During Work:**
```bash
npx claude-flow@alpha hooks post-edit --file "[file]" --memory-key "swarm/[agent]/[step]"
npx claude-flow@alpha hooks notify --message "[what was done]"
```
**After Work:**
```bash
npx claude-flow@alpha hooks post-task --task-id "[task]"
npx claude-flow@alpha hooks session-end --export-metrics true
```
```javascript
// Single message with complete parallel execution
[Parallel Agent Execution]:
// Spawn all agents concurrently
Task("Requirements Analyst", "Analyze full-stack requirements for user authentication. Document in docs/auth-spec.md.", "researcher")
Task("Backend Developer", "Build Express REST API with JWT auth. TDD approach. Save to src/backend/. Coordinate via hooks.", "backend-dev")
Task("Frontend Developer", "Create React login UI. Save to src/frontend/. Check memory for API contracts.", "coder")
Task("Database Architect", "Design PostgreSQL user schema. Save to src/database/. Store schema in memory.", "code-analyzer")
Task("Test Engineer", "Write Jest tests for all layers. Save to tests/. 90% coverage minimum.", "tester")
Task("DevOps Engineer", "Setup Docker and CI/CD pipeline. Save to config/. Document in docs/deployment.md.", "cicd-engineer")
Task("Security Auditor", "Review authentication security. Report findings to docs/security-audit.md.", "reviewer")
// Batch ALL todos (8-10 minimum)
TodoWrite { todos: [
{content: "Research auth patterns", status: "in_progress", activeForm: "Researching auth patterns"},
{content: "Design database schema", status: "in_progress", activeForm: "Designing database schema"},
{content: "Implement JWT authentication", status: "pending", activeForm: "Implementing JWT authentication"},
{content: "Build REST endpoints", status: "pending", activeForm: "Building REST endpoints"},
{content: "Create React components", status: "pending", activeForm: "Creating React components"},
{content: "Write unit tests", status: "pending", activeForm: "Writing unit tests"},
{content: "Write integration tests", status: "pending", activeForm: "Writing integration tests"},
{content: "Security audit", status: "pending", activeForm: "Performing security audit"},
{content: "Setup CI/CD", status: "pending", activeForm: "Setting up CI/CD"},
{content: "Generate documentation", status: "pending", activeForm: "Generating documentation"}
]}
// Batch all file operations
Bash "mkdir -p src/{backend,frontend,database} tests/{unit,integration} docs config"
Write "src/backend/server.js"
Write "src/frontend/App.jsx"
Write "src/database/schema.sql"
Write "tests/unit/auth.test.js"
Write "tests/integration/api.test.js"
Write "config/Dockerfile"
Write "docs/auth-spec.md"
```
1. **Never save to root folder** - Always use organized subdirectories
2. **Always batch operations** - Single message for related operations
3. **Always use Task tool for agents** - Not sequential commands
4. **Always create 8-10+ todos** - Comprehensive task tracking
5. **Never create unnecessary files** - Only what's required
6. **Prefer editing over creating** - Modify existing files when possible
7. **No proactive documentation** - Only when explicitly requested
```bash
claude mcp add claude-flow npx claude-flow@alpha mcp start
```
1. Start with basic SPARC phases for simple tasks
2. Scale to concurrent agents for complex features
3. Use memory for cross-agent context sharing
4. Monitor progress with hooks
5. Train neural patterns from successful workflows
6. Batch all operations in single messages
7. Organize files properly from the start
**Remember: Claude Flow coordinates, Claude Code creates!**
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/sparc-development-environment-with-claude-flow/raw