This project uses the SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) methodology for systematic Test-Driven Development with AI assistance through Claude-Flow orchestration.
npx claude-flow sparc modes: List all available SPARC development modesnpx claude-flow sparc run <mode> "<task>": Execute specific SPARC mode for a tasknpx claude-flow sparc tdd "<feature>": Run complete TDD workflow using SPARC methodologynpx claude-flow sparc info <mode>: Get detailed information about a specific mode
npm run build: Build the projectnpm run test: Run the test suitenpm run lint: Run linter and format checksnpm run typecheck: Run TypeScript type checking
# Create detailed specifications and requirements
npx claude-flow sparc run spec-pseudocode "Define user authentication requirements"- Define clear functional requirements
- Document edge cases and constraints
- Create user stories and acceptance criteria
- Establish non-functional requirements
# Develop algorithmic logic and data flows
npx claude-flow sparc run spec-pseudocode "Create authentication flow pseudocode"- Break down complex logic into steps
- Define data structures and interfaces
- Plan error handling and edge cases
- Create modular, testable components
# Design system architecture and component structure
npx claude-flow sparc run architect "Design authentication service architecture"- Create system diagrams and component relationships
- Define API contracts and interfaces
- Plan database schemas and data flows
- Establish security and scalability patterns
# Execute Test-Driven Development cycle
npx claude-flow sparc tdd "implement user authentication system"TDD Cycle:
- Red: Write failing tests first
- Green: Implement minimal code to pass tests
- Refactor: Optimize and clean up code
- Repeat: Continue until feature is complete
# Integration, documentation, and validation
npx claude-flow sparc run integration "integrate authentication with user management"- Integrate all components
- Perform end-to-end testing
- Create comprehensive documentation
- Validate against original requirements
architect: System design and architecture planningcode: Clean, modular code implementationtdd: Test-driven development and testingspec-pseudocode: Requirements and algorithmic planningintegration: System integration and coordination
debug: Troubleshooting and bug resolutionsecurity-review: Security analysis and vulnerability assessmentrefinement-optimization-mode: Performance optimization and refactoring
docs-writer: Documentation creation and maintenancedevops: Deployment and infrastructure managementmcp: External service integrationswarm: Multi-agent coordination for complex tasks
Claude Code slash commands are available in .claude/commands/:
/sparc: Execute SPARC methodology workflows/sparc-<mode>: Run specific SPARC mode (e.g., /sparc-architect)/claude-flow-help: Show all Claude-Flow commands/claude-flow-memory: Interact with memory system/claude-flow-swarm: Coordinate multi-agent swarms
- Type
/in Claude Code to see available commands - Select a command or type its name
- Commands are context-aware and project-specific
- Custom commands can be added to
.claude/commands/
- Modular Design: Keep files under 500 lines, break into logical components
- Environment Safety: Never hardcode secrets or environment-specific values
- Test-First: Always write tests before implementation (Red-Green-Refactor)
- Clean Architecture: Separate concerns, use dependency injection
- Documentation: Maintain clear, up-to-date documentation
- Use TypeScript for type safety and better tooling
- Follow consistent naming conventions (camelCase for variables, PascalCase for classes)
- Implement proper error handling and logging
- Use async/await for asynchronous operations
- Prefer composition over inheritance
- Use claude-flow memory system for persistent state across sessions
- Store progress and findings using namespaced keys
- Query previous work before starting new tasks
- Export/import memory for backup and sharing
# Store project specifications
npx claude-flow memory store spec_auth "User authentication requirements and constraints"
# Store architectural decisions
npx claude-flow memory store arch_decisions "Database schema and API design choices"
# Store test results and coverage
npx claude-flow memory store test_coverage "Authentication module: 95% coverage, all tests passing"
# Query previous work
npx claude-flow memory query auth_implementation
# Export project memory
npx claude-flow memory export project_backup.jsonspec: Requirements and specificationsarch: Architecture and design decisionsimpl: Implementation notes and code patternstest: Test results and coverage reportsdebug: Bug reports and resolution notes
# 1. Start with specification
npx claude-flow sparc run spec-pseudocode "User profile management feature"
# 2. Design architecture
npx claude-flow sparc run architect "Profile service architecture with data validation"
# 3. Implement with TDD
npx claude-flow sparc tdd "user profile CRUD operations"
# 4. Security review
npx claude-flow sparc run security-review "profile data access and validation"
# 5. Integration testing
npx claude-flow sparc run integration "profile service with authentication system"
# 6. Documentation
npx claude-flow sparc run docs-writer "profile service API documentation"# 1. Debug and analyze
npx claude-flow sparc run debug "authentication token expiration issue"
# 2. Write regression tests
npx claude-flow sparc run tdd "token refresh mechanism tests"
# 3. Implement fix
npx claude-flow sparc run code "fix token refresh in authentication service"
# 4. Security review
npx claude-flow sparc run security-review "token handling security implications".claude/commands/: Claude Code slash commands for all SPARC modes.claude/logs/: Conversation and session logs
.roomodes: SPARC mode definitions and configurations (auto-generated).roo/: SPARC templates and workflows (auto-generated)
memory/: Persistent memory and session datacoordination/: Multi-agent coordination settingsCLAUDE.md: Project instructions for Claude Code
- Specification commits: After completing requirements analysis
- Architecture commits: After design phase completion
- TDD commits: After each Red-Green-Refactor cycle
- Integration commits: After successful component integration
- Documentation commits: After completing documentation updates
feature/sparc-<feature-name>: Feature development with SPARC methodologyhotfix/sparc-<issue>: Bug fixes using SPARC debugging workflowrefactor/sparc-<component>: Refactoring using optimization mode
- Mode not found: Check
.roomodesfile exists and is valid JSON - Memory persistence: Ensure
memory/directory has write permissions - Tool access: Verify required tools are available for the selected mode
- Namespace conflicts: Use unique memory namespaces for different features
# Check SPARC configuration
npx claude-flow sparc modes
# Verify memory system
npx claude-flow memory stats
# Check system status
npx claude-flow status
# View detailed mode information
npx claude-flow sparc info <mode-name>This SPARC-enabled project follows a systematic development approach:
- Clear separation of concerns through modular design
- Test-driven development ensuring reliability and maintainability
- Iterative refinement for continuous improvement
- Comprehensive documentation for team collaboration
- AI-assisted development through specialized SPARC modes
- Always run tests before committing (
npm run test) - Use SPARC memory system to maintain context across sessions
- Follow the Red-Green-Refactor cycle during TDD phases
- Document architectural decisions in memory for future reference
- Regular security reviews for any authentication or data handling code
- Claude Code slash commands provide quick access to SPARC modes
For more information about SPARC methodology, see: https://github.com/ruvnet/claude-code-flow/docs/sparc.md