Skip to main content
sparc-methodology SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) comprehensive development methodology with multi-agent orchestration
Jump to install Skills Marketplace Discover and explore AI skills built by the community.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Copy promptShow prompt details A direct command skips the review prompt. Inspect the source before running it.
npx skills add https://github.com/oimiragieo/agent-studio --skill sparc-methodologyThe command stays on one line. Scroll horizontally to inspect it before copying.
Prefer a local copy? Download the files currently available to SkillsMP.
Download Zip Downloading... Related occupations SOC
Based on SOC occupation classification
More from this repository name sparc-methodology description SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) comprehensive development methodology with multi-agent orchestration version 2.7.0 category development tags ["sparc","tdd","architecture","orchestration","methodology","multi-agent"] author Agent Studio tools ["Read","Write","Edit","Bash","Task","TaskUpdate","TaskList","Skill"] verified true lastVerifiedAt "2026-02-22T00:00:00.000Z" source builtin trust_score 100 provenance_sha 39d235c8689bd68b
SPARC Methodology - Comprehensive Development Framework
Overview
SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) is a systematic development methodology integrated with this framework's multi-agent orchestration capabilities. It provides 17 specialized modes for comprehensive software development, from initial research through deployment and monitoring.
In agent-studio: When the mcp__claude-flow__* or npx claude-flow examples below are not available, use the Task tool to spawn agents (e.g. planner, developer, qa, architect) and follow the workflows in .claude/workflows/ and router-decision.md instead.
Table of Contents
Core Philosophy
Development Phases
Available Modes
Activation Methods
Orchestration Patterns
TDD Workflows
Best Practices
Integration Examples
Common Workflows
Core Philosophy
SPARC methodology emphasizes:
Systematic Approach : Structured phases from specification to completion
Test-Driven Development : Tests written before implementation
Parallel Execution : Concurrent agent coordination for 2.8-4.4x speed improvements
Memory Integration : Persistent knowledge sharing across agents and sessions
Quality First : Comprehensive reviews, testing, and validation
Modular Design : Clean separation of concerns with clear interfaces
Key Principles
Specification Before Code : Define requirements and constraints clearly
Design Before Implementation : Plan architecture and components
Tests Before Features : Write failing tests, then make them pass
Review Everything : Code quality, security, and performance checks
Document Continuously : Maintain current documentation throughout
Development Phases
Phase 1: Specification
Goal : Define requirements, constraints, and success criteria
Requirements analysis
User story mapping
Constraint identification
Success metrics definition
Pseudocode planning
Key Modes : researcher, analyzer, memory-manager
Phase 2: Architecture Goal : Design system structure and component interfaces
System architecture design
Component interface definition
Database schema planning
API contract specification
Infrastructure planning
Key Modes : architect, designer, orchestrator
Phase 3: Refinement (TDD Implementation) Goal : Implement features with test-first approach
Write failing tests
Implement minimum viable code
Make tests pass
Refactor for quality
Iterate until complete
Key Modes : tdd, coder, tester
Phase 4: Review Goal : Ensure code quality, security, and performance
Code quality assessment
Security vulnerability scanning
Performance profiling
Best practices validation
Documentation review
Key Modes : reviewer, optimizer, debugger
Phase 5: Completion Goal : Integration, deployment, and monitoring
System integration
Deployment automation
Monitoring setup
Documentation finalization
Knowledge capture
Key Modes : workflow-manager, documenter, memory-manager
Available Modes
Core Orchestration Modes
orchestratorMulti-agent task orchestration with TaskCreate/Task/Memory coordination.
Task decomposition into manageable units
Agent coordination and resource allocation
Progress tracking and result synthesis
Adaptive strategy selection
Cross-agent communication
mcp__claude-flow__sparc_mode {
mode : "orchestrator" ,
task_description : "coordinate feature development" ,
options : { parallel : true , monitor : true }
}
swarm-coordinatorSpecialized swarm management for complex multi-agent workflows.
Topology optimization (mesh, hierarchical, ring, star)
Agent lifecycle management
Dynamic scaling based on workload
Fault tolerance and recovery
Performance monitoring
workflow-managerProcess automation and workflow orchestration.
Workflow definition and execution
Event-driven triggers
Sequential and parallel pipelines
State management
Error handling and retry logic
batch-executorParallel task execution for high-throughput operations.
Concurrent file operations
Batch processing optimization
Resource pooling
Load balancing
Progress aggregation
Development Modes
coderAutonomous code generation with batch file operations.
Feature implementation
Code refactoring
Bug fixes and patches
API development
Algorithm implementation
ES2022+ standards
TypeScript type safety
Comprehensive error handling
Performance optimization
Security best practices
mcp__claude-flow__sparc_mode {
mode : "coder" ,
task_description : "implement user authentication with JWT" ,
options : {
test_driven : true ,
parallel_edits : true ,
typescript : true
}
}
architectSystem design with Memory-based coordination.
Microservices architecture
Event-driven design
Domain-driven design (DDD)
Hexagonal architecture
CQRS and Event Sourcing
Store architectural decisions
Share component specifications
Maintain design consistency
Track architectural evolution
Layered architecture
Microservices patterns
Event-driven patterns
Domain modeling
Infrastructure as Code
mcp__claude-flow__sparc_mode {
mode : "architect" ,
task_description : "design scalable e-commerce platform" ,
options : {
detailed : true ,
memory_enabled : true ,
patterns : ["microservices" , "event-driven" ]
}
}
tddTest-driven development with comprehensive testing.
Test-first development
Red-green-refactor cycle
Test suite design
Coverage optimization (target: 90%+)
Continuous testing
Write failing test (RED)
Implement minimum code
Make test pass (GREEN)
Refactor for quality (REFACTOR)
Repeat cycle
Unit testing (Jest, Mocha, Vitest)
Integration testing
End-to-end testing (Playwright, Cypress)
Performance testing
Security testing
mcp__claude-flow__sparc_mode {
mode : "tdd" ,
task_description : "shopping cart feature with payment integration" ,
options : {
coverage_target : 90 ,
test_framework : "jest" ,
e2e_framework : "playwright"
}
}
reviewerCode review using batch file analysis.
Code quality assessment
Security vulnerability detection
Performance analysis
Best practices validation
Documentation review
Code correctness and logic
Design pattern adherence
Comprehensive error handling
Test coverage adequacy
Maintainability and readability
Security vulnerabilities
Performance bottlenecks
Parallel file review
Pattern detection
Dependency checking
Consistency validation
Automated reporting
mcp__claude-flow__sparc_mode {
mode : "reviewer" ,
task_description : "review authentication module PR #123" ,
options : {
security_check : true ,
performance_check : true ,
test_coverage_check : true
}
}
Analysis and Research Modes
researcherDeep research with parallel WebSearch/WebFetch and Memory coordination.
Comprehensive information gathering
Source credibility evaluation
Trend analysis and forecasting
Competitive research
Technology assessment
Parallel web searches
Academic paper analysis
Industry report synthesis
Expert opinion gathering
Statistical data compilation
Store research findings with citations
Build knowledge graphs
Track information sources
Cross-reference insights
Maintain research history
mcp__claude-flow__sparc_mode {
mode : "researcher" ,
task_description : "research microservices best practices 2024" ,
options : {
depth : "comprehensive" ,
sources : ["academic" , "industry" , "news" ],
citations : true
}
}
analyzerCode and data analysis with pattern recognition.
Static code analysis
Dependency analysis
Performance profiling
Security scanning
Data pattern recognition
optimizerPerformance optimization and bottleneck resolution.
Algorithm optimization
Database query tuning
Caching strategy design
Bundle size reduction
Memory leak detection
Creative and Support Modes
designerUI/UX design with accessibility focus.
Interface design
User experience optimization
Accessibility compliance (WCAG 2.1)
Design system creation
Responsive layout design
innovatorCreative problem-solving and novel solutions.
Brainstorming and ideation
Alternative approach generation
Technology evaluation
Proof of concept development
Innovation feasibility analysis
documenterComprehensive documentation generation.
API documentation (OpenAPI/Swagger)
Architecture diagrams
User guides and tutorials
Code comments and JSDoc
README and changelog maintenance
debuggerSystematic debugging and issue resolution.
Bug reproduction
Root cause analysis
Fix implementation
Regression prevention
Debug logging optimization
testerComprehensive testing beyond TDD.
Test suite expansion
Edge case identification
Performance testing
Load testing
Chaos engineering
memory-managerKnowledge management and context preservation.
Cross-session memory persistence
Knowledge graph construction
Context restoration
Learning pattern extraction
Decision tracking
Activation Methods
Method 1: MCP Tools (Preferred in Claude Code) Best for : Integrated Claude Code workflows with full orchestration capabilities
mcp__claude-flow__sparc_mode {
mode : "<mode-name>" ,
task_description : "<task description>" ,
options : {
}
}
mcp__claude-flow__swarm_init {
topology : "hierarchical" ,
strategy : "auto" ,
maxAgents : 8
}
mcp__claude-flow__agent_spawn {
type : "<agent-type>" ,
capabilities : ["<capability1>" , "<capability2>" ]
}
mcp__claude-flow__swarm_monitor {
swarmId : "current" ,
interval : 5000
}
Method 2: NPX CLI (Fallback) Best for : Terminal usage or when MCP tools unavailable
npx claude-flow sparc run <mode> "task description"
npx claude-flow@alpha sparc run <mode> "task description"
npx claude-flow sparc modes
npx claude-flow sparc help <mode>
npx claude-flow sparc run <mode> "task" --parallel --monitor
npx claude-flow sparc tdd "feature description"
npx claude-flow sparc batch <mode1,mode2,mode3> "task"
npx claude-flow sparc pipeline "task description"
Method 3: Local Installation Best for : Projects with local claude-flow installation
./claude-flow sparc run <mode> "task description"
Orchestration Patterns
Pattern 1: Hierarchical Coordination Best for : Complex projects with clear delegation hierarchy
mcp__claude-flow__swarm_init {
topology : "hierarchical" ,
maxAgents : 12
}
mcp__claude-flow__agent_spawn {
type : "coordinator" ,
capabilities : ["planning" , "delegation" , "monitoring" ]
}
mcp__claude-flow__agent_spawn { type : "architect" }
mcp__claude-flow__agent_spawn { type : "coder" }
mcp__claude-flow__agent_spawn { type : "tester" }
mcp__claude-flow__agent_spawn { type : "reviewer" }
Pattern 2: Mesh Coordination Best for : Collaborative tasks requiring peer-to-peer communication
mcp__claude-flow__swarm_init {
topology : "mesh" ,
strategy : "balanced" ,
maxAgents : 6
}
Pattern 3: Sequential Pipeline Best for : Ordered workflow execution (spec → design → code → test → review)
mcp__claude-flow__workflow_create {
name : "development-pipeline" ,
steps : [
{ mode : "researcher" , task : "gather requirements" },
{ mode : "architect" , task : "design system" },
{ mode : "coder" , task : "implement features" },
{ mode : "tdd" , task : "create tests" },
{ mode : "reviewer" , task : "review code" }
],
triggers : ["on_step_complete" ]
}
Pattern 4: Parallel Execution Best for : Independent tasks that can run concurrently
mcp__claude-flow__task_orchestrate {
task : "build full-stack application" ,
strategy : "parallel" ,
dependencies : {
backend : [],
frontend : [],
database : [],
tests : ["backend" , "frontend" ]
}
}
Pattern 5: Adaptive Strategy Best for : Dynamic workloads with changing requirements
mcp__claude-flow__swarm_init {
topology : "hierarchical" ,
strategy : "adaptive" ,
maxAgents : 20
}
TDD Workflows
Complete TDD Workflow
mcp__claude-flow__swarm_init {
topology : "hierarchical" ,
maxAgents : 8
}
mcp__claude-flow__sparc_mode {
mode : "researcher" ,
task_description : "research testing best practices for feature X"
}
mcp__claude-flow__sparc_mode {
mode : "architect" ,
task_description : "design testable architecture for feature X"
}
mcp__claude-flow__sparc_mode {
mode : "tdd" ,
task_description : "implement feature X with 90% coverage" ,
options : {
coverage_target : 90 ,
test_framework : "jest" ,
parallel_tests : true
}
}
mcp__claude-flow__sparc_mode {
mode : "reviewer" ,
task_description : "review feature X implementation" ,
options : {
test_coverage_check : true ,
security_check : true
}
}
mcp__claude-flow__sparc_mode {
mode : "optimizer" ,
task_description : "optimize feature X performance"
}
Red-Green-Refactor Cycle
mcp__claude-flow__sparc_mode {
mode : "tester" ,
task_description : "create failing test for shopping cart add item" ,
options : { expect_failure : true }
}
mcp__claude-flow__sparc_mode {
mode : "coder" ,
task_description : "implement minimal code to pass test" ,
options : { minimal : true }
}
mcp__claude-flow__sparc_mode {
mode : "coder" ,
task_description : "refactor shopping cart implementation" ,
options : { maintain_tests : true }
}
Best Practices
1. Memory Integration Always use Memory for cross-agent coordination :
mcp__claude-flow__memory_usage {
action : "store" ,
namespace : "architecture" ,
key : "api-design-v1" ,
value : JSON .stringify (apiDesign),
ttl : 86400000
}
mcp__claude-flow__memory_usage {
action : "retrieve" ,
namespace : "architecture" ,
key : "api-design-v1"
}
2. Parallel Operations Batch all related operations in single message :
[Single Message ]:
mcp__claude-flow__agent_spawn { type : "researcher" }
mcp__claude-flow__agent_spawn { type : "coder" }
mcp__claude-flow__agent_spawn { type : "tester" }
TaskCreate { tasks : [8 -10 tasks] }
Message 1 : mcp__claude-flow__agent_spawn { type : "researcher" }
Message 2 : mcp__claude-flow__agent_spawn { type : "coder" }
Message 3 : TaskCreate { tasks : [...] }
3. Hook Integration Every SPARC mode should use hooks :
npx claude-flow@alpha hooks pre-task --description "implement auth"
npx claude-flow@alpha hooks post-edit --file "auth.js"
npx claude-flow@alpha hooks post-task --task-id "task-123"
4. Test Coverage Maintain minimum 90% coverage :
Unit tests for all functions
Integration tests for APIs
E2E tests for critical flows
Edge case coverage
Error path testing
5. Documentation
API documentation (OpenAPI)
Architecture decision records (ADR)
Code comments for complex logic
README with setup instructions
Changelog for version tracking
6. File Organization Never save to root folder :
project/
├── src/ # Source code
├── tests/ # Test files
├── docs/ # Documentation
├── config/ # Configuration
├── scripts/ # Utility scripts
└── examples/ # Example code
Integration Examples
Example 1: Full-Stack Development [Single Message - Parallel Agent Execution ]:
mcp__claude-flow__swarm_init {
topology : "hierarchical" ,
maxAgents : 10
}
mcp__claude-flow__sparc_mode {
mode : "architect" ,
task_description : "design REST API with authentication" ,
options : { memory_enabled : true }
}
mcp__claude-flow__sparc_mode {
mode : "researcher" ,
task_description : "research authentication best practices"
}
mcp__claude-flow__sparc_mode {
mode : "coder" ,
task_description : "implement Express API with JWT auth" ,
options : { test_driven : true }
}
mcp__claude-flow__sparc_mode {
mode : "tdd" ,
task_description : "comprehensive API tests" ,
options : { coverage_target : 90 }
}
mcp__claude-flow__sparc_mode {
mode : "reviewer" ,
task_description : "security and performance review" ,
options : { security_check : true }
}
TaskCreate {
tasks : [
{content : "Design API schema" , status : "completed" },
{content : "Research JWT implementation" , status : "completed" },
{content : "Implement authentication" , status : "in_progress" },
{content : "Write API tests" , status : "pending" },
{content : "Security review" , status : "pending" },
{content : "Performance optimization" , status : "pending" },
{content : "API documentation" , status : "pending" },
{content : "Deployment setup" , status : "pending" }
]
}
Example 2: Research-Driven Innovation
mcp__claude-flow__sparc_mode {
mode : "researcher" ,
task_description : "research AI-powered search implementations" ,
options : {
depth : "comprehensive" ,
sources : ["academic" , "industry" ]
}
}
mcp__claude-flow__sparc_mode {
mode : "innovator" ,
task_description : "propose novel search algorithm" ,
options : { memory_enabled : true }
}
mcp__claude-flow__sparc_mode {
mode : "architect" ,
task_description : "design scalable search system"
}
mcp__claude-flow__sparc_mode {
mode : "coder" ,
task_description : "implement search algorithm" ,
options : { test_driven : true }
}
mcp__claude-flow__sparc_mode {
mode : "documenter" ,
task_description : "document search system architecture and API"
}
Example 3: Legacy Code Refactoring
mcp__claude-flow__sparc_mode {
mode : "analyzer" ,
task_description : "analyze legacy codebase dependencies"
}
mcp__claude-flow__sparc_mode {
mode : "orchestrator" ,
task_description : "plan incremental refactoring strategy"
}
mcp__claude-flow__sparc_mode {
mode : "tester" ,
task_description : "create comprehensive test suite for legacy code" ,
options : { coverage_target : 80 }
}
mcp__claude-flow__sparc_mode {
mode : "coder" ,
task_description : "refactor module X with modern patterns" ,
options : { maintain_tests : true }
}
mcp__claude-flow__sparc_mode {
mode : "reviewer" ,
task_description : "validate refactoring maintains functionality"
}
Common Workflows
Workflow 1: Feature Development
npx claude-flow sparc run researcher "authentication patterns"
npx claude-flow sparc run architect "design auth system"
npx claude-flow sparc tdd "user authentication feature"
npx claude-flow sparc run reviewer "review auth implementation"
npx claude-flow sparc run documenter "document auth API"
Workflow 2: Bug Investigation
npx claude-flow sparc run analyzer "investigate bug #456"
npx claude-flow sparc run debugger "fix memory leak in service X"
npx claude-flow sparc run tester "regression tests for bug #456"
npx claude-flow sparc run reviewer "validate bug fix"
Workflow 3: Performance Optimization
npx claude-flow sparc run analyzer "profile API response times"
npx claude-flow sparc run optimizer "optimize database queries"
npx claude-flow sparc run coder "implement caching layer"
npx claude-flow sparc run tester "performance benchmarks"
Workflow 4: Complete Pipeline
npx claude-flow sparc pipeline "e-commerce checkout feature"
Advanced Features
Neural Pattern Training
mcp__claude-flow__neural_train {
pattern_type : "coordination" ,
training_data : "successful_tdd_workflow.json" ,
epochs : 50
}
Cross-Session Memory
mcp__claude-flow__memory_persist {
sessionId : "feature-auth-v1"
}
mcp__claude-flow__context_restore {
snapshotId : "feature-auth-v1"
}
GitHub Integration
mcp__claude-flow__github_repo_analyze {
repo : "owner/repo" ,
analysis_type : "code_quality"
}
mcp__claude-flow__github_pr_manage {
repo : "owner/repo" ,
pr_number : 123 ,
action : "review"
}
Performance Monitoring
mcp__claude-flow__swarm_monitor {
swarmId : "current" ,
interval : 5000
}
mcp__claude-flow__bottleneck_analyze {
component : "api-layer" ,
metrics : ["latency" , "throughput" , "errors" ]
}
mcp__claude-flow__token_usage {
operation : "feature-development" ,
timeframe : "24h"
}
Performance Benefits
84.8% SWE-Bench solve rate
32.3% token reduction through optimizations
2.8-4.4x speed improvement with parallel execution
27+ neural models for pattern learning
90%+ test coverage standard
Support and Resources
Quick Reference
Most Common Commands
npx claude-flow sparc modes
npx claude-flow sparc run <mode> "task"
npx claude-flow sparc tdd "feature"
npx claude-flow sparc pipeline "task"
npx claude-flow sparc batch <modes> "task"
Most Common MCP Calls
mcp__claude-flow__swarm_init { topology : "hierarchical" }
mcp__claude-flow__sparc_mode { mode : "coder" , task_description : "..." }
mcp__claude-flow__swarm_monitor { interval : 5000 }
mcp__claude-flow__memory_usage { action : "store" , key : "..." , value : "..." }
Iron Laws
NEVER write implementation code before completing the Specification phase
ALWAYS write failing tests before any implementation in the Refinement phase
NEVER advance to the next SPARC phase without completing all review gates of the current phase
ALWAYS decompose complex tasks into subtasks with explicit dependencies before spawning agents
NEVER claim phase completion without documented evidence of passing quality gates
Anti-Patterns Anti-Pattern Why It Fails Correct Approach Skipping Specification phase Implementation targets wrong requirements Define requirements, user stories, and constraints before any code Implementing before tests No way to verify correctness; regressions slip through Write failing tests in Refinement before writing any feature code Phase-skipping under time pressure Quality gates missed; downstream phases fail Complete all review gates before advancing; gates exist for good reasons Spawning agents without dependency mapping Agents block each other or duplicate work Map task dependencies and parallel groups before spawning agents Marking phases complete without evidence Incomplete work propagates to later phases Require explicit gate evidence (test results, review sign-off) per phase
Memory Protocol (MANDATORY) Before starting:
Read .claude/context/memory/learnings.md
New pattern -> .claude/context/memory/learnings.md
Issue found -> .claude/context/memory/issues.md
Decision made -> .claude/context/memory/decisions.md
ASSUME INTERRUPTION: If it's not in memory, it didn't happen.
Remember: SPARC = Systematic, Parallel, Agile, Refined, Complete