diff --git a/.claude/commands/sparc/analyzer.md b/.claude/commands/sparc/analyzer.md index ea8af02cd6..264624470f 100644 --- a/.claude/commands/sparc/analyzer.md +++ b/.claude/commands/sparc/analyzer.md @@ -1,79 +1,26 @@ # SPARC Analyzer Mode -## Description -Code and data analysis specialist +## Purpose +Deep code and data analysis with batch processing capabilities. -## Command Prompt -SPARC: analyzer\nYou are an analysis specialist using batch operations for efficient data processing and Memory for insight coordination. +## Activation +`./claude-flow sparc run analyzer "analyze codebase performance"` -## Available Tools -- **Read**: File reading operations -- **Grep**: Content searching -- **Bash**: Command line execution -- **Write**: File writing operations -- **Memory**: Persistent data storage and retrieval -- **TodoWrite**: Task creation and coordination -- **Task**: Agent spawning and management +## Core Capabilities +- Code analysis with parallel file processing +- Data pattern recognition +- Performance profiling +- Memory usage analysis +- Dependency mapping -## Configuration -- **Batch Optimized**: Yes -- **Coordination Mode**: Standard -- **Max Parallel Tasks**: Unlimited +## Batch Operations +- Parallel file analysis using concurrent Read operations +- Batch pattern matching with Grep tool +- Simultaneous metric collection +- Aggregated reporting -## Usage Examples - -### Basic Usage -```bash -./claude-flow sparc analyzer "Your task description here" -``` - -### Advanced Usage with Coordination -```javascript -// Use TodoWrite for task coordination -TodoWrite([ - { - id: "analyzer_task", - content: "Execute analyzer task with batch optimization", - status: "pending", - priority: "high", - mode: "analyzer", - batchOptimized: true, - - - tools: ["Read","Grep","Bash","Write","Memory","TodoWrite","Task"] - } -]); - -// Launch specialized agent -Task("Analyzer Agent", "Execute specialized analyzer task", { - mode: "analyzer", - batchOptimized: true, - - memoryIntegration: true -}); -``` - -## Best Practices -- Use batch operations when working with multiple files -- Store intermediate results in Memory for coordination -- Enable parallel execution for independent tasks -- Monitor resource usage during intensive operations - - -## Integration -This mode integrates with: -- Memory system for state persistence -- TodoWrite/TodoRead for task coordination -- Task tool for agent spawning -- Batch file operations for efficiency -- Real-time monitoring and metrics - -## Troubleshooting -- Ensure proper tool permissions are set -- Check Memory keys for coordination data -- Monitor resource usage during batch operations -- Validate input parameters and constraints -- Use verbose logging for debugging - ---- -Generated by Claude-Flow SPARC Integration System +## Output Format +- Detailed analysis reports +- Performance metrics +- Improvement recommendations +- Visualizations when applicable diff --git a/.claude/commands/sparc/architect.md b/.claude/commands/sparc/architect.md index e90cf9e527..2b87bb9c4e 100644 --- a/.claude/commands/sparc/architect.md +++ b/.claude/commands/sparc/architect.md @@ -1,78 +1,27 @@ # SPARC Architect Mode -## Description -System design and architecture planning +## Purpose +System design with Memory-based coordination for scalable architectures. -## Command Prompt -SPARC: architect\nYou are a software architect focused on designing scalable, maintainable system architectures using Memory for design coordination. +## Activation +`./claude-flow sparc run architect "design microservices architecture"` -## Available Tools -- **Read**: File reading operations -- **Write**: File writing operations -- **Glob**: File pattern matching -- **Memory**: Persistent data storage and retrieval -- **TodoWrite**: Task creation and coordination -- **Task**: Agent spawning and management +## Core Capabilities +- System architecture design +- Component interface definition +- Database schema design +- API contract specification +- Infrastructure planning -## Configuration -- **Batch Optimized**: Yes -- **Coordination Mode**: Standard -- **Max Parallel Tasks**: Unlimited +## Memory Integration +- Store architecture decisions in Memory +- Share component specifications across agents +- Maintain design consistency +- Track architectural evolution -## Usage Examples - -### Basic Usage -```bash -./claude-flow sparc architect "Your task description here" -``` - -### Advanced Usage with Coordination -```javascript -// Use TodoWrite for task coordination -TodoWrite([ - { - id: "architect_task", - content: "Execute architect task with batch optimization", - status: "pending", - priority: "high", - mode: "architect", - batchOptimized: true, - - - tools: ["Read","Write","Glob","Memory","TodoWrite","Task"] - } -]); - -// Launch specialized agent -Task("Architect Agent", "Execute specialized architect task", { - mode: "architect", - batchOptimized: true, - - memoryIntegration: true -}); -``` - -## Best Practices -- Use batch operations when working with multiple files -- Store intermediate results in Memory for coordination -- Enable parallel execution for independent tasks -- Monitor resource usage during intensive operations - - -## Integration -This mode integrates with: -- Memory system for state persistence -- TodoWrite/TodoRead for task coordination -- Task tool for agent spawning -- Batch file operations for efficiency -- Real-time monitoring and metrics - -## Troubleshooting -- Ensure proper tool permissions are set -- Check Memory keys for coordination data -- Monitor resource usage during batch operations -- Validate input parameters and constraints -- Use verbose logging for debugging - ---- -Generated by Claude-Flow SPARC Integration System +## Design Patterns +- Microservices +- Event-driven architecture +- Domain-driven design +- Hexagonal architecture +- CQRS and Event Sourcing diff --git a/.claude/commands/sparc/batch-executor.md b/.claude/commands/sparc/batch-executor.md index daabaf512f..96a9eaa7cb 100644 --- a/.claude/commands/sparc/batch-executor.md +++ b/.claude/commands/sparc/batch-executor.md @@ -1,78 +1,28 @@ -# SPARC Batch executor Mode +# SPARC Batch Executor Mode -## Description -Parallel task execution specialist +## Purpose +Parallel task execution specialist using batch operations. -## Command Prompt -SPARC: batch-executor\nYou excel at executing multiple tasks in parallel using batch tool operations and Task coordination for maximum efficiency. +## Activation +`./claude-flow sparc run batch-executor "process multiple files"` -## Available Tools -- **Task**: Agent spawning and management -- **Bash**: Command line execution -- **Read**: File reading operations -- **Write**: File writing operations -- **TodoWrite**: Task creation and coordination -- **Memory**: Persistent data storage and retrieval +## Core Capabilities +- Parallel file operations +- Concurrent task execution +- Resource optimization +- Load balancing +- Progress tracking -## Configuration -- **Batch Optimized**: Yes -- **Coordination Mode**: Standard -- **Max Parallel Tasks**: Unlimited +## Execution Patterns +- Parallel Read/Write operations +- Concurrent Edit operations +- Batch file transformations +- Distributed processing +- Pipeline orchestration -## Usage Examples - -### Basic Usage -```bash -./claude-flow sparc batch-executor "Your task description here" -``` - -### Advanced Usage with Coordination -```javascript -// Use TodoWrite for task coordination -TodoWrite([ - { - id: "batch-executor_task", - content: "Execute batch-executor task with batch optimization", - status: "pending", - priority: "high", - mode: "batch-executor", - batchOptimized: true, - - - tools: ["Task","Bash","Read","Write","TodoWrite","Memory"] - } -]); - -// Launch specialized agent -Task("Batch executor Agent", "Execute specialized batch-executor task", { - mode: "batch-executor", - batchOptimized: true, - - memoryIntegration: true -}); -``` - -## Best Practices -- Use batch operations when working with multiple files -- Store intermediate results in Memory for coordination -- Enable parallel execution for independent tasks -- Monitor resource usage during intensive operations - - -## Integration -This mode integrates with: -- Memory system for state persistence -- TodoWrite/TodoRead for task coordination -- Task tool for agent spawning -- Batch file operations for efficiency -- Real-time monitoring and metrics - -## Troubleshooting -- Ensure proper tool permissions are set -- Check Memory keys for coordination data -- Monitor resource usage during batch operations -- Validate input parameters and constraints -- Use verbose logging for debugging - ---- -Generated by Claude-Flow SPARC Integration System +## Performance Features +- Dynamic resource allocation +- Automatic load balancing +- Progress monitoring +- Error recovery +- Result aggregation diff --git a/.claude/commands/sparc/coder.md b/.claude/commands/sparc/coder.md index 21600c72ac..4cf08804c7 100644 --- a/.claude/commands/sparc/coder.md +++ b/.claude/commands/sparc/coder.md @@ -1,79 +1,28 @@ -# 🔥 SPARC Coder Mode +# SPARC Coder Mode -## Description -Autonomous code generation and implementation +## Purpose +Autonomous code generation with batch file operations. -## Command Prompt -SPARC: coder\nYou are an expert programmer focused on writing clean, efficient, and well-documented code using batch file operations. +## Activation +`./claude-flow sparc run coder "implement user authentication"` -## Available Tools -- **Read**: File reading operations -- **Write**: File writing operations -- **Edit**: File editing and modification -- **Bash**: Command line execution -- **Glob**: File pattern matching -- **Grep**: Content searching -- **TodoWrite**: Task creation and coordination +## Core Capabilities +- Feature implementation +- Code refactoring +- Bug fixes +- API development +- Algorithm implementation -## Configuration -- **Batch Optimized**: Yes -- **Coordination Mode**: Standard -- **Max Parallel Tasks**: Unlimited +## Batch Operations +- Parallel file creation +- Concurrent code modifications +- Batch import updates +- Test file generation +- Documentation updates -## Usage Examples - -### Basic Usage -```bash -./claude-flow sparc coder "Your task description here" -``` - -### Advanced Usage with Coordination -```javascript -// Use TodoWrite for task coordination -TodoWrite([ - { - id: "coder_task", - content: "Execute coder task with batch optimization", - status: "pending", - priority: "high", - mode: "coder", - batchOptimized: true, - - - tools: ["Read","Write","Edit","Bash","Glob","Grep","TodoWrite"] - } -]); - -// Launch specialized agent -Task("Coder Agent", "Execute specialized coder task", { - mode: "coder", - batchOptimized: true, - - memoryIntegration: true -}); -``` - -## Best Practices -- Use batch operations when working with multiple files -- Store intermediate results in Memory for coordination -- Enable parallel execution for independent tasks -- Monitor resource usage during intensive operations - - -## Integration -This mode integrates with: -- Memory system for state persistence -- TodoWrite/TodoRead for task coordination -- Task tool for agent spawning -- Batch file operations for efficiency -- Real-time monitoring and metrics - -## Troubleshooting -- Ensure proper tool permissions are set -- Check Memory keys for coordination data -- Monitor resource usage during batch operations -- Validate input parameters and constraints -- Use verbose logging for debugging - ---- -Generated by Claude-Flow SPARC Integration System +## Code Quality +- ES2022 standards +- Type safety with TypeScript +- Comprehensive error handling +- Performance optimization +- Security best practices diff --git a/.claude/commands/sparc/debugger.md b/.claude/commands/sparc/debugger.md index 39cecffc40..a315428aa5 100644 --- a/.claude/commands/sparc/debugger.md +++ b/.claude/commands/sparc/debugger.md @@ -1,78 +1,28 @@ # SPARC Debugger Mode -## Description -Debug and fix issues systematically +## Purpose +Systematic debugging with TodoWrite and Memory integration. -## Command Prompt -SPARC: debugger\nYou are a debugging specialist using TodoWrite for systematic debugging and Memory for tracking issue patterns. +## Activation +`./claude-flow sparc run debugger "fix authentication issues"` -## Available Tools -- **Read**: File reading operations -- **Edit**: File editing and modification -- **Bash**: Command line execution -- **Grep**: Content searching -- **TodoWrite**: Task creation and coordination -- **Memory**: Persistent data storage and retrieval +## Core Capabilities +- Issue reproduction +- Root cause analysis +- Stack trace analysis +- Memory leak detection +- Performance bottleneck identification -## Configuration -- **Batch Optimized**: Yes -- **Coordination Mode**: Standard -- **Max Parallel Tasks**: Unlimited +## Debugging Workflow +1. Create debugging plan with TodoWrite +2. Systematic issue investigation +3. Store findings in Memory +4. Track fix progress +5. Verify resolution -## Usage Examples - -### Basic Usage -```bash -./claude-flow sparc debugger "Your task description here" -``` - -### Advanced Usage with Coordination -```javascript -// Use TodoWrite for task coordination -TodoWrite([ - { - id: "debugger_task", - content: "Execute debugger task with batch optimization", - status: "pending", - priority: "high", - mode: "debugger", - batchOptimized: true, - - - tools: ["Read","Edit","Bash","Grep","TodoWrite","Memory"] - } -]); - -// Launch specialized agent -Task("Debugger Agent", "Execute specialized debugger task", { - mode: "debugger", - batchOptimized: true, - - memoryIntegration: true -}); -``` - -## Best Practices -- Use batch operations when working with multiple files -- Store intermediate results in Memory for coordination -- Enable parallel execution for independent tasks -- Monitor resource usage during intensive operations - - -## Integration -This mode integrates with: -- Memory system for state persistence -- TodoWrite/TodoRead for task coordination -- Task tool for agent spawning -- Batch file operations for efficiency -- Real-time monitoring and metrics - -## Troubleshooting -- Ensure proper tool permissions are set -- Check Memory keys for coordination data -- Monitor resource usage during batch operations -- Validate input parameters and constraints -- Use verbose logging for debugging - ---- -Generated by Claude-Flow SPARC Integration System +## Tools Integration +- Error log analysis +- Breakpoint simulation +- Variable inspection +- Call stack tracing +- Memory profiling diff --git a/.claude/commands/sparc/designer.md b/.claude/commands/sparc/designer.md index 870bee9304..91e1e958ac 100644 --- a/.claude/commands/sparc/designer.md +++ b/.claude/commands/sparc/designer.md @@ -1,77 +1,27 @@ # SPARC Designer Mode -## Description -UI/UX design and user experience +## Purpose +UI/UX design with Memory coordination for consistent experiences. -## Command Prompt -SPARC: designer\nYou are a UI/UX designer using Memory for design coordination and TodoWrite for design process management. +## Activation +`./claude-flow sparc run designer "create dashboard UI"` -## Available Tools -- **Read**: File reading operations -- **Write**: File writing operations -- **Edit**: File editing and modification -- **Memory**: Persistent data storage and retrieval -- **TodoWrite**: Task creation and coordination +## Core Capabilities +- Interface design +- Component architecture +- Design system creation +- Accessibility planning +- Responsive layouts -## Configuration -- **Batch Optimized**: Yes -- **Coordination Mode**: Standard -- **Max Parallel Tasks**: Unlimited +## Design Process +- User research insights +- Wireframe creation +- Component design +- Interaction patterns +- Design token management -## Usage Examples - -### Basic Usage -```bash -./claude-flow sparc designer "Your task description here" -``` - -### Advanced Usage with Coordination -```javascript -// Use TodoWrite for task coordination -TodoWrite([ - { - id: "designer_task", - content: "Execute designer task with batch optimization", - status: "pending", - priority: "high", - mode: "designer", - batchOptimized: true, - - - tools: ["Read","Write","Edit","Memory","TodoWrite"] - } -]); - -// Launch specialized agent -Task("Designer Agent", "Execute specialized designer task", { - mode: "designer", - batchOptimized: true, - - memoryIntegration: true -}); -``` - -## Best Practices -- Use batch operations when working with multiple files -- Store intermediate results in Memory for coordination -- Enable parallel execution for independent tasks -- Monitor resource usage during intensive operations - - -## Integration -This mode integrates with: -- Memory system for state persistence -- TodoWrite/TodoRead for task coordination -- Task tool for agent spawning -- Batch file operations for efficiency -- Real-time monitoring and metrics - -## Troubleshooting -- Ensure proper tool permissions are set -- Check Memory keys for coordination data -- Monitor resource usage during batch operations -- Validate input parameters and constraints -- Use verbose logging for debugging - ---- -Generated by Claude-Flow SPARC Integration System +## Memory Coordination +- Store design decisions +- Share component specs +- Maintain consistency +- Track design evolution diff --git a/.claude/commands/sparc/documenter.md b/.claude/commands/sparc/documenter.md index 25d74723bf..4be1a1106d 100644 --- a/.claude/commands/sparc/documenter.md +++ b/.claude/commands/sparc/documenter.md @@ -1,77 +1,28 @@ # SPARC Documenter Mode -## Description -Documentation generation and maintenance +## Purpose +Documentation with batch file operations for comprehensive docs. -## Command Prompt -SPARC: documenter\nYou are a documentation specialist using batch file operations and Memory for comprehensive documentation coordination. +## Activation +`./claude-flow sparc run documenter "create API documentation"` -## Available Tools -- **Read**: File reading operations -- **Write**: File writing operations -- **Glob**: File pattern matching -- **Memory**: Persistent data storage and retrieval -- **TodoWrite**: Task creation and coordination +## Core Capabilities +- API documentation +- Code documentation +- User guides +- Architecture docs +- README files -## Configuration -- **Batch Optimized**: Yes -- **Coordination Mode**: Standard -- **Max Parallel Tasks**: Unlimited +## Documentation Types +- Markdown documentation +- JSDoc comments +- API specifications +- Integration guides +- Deployment docs -## Usage Examples - -### Basic Usage -```bash -./claude-flow sparc documenter "Your task description here" -``` - -### Advanced Usage with Coordination -```javascript -// Use TodoWrite for task coordination -TodoWrite([ - { - id: "documenter_task", - content: "Execute documenter task with batch optimization", - status: "pending", - priority: "high", - mode: "documenter", - batchOptimized: true, - - - tools: ["Read","Write","Glob","Memory","TodoWrite"] - } -]); - -// Launch specialized agent -Task("Documenter Agent", "Execute specialized documenter task", { - mode: "documenter", - batchOptimized: true, - - memoryIntegration: true -}); -``` - -## Best Practices -- Use batch operations when working with multiple files -- Store intermediate results in Memory for coordination -- Enable parallel execution for independent tasks -- Monitor resource usage during intensive operations - - -## Integration -This mode integrates with: -- Memory system for state persistence -- TodoWrite/TodoRead for task coordination -- Task tool for agent spawning -- Batch file operations for efficiency -- Real-time monitoring and metrics - -## Troubleshooting -- Ensure proper tool permissions are set -- Check Memory keys for coordination data -- Monitor resource usage during batch operations -- Validate input parameters and constraints -- Use verbose logging for debugging - ---- -Generated by Claude-Flow SPARC Integration System +## Batch Features +- Parallel doc generation +- Bulk file updates +- Cross-reference management +- Example generation +- Diagram creation diff --git a/.claude/commands/sparc/innovator.md b/.claude/commands/sparc/innovator.md index fe9de3430a..a4a07aedb1 100644 --- a/.claude/commands/sparc/innovator.md +++ b/.claude/commands/sparc/innovator.md @@ -1,78 +1,28 @@ # SPARC Innovator Mode -## Description -Creative problem solving and innovation +## Purpose +Creative problem solving with WebSearch and Memory integration. -## Command Prompt -SPARC: innovator\nYou are an innovation specialist using WebSearch for inspiration and Memory for idea coordination across sessions. +## Activation +`./claude-flow sparc run innovator "innovative solutions for scaling"` -## Available Tools -- **Read**: File reading operations -- **Write**: File writing operations -- **WebSearch**: Web search capabilities -- **Memory**: Persistent data storage and retrieval -- **TodoWrite**: Task creation and coordination -- **Task**: Agent spawning and management +## Core Capabilities +- Creative ideation +- Solution brainstorming +- Technology exploration +- Pattern innovation +- Proof of concept -## Configuration -- **Batch Optimized**: Yes -- **Coordination Mode**: Standard -- **Max Parallel Tasks**: Unlimited +## Innovation Process +- Divergent thinking phase +- Research and exploration +- Convergent synthesis +- Prototype planning +- Feasibility analysis -## Usage Examples - -### Basic Usage -```bash -./claude-flow sparc innovator "Your task description here" -``` - -### Advanced Usage with Coordination -```javascript -// Use TodoWrite for task coordination -TodoWrite([ - { - id: "innovator_task", - content: "Execute innovator task with batch optimization", - status: "pending", - priority: "high", - mode: "innovator", - batchOptimized: true, - - - tools: ["Read","Write","WebSearch","Memory","TodoWrite","Task"] - } -]); - -// Launch specialized agent -Task("Innovator Agent", "Execute specialized innovator task", { - mode: "innovator", - batchOptimized: true, - - memoryIntegration: true -}); -``` - -## Best Practices -- Use batch operations when working with multiple files -- Store intermediate results in Memory for coordination -- Enable parallel execution for independent tasks -- Monitor resource usage during intensive operations - - -## Integration -This mode integrates with: -- Memory system for state persistence -- TodoWrite/TodoRead for task coordination -- Task tool for agent spawning -- Batch file operations for efficiency -- Real-time monitoring and metrics - -## Troubleshooting -- Ensure proper tool permissions are set -- Check Memory keys for coordination data -- Monitor resource usage during batch operations -- Validate input parameters and constraints -- Use verbose logging for debugging - ---- -Generated by Claude-Flow SPARC Integration System +## Knowledge Sources +- WebSearch for trends +- Memory for context +- Cross-domain insights +- Pattern recognition +- Analogical reasoning diff --git a/.claude/commands/sparc/memory-manager.md b/.claude/commands/sparc/memory-manager.md index e7a5ea9c98..56c85ce772 100644 --- a/.claude/commands/sparc/memory-manager.md +++ b/.claude/commands/sparc/memory-manager.md @@ -1,77 +1,28 @@ -# SPARC Memory manager Mode +# SPARC Memory Manager Mode -## Description -Memory and knowledge management +## Purpose +Knowledge management with Memory tools for persistent insights. -## Command Prompt -SPARC: memory-manager\nYou manage knowledge and memory systems using Memory tools for persistent storage and TodoWrite for knowledge organization. +## Activation +`./claude-flow sparc run memory-manager "organize project knowledge"` -## Available Tools -- **Memory**: Persistent data storage and retrieval -- **Read**: File reading operations -- **Write**: File writing operations -- **TodoWrite**: Task creation and coordination -- **TodoRead**: Task status and progress reading +## Core Capabilities +- Knowledge organization +- Information retrieval +- Context management +- Insight preservation +- Cross-session persistence -## Configuration -- **Batch Optimized**: Yes -- **Coordination Mode**: Standard -- **Max Parallel Tasks**: Unlimited +## Memory Strategies +- Hierarchical organization +- Tag-based categorization +- Temporal tracking +- Relationship mapping +- Priority management -## Usage Examples - -### Basic Usage -```bash -./claude-flow sparc memory-manager "Your task description here" -``` - -### Advanced Usage with Coordination -```javascript -// Use TodoWrite for task coordination -TodoWrite([ - { - id: "memory-manager_task", - content: "Execute memory-manager task with batch optimization", - status: "pending", - priority: "high", - mode: "memory-manager", - batchOptimized: true, - - - tools: ["Memory","Read","Write","TodoWrite","TodoRead"] - } -]); - -// Launch specialized agent -Task("Memory manager Agent", "Execute specialized memory-manager task", { - mode: "memory-manager", - batchOptimized: true, - - memoryIntegration: true -}); -``` - -## Best Practices -- Use batch operations when working with multiple files -- Store intermediate results in Memory for coordination -- Enable parallel execution for independent tasks -- Monitor resource usage during intensive operations - - -## Integration -This mode integrates with: -- Memory system for state persistence -- TodoWrite/TodoRead for task coordination -- Task tool for agent spawning -- Batch file operations for efficiency -- Real-time monitoring and metrics - -## Troubleshooting -- Ensure proper tool permissions are set -- Check Memory keys for coordination data -- Monitor resource usage during batch operations -- Validate input parameters and constraints -- Use verbose logging for debugging - ---- -Generated by Claude-Flow SPARC Integration System +## Knowledge Operations +- Store critical insights +- Retrieve relevant context +- Update knowledge base +- Merge related information +- Archive obsolete data diff --git a/.claude/commands/sparc/optimizer.md b/.claude/commands/sparc/optimizer.md index e4e66af4cf..5b6d1d9f79 100644 --- a/.claude/commands/sparc/optimizer.md +++ b/.claude/commands/sparc/optimizer.md @@ -1,78 +1,28 @@ # SPARC Optimizer Mode -## Description -Performance optimization specialist +## Purpose +Performance optimization with systematic analysis and improvements. -## Command Prompt -SPARC: optimizer\nYou are a performance optimization specialist using systematic analysis and TodoWrite for optimization planning. +## Activation +`./claude-flow sparc run optimizer "optimize application performance"` -## Available Tools -- **Read**: File reading operations -- **Edit**: File editing and modification -- **Bash**: Command line execution -- **Grep**: Content searching -- **TodoWrite**: Task creation and coordination -- **Memory**: Persistent data storage and retrieval +## Core Capabilities +- Performance profiling +- Code optimization +- Resource optimization +- Algorithm improvement +- Scalability enhancement -## Configuration -- **Batch Optimized**: Yes -- **Coordination Mode**: Standard -- **Max Parallel Tasks**: Unlimited +## Optimization Areas +- Execution speed +- Memory usage +- Network efficiency +- Database queries +- Bundle size -## Usage Examples - -### Basic Usage -```bash -./claude-flow sparc optimizer "Your task description here" -``` - -### Advanced Usage with Coordination -```javascript -// Use TodoWrite for task coordination -TodoWrite([ - { - id: "optimizer_task", - content: "Execute optimizer task with batch optimization", - status: "pending", - priority: "high", - mode: "optimizer", - batchOptimized: true, - - - tools: ["Read","Edit","Bash","Grep","TodoWrite","Memory"] - } -]); - -// Launch specialized agent -Task("Optimizer Agent", "Execute specialized optimizer task", { - mode: "optimizer", - batchOptimized: true, - - memoryIntegration: true -}); -``` - -## Best Practices -- Use batch operations when working with multiple files -- Store intermediate results in Memory for coordination -- Enable parallel execution for independent tasks -- Monitor resource usage during intensive operations - - -## Integration -This mode integrates with: -- Memory system for state persistence -- TodoWrite/TodoRead for task coordination -- Task tool for agent spawning -- Batch file operations for efficiency -- Real-time monitoring and metrics - -## Troubleshooting -- Ensure proper tool permissions are set -- Check Memory keys for coordination data -- Monitor resource usage during batch operations -- Validate input parameters and constraints -- Use verbose logging for debugging - ---- -Generated by Claude-Flow SPARC Integration System +## Systematic Approach +1. Baseline measurement +2. Bottleneck identification +3. Optimization implementation +4. Impact verification +5. Continuous monitoring diff --git a/.claude/commands/sparc/orchestrator.md b/.claude/commands/sparc/orchestrator.md index 8078598f05..8ca5db2027 100644 --- a/.claude/commands/sparc/orchestrator.md +++ b/.claude/commands/sparc/orchestrator.md @@ -1,79 +1,28 @@ # SPARC Orchestrator Mode -## Description -Multi-agent task orchestration and coordination +## Purpose +Multi-agent task orchestration with TodoWrite/TodoRead/Task/Memory. -## Command Prompt -SPARC: orchestrator -You are an AI orchestrator that coordinates multiple specialized agents to complete complex tasks efficiently. - -## Available Tools -- **TodoWrite**: Create and manage task coordination -- **TodoRead**: Monitor task progress and status -- **Task**: Spawn and manage specialized agents -- **Memory**: Store and retrieve coordination data -- **Bash**: Execute system commands +## Activation +`./claude-flow sparc run orchestrator "coordinate feature development"` ## Core Capabilities -- Centralized coordination of up to 10 parallel agents -- Batch-optimized operations for efficiency -- Memory-based state management across agents -- Real-time task progress monitoring +- Task decomposition +- Agent coordination +- Resource allocation +- Progress tracking +- Result synthesis -## Usage Examples +## Orchestration Patterns +- Hierarchical coordination +- Parallel execution +- Sequential pipelines +- Event-driven flows +- Adaptive strategies -### Basic Usage -```bash -./claude-flow sparc orchestrator "Your task description here" -``` - -### Advanced Usage with Coordination -```javascript -// Use TodoWrite for task coordination -TodoWrite([ - { - id: "orchestrator_task", - content: "Execute orchestrator task with batch optimization", - status: "pending", - priority: "high", - mode: "orchestrator", - batchOptimized: true, - coordinationMode: "centralized", - maxParallelTasks: 10, - tools: ["TodoWrite","TodoRead","Task","Memory","Bash"] - } -]); - -// Launch specialized agent -Task("Orchestrator Agent", "Execute specialized orchestrator task", { - mode: "orchestrator", - batchOptimized: true, - coordinationMode: "centralized", - memoryIntegration: true -}); -``` - -## Best Practices -- Use batch operations when working with multiple files -- Store intermediate results in Memory for coordination -- Enable parallel execution for independent tasks -- Monitor resource usage during intensive operations -- Leverage centralized coordination for team management - -## Integration -This mode integrates with: -- Memory system for state persistence -- TodoWrite/TodoRead for task coordination -- Task tool for agent spawning -- Batch file operations for efficiency -- Real-time monitoring and metrics - -## Troubleshooting -- Ensure proper tool permissions are set -- Check Memory keys for coordination data -- Monitor resource usage during batch operations -- Validate input parameters and constraints -- Use verbose logging for debugging - ---- -Generated by Claude-Flow SPARC Integration System +## Coordination Tools +- TodoWrite for planning +- Task for agent launch +- Memory for sharing +- Progress monitoring +- Result aggregation diff --git a/.claude/commands/sparc/researcher.md b/.claude/commands/sparc/researcher.md index 305efd5a0b..7e89ea81f0 100644 --- a/.claude/commands/sparc/researcher.md +++ b/.claude/commands/sparc/researcher.md @@ -1,79 +1,28 @@ # SPARC Researcher Mode -## Description -Deep research and comprehensive analysis +## Purpose +Deep research with parallel WebSearch/WebFetch and Memory coordination. -## Command Prompt -SPARC: researcher\nYou are a research specialist focused on gathering comprehensive information using parallel WebSearch/WebFetch and Memory coordination. +## Activation +`./claude-flow sparc run researcher "research AI trends 2024"` -## Available Tools -- **WebSearch**: Web search capabilities -- **WebFetch**: Web content retrieval -- **Read**: File reading operations -- **Write**: File writing operations -- **Memory**: Persistent data storage and retrieval -- **TodoWrite**: Task creation and coordination -- **Task**: Agent spawning and management +## Core Capabilities +- Information gathering +- Source evaluation +- Trend analysis +- Competitive research +- Technology assessment -## Configuration -- **Batch Optimized**: Yes -- **Coordination Mode**: Standard -- **Max Parallel Tasks**: Unlimited +## Research Methods +- Parallel web searches +- Academic paper analysis +- Industry report synthesis +- Expert opinion gathering +- Data compilation -## Usage Examples - -### Basic Usage -```bash -./claude-flow sparc researcher "Your task description here" -``` - -### Advanced Usage with Coordination -```javascript -// Use TodoWrite for task coordination -TodoWrite([ - { - id: "researcher_task", - content: "Execute researcher task with batch optimization", - status: "pending", - priority: "high", - mode: "researcher", - batchOptimized: true, - - - tools: ["WebSearch","WebFetch","Read","Write","Memory","TodoWrite","Task"] - } -]); - -// Launch specialized agent -Task("Researcher Agent", "Execute specialized researcher task", { - mode: "researcher", - batchOptimized: true, - - memoryIntegration: true -}); -``` - -## Best Practices -- Use batch operations when working with multiple files -- Store intermediate results in Memory for coordination -- Enable parallel execution for independent tasks -- Monitor resource usage during intensive operations - - -## Integration -This mode integrates with: -- Memory system for state persistence -- TodoWrite/TodoRead for task coordination -- Task tool for agent spawning -- Batch file operations for efficiency -- Real-time monitoring and metrics - -## Troubleshooting -- Ensure proper tool permissions are set -- Check Memory keys for coordination data -- Monitor resource usage during batch operations -- Validate input parameters and constraints -- Use verbose logging for debugging - ---- -Generated by Claude-Flow SPARC Integration System +## Memory Integration +- Store research findings +- Build knowledge graphs +- Track information sources +- Cross-reference insights +- Maintain research history diff --git a/.claude/commands/sparc/reviewer.md b/.claude/commands/sparc/reviewer.md index a299f795f1..0f6f26ce98 100644 --- a/.claude/commands/sparc/reviewer.md +++ b/.claude/commands/sparc/reviewer.md @@ -1,78 +1,28 @@ # SPARC Reviewer Mode -## Description -Code review and quality optimization +## Purpose +Code review using batch file analysis for comprehensive reviews. -## Command Prompt -SPARC: reviewer\nYou are a code reviewer focused on improving code quality using batch file analysis and systematic review processes. +## Activation +`./claude-flow sparc run reviewer "review pull request #123"` -## Available Tools -- **Read**: File reading operations -- **Edit**: File editing and modification -- **Grep**: Content searching -- **Bash**: Command line execution -- **TodoWrite**: Task creation and coordination -- **Memory**: Persistent data storage and retrieval +## Core Capabilities +- Code quality assessment +- Security review +- Performance analysis +- Best practices check +- Documentation review -## Configuration -- **Batch Optimized**: Yes -- **Coordination Mode**: Standard -- **Max Parallel Tasks**: Unlimited +## Review Criteria +- Code correctness +- Design patterns +- Error handling +- Test coverage +- Maintainability -## Usage Examples - -### Basic Usage -```bash -./claude-flow sparc reviewer "Your task description here" -``` - -### Advanced Usage with Coordination -```javascript -// Use TodoWrite for task coordination -TodoWrite([ - { - id: "reviewer_task", - content: "Execute reviewer task with batch optimization", - status: "pending", - priority: "high", - mode: "reviewer", - batchOptimized: true, - - - tools: ["Read","Edit","Grep","Bash","TodoWrite","Memory"] - } -]); - -// Launch specialized agent -Task("Reviewer Agent", "Execute specialized reviewer task", { - mode: "reviewer", - batchOptimized: true, - - memoryIntegration: true -}); -``` - -## Best Practices -- Use batch operations when working with multiple files -- Store intermediate results in Memory for coordination -- Enable parallel execution for independent tasks -- Monitor resource usage during intensive operations - - -## Integration -This mode integrates with: -- Memory system for state persistence -- TodoWrite/TodoRead for task coordination -- Task tool for agent spawning -- Batch file operations for efficiency -- Real-time monitoring and metrics - -## Troubleshooting -- Ensure proper tool permissions are set -- Check Memory keys for coordination data -- Monitor resource usage during batch operations -- Validate input parameters and constraints -- Use verbose logging for debugging - ---- -Generated by Claude-Flow SPARC Integration System +## Batch Analysis +- Parallel file review +- Pattern detection +- Dependency checking +- Consistency validation +- Automated reporting diff --git a/.claude/commands/sparc/sparc-modes.md b/.claude/commands/sparc/sparc-modes.md index 355b98d95c..92cbcb9cfe 100644 --- a/.claude/commands/sparc/sparc-modes.md +++ b/.claude/commands/sparc/sparc-modes.md @@ -1,362 +1,42 @@ -# SPARC Development Modes +# SPARC Modes Overview -## Overview -This document describes all 17 specialized SPARC development modes available in Claude-Flow. Each mode is optimized for specific tasks and includes batch tool integration for maximum efficiency. +SPARC (Specification, Planning, Architecture, Review, Code) is a comprehensive development methodology with 17 specialized modes. -## Core Orchestration Modes +## Available Modes -### orchestrator -**Multi-agent task orchestration and coordination** -- **Coordination Mode**: Centralized -- **Max Parallel Tasks**: 10 -- **Batch Optimized**: Yes -- **Tools**: TodoWrite, TodoRead, Task, Memory, Bash -- **Usage**: `/sparc orchestrator ` -- **Best For**: Coordinating multiple agents, complex project management +### Core Orchestration Modes +- **orchestrator**: Multi-agent task orchestration +- **swarm-coordinator**: Specialized swarm management +- **workflow-manager**: Process automation +- **batch-executor**: Parallel task execution -### swarm-coordinator -**Swarm coordination and management** -- **Coordination Mode**: Hierarchical -- **Swarm Size**: Scalable -- **Load Balancing**: Automatic -- **Tools**: TodoWrite, TodoRead, Task, Memory, Bash -- **Usage**: `/sparc swarm-coordinator ` -- **Best For**: Managing large teams of agents, dynamic resource allocation +### Development Modes +- **coder**: Autonomous code generation +- **architect**: System design +- **reviewer**: Code review +- **tdd**: Test-driven development -### workflow-manager -**Workflow automation and process management** -- **Workflow Engine**: Event-driven -- **Process Optimization**: Continuous -- **Automation Level**: High -- **Tools**: TodoWrite, TodoRead, Task, Bash, Memory -- **Usage**: `/sparc workflow-manager ` -- **Best For**: Process automation, workflow optimization +### Analysis and Research Modes +- **researcher**: Deep research capabilities +- **analyzer**: Code and data analysis +- **optimizer**: Performance optimization -### batch-executor -**Parallel task execution specialist** -- **Execution Mode**: Parallel -- **Resource Management**: Dynamic -- **Throughput Optimized**: Yes -- **Tools**: Task, Bash, Read, Write, TodoWrite, Memory -- **Usage**: `/sparc batch-executor ` -- **Best For**: High-throughput parallel processing, batch operations - -## Development Modes - -### coder -**Autonomous code generation and implementation** -- **File Operations**: Parallel -- **Code Style**: ES2022 -- **Batch Optimized**: Yes -- **Tools**: Read, Write, Edit, Bash, Glob, Grep, TodoWrite -- **Usage**: `/sparc coder ` -- **Best For**: Code generation, implementation, refactoring - -### architect -**System design and architecture planning** -- **Design Patterns**: Enterprise -- **Scalability Focus**: Yes -- **Memory Integration**: Automatic -- **Tools**: Read, Write, Glob, Memory, TodoWrite, Task -- **Usage**: `/sparc architect ` -- **Best For**: System architecture, design patterns, scalability planning - -### reviewer -**Code review and quality optimization** -- **Review Depth**: Comprehensive -- **Quality Gates**: Security, Performance, Maintainability -- **Batch Analysis**: Yes -- **Tools**: Read, Edit, Grep, Bash, TodoWrite, Memory -- **Usage**: `/sparc reviewer ` -- **Best For**: Code review, quality assurance, optimization - -### tdd -**Test-driven development methodology** -- **Testing Mode**: Comprehensive -- **Coverage Target**: 90% -- **Batch Test Execution**: Yes -- **Tools**: Read, Write, Edit, Bash, TodoWrite, Task -- **Usage**: `/sparc tdd ` -- **Best For**: Test-driven development, comprehensive testing - -### debugger -**Debug and fix issues systematically** -- **Debugging Approach**: Systematic -- **Issue Tracking**: Memory-based -- **Pattern Recognition**: Yes -- **Tools**: Read, Edit, Bash, Grep, TodoWrite, Memory -- **Usage**: `/sparc debugger ` -- **Best For**: Bug fixing, issue resolution, systematic debugging - -## Analysis and Research Modes - -### researcher -**Deep research and comprehensive analysis** -- **Search Mode**: Parallel -- **Memory Integration**: Automatic -- **Web Research**: Optimized -- **Tools**: WebSearch, WebFetch, Read, Write, Memory, TodoWrite, Task -- **Usage**: `/sparc researcher ` -- **Best For**: Information gathering, research, competitive analysis - -### analyzer -**Code and data analysis specialist** -- **Analysis Depth**: Comprehensive -- **Data Processing**: Parallel -- **Pattern Recognition**: Advanced -- **Tools**: Read, Grep, Bash, Write, Memory, TodoWrite, Task -- **Usage**: `/sparc analyzer ` -- **Best For**: Data analysis, pattern recognition, code analysis - -### optimizer -**Performance optimization specialist** -- **Optimization Focus**: Performance, Memory, Scalability -- **Benchmarking**: Automatic -- **Systematic Approach**: Yes -- **Tools**: Read, Edit, Bash, Grep, TodoWrite, Memory -- **Usage**: `/sparc optimizer ` -- **Best For**: Performance optimization, bottleneck identification - -### tester -**Comprehensive testing and validation** -- **Test Types**: Unit, Integration, E2E, Performance -- **Parallel Execution**: Yes -- **Coverage Analysis**: Comprehensive -- **Tools**: Read, Write, Edit, Bash, TodoWrite, Task -- **Usage**: `/sparc tester ` -- **Best For**: Testing strategies, validation, quality assurance - -## Creative and Support Modes - -### designer -**UI/UX design and user experience** -- **Design Systems**: Atomic -- **User Centered**: Yes -- **Memory Coordination**: Yes -- **Tools**: Read, Write, Edit, Memory, TodoWrite -- **Usage**: `/sparc designer ` -- **Best For**: UI/UX design, user experience, design systems - -### innovator -**Creative problem solving and innovation** -- **Creativity Mode**: Divergent-Convergent -- **Inspiration Sources**: Web Research -- **Cross-session Ideas**: Memory-based -- **Tools**: Read, Write, WebSearch, Memory, TodoWrite, Task -- **Usage**: `/sparc innovator ` -- **Best For**: Creative problem solving, innovation, brainstorming - -### documenter -**Documentation generation and maintenance** -- **Doc Formats**: Markdown, JSDoc, API-docs -- **Auto Generation**: Yes -- **Batch File Processing**: Yes -- **Tools**: Read, Write, Glob, Memory, TodoWrite -- **Usage**: `/sparc documenter ` -- **Best For**: Documentation, technical writing, knowledge management - -### memory-manager -**Memory and knowledge management** -- **Memory Strategy**: Hierarchical -- **Knowledge Graph**: Yes -- **Cross-session Persistence**: Yes -- **Tools**: Memory, Read, Write, TodoWrite, TodoRead -- **Usage**: `/sparc memory-manager ` -- **Best For**: Knowledge management, memory organization, data persistence - -## Advanced Usage Patterns - -### Batch Operations -All SPARC modes support batch operations for maximum efficiency: - -```javascript -// Example: Parallel development with multiple agents -TodoWrite([ - { - id: "architecture_design", - content: "Design system architecture", - status: "pending", - priority: "high", - mode: "architect", - batchOptimized: true - }, - { - id: "frontend_development", - content: "Develop user interface", - status: "pending", - priority: "medium", - mode: "coder", - parallelExecution: true, - dependsOn: ["architecture_design"] - }, - { - id: "testing_suite", - content: "Create comprehensive tests", - status: "pending", - priority: "high", - mode: "tester", - parallelExecution: true, - dependsOn: ["frontend_development"] - } -]); -``` - -### Memory Coordination -Use Memory tools for cross-mode coordination: - -```javascript -// Store architecture in memory for other modes to use -Memory.store("system_architecture", { - components: ["frontend", "backend", "database"], - patterns: ["MVC", "Observer", "Factory"], - scalability: "horizontal" -}); - -// Other modes can access this shared knowledge -const architecture = Memory.get("system_architecture"); -``` - -### Workflow Integration -Integrate modes into complex workflows: +### Creative and Support Modes +- **designer**: UI/UX design +- **innovator**: Creative problem solving +- **documenter**: Documentation generation +- **debugger**: Systematic debugging +- **tester**: Comprehensive testing +- **memory-manager**: Knowledge management +## Usage ```bash -# Research-driven development workflow -./claude-flow sparc researcher "Best practices for microservices" -./claude-flow sparc architect "Design microservices architecture" -./claude-flow sparc coder "Implement service layer" -./claude-flow sparc tester "Create integration tests" -./claude-flow sparc reviewer "Review implementation" +# Run a specific mode +./claude-flow sparc run "task description" + +# List all modes +./claude-flow sparc modes + +# Get help for a mode +./claude-flow sparc help ``` - -## Best Practices - -### Mode Selection -- Use **orchestrator** for complex multi-agent tasks -- Use **coder** for implementation and development -- Use **researcher** for information gathering -- Use **tdd** for test-driven development -- Use **analyzer** for data analysis and insights -- Use **optimizer** for performance improvements - -### Batch Processing -- Enable batch operations with `batchOptimized: true` -- Use parallel execution for independent tasks -- Coordinate through Memory for shared state -- Monitor resource usage during batch operations - -### Memory Management -- Store intermediate results in Memory -- Use descriptive keys for shared data -- Implement proper cleanup for temporary data -- Leverage cross-session persistence - -### Error Handling -- Implement proper error handling in all modes -- Use circuit breaker patterns for resilience -- Store error patterns in Memory for learning -- Provide graceful degradation strategies - -## Integration Examples - -### Full Development Cycle -```javascript -// 1. Research and planning -Task("Research Agent", "Research technology options", { - mode: "researcher", - memoryKey: "research_findings" -}); - -// 2. Architecture design -Task("System Architect", "Design scalable architecture", { - mode: "architect", - memoryDependency: "research_findings", - memoryKey: "system_architecture" -}); - -// 3. Parallel development -Task("Frontend Team", "Develop user interface", { - mode: "coder", - parallelFileOps: true, - memoryDependency: "system_architecture" -}); - -// 4. Quality assurance -Task("QA Team", "Comprehensive testing", { - mode: "tester", - testTypes: ["unit", "integration", "e2e"], - parallelExecution: true -}); - -// 5. Optimization -Task("Performance Team", "Optimize performance", { - mode: "optimizer", - benchmarkingEnabled: true, - memoryKey: "performance_metrics" -}); -``` - -### Research and Analysis Pipeline -```javascript -// Multi-modal research approach -const researchTasks = [ - {mode: "researcher", task: "Market research", priority: "high"}, - {mode: "analyzer", task: "Competitive analysis", priority: "medium"}, - {mode: "innovator", task: "Innovation opportunities", priority: "low"} -]; - -// Execute in parallel with Memory coordination -researchTasks.forEach(task => { - Task(`${task.mode} Agent`, task.task, { - mode: task.mode, - priority: task.priority, - memoryIntegration: true, - parallelExecution: true - }); -}); -``` - -## Performance Optimization - -### Resource Management -- Monitor CPU and memory usage during batch operations -- Implement dynamic resource allocation -- Use load balancing for distributed processing -- Set appropriate timeouts for long-running tasks - -### Monitoring -- Enable real-time monitoring for complex workflows -- Track performance metrics for optimization -- Use alerting for critical failures -- Implement health checks for all modes - -### Scalability -- Design for horizontal scaling -- Use async/await patterns for non-blocking operations -- Implement proper caching strategies -- Optimize database queries and file operations - -## Troubleshooting - -### Common Issues -1. **Memory Coordination**: Ensure Memory keys are unique and descriptive -2. **Batch Operations**: Check resource limits and concurrency settings -3. **Mode Selection**: Choose appropriate mode for task complexity -4. **Error Handling**: Implement proper error recovery mechanisms - -### Debugging -- Use verbose logging for detailed execution traces -- Monitor Memory usage and cleanup -- Check Task coordination and dependencies -- Validate input parameters and constraints - -### Performance Issues -- Profile resource usage during batch operations -- Optimize file I/O operations -- Implement proper caching strategies -- Use appropriate data structures for large datasets - -## Conclusion - -SPARC modes provide a comprehensive framework for specialized AI task execution. By leveraging batch operations, Memory coordination, and proper mode selection, you can achieve maximum efficiency and scalability in your AI-driven development workflows. - -For more detailed information about specific modes, refer to the individual mode documentation files in this directory. \ No newline at end of file diff --git a/.claude/commands/sparc/swarm-coordinator.md b/.claude/commands/sparc/swarm-coordinator.md index a6fcd05738..c2e2b51906 100644 --- a/.claude/commands/sparc/swarm-coordinator.md +++ b/.claude/commands/sparc/swarm-coordinator.md @@ -1,77 +1,28 @@ -# SPARC Swarm coordinator Mode +# SPARC Swarm Coordinator Mode -## Description -Swarm coordination and management +## Purpose +Specialized swarm management with batch coordination capabilities. -## Command Prompt -SPARC: swarm-coordinator\nYou coordinate swarms of AI agents using TodoWrite for task management, Task for agent launching, and Memory for coordination. +## Activation +`./claude-flow sparc run swarm-coordinator "manage development swarm"` -## Available Tools -- **TodoWrite**: Task creation and coordination -- **TodoRead**: Task status and progress reading -- **Task**: Agent spawning and management -- **Memory**: Persistent data storage and retrieval -- **Bash**: Command line execution +## Core Capabilities +- Swarm initialization +- Agent management +- Task distribution +- Load balancing +- Result collection -## Configuration -- **Batch Optimized**: Yes -- **Coordination Mode**: hierarchical -- **Max Parallel Tasks**: Unlimited +## Coordination Modes +- Hierarchical swarms +- Mesh networks +- Pipeline coordination +- Adaptive strategies +- Hybrid approaches -## Usage Examples - -### Basic Usage -```bash -./claude-flow sparc swarm-coordinator "Your task description here" -``` - -### Advanced Usage with Coordination -```javascript -// Use TodoWrite for task coordination -TodoWrite([ - { - id: "swarm-coordinator_task", - content: "Execute swarm-coordinator task with batch optimization", - status: "pending", - priority: "high", - mode: "swarm-coordinator", - batchOptimized: true, - coordinationMode: "hierarchical", - - tools: ["TodoWrite","TodoRead","Task","Memory","Bash"] - } -]); - -// Launch specialized agent -Task("Swarm coordinator Agent", "Execute specialized swarm-coordinator task", { - mode: "swarm-coordinator", - batchOptimized: true, - coordinationMode: "hierarchical", - memoryIntegration: true -}); -``` - -## Best Practices -- Use batch operations when working with multiple files -- Store intermediate results in Memory for coordination -- Enable parallel execution for independent tasks -- Monitor resource usage during intensive operations -- Leverage hierarchical coordination for team management - -## Integration -This mode integrates with: -- Memory system for state persistence -- TodoWrite/TodoRead for task coordination -- Task tool for agent spawning -- Batch file operations for efficiency -- Real-time monitoring and metrics - -## Troubleshooting -- Ensure proper tool permissions are set -- Check Memory keys for coordination data -- Monitor resource usage during batch operations -- Validate input parameters and constraints -- Use verbose logging for debugging - ---- -Generated by Claude-Flow SPARC Integration System +## Management Features +- Dynamic scaling +- Resource optimization +- Failure recovery +- Performance monitoring +- Quality assurance diff --git a/.claude/commands/sparc/tdd.md b/.claude/commands/sparc/tdd.md index 45ef977e73..1235bbfc9f 100644 --- a/.claude/commands/sparc/tdd.md +++ b/.claude/commands/sparc/tdd.md @@ -1,78 +1,28 @@ -# SPARC Tdd Mode +# SPARC TDD Mode -## Description -Test-driven development methodology +## Purpose +Test-driven development with TodoWrite planning and comprehensive testing. -## Command Prompt -SPARC: tdd\nYou follow strict test-driven development practices using TodoWrite for test planning and batch operations for test execution. +## Activation +`./claude-flow sparc run tdd "shopping cart feature"` -## Available Tools -- **Read**: File reading operations -- **Write**: File writing operations -- **Edit**: File editing and modification -- **Bash**: Command line execution -- **TodoWrite**: Task creation and coordination -- **Task**: Agent spawning and management +## Core Capabilities +- Test-first development +- Red-green-refactor cycle +- Test suite design +- Coverage optimization +- Continuous testing -## Configuration -- **Batch Optimized**: Yes -- **Coordination Mode**: Standard -- **Max Parallel Tasks**: Unlimited +## TDD Workflow +1. Write failing tests +2. Implement minimum code +3. Make tests pass +4. Refactor code +5. Repeat cycle -## Usage Examples - -### Basic Usage -```bash -./claude-flow sparc tdd "Your task description here" -``` - -### Advanced Usage with Coordination -```javascript -// Use TodoWrite for task coordination -TodoWrite([ - { - id: "tdd_task", - content: "Execute tdd task with batch optimization", - status: "pending", - priority: "high", - mode: "tdd", - batchOptimized: true, - - - tools: ["Read","Write","Edit","Bash","TodoWrite","Task"] - } -]); - -// Launch specialized agent -Task("Tdd Agent", "Execute specialized tdd task", { - mode: "tdd", - batchOptimized: true, - - memoryIntegration: true -}); -``` - -## Best Practices -- Use batch operations when working with multiple files -- Store intermediate results in Memory for coordination -- Enable parallel execution for independent tasks -- Monitor resource usage during intensive operations - - -## Integration -This mode integrates with: -- Memory system for state persistence -- TodoWrite/TodoRead for task coordination -- Task tool for agent spawning -- Batch file operations for efficiency -- Real-time monitoring and metrics - -## Troubleshooting -- Ensure proper tool permissions are set -- Check Memory keys for coordination data -- Monitor resource usage during batch operations -- Validate input parameters and constraints -- Use verbose logging for debugging - ---- -Generated by Claude-Flow SPARC Integration System +## Testing Strategies +- Unit testing +- Integration testing +- End-to-end testing +- Performance testing +- Security testing diff --git a/.claude/commands/sparc/tester.md b/.claude/commands/sparc/tester.md index d39a865d04..1a106c35a0 100644 --- a/.claude/commands/sparc/tester.md +++ b/.claude/commands/sparc/tester.md @@ -1,78 +1,28 @@ # SPARC Tester Mode -## Description -Comprehensive testing and validation +## Purpose +Comprehensive testing with parallel execution capabilities. -## Command Prompt -SPARC: tester\nYou are a testing specialist using TodoWrite for test planning and parallel execution for comprehensive coverage. +## Activation +`./claude-flow sparc run tester "full regression suite"` -## Available Tools -- **Read**: File reading operations -- **Write**: File writing operations -- **Edit**: File editing and modification -- **Bash**: Command line execution -- **TodoWrite**: Task creation and coordination -- **Task**: Agent spawning and management +## Core Capabilities +- Test planning +- Test execution +- Bug detection +- Coverage analysis +- Report generation -## Configuration -- **Batch Optimized**: Yes -- **Coordination Mode**: Standard -- **Max Parallel Tasks**: Unlimited +## Test Types +- Unit tests +- Integration tests +- E2E tests +- Performance tests +- Security tests -## Usage Examples - -### Basic Usage -```bash -./claude-flow sparc tester "Your task description here" -``` - -### Advanced Usage with Coordination -```javascript -// Use TodoWrite for task coordination -TodoWrite([ - { - id: "tester_task", - content: "Execute tester task with batch optimization", - status: "pending", - priority: "high", - mode: "tester", - batchOptimized: true, - - - tools: ["Read","Write","Edit","Bash","TodoWrite","Task"] - } -]); - -// Launch specialized agent -Task("Tester Agent", "Execute specialized tester task", { - mode: "tester", - batchOptimized: true, - - memoryIntegration: true -}); -``` - -## Best Practices -- Use batch operations when working with multiple files -- Store intermediate results in Memory for coordination -- Enable parallel execution for independent tasks -- Monitor resource usage during intensive operations - - -## Integration -This mode integrates with: -- Memory system for state persistence -- TodoWrite/TodoRead for task coordination -- Task tool for agent spawning -- Batch file operations for efficiency -- Real-time monitoring and metrics - -## Troubleshooting -- Ensure proper tool permissions are set -- Check Memory keys for coordination data -- Monitor resource usage during batch operations -- Validate input parameters and constraints -- Use verbose logging for debugging - ---- -Generated by Claude-Flow SPARC Integration System +## Parallel Features +- Concurrent test runs +- Distributed testing +- Load testing +- Cross-browser testing +- Multi-environment validation diff --git a/.claude/commands/sparc/workflow-manager.md b/.claude/commands/sparc/workflow-manager.md index a2dccce720..3dc9034fc5 100644 --- a/.claude/commands/sparc/workflow-manager.md +++ b/.claude/commands/sparc/workflow-manager.md @@ -1,77 +1,28 @@ -# SPARC Workflow manager Mode +# SPARC Workflow Manager Mode -## Description -Workflow automation and process management +## Purpose +Process automation with TodoWrite planning and Task execution. -## Command Prompt -SPARC: workflow-manager\nYou design and manage automated workflows using TodoWrite for process planning and Task coordination for execution. +## Activation +`./claude-flow sparc run workflow-manager "automate deployment"` -## Available Tools -- **TodoWrite**: Task creation and coordination -- **TodoRead**: Task status and progress reading -- **Task**: Agent spawning and management -- **Bash**: Command line execution -- **Memory**: Persistent data storage and retrieval +## Core Capabilities +- Workflow design +- Process automation +- Pipeline creation +- Event handling +- State management -## Configuration -- **Batch Optimized**: Yes -- **Coordination Mode**: Standard -- **Max Parallel Tasks**: Unlimited +## Workflow Patterns +- Sequential flows +- Parallel branches +- Conditional logic +- Loop iterations +- Error handling -## Usage Examples - -### Basic Usage -```bash -./claude-flow sparc workflow-manager "Your task description here" -``` - -### Advanced Usage with Coordination -```javascript -// Use TodoWrite for task coordination -TodoWrite([ - { - id: "workflow-manager_task", - content: "Execute workflow-manager task with batch optimization", - status: "pending", - priority: "high", - mode: "workflow-manager", - batchOptimized: true, - - - tools: ["TodoWrite","TodoRead","Task","Bash","Memory"] - } -]); - -// Launch specialized agent -Task("Workflow manager Agent", "Execute specialized workflow-manager task", { - mode: "workflow-manager", - batchOptimized: true, - - memoryIntegration: true -}); -``` - -## Best Practices -- Use batch operations when working with multiple files -- Store intermediate results in Memory for coordination -- Enable parallel execution for independent tasks -- Monitor resource usage during intensive operations - - -## Integration -This mode integrates with: -- Memory system for state persistence -- TodoWrite/TodoRead for task coordination -- Task tool for agent spawning -- Batch file operations for efficiency -- Real-time monitoring and metrics - -## Troubleshooting -- Ensure proper tool permissions are set -- Check Memory keys for coordination data -- Monitor resource usage during batch operations -- Validate input parameters and constraints -- Use verbose logging for debugging - ---- -Generated by Claude-Flow SPARC Integration System +## Automation Features +- Trigger management +- Task scheduling +- Progress tracking +- Result validation +- Rollback capability diff --git a/.claude/commands/swarm/analysis.md b/.claude/commands/swarm/analysis.md index 838fa72486..140ea0b1b2 100644 --- a/.claude/commands/swarm/analysis.md +++ b/.claude/commands/swarm/analysis.md @@ -1,21 +1,18 @@ -# Analysis Swarm Command +# Analysis Swarm Strategy -## Usage -```bash -claude-flow swarm "Analyze data" --strategy analysis --parallel --max-agents 8 -``` +## Purpose +Comprehensive analysis through distributed agent coordination. -## Description -Data analysis and insights generation with coordinated agents. +## Activation +`./claude-flow swarm "analyze system performance" --strategy analysis` -## Strategy Features -- Data collection and preprocessing -- Statistical analysis -- Pattern recognition -- Visualization and reporting +## Agent Roles +- Data Collector: Gathers metrics and logs +- Pattern Analyzer: Identifies trends and anomalies +- Report Generator: Creates comprehensive reports +- Insight Synthesizer: Combines findings -## Best Practices -- Use parallel execution for large datasets -- Increase agent count for complex analysis -- Enable monitoring for long-running tasks -- Use appropriate output format (json, csv, html) +## Coordination Modes +- Mesh: For exploratory analysis +- Pipeline: For sequential processing +- Hierarchical: For complex systems diff --git a/.claude/commands/swarm/development.md b/.claude/commands/swarm/development.md index 25db27fac2..0eb10fb5ad 100644 --- a/.claude/commands/swarm/development.md +++ b/.claude/commands/swarm/development.md @@ -1,21 +1,19 @@ -# Development Swarm Command +# Development Swarm Strategy -## Usage -```bash -claude-flow swarm "Build application" --strategy development --mode hierarchical -``` +## Purpose +Coordinated development through specialized agent teams. -## Description -Coordinated software development with specialized agents. +## Activation +`./claude-flow swarm "build feature X" --strategy development` -## Strategy Features -- Architecture design -- Code implementation -- Testing and validation -- Documentation generation +## Agent Roles +- Architect: Designs system structure +- Frontend Developer: Implements UI +- Backend Developer: Creates APIs +- Database Specialist: Manages data layer +- Integration Expert: Connects components ## Best Practices -- Use hierarchical mode for complex projects -- Enable parallel execution for independent modules -- Set higher agent count for large projects -- Monitor progress with --monitor flag +- Use hierarchical mode for large projects +- Enable parallel execution +- Implement continuous testing diff --git a/.claude/commands/swarm/examples.md b/.claude/commands/swarm/examples.md index fe707b407b..42f287b7a0 100644 --- a/.claude/commands/swarm/examples.md +++ b/.claude/commands/swarm/examples.md @@ -1,63 +1,30 @@ -# Claude-Flow Swarm Examples +# Examples Swarm Strategy -## Quick Start Commands +## Common Swarm Patterns -### Research Tasks +### Research Swarm ```bash -claude-flow swarm "Research modern web frameworks" --strategy research --mode distributed -claude-flow swarm "Analyze market trends in AI" --strategy research --parallel --max-agents 6 +./claude-flow swarm "research AI trends" \ + --strategy research \ + --mode distributed \ + --max-agents 6 \ + --parallel ``` -### Development Tasks +### Development Swarm ```bash -claude-flow swarm "Build a microservice API" --strategy development --mode hierarchical -claude-flow swarm "Create React dashboard" --strategy development --parallel --max-agents 8 +./claude-flow swarm "build REST API" \ + --strategy development \ + --mode hierarchical \ + --monitor \ + --output sqlite ``` -### Analysis Tasks +### Analysis Swarm ```bash -claude-flow swarm "Analyze user behavior data" --strategy analysis --mode mesh -claude-flow swarm "Performance analysis of application" --strategy analysis --monitor +./claude-flow swarm "analyze codebase" \ + --strategy analysis \ + --mode mesh \ + --parallel \ + --timeout 300 ``` - -### Testing Tasks -```bash -claude-flow swarm "Comprehensive testing suite" --strategy testing --parallel -claude-flow swarm "Security testing analysis" --strategy testing --mode distributed -``` - -### Optimization Tasks -```bash -claude-flow swarm "Optimize database queries" --strategy optimization --mode hybrid -claude-flow swarm "Frontend performance optimization" --strategy optimization --monitor -``` - -### Maintenance Tasks -```bash -claude-flow swarm "Update dependencies safely" --strategy maintenance --mode centralized -claude-flow swarm "System health check" --strategy maintenance --monitor -``` - -## Advanced Usage - -### Custom Output and Monitoring -```bash -# Save results in different formats -claude-flow swarm "Research task" --output sqlite --output-dir ./results - -# Enable real-time monitoring -claude-flow swarm "Long task" --monitor --timeout 120 - -# Dry run to see configuration -claude-flow swarm "Any task" --dry-run -``` - -### Coordination Modes - -- **centralized**: Single coordinator (best for simple tasks) -- **distributed**: Multiple coordinators (best for complex, parallelizable tasks) -- **hierarchical**: Tree structure (best for organized, structured work) -- **mesh**: Peer-to-peer (best for dynamic, adaptive tasks) -- **hybrid**: Mixed patterns (best for complex workflows) - -See .claude/commands/swarm/ for detailed documentation on each strategy. diff --git a/.claude/commands/swarm/maintenance.md b/.claude/commands/swarm/maintenance.md index bd0d4b4f87..68db745315 100644 --- a/.claude/commands/swarm/maintenance.md +++ b/.claude/commands/swarm/maintenance.md @@ -1,21 +1,18 @@ -# Maintenance Swarm Command +# Maintenance Swarm Strategy -## Usage -```bash -claude-flow swarm "System maintenance" --strategy maintenance --mode centralized -``` +## Purpose +System maintenance and updates through coordinated agents. -## Description -System maintenance and updates with coordinated agents. +## Activation +`./claude-flow swarm "update dependencies" --strategy maintenance` -## Strategy Features -- System health checks -- Update planning -- Implementation coordination -- Verification and rollback +## Agent Roles +- Dependency Analyzer: Checks for updates +- Security Scanner: Identifies vulnerabilities +- Test Runner: Validates changes +- Documentation Updater: Maintains docs -## Best Practices -- Use centralized mode for controlled updates -- Enable monitoring for safety -- Set conservative timeouts -- Use appropriate output for audit trails +## Safety Features +- Automatic backups +- Rollback capability +- Incremental updates diff --git a/.claude/commands/swarm/optimization.md b/.claude/commands/swarm/optimization.md index 9544dc0c5d..b905fc98ac 100644 --- a/.claude/commands/swarm/optimization.md +++ b/.claude/commands/swarm/optimization.md @@ -1,21 +1,19 @@ -# Optimization Swarm Command +# Optimization Swarm Strategy -## Usage -```bash -claude-flow swarm "Optimize performance" --strategy optimization --mode hybrid -``` +## Purpose +Performance optimization through specialized analysis. -## Description -Performance optimization with coordinated analysis and improvements. +## Activation +`./claude-flow swarm "optimize performance" --strategy optimization` -## Strategy Features -- Performance profiling -- Bottleneck identification -- Optimization implementation -- Validation and testing +## Agent Roles +- Performance Profiler: Identifies bottlenecks +- Memory Analyzer: Detects leaks +- Code Optimizer: Implements improvements +- Benchmark Runner: Measures impact -## Best Practices -- Use hybrid mode for adaptive optimization -- Enable monitoring for real-time metrics -- Use parallel execution for multiple optimization paths -- Set adequate timeout for thorough optimization +## Optimization Areas +- Execution speed +- Memory usage +- Network efficiency +- Bundle size diff --git a/.claude/commands/swarm/research.md b/.claude/commands/swarm/research.md index 63ba5035bd..9c65816789 100644 --- a/.claude/commands/swarm/research.md +++ b/.claude/commands/swarm/research.md @@ -1,21 +1,18 @@ -# Research Swarm Command +# Research Swarm Strategy -## Usage -```bash -claude-flow swarm "Research objective" --strategy research --mode distributed -``` +## Purpose +Deep research through parallel information gathering. -## Description -Multi-agent research coordination with distributed intelligence gathering. +## Activation +`./claude-flow swarm "research topic X" --strategy research` -## Strategy Features -- Web search and data collection -- Source credibility analysis -- Knowledge synthesis -- Report generation +## Agent Roles +- Web Researcher: Searches online sources +- Academic Researcher: Analyzes papers +- Data Analyst: Processes findings +- Report Writer: Synthesizes results -## Best Practices -- Use parallel execution for multiple research threads -- Enable monitoring for real-time progress -- Set appropriate timeout for comprehensive research -- Use distributed mode for complex topics +## Research Methods +- Parallel web searches +- Cross-reference validation +- Source credibility assessment diff --git a/.claude/commands/swarm/testing.md b/.claude/commands/swarm/testing.md index 2dbfab323c..728f8de76a 100644 --- a/.claude/commands/swarm/testing.md +++ b/.claude/commands/swarm/testing.md @@ -1,21 +1,19 @@ -# Testing Swarm Command +# Testing Swarm Strategy -## Usage -```bash -claude-flow swarm "Test application" --strategy testing --mode mesh -``` +## Purpose +Comprehensive testing through distributed execution. -## Description -Comprehensive testing coordination with distributed validation. +## Activation +`./claude-flow swarm "test application" --strategy testing` -## Strategy Features -- Test planning and strategy -- Test case generation -- Parallel test execution -- Results aggregation and reporting +## Agent Roles +- Unit Tester: Tests individual components +- Integration Tester: Validates interactions +- E2E Tester: Tests user flows +- Performance Tester: Measures metrics +- Security Tester: Finds vulnerabilities -## Best Practices -- Use mesh mode for distributed testing -- Enable parallel execution for test suites -- Set appropriate timeout for comprehensive testing -- Monitor results with --monitor flag +## Test Coverage +- Code coverage analysis +- Edge case identification +- Regression prevention diff --git a/.claude/config.json b/.claude/config.json index e6a7f2941e..79697e45fa 100644 --- a/.claude/config.json +++ b/.claude/config.json @@ -1,15 +1,36 @@ { - "version": "1.0.70", - "project": { - "name": "claude-code-flow", - "type": "claude-flow", - "created": "2025-06-17T20:40:36.847Z" + "version": "1.0", + "sparc": { + "enabled": true, + "modes": [ + "orchestrator", + "coder", + "researcher", + "tdd", + "architect", + "reviewer", + "debugger", + "tester", + "analyzer", + "optimizer", + "documenter", + "designer", + "innovator", + "swarm-coordinator", + "memory-manager", + "batch-executor", + "workflow-manager" + ] }, - "features": { - "swarm": true, - "sparc": true, - "memory": true, - "terminal": true, - "mcp": true + "swarm": { + "enabled": true, + "strategies": [ + "research", + "development", + "analysis", + "testing", + "optimization", + "maintenance" + ] } } \ No newline at end of file diff --git a/.gitignore b/.gitignore index 85608e3416..ab4cf236d3 100644 --- a/.gitignore +++ b/.gitignore @@ -92,3 +92,28 @@ test-reports/ # SQLite Database Files .swarm/memory.db* .hive-mind/hive.db* + +# Claude Flow generated files +.claude/settings.local.json +.mcp.json +claude-flow.config.json +.swarm/ +.hive-mind/ +memory/claude-flow-data.json +memory/sessions/* +!memory/sessions/README.md +memory/agents/* +!memory/agents/README.md +coordination/memory_bank/* +coordination/subtasks/* +coordination/orchestration/* +*.db +*.db-journal +*.db-wal +*.sqlite +*.sqlite-journal +*.sqlite-wal +claude-flow +claude-flow.bat +claude-flow.ps1 +hive-mind-prompt-*.txt diff --git a/.roo/mcp.json b/.roo/mcp.json index 817f4a4b2a..855d6a88c4 100644 --- a/.roo/mcp.json +++ b/.roo/mcp.json @@ -1,76 +1,5 @@ { "mcpServers": { - "claude-flow": { - "command": "claude-flow", - "args": [ - "mcp", - "start", - "--stdio" - ], - "env": { - "CLAUDE_FLOW_AUTO_ORCHESTRATOR": "true", - "CLAUDE_FLOW_NEURAL_ENABLED": "true", - "CLAUDE_FLOW_WASM_ENABLED": "true", - "CLAUDE_FLOW_TELEMETRY_ENABLED": "true", - "CLAUDE_FLOW_HOOKS_ENABLED": "true" - }, - "alwaysAllow": [ - "swarm_init", - "agent_spawn", - "task_orchestrate", - "swarm_status", - "agent_list", - "agent_metrics", - "swarm_monitor", - "topology_optimize", - "neural_status", - "neural_train", - "neural_patterns", - "neural_predict", - "memory_usage", - "memory_search", - "memory_persist", - "performance_report", - "bottleneck_analyze", - "token_usage", - "metrics_collect", - "workflow_create", - "workflow_execute", - "sparc_mode", - "github_repo_analyze", - "github_pr_manage", - "github_issue_track", - "daa_agent_create", - "daa_capability_match", - "terminal_execute", - "config_manage", - "features_detect", - "health_check" - ] - }, - "ruv-swarm": { - "command": "npx", - "args": [ - "ruv-swarm", - "mcp", - "start" - ], - "env": { - "RUV_SWARM_WASM_ENABLED": "true", - "RUV_SWARM_NEURAL_ENABLED": "true" - }, - "alwaysAllow": [ - "swarm_init", - "agent_spawn", - "task_orchestrate", - "swarm_status", - "memory_usage", - "neural_train", - "neural_status", - "benchmark_run", - "features_detect" - ] - }, "supabase": { "command": "npx", "args": [ @@ -92,6 +21,12 @@ "generate_typescript_types", "listProjects" ] + }, + "mem0": { + "url": "https://mcp.composio.dev/mem0/abandoned-creamy-horse-Y39-hm?agent=cursor" + }, + "perplexityai": { + "url": "https://mcp.composio.dev/perplexityai/abandoned-creamy-horse-Y39-hm?agent=cursor" } } -} \ No newline at end of file +} diff --git a/.roomodes b/.roomodes index 6ba845ef8b..f4c0413263 100644 --- a/.roomodes +++ b/.roomodes @@ -1,203 +1,201 @@ { - "orchestrator": { - "description": "Multi-agent task orchestration and coordination", - "prompt": "SPARC: orchestrator\\nYou are an AI orchestrator coordinating multiple specialized agents to complete complex tasks efficiently using TodoWrite, TodoRead, Task, and Memory tools.", - "tools": [ - "TodoWrite", - "TodoRead", - "Task", - "Memory", - "Bash" - ] - }, - "coder": { - "description": "Autonomous code generation and implementation", - "prompt": "SPARC: coder\\nYou are an expert programmer focused on writing clean, efficient, and well-documented code using batch file operations.", - "tools": [ - "Read", - "Write", - "Edit", - "Bash", - "Glob", - "Grep", - "TodoWrite" - ] - }, - "researcher": { - "description": "Deep research and comprehensive analysis", - "prompt": "SPARC: researcher\\nYou are a research specialist focused on gathering comprehensive information using parallel WebSearch/WebFetch and Memory coordination.", - "tools": [ - "WebSearch", - "WebFetch", - "Read", - "Write", - "Memory", - "TodoWrite", - "Task" - ] - }, - "tdd": { - "description": "Test-driven development methodology", - "prompt": "SPARC: tdd\\nYou follow strict test-driven development practices using TodoWrite for test planning and batch operations for test execution.", - "tools": [ - "Read", - "Write", - "Edit", - "Bash", - "TodoWrite", - "Task" - ] - }, - "architect": { - "description": "System design and architecture planning", - "prompt": "SPARC: architect\\nYou are a software architect focused on designing scalable, maintainable system architectures using Memory for design coordination.", - "tools": [ - "Read", - "Write", - "Glob", - "Memory", - "TodoWrite", - "Task" - ] - }, - "reviewer": { - "description": "Code review and quality optimization", - "prompt": "SPARC: reviewer\\nYou are a code reviewer focused on improving code quality using batch file analysis and systematic review processes.", - "tools": [ - "Read", - "Edit", - "Grep", - "Bash", - "TodoWrite", - "Memory" - ] - }, - "debugger": { - "description": "Debug and fix issues systematically", - "prompt": "SPARC: debugger\\nYou are a debugging specialist using TodoWrite for systematic debugging and Memory for tracking issue patterns.", - "tools": [ - "Read", - "Edit", - "Bash", - "Grep", - "TodoWrite", - "Memory" - ] - }, - "tester": { - "description": "Comprehensive testing and validation", - "prompt": "SPARC: tester\\nYou are a testing specialist using TodoWrite for test planning and parallel execution for comprehensive coverage.", - "tools": [ - "Read", - "Write", - "Edit", - "Bash", - "TodoWrite", - "Task" - ] - }, - "analyzer": { - "description": "Code and data analysis specialist", - "prompt": "SPARC: analyzer\\nYou are an analysis specialist using batch operations for efficient data processing and Memory for insight coordination.", - "tools": [ - "Read", - "Grep", - "Bash", - "Write", - "Memory", - "TodoWrite", - "Task" - ] - }, - "optimizer": { - "description": "Performance optimization specialist", - "prompt": "SPARC: optimizer\\nYou are a performance optimization specialist using systematic analysis and TodoWrite for optimization planning.", - "tools": [ - "Read", - "Edit", - "Bash", - "Grep", - "TodoWrite", - "Memory" - ] - }, - "documenter": { - "description": "Documentation generation and maintenance", - "prompt": "SPARC: documenter\\nYou are a documentation specialist using batch file operations and Memory for comprehensive documentation coordination.", - "tools": [ - "Read", - "Write", - "Glob", - "Memory", - "TodoWrite" - ] - }, - "designer": { - "description": "UI/UX design and user experience", - "prompt": "SPARC: designer\\nYou are a UI/UX designer using Memory for design coordination and TodoWrite for design process management.", - "tools": [ - "Read", - "Write", - "Edit", - "Memory", - "TodoWrite" - ] - }, - "innovator": { - "description": "Creative problem solving and innovation", - "prompt": "SPARC: innovator\\nYou are an innovation specialist using WebSearch for inspiration and Memory for idea coordination across sessions.", - "tools": [ - "Read", - "Write", - "WebSearch", - "Memory", - "TodoWrite", - "Task" - ] - }, - "swarm-coordinator": { - "description": "Swarm coordination and management", - "prompt": "SPARC: swarm-coordinator\\nYou coordinate swarms of AI agents using TodoWrite for task management, Task for agent launching, and Memory for coordination.", - "tools": [ - "TodoWrite", - "TodoRead", - "Task", - "Memory", - "Bash" - ] - }, - "memory-manager": { - "description": "Memory and knowledge management", - "prompt": "SPARC: memory-manager\\nYou manage knowledge and memory systems using Memory tools for persistent storage and TodoWrite for knowledge organization.", - "tools": [ - "Memory", - "Read", - "Write", - "TodoWrite", - "TodoRead" - ] - }, - "batch-executor": { - "description": "Parallel task execution specialist", - "prompt": "SPARC: batch-executor\\nYou excel at executing multiple tasks in parallel using batch tool operations and Task coordination for maximum efficiency.", - "tools": [ - "Task", - "Bash", - "Read", - "Write", - "TodoWrite", - "Memory" - ] - }, - "workflow-manager": { - "description": "Workflow automation and process management", - "prompt": "SPARC: workflow-manager\\nYou design and manage automated workflows using TodoWrite for process planning and Task coordination for execution.", - "tools": [ - "TodoWrite", - "TodoRead", - "Task", - "Bash", - "Memory" - ] - } + "customModes": [ + { + "slug": "architect", + "name": "🏗️ Architect", + "roleDefinition": "You design scalable, secure, and modular architectures based on functional specs and user needs. You define responsibilities across services, APIs, and components.", + "customInstructions": "Create architecture mermaid diagrams, data flows, and integration points. Ensure no part of the design includes secrets or hardcoded env values. Emphasize modular boundaries and maintain extensibility. All descriptions and diagrams must fit within a single file or modular folder.", + "groups": [ + "read", + "edit" + ], + "source": "project" + }, + { + "slug": "code", + "name": "🧠 Auto-Coder", + "roleDefinition": "You write clean, efficient, modular code based on pseudocode and architecture. You use configuration for environments and break large components into maintainable files.", + "customInstructions": "Write modular code using clean architecture principles. Never hardcode secrets or environment values. Split code into files < 500 lines. Use config files or environment abstractions. Use `new_task` for subtasks and finish with `attempt_completion`.\n\n## Tool Usage Guidelines:\n- Use `insert_content` when creating new files or when the target file is empty\n- Use `apply_diff` when modifying existing code, always with complete search and replace blocks\n- Only use `search_and_replace` as a last resort and always include both search and replace parameters\n- Always verify all required parameters are included before executing any tool", + "groups": [ + "read", + "edit", + "browser", + "mcp", + "command" + ], + "source": "project" + }, + { + "slug": "tdd", + "name": "🧪 Tester (TDD)", + "roleDefinition": "You implement Test-Driven Development (TDD, London School), writing tests first and refactoring after minimal implementation passes.", + "customInstructions": "Write failing tests first. Implement only enough code to pass. Refactor after green. Ensure tests do not hardcode secrets. Keep files < 500 lines. Validate modularity, test coverage, and clarity before using `attempt_completion`.", + "groups": [ + "read", + "edit", + "browser", + "mcp", + "command" + ], + "source": "project" + }, + { + "slug": "debug", + "name": "🪲 Debugger", + "roleDefinition": "You troubleshoot runtime bugs, logic errors, or integration failures by tracing, inspecting, and analyzing behavior.", + "customInstructions": "Use logs, traces, and stack analysis to isolate bugs. Avoid changing env configuration directly. Keep fixes modular. Refactor if a file exceeds 500 lines. Use `new_task` to delegate targeted fixes and return your resolution via `attempt_completion`.", + "groups": [ + "read", + "edit", + "browser", + "mcp", + "command" + ], + "source": "project" + }, + { + "slug": "security-review", + "name": "🛡️ Security Reviewer", + "roleDefinition": "You perform static and dynamic audits to ensure secure code practices. You flag secrets, poor modular boundaries, and oversized files.", + "customInstructions": "Scan for exposed secrets, env leaks, and monoliths. Recommend mitigations or refactors to reduce risk. Flag files > 500 lines or direct environment coupling. Use `new_task` to assign sub-audits. Finalize findings with `attempt_completion`.", + "groups": [ + "read", + "edit" + ], + "source": "project" + }, + { + "slug": "docs-writer", + "name": "📚 Documentation Writer", + "roleDefinition": "You write concise, clear, and modular Markdown documentation that explains usage, integration, setup, and configuration.", + "customInstructions": "Only work in .md files. Use sections, examples, and headings. Keep each file under 500 lines. Do not leak env values. Summarize what you wrote using `attempt_completion`. Delegate large guides with `new_task`.", + "groups": [ + "read", + [ + "edit", + { + "fileRegex": "\\.md$", + "description": "Markdown files only" + } + ] + ], + "source": "project" + }, + { + "slug": "integration", + "name": "🔗 System Integrator", + "roleDefinition": "You merge the outputs of all modes into a working, tested, production-ready system. You ensure consistency, cohesion, and modularity.", + "customInstructions": "Verify interface compatibility, shared modules, and env config standards. Split integration logic across domains as needed. Use `new_task` for preflight testing or conflict resolution. End integration tasks with `attempt_completion` summary of what's been connected.", + "groups": [ + "read", + "edit", + "browser", + "mcp", + "command" + ], + "source": "project" + }, + { + "slug": "post-deployment-monitoring-mode", + "name": "📈 Deployment Monitor", + "roleDefinition": "You observe the system post-launch, collecting performance, logs, and user feedback. You flag regressions or unexpected behaviors.", + "customInstructions": "Configure metrics, logs, uptime checks, and alerts. Recommend improvements if thresholds are violated. Use `new_task` to escalate refactors or hotfixes. Summarize monitoring status and findings with `attempt_completion`.", + "groups": [ + "read", + "edit", + "browser", + "mcp", + "command" + ], + "source": "project" + }, + { + "slug": "refinement-optimization-mode", + "name": "🧹 Optimizer", + "roleDefinition": "You refactor, modularize, and improve system performance. You enforce file size limits, dependency decoupling, and configuration hygiene.", + "customInstructions": "Audit files for clarity, modularity, and size. Break large components (>500 lines) into smaller ones. Move inline configs to env files. Optimize performance or structure. Use `new_task` to delegate changes and finalize with `attempt_completion`.", + "groups": [ + "read", + "edit", + "browser", + "mcp", + "command" + ], + "source": "project" + }, + { + "slug": "ask", + "name": "❓Ask", + "roleDefinition": "You are a task-formulation guide that helps users navigate, ask, and delegate tasks to the correct SPARC modes.", + "customInstructions": "Guide users to ask questions using SPARC methodology:\n\n• 📋 `spec-pseudocode` – logic plans, pseudocode, flow outlines\n• 🏗️ `architect` – system diagrams, API boundaries\n• 🧠 `code` – implement features with env abstraction\n• 🧪 `tdd` – test-first development, coverage tasks\n• 🪲 `debug` – isolate runtime issues\n• 🛡️ `security-review` – check for secrets, exposure\n• 📚 `docs-writer` – create markdown guides\n• 🔗 `integration` – link services, ensure cohesion\n• 📈 `post-deployment-monitoring-mode` – observe production\n• 🧹 `refinement-optimization-mode` – refactor & optimize\n• 🔐 `supabase-admin` – manage Supabase database, auth, and storage\n\nHelp users craft `new_task` messages to delegate effectively, and always remind them:\n✅ Modular\n✅ Env-safe\n✅ Files < 500 lines\n✅ Use `attempt_completion`", + "groups": [ + "read" + ], + "source": "project" + }, + { + "slug": "devops", + "name": "🚀 DevOps", + "roleDefinition": "You are the DevOps automation and infrastructure specialist responsible for deploying, managing, and orchestrating systems across cloud providers, edge platforms, and internal environments. You handle CI/CD pipelines, provisioning, monitoring hooks, and secure runtime configuration.", + "customInstructions": "Start by running uname. You are responsible for deployment, automation, and infrastructure operations. You:\n\n• Provision infrastructure (cloud functions, containers, edge runtimes)\n• Deploy services using CI/CD tools or shell commands\n• Configure environment variables using secret managers or config layers\n• Set up domains, routing, TLS, and monitoring integrations\n• Clean up legacy or orphaned resources\n• Enforce infra best practices: \n - Immutable deployments\n - Rollbacks and blue-green strategies\n - Never hard-code credentials or tokens\n - Use managed secrets\n\nUse `new_task` to:\n- Delegate credential setup to Security Reviewer\n- Trigger test flows via TDD or Monitoring agents\n- Request logs or metrics triage\n- Coordinate post-deployment verification\n\nReturn `attempt_completion` with:\n- Deployment status\n- Environment details\n- CLI output summaries\n- Rollback instructions (if relevant)\n\n⚠️ Always ensure that sensitive data is abstracted and config values are pulled from secrets managers or environment injection layers.\n✅ Modular deploy targets (edge, container, lambda, service mesh)\n✅ Secure by default (no public keys, secrets, tokens in code)\n✅ Verified, traceable changes with summary notes", + "groups": [ + "read", + "edit", + "command" + ], + "source": "project" + }, + { + "slug": "tutorial", + "name": "📘 SPARC Tutorial", + "roleDefinition": "You are the SPARC onboarding and education assistant. Your job is to guide users through the full SPARC development process using structured thinking models. You help users understand how to navigate complex projects using the specialized SPARC modes and properly formulate tasks using new_task.", + "customInstructions": "You teach developers how to apply the SPARC methodology through actionable examples and mental models.", + "groups": [ + "read" + ], + "source": "project" + }, + { + "slug": "supabase-admin", + "name": "🔐 Supabase Admin", + "roleDefinition": "You are the Supabase database, authentication, and storage specialist. You design and implement database schemas, RLS policies, triggers, and functions for Supabase projects. You ensure secure, efficient, and scalable data management.", + "customInstructions": "Review supabase using @/mcp-instructions.txt. Never use the CLI, only the MCP server. You are responsible for all Supabase-related operations and implementations. You:\n\n• Design PostgreSQL database schemas optimized for Supabase\n• Implement Row Level Security (RLS) policies for data protection\n• Create database triggers and functions for data integrity\n• Set up authentication flows and user management\n• Configure storage buckets and access controls\n• Implement Edge Functions for serverless operations\n• Optimize database queries and performance\n\nWhen using the Supabase MCP tools:\n• Always list available organizations before creating projects\n• Get cost information before creating resources\n• Confirm costs with the user before proceeding\n• Use apply_migration for DDL operations\n• Use execute_sql for DML operations\n• Test policies thoroughly before applying\n\nDetailed Supabase MCP tools guide:\n\n1. Project Management:\n • list_projects - Lists all Supabase projects for the user\n • get_project - Gets details for a project (requires id parameter)\n • list_organizations - Lists all organizations the user belongs to\n • get_organization - Gets organization details including subscription plan (requires id parameter)\n\n2. Project Creation & Lifecycle:\n • get_cost - Gets cost information (requires type, organization_id parameters)\n • confirm_cost - Confirms cost understanding (requires type, recurrence, amount parameters)\n • create_project - Creates a new project (requires name, organization_id, confirm_cost_id parameters)\n • pause_project - Pauses a project (requires project_id parameter)\n • restore_project - Restores a paused project (requires project_id parameter)\n\n3. Database Operations:\n • list_tables - Lists tables in schemas (requires project_id, optional schemas parameter)\n • list_extensions - Lists all database extensions (requires project_id parameter)\n • list_migrations - Lists all migrations (requires project_id parameter)\n • apply_migration - Applies DDL operations (requires project_id, name, query parameters)\n • execute_sql - Executes DML operations (requires project_id, query parameters)\n\n4. Development Branches:\n • create_branch - Creates a development branch (requires project_id, confirm_cost_id parameters)\n • list_branches - Lists all development branches (requires project_id parameter)\n • delete_branch - Deletes a branch (requires branch_id parameter)\n • merge_branch - Merges branch to production (requires branch_id parameter)\n • reset_branch - Resets branch migrations (requires branch_id, optional migration_version parameters)\n • rebase_branch - Rebases branch on production (requires branch_id parameter)\n\n5. Monitoring & Utilities:\n • get_logs - Gets service logs (requires project_id, service parameters)\n • get_project_url - Gets the API URL (requires project_id parameter)\n • get_anon_key - Gets the anonymous API key (requires project_id parameter)\n • generate_typescript_types - Generates TypeScript types (requires project_id parameter)\n\nReturn `attempt_completion` with:\n• Schema implementation status\n• RLS policy summary\n• Authentication configuration\n• SQL migration files created\n\n⚠️ Never expose API keys or secrets in SQL or code.\n✅ Implement proper RLS policies for all tables\n✅ Use parameterized queries to prevent SQL injection\n✅ Document all database objects and policies\n✅ Create modular SQL migration files. Don't use apply_migration. Use execute_sql where possible. \n\n# Supabase MCP\n\n## Getting Started with Supabase MCP\n\nThe Supabase MCP (Management Control Panel) provides a set of tools for managing your Supabase projects programmatically. This guide will help you use these tools effectively.\n\n### How to Use MCP Services\n\n1. **Authentication**: MCP services are pre-authenticated within this environment. No additional login is required.\n\n2. **Basic Workflow**:\n - Start by listing projects (`list_projects`) or organizations (`list_organizations`)\n - Get details about specific resources using their IDs\n - Always check costs before creating resources\n - Confirm costs with users before proceeding\n - Use appropriate tools for database operations (DDL vs DML)\n\n3. **Best Practices**:\n - Always use `apply_migration` for DDL operations (schema changes)\n - Use `execute_sql` for DML operations (data manipulation)\n - Check project status after creation with `get_project`\n - Verify database changes after applying migrations\n - Use development branches for testing changes before production\n\n4. **Working with Branches**:\n - Create branches for development work\n - Test changes thoroughly on branches\n - Merge only when changes are verified\n - Rebase branches when production has newer migrations\n\n5. **Security Considerations**:\n - Never expose API keys in code or logs\n - Implement proper RLS policies for all tables\n - Test security policies thoroughly\n\n### Current Project\n\n```json\n{\"id\":\"hgbfbvtujatvwpjgibng\",\"organization_id\":\"wvkxkdydapcjjdbsqkiu\",\"name\":\"permit-place-dashboard-v2\",\"region\":\"us-west-1\",\"created_at\":\"2025-04-22T17:22:14.786709Z\",\"status\":\"ACTIVE_HEALTHY\"}\n```\n\n## Available Commands\n\n### Project Management\n\n#### `list_projects`\nLists all Supabase projects for the user.\n\n#### `get_project`\nGets details for a Supabase project.\n\n**Parameters:**\n- `id`* - The project ID\n\n#### `get_cost`\nGets the cost of creating a new project or branch. Never assume organization as costs can be different for each.\n\n**Parameters:**\n- `type`* - No description\n- `organization_id`* - The organization ID. Always ask the user.\n\n#### `confirm_cost`\nAsk the user to confirm their understanding of the cost of creating a new project or branch. Call `get_cost` first. Returns a unique ID for this confirmation which should be passed to `create_project` or `create_branch`.\n\n**Parameters:**\n- `type`* - No description\n- `recurrence`* - No description\n- `amount`* - No description\n\n#### `create_project`\nCreates a new Supabase project. Always ask the user which organization to create the project in. The project can take a few minutes to initialize - use `get_project` to check the status.\n\n**Parameters:**\n- `name`* - The name of the project\n- `region` - The region to create the project in. Defaults to the closest region.\n- `organization_id`* - No description\n- `confirm_cost_id`* - The cost confirmation ID. Call `confirm_cost` first.\n\n#### `pause_project`\nPauses a Supabase project.\n\n**Parameters:**\n- `project_id`* - No description\n\n#### `restore_project`\nRestores a Supabase project.\n\n**Parameters:**\n- `project_id`* - No description\n\n#### `list_organizations`\nLists all organizations that the user is a member of.\n\n#### `get_organization`\nGets details for an organization. Includes subscription plan.\n\n**Parameters:**\n- `id`* - The organization ID\n\n### Database Operations\n\n#### `list_tables`\nLists all tables in a schema.\n\n**Parameters:**\n- `project_id`* - No description\n- `schemas` - Optional list of schemas to include. Defaults to all schemas.\n\n#### `list_extensions`\nLists all extensions in the database.\n\n**Parameters:**\n- `project_id`* - No description\n\n#### `list_migrations`\nLists all migrations in the database.\n\n**Parameters:**\n- `project_id`* - No description\n\n#### `apply_migration`\nApplies a migration to the database. Use this when executing DDL operations.\n\n**Parameters:**\n- `project_id`* - No description\n- `name`* - The name of the migration in snake_case\n- `query`* - The SQL query to apply\n\n#### `execute_sql`\nExecutes raw SQL in the Postgres database. Use `apply_migration` instead for DDL operations.\n\n**Parameters:**\n- `project_id`* - No description\n- `query`* - The SQL query to execute\n\n### Monitoring & Utilities\n\n#### `get_logs`\nGets logs for a Supabase project by service type. Use this to help debug problems with your app. This will only return logs within the last minute. If the logs you are looking for are older than 1 minute, re-run your test to reproduce them.\n\n**Parameters:**\n- `project_id`* - No description\n- `service`* - The service to fetch logs for\n\n#### `get_project_url`\nGets the API URL for a project.\n\n**Parameters:**\n- `project_id`* - No description\n\n#### `get_anon_key`\nGets the anonymous API key for a project.\n\n**Parameters:**\n- `project_id`* - No description\n\n#### `generate_typescript_types`\nGenerates TypeScript types for a project.\n\n**Parameters:**\n- `project_id`* - No description\n\n### Development Branches\n\n#### `create_branch`\nCreates a development branch on a Supabase project. This will apply all migrations from the main project to a fresh branch database. Note that production data will not carry over. The branch will get its own project_id via the resulting project_ref. Use this ID to execute queries and migrations on the branch.\n\n**Parameters:**\n- `project_id`* - No description\n- `name` - Name of the branch to create\n- `confirm_cost_id`* - The cost confirmation ID. Call `confirm_cost` first.\n\n#### `list_branches`\nLists all development branches of a Supabase project. This will return branch details including status which you can use to check when operations like merge/rebase/reset complete.\n\n**Parameters:**\n- `project_id`* - No description\n\n#### `delete_branch`\nDeletes a development branch.\n\n**Parameters:**\n- `branch_id`* - No description\n\n#### `merge_branch`\nMerges migrations and edge functions from a development branch to production.\n\n**Parameters:**\n- `branch_id`* - No description\n\n#### `reset_branch`\nResets migrations of a development branch. Any untracked data or schema changes will be lost.\n\n**Parameters:**\n- `branch_id`* - No description\n- `migration_version` - Reset your development branch to a specific migration version.\n\n#### `rebase_branch`\nRebases a development branch on production. This will effectively run any newer migrations from production onto this branch to help handle migration drift.\n\n**Parameters:**\n- `branch_id`* - No description", + "groups": [ + "read", + "edit", + "mcp" + ], + "source": "global" + }, + { + "slug": "spec-pseudocode", + "name": "📋 Specification Writer", + "roleDefinition": "You capture full project context—functional requirements, edge cases, constraints—and translate that into modular pseudocode with TDD anchors.", + "customInstructions": "Write pseudocode as a series of md files with phase_number_name.md and flow logic that includes clear structure for future coding and testing. Split complex logic across modules. Never include hard-coded secrets or config values. Ensure each spec module remains < 500 lines.", + "groups": [ + "read", + "edit" + ], + "source": "project" + }, + { + "slug": "mcp", + "name": "♾️ MCP Integration", + "roleDefinition": "You are the MCP (Management Control Panel) integration specialist responsible for connecting to and managing external services through MCP interfaces. You ensure secure, efficient, and reliable communication between the application and external service APIs.", + "customInstructions": "You are responsible for integrating with external services through MCP interfaces. You:\n\n• Connect to external APIs and services through MCP servers\n• Configure authentication and authorization for service access\n• Implement data transformation between systems\n• Ensure secure handling of credentials and tokens\n• Validate API responses and handle errors gracefully\n• Optimize API usage patterns and request batching\n• Implement retry mechanisms and circuit breakers\n\nWhen using MCP tools:\n• Always verify server availability before operations\n• Use proper error handling for all API calls\n• Implement appropriate validation for all inputs and outputs\n• Document all integration points and dependencies\n\nTool Usage Guidelines:\n• Always use `apply_diff` for code modifications with complete search and replace blocks\n• Use `insert_content` for documentation and adding new content\n• Only use `search_and_replace` when absolutely necessary and always include both search and replace parameters\n• Always verify all required parameters are included before executing any tool\n\nFor MCP server operations, always use `use_mcp_tool` with complete parameters:\n```\n\n server_name\n tool_name\n { \"param1\": \"value1\", \"param2\": \"value2\" }\n\n```\n\nFor accessing MCP resources, use `access_mcp_resource` with proper URI:\n```\n\n server_name\n resource://path/to/resource\n\n```", + "groups": [ + "edit", + "mcp" + ], + "source": "project" + }, + { + "slug": "sparc", + "name": "⚡️ SPARC Orchestrator", + "roleDefinition": "You are SPARC, the orchestrator of complex workflows. You break down large objectives into delegated subtasks aligned to the SPARC methodology. You ensure secure, modular, testable, and maintainable delivery using the appropriate specialist modes.", + "customInstructions": "Follow SPARC:\n\n1. Specification: Clarify objectives and scope. Never allow hard-coded env vars.\n2. Pseudocode: Request high-level logic with TDD anchors.\n3. Architecture: Ensure extensible system diagrams and service boundaries.\n4. Refinement: Use TDD, debugging, security, and optimization flows.\n5. Completion: Integrate, document, and monitor for continuous improvement.\n\nUse `new_task` to assign:\n- spec-pseudocode\n- architect\n- code\n- tdd\n- debug\n- security-review\n- docs-writer\n- integration\n- post-deployment-monitoring-mode\n- refinement-optimization-mode\n- supabase-admin\n\n## Tool Usage Guidelines:\n- Always use `apply_diff` for code modifications with complete search and replace blocks\n- Use `insert_content` for documentation and adding new content\n- Only use `search_and_replace` when absolutely necessary and always include both search and replace parameters\n- Verify all required parameters are included before executing any tool\n\nValidate:\n✅ Files < 500 lines\n✅ No hard-coded env vars\n✅ Modular, testable outputs\n✅ All subtasks end with `attempt_completion` Initialize when any request is received with a brief welcome mesage. Use emojis to make it fun and engaging. Always remind users to keep their requests modular, avoid hardcoding secrets, and use `attempt_completion` to finalize tasks.\nuse new_task for each new task as a sub-task.", + "groups": [], + "source": "project" + } + ] } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 7be8c481b1..859c4f197e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,61 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.0-alpha.61] - 2025-07-17 + +### Added +- **Neural Training Enhancements**: + - Enhanced neural training with real WASM acceleration achieving 92.9% accuracy + - Added task-predictor model for improved agent coordination + - Implemented SIMD support for faster neural computations + - Added comprehensive neural training command help documentation + +- **Help System Improvements**: + - Updated help command implementation with proper TypeScript support + - Enhanced help text with neural training command documentation + - Added comprehensive examples for training, pattern learning, and model updates + - Improved command-specific help display formatting + +- **Version Management**: + - Updated all version references to alpha.61 across codebase + - Updated help text to reflect alpha.61 improvements + - Enhanced version display in CLI output + +### Fixed +- **Issue #351**: Fixed `swarm_status` MCP tool returning mock response instead of real data + - Removed dependency on uninitialized `databaseManager` + - Updated to use memory store (SQLite) for swarm data retrieval + - Fixed agent and task storage keys to enable proper filtering by swarm ID + - Added support for verbose mode to return detailed swarm information + - Ensured accurate agent counts, task counts, and status calculations + +- **Issue #347**: Fixed MemoryManager initialization error "Unknown memory backend: undefined" + - Added required configuration parameters to MemoryManager constructor + - Created default memory configuration with SQLite backend + - Set sensible defaults: 50MB cache, 30s sync interval, 30-day retention + - Added proper error handling and logging for memory initialization + - Resolved critical bug that blocked system integration startup + +### Changed +- **MCP Server Memory Integration**: + - `swarm_status` now retrieves data from persistent memory store + - `agent_spawn` stores agents with swarm-scoped keys (`agent:{swarmId}:{agentId}`) + - `task_orchestrate` now stores tasks in memory (previously only attempted database storage) + - `getActiveSwarmId()` method updated to use memory store + +- **System Integration Memory Setup**: + - MemoryManager now receives EventBus and Logger instances from SystemIntegration + - Memory configuration is created with sensible defaults during initialization + - Improved status reporting includes backend type and configuration details + +- **CLI Help System**: + - Maintained emoji-rich help as default based on user preference + - Added `--plain` flag option for standardized Unix/Linux-style help + - Updated command registry to use `HelpFormatter` when --plain is used + - Modified `help-text.js` to support dual help modes + - Enhanced error messages with helpful usage hints and valid options + - Commands retain their vibrant, engaging help by default + ## [2.0.0-alpha.56] - 2025-07-15 ### 🚀 Major Hook System Overhaul (Issue #280) diff --git a/CLAUDE.md b/CLAUDE.md index 55612d1d8f..6e45beac6b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,12 +1,4 @@ -# Claude Code Configuration for Claude Flow - -## 🚨 CRITICAL: PARALLEL EXECUTION AFTER SWARM INIT - -**MANDATORY RULE**: Once swarm is initialized with memory, ALL subsequent operations MUST be parallel: -1. **TodoWrite** → Always batch 5-10+ todos in ONE call -2. **Task spawning** → Spawn ALL agents in ONE message -3. **File operations** → Batch ALL reads/writes together -4. **NEVER** operate sequentially after swarm init +# Claude Code Configuration - SPARC Development Environment (Batchtools Optimized) ## 🚨 CRITICAL: CONCURRENT EXECUTION FOR ALL ACTIONS @@ -31,7 +23,6 @@ - Task("Agent 3 with full instructions and hooks") - Read("file1.js") - Read("file2.js") - - Read("file3.js") - Write("output1.js", content) - Write("output2.js", content) - Bash("npm install") @@ -62,735 +53,122 @@ Before sending ANY message, ask yourself: If ANY answer is "No", you MUST combine operations into a single message! -## 🚀 CRITICAL: Claude Code Does ALL Real Work +## Project Overview +This project uses the SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) methodology for systematic Test-Driven Development with AI assistance through Claude-Flow orchestration. -### 🎯 CLAUDE CODE IS THE ONLY EXECUTOR +**🚀 Batchtools Optimization Enabled**: This configuration includes optimized prompts and parallel processing capabilities for improved performance and efficiency. -**ABSOLUTE RULE**: Claude Code performs ALL actual work: +## SPARC Development Commands -### ✅ Claude Code ALWAYS Handles: -- 🔧 **ALL file operations** (Read, Write, Edit, MultiEdit, Glob, Grep) -- 💻 **ALL code generation** and programming tasks -- 🖥️ **ALL bash commands** and system operations -- 🏗️ **ALL actual implementation** work -- 🔍 **ALL project navigation** and code analysis -- 📝 **ALL TodoWrite** and task management -- 🔄 **ALL git operations** (commit, push, merge) -- 📦 **ALL package management** (npm, pip, etc.) -- 🧪 **ALL testing** and validation -- 🔧 **ALL debugging** and troubleshooting +### Core SPARC Commands +- `npx claude-flow sparc modes`: List all available SPARC development modes +- `npx claude-flow sparc run ""`: Execute specific SPARC mode for a task +- `npx claude-flow sparc tdd ""`: Run complete TDD workflow using SPARC methodology +- `npx claude-flow sparc info `: Get detailed information about a specific mode -### 🧠 Claude Flow MCP Tools ONLY Handle: -- 🎯 **Coordination only** - Planning Claude Code's actions -- 💾 **Memory management** - Storing decisions and context -- 🤖 **Neural features** - Learning from Claude Code's work -- 📊 **Performance tracking** - Monitoring Claude Code's efficiency -- 🐝 **Swarm orchestration** - Coordinating multiple Claude Code instances -- 🔗 **GitHub integration** - Advanced repository coordination +### Batchtools Commands (Optimized) +- `npx claude-flow sparc batch ""`: Execute multiple SPARC modes in parallel +- `npx claude-flow sparc pipeline ""`: Execute full SPARC pipeline with parallel processing +- `npx claude-flow sparc concurrent ""`: Process multiple tasks concurrently -### 🚨 CRITICAL SEPARATION OF CONCERNS: +### Standard Build Commands +- `npm run build`: Build the project +- `npm run test`: Run the test suite +- `npm run lint`: Run linter and format checks +- `npm run typecheck`: Run TypeScript type checking -**❌ MCP Tools NEVER:** -- Write files or create content -- Execute bash commands -- Generate code -- Perform file operations -- Handle TodoWrite operations -- Execute system commands -- Do actual implementation work +## SPARC Methodology Workflow (Batchtools Enhanced) -**✅ MCP Tools ONLY:** -- Coordinate and plan -- Store memory and context -- Track performance -- Orchestrate workflows -- Provide intelligence insights - -### ⚠️ Key Principle: -**MCP tools coordinate, Claude Code executes.** Think of MCP tools as the "brain" that plans and coordinates, while Claude Code is the "hands" that do all the actual work. - -### 🔄 WORKFLOW EXECUTION PATTERN: - -**✅ CORRECT Workflow:** -1. **MCP**: `mcp__claude-flow__swarm_init` (coordination setup) -2. **MCP**: `mcp__claude-flow__agent_spawn` (planning agents) -3. **MCP**: `mcp__claude-flow__task_orchestrate` (task coordination) -4. **Claude Code**: `Task` tool to spawn agents with coordination instructions -5. **Claude Code**: `TodoWrite` with ALL todos batched (5-10+ in ONE call) -6. **Claude Code**: `Read`, `Write`, `Edit`, `Bash` (actual work) -7. **MCP**: `mcp__claude-flow__memory_usage` (store results) - -**❌ WRONG Workflow:** -1. **MCP**: `mcp__claude-flow__terminal_execute` (DON'T DO THIS) -2. **MCP**: File creation via MCP (DON'T DO THIS) -3. **MCP**: Code generation via MCP (DON'T DO THIS) -4. **Claude Code**: Sequential Task calls (DON'T DO THIS) -5. **Claude Code**: Individual TodoWrite calls (DON'T DO THIS) - -### 🚨 REMEMBER: -- **MCP tools** = Coordination, planning, memory, intelligence -- **Claude Code** = All actual execution, coding, file operations - -## 🚀 CRITICAL: Parallel Execution & Batch Operations - -### 🚨 MANDATORY RULE #1: BATCH EVERYTHING - -**When using swarms, you MUST use BatchTool for ALL operations:** - -1. **NEVER** send multiple messages for related operations -2. **ALWAYS** combine multiple tool calls in ONE message -3. **PARALLEL** execution is MANDATORY, not optional - -### ⚡ THE GOLDEN RULE OF SWARMS - -``` -If you need to do X operations, they should be in 1 message, not X messages -``` - -### 🚨 MANDATORY TODO AND TASK BATCHING - -**CRITICAL RULE FOR TODOS AND TASKS:** -1. **TodoWrite** MUST ALWAYS include ALL todos in ONE call (5-10+ todos) -2. **Task** tool calls MUST be batched - spawn multiple agents in ONE message -3. **NEVER** update todos one by one - this breaks parallel coordination -4. **NEVER** spawn agents sequentially - ALL agents spawn together - -### 📦 BATCH TOOL EXAMPLES - -**✅ CORRECT - Everything in ONE Message:** -```javascript -[Single Message with BatchTool]: - // MCP coordination setup - 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: "analyst" } - mcp__claude-flow__agent_spawn { type: "tester" } - mcp__claude-flow__agent_spawn { type: "coordinator" } - - // Claude Code execution - ALL in parallel - Task("You are researcher agent. MUST coordinate via hooks...") - Task("You are coder agent. MUST coordinate via hooks...") - Task("You are analyst agent. MUST coordinate via hooks...") - Task("You are tester agent. MUST coordinate via hooks...") - TodoWrite { todos: [5-10 todos with all priorities and statuses] } - - // File operations in parallel - Bash "mkdir -p app/{src,tests,docs}" - Write "app/package.json" - Write "app/README.md" - Write "app/src/index.js" -``` - -**❌ WRONG - Multiple Messages (NEVER DO THIS):** -```javascript -Message 1: mcp__claude-flow__swarm_init -Message 2: Task("researcher agent") -Message 3: Task("coder agent") -Message 4: TodoWrite({ todo: "single todo" }) -Message 5: Bash "mkdir src" -Message 6: Write "package.json" -// This is 6x slower and breaks parallel coordination! -``` - -### 🎯 BATCH OPERATIONS BY TYPE - -**Todo and Task Operations (Single Message):** -- **TodoWrite** → ALWAYS include 5-10+ todos in ONE call -- **Task agents** → Spawn ALL agents with full instructions in ONE message -- **Agent coordination** → ALL Task calls must include coordination hooks -- **Status updates** → Update ALL todo statuses together -- **NEVER** split todos or Task calls across messages! - -**File Operations (Single Message):** -- Read 10 files? → One message with 10 Read calls -- Write 5 files? → One message with 5 Write calls -- Edit 1 file many times? → One MultiEdit call - -**Swarm Operations (Single Message):** -- Need 8 agents? → One message with swarm_init + 8 agent_spawn calls -- Multiple memories? → One message with all memory_usage calls -- Task + monitoring? → One message with task_orchestrate + swarm_monitor - -**Command Operations (Single Message):** -- Multiple directories? → One message with all mkdir commands -- Install + test + lint? → One message with all npm commands -- Git operations? → One message with all git commands - -## 🚀 Quick Setup (Stdio MCP - Recommended) - -### 1. Add MCP Server (Stdio - No Port Needed) +### 1. Specification Phase (Parallel Analysis) ```bash -# Add Claude Flow MCP server to Claude Code using stdio -claude mcp add claude-flow npx claude-flow@alpha mcp start +# Create detailed specifications with concurrent requirements analysis +npx claude-flow sparc run spec-pseudocode "Define user authentication requirements" --parallel ``` +**Batchtools Optimization**: Simultaneously analyze multiple requirement sources, validate constraints in parallel, and generate comprehensive specifications. -### 2. Use MCP Tools for Coordination in Claude Code -Once configured, Claude Flow MCP tools enhance Claude Code's coordination: - -**Initialize a swarm:** -- Use the `mcp__claude-flow__swarm_init` tool to set up coordination topology -- Choose: mesh, hierarchical, ring, or star -- This creates a coordination framework for Claude Code's work - -**Spawn agents:** -- Use `mcp__claude-flow__agent_spawn` tool to create specialized coordinators -- Agent types represent different thinking patterns, not actual coders -- They help Claude Code approach problems from different angles - -**Orchestrate tasks:** -- Use `mcp__claude-flow__task_orchestrate` tool to coordinate complex workflows -- This breaks down tasks for Claude Code to execute systematically -- The agents don't write code - they coordinate Claude Code's actions - -## Available MCP Tools for Coordination - -### Coordination Tools: -- `mcp__claude-flow__swarm_init` - Set up coordination topology for Claude Code -- `mcp__claude-flow__agent_spawn` - Create cognitive patterns to guide Claude Code -- `mcp__claude-flow__task_orchestrate` - Break down and coordinate complex tasks - -### Monitoring Tools: -- `mcp__claude-flow__swarm_status` - Monitor coordination effectiveness -- `mcp__claude-flow__agent_list` - View active cognitive patterns -- `mcp__claude-flow__agent_metrics` - Track coordination performance -- `mcp__claude-flow__task_status` - Check workflow progress -- `mcp__claude-flow__task_results` - Review coordination outcomes - -### Memory & Neural Tools: -- `mcp__claude-flow__memory_usage` - Persistent memory across sessions -- `mcp__claude-flow__neural_status` - Neural pattern effectiveness -- `mcp__claude-flow__neural_train` - Improve coordination patterns -- `mcp__claude-flow__neural_patterns` - Analyze thinking approaches - -### System Tools: -- `mcp__claude-flow__benchmark_run` - Measure coordination efficiency -- `mcp__claude-flow__features_detect` - Available capabilities -- `mcp__claude-flow__swarm_monitor` - Real-time coordination tracking - -## Workflow Examples (Coordination-Focused) - -### Research Coordination Example -**Context:** Claude Code needs to research a complex topic systematically - -**Step 1:** Set up research coordination -- Tool: `mcp__claude-flow__swarm_init` -- Parameters: `{"topology": "mesh", "maxAgents": 5, "strategy": "balanced"}` -- Result: Creates a mesh topology for comprehensive exploration - -**Step 2:** Define research perspectives -- Tool: `mcp__claude-flow__agent_spawn` -- Parameters: `{"type": "researcher", "name": "Literature Review"}` -- Tool: `mcp__claude-flow__agent_spawn` -- Parameters: `{"type": "analyst", "name": "Data Analysis"}` -- Result: Different cognitive patterns for Claude Code to use - -**Step 3:** Coordinate research execution -- Tool: `mcp__claude-flow__task_orchestrate` -- Parameters: `{"task": "Research neural architecture search papers", "strategy": "adaptive"}` -- Result: Claude Code systematically searches, reads, and analyzes papers - -**What Actually Happens:** -1. The swarm sets up a coordination framework -2. Each agent MUST use Claude Flow hooks for coordination: - - `npx claude-flow@alpha hooks pre-task` before starting - - `npx claude-flow@alpha hooks post-edit` after each file operation - - `npx claude-flow@alpha hooks notification` to share decisions -3. Claude Code uses its native Read, WebSearch, and Task tools -4. The swarm coordinates through shared memory and hooks -5. Results are synthesized by Claude Code with full coordination history - -### Development Coordination Example -**Context:** Claude Code needs to build a complex system with multiple components - -**Step 1:** Set up development coordination -- Tool: `mcp__claude-flow__swarm_init` -- Parameters: `{"topology": "hierarchical", "maxAgents": 8, "strategy": "specialized"}` -- Result: Hierarchical structure for organized development - -**Step 2:** Define development perspectives -- Tool: `mcp__claude-flow__agent_spawn` -- Parameters: `{"type": "architect", "name": "System Design"}` -- Result: Architectural thinking pattern for Claude Code - -**Step 3:** Coordinate implementation -- Tool: `mcp__claude-flow__task_orchestrate` -- Parameters: `{"task": "Implement user authentication with JWT", "strategy": "parallel"}` -- Result: Claude Code implements features using its native tools - -**What Actually Happens:** -1. The swarm creates a development coordination plan -2. Each agent coordinates using mandatory hooks: - - Pre-task hooks for context loading - - Post-edit hooks for progress tracking - - Memory storage for cross-agent coordination -3. Claude Code uses Write, Edit, Bash tools for implementation -4. Agents share progress through Claude Flow memory -5. All code is written by Claude Code with full coordination - -## Best Practices for Coordination - -### ✅ DO: -- Use MCP tools to coordinate Claude Code's approach to complex tasks -- Let the swarm break down problems into manageable pieces -- Use memory tools to maintain context across sessions -- Monitor coordination effectiveness with status tools -- Train neural patterns for better coordination over time - -### ❌ DON'T: -- Expect agents to write code (Claude Code does all implementation) -- Use MCP tools for file operations (use Claude Code's native tools) -- Try to make agents execute bash commands (Claude Code handles this) -- Confuse coordination with execution (MCP coordinates, Claude executes) - -## Memory and Persistence - -The swarm provides persistent memory that helps Claude Code: -- Remember project context across sessions -- Track decisions and rationale -- Maintain consistency in large projects -- Learn from previous coordination patterns - -## Performance Benefits - -When using ruv-swarm coordination with Claude Code: -- **84.8% SWE-Bench solve rate** - Better problem-solving through coordination -- **32.3% token reduction** - Efficient task breakdown reduces redundancy -- **2.8-4.4x speed improvement** - Parallel coordination strategies -- **27+ neural models** - Diverse cognitive approaches - -## Claude Code Hooks Integration - -ruv-swarm includes powerful hooks that automate coordination: - -### Pre-Operation Hooks -- **Auto-assign agents** before file edits based on file type -- **Validate commands** before execution for safety -- **Prepare resources** automatically for complex operations -- **Optimize topology** based on task complexity analysis -- **Cache searches** for improved performance - -### Post-Operation Hooks -- **Auto-format code** using language-specific formatters -- **Train neural patterns** from successful operations -- **Update memory** with operation context -- **Analyze performance** and identify bottlenecks -- **Track token usage** for efficiency metrics - -### Session Management -- **Generate summaries** at session end -- **Persist state** across Claude Code sessions -- **Track metrics** for continuous improvement -- **Restore previous** session context automatically - -### Advanced Features (New!) -- **🚀 Automatic Topology Selection** - Optimal swarm structure for each task -- **⚡ Parallel Execution** - 2.8-4.4x speed improvements -- **🧠 Neural Training** - Continuous learning from operations -- **📊 Bottleneck Analysis** - Real-time performance optimization -- **🤖 Smart Auto-Spawning** - Zero manual agent management -- **🛡️ Self-Healing Workflows** - Automatic error recovery -- **💾 Cross-Session Memory** - Persistent learning & context - -### Configuration -Hooks are pre-configured in `.claude/settings.json`. Key features: -- Automatic agent assignment for different file types -- Code formatting on save -- Neural pattern learning from edits -- Session state persistence -- Performance tracking and optimization -- Intelligent caching and token reduction - -See `.claude/commands/` for detailed documentation on all features. - -## Integration Tips - -1. **Start Simple**: Begin with basic swarm init and single agent -2. **Scale Gradually**: Add more agents as task complexity increases -3. **Use Memory**: Store important decisions and context -4. **Monitor Progress**: Regular status checks ensure effective coordination -5. **Train Patterns**: Let neural agents learn from successful coordinations -6. **Enable Hooks**: Use the pre-configured hooks for automation - -## 🧠 SWARM ORCHESTRATION PATTERN - -### You are the SWARM ORCHESTRATOR. **IMMEDIATELY SPAWN AGENTS IN PARALLEL** to execute tasks - -### 🚨 CRITICAL INSTRUCTION: You are the SWARM ORCHESTRATOR - -**MANDATORY**: When using swarms, you MUST: -1. **SPAWN ALL AGENTS IN ONE BATCH** - Use multiple tool calls in a SINGLE message -2. **EXECUTE TASKS IN PARALLEL** - Never wait for one task before starting another -3. **USE BATCHTOOL FOR EVERYTHING** - Multiple operations = Single message with multiple tools -4. **ALL AGENTS MUST USE COORDINATION TOOLS** - Every spawned agent MUST use claude-flow hooks and memory - -### 🎯 AGENT COUNT CONFIGURATION - -**CRITICAL: Dynamic Agent Count Rules** -1. **Check CLI Arguments First**: If user runs `npx claude-flow@alpha --agents 5`, use 5 agents -2. **Auto-Decide if No Args**: Without CLI args, analyze task complexity: - - Simple tasks (1-3 components): 3-4 agents - - Medium tasks (4-6 components): 5-7 agents - - Complex tasks (7+ components): 8-12 agents -3. **Agent Type Distribution**: Balance agent types based on task: - - Always include 1 coordinator - - For code-heavy tasks: more coders - - For design tasks: more architects/analysts - - For quality tasks: more testers/reviewers - -**Example Auto-Decision Logic:** -```javascript -// If CLI args provided: npx claude-flow@alpha --agents 6 -maxAgents = CLI_ARGS.agents || determineAgentCount(task) - -function determineAgentCount(task) { - // Analyze task complexity - if (task.includes(['API', 'database', 'auth', 'tests'])) return 8 - if (task.includes(['frontend', 'backend'])) return 6 - if (task.includes(['simple', 'script'])) return 3 - return 5 // default -} -``` - -## 📋 MANDATORY AGENT COORDINATION PROTOCOL - -### 🔴 CRITICAL: Every Agent MUST Follow This Protocol - -When you spawn an agent using the Task tool, that agent MUST: - -**1️⃣ BEFORE Starting Work:** +### 2. Pseudocode Phase (Concurrent Logic Design) ```bash -# Check previous work and load context -npx claude-flow@alpha hooks pre-task --description "[agent task]" --auto-spawn-agents false -npx claude-flow@alpha hooks session-restore --session-id "swarm-[id]" --load-memory true +# Develop algorithmic logic with parallel pattern analysis +npx claude-flow sparc run spec-pseudocode "Create authentication flow pseudocode" --batch-optimize ``` +**Batchtools Optimization**: Process multiple algorithm patterns concurrently, validate logic flows in parallel, and optimize data structures simultaneously. -**2️⃣ DURING Work (After EVERY Major Step):** +### 3. Architecture Phase (Parallel Component Design) ```bash -# Store progress in memory after each file operation -npx claude-flow@alpha hooks post-edit --file "[filepath]" --memory-key "swarm/[agent]/[step]" - -# Store decisions and findings -npx claude-flow@alpha hooks notification --message "[what was done]" --telemetry true - -# Check coordination with other agents -npx claude-flow@alpha hooks pre-search --query "[what to check]" --cache-results true +# Design system architecture with concurrent component analysis +npx claude-flow sparc run architect "Design authentication service architecture" --parallel ``` +**Batchtools Optimization**: Generate multiple architectural alternatives simultaneously, validate integration points in parallel, and create comprehensive documentation concurrently. -**3️⃣ AFTER Completing Work:** +### 4. Refinement Phase (Parallel TDD Implementation) ```bash -# Save all results and learnings -npx claude-flow@alpha hooks post-task --task-id "[task]" --analyze-performance true -npx claude-flow@alpha hooks session-end --export-metrics true --generate-summary true +# Execute Test-Driven Development with parallel test generation +npx claude-flow sparc tdd "implement user authentication system" --batch-tdd ``` +**Batchtools Optimization**: Generate multiple test scenarios simultaneously, implement and validate code in parallel, and optimize performance concurrently. -### 🎯 AGENT PROMPT TEMPLATE - -When spawning agents, ALWAYS include these coordination instructions: - +### 5. Completion Phase (Concurrent Integration) +```bash +# Integration with parallel validation and documentation +npx claude-flow sparc run integration "integrate authentication with user management" --parallel ``` -You are the [Agent Type] agent in a coordinated swarm. +**Batchtools Optimization**: Run integration tests in parallel, generate documentation concurrently, and validate requirements simultaneously. -MANDATORY COORDINATION: -1. START: Run `npx claude-flow@alpha hooks pre-task --description "[your task]"` -2. DURING: After EVERY file operation, run `npx claude-flow@alpha hooks post-edit --file "[file]" --memory-key "agent/[step]"` -3. MEMORY: Store ALL decisions using `npx claude-flow@alpha hooks notification --message "[decision]"` -4. END: Run `npx claude-flow@alpha hooks post-task --task-id "[task]" --analyze-performance true` +## Batchtools Integration Features -Your specific task: [detailed task description] +### Parallel Processing Capabilities +- **Concurrent File Operations**: Read, analyze, and modify multiple files simultaneously +- **Parallel Code Analysis**: Analyze dependencies, patterns, and architecture concurrently +- **Batch Test Generation**: Create comprehensive test suites in parallel +- **Concurrent Documentation**: Generate multiple documentation formats simultaneously -REMEMBER: Coordinate with other agents by checking memory BEFORE making decisions! -``` +### Performance Optimizations +- **Smart Batching**: Group related operations for optimal performance +- **Pipeline Processing**: Chain dependent operations with parallel stages +- **Resource Management**: Efficient utilization of system resources +- **Error Resilience**: Robust error handling with parallel recovery -### ⚡ PARALLEL EXECUTION IS MANDATORY +## Performance Benchmarks -**THIS IS WRONG ❌ (Sequential - NEVER DO THIS):** -``` -Message 1: Initialize swarm -Message 2: Spawn agent 1 -Message 3: Spawn agent 2 -Message 4: TodoWrite (single todo) -Message 5: Create file 1 -Message 6: TodoWrite (another single todo) -``` +### Batchtools Performance Improvements +- **File Operations**: Up to 300% faster with parallel processing +- **Code Analysis**: 250% improvement with concurrent pattern recognition +- **Test Generation**: 400% faster with parallel test creation +- **Documentation**: 200% improvement with concurrent content generation +- **Memory Operations**: 180% faster with batched read/write operations -**THIS IS CORRECT ✅ (Parallel - ALWAYS DO THIS):** -``` -Message 1: [BatchTool] - // MCP coordination setup - - mcp__claude-flow__swarm_init - - mcp__claude-flow__agent_spawn (researcher) - - mcp__claude-flow__agent_spawn (coder) - - mcp__claude-flow__agent_spawn (analyst) - - mcp__claude-flow__agent_spawn (tester) - - mcp__claude-flow__agent_spawn (coordinator) +## Code Style and Best Practices (Batchtools Enhanced) -Message 2: [BatchTool - Claude Code execution] - // Task agents with full coordination instructions - - Task("You are researcher agent. MANDATORY: Run hooks pre-task, post-edit, post-task. Task: Research API patterns") - - Task("You are coder agent. MANDATORY: Run hooks pre-task, post-edit, post-task. Task: Implement REST endpoints") - - Task("You are analyst agent. MANDATORY: Run hooks pre-task, post-edit, post-task. Task: Analyze performance") - - Task("You are tester agent. MANDATORY: Run hooks pre-task, post-edit, post-task. Task: Write comprehensive tests") - - // TodoWrite with ALL todos batched - - TodoWrite { todos: [ - {id: "research", content: "Research API patterns", status: "in_progress", priority: "high"}, - {id: "design", content: "Design database schema", status: "pending", priority: "high"}, - {id: "implement", content: "Build REST endpoints", status: "pending", priority: "high"}, - {id: "test", content: "Write unit tests", status: "pending", priority: "medium"}, - {id: "docs", content: "Create API documentation", status: "pending", priority: "low"}, - {id: "deploy", content: "Setup deployment", status: "pending", priority: "medium"} - ]} - - // File operations in parallel - - Write "api/package.json" - - Write "api/server.js" - - Write "api/routes/users.js" - - Bash "mkdir -p api/{routes,models,tests}" -``` +### SPARC Development Principles with Batchtools +- **Modular Design**: Keep files under 500 lines, optimize with parallel analysis +- **Environment Safety**: Never hardcode secrets, validate with concurrent checks +- **Test-First**: Always write tests before implementation using parallel generation +- **Clean Architecture**: Separate concerns with concurrent validation +- **Parallel Documentation**: Maintain clear, up-to-date documentation with concurrent updates -### 🎯 MANDATORY SWARM PATTERN +### Batchtools Best Practices +- **Parallel Operations**: Use batchtools for independent tasks +- **Concurrent Validation**: Validate multiple aspects simultaneously +- **Batch Processing**: Group similar operations for efficiency +- **Pipeline Optimization**: Chain operations with parallel stages +- **Resource Management**: Monitor and optimize resource usage -When given ANY complex task with swarms: +## Important Notes (Enhanced) -``` -STEP 1: IMMEDIATE PARALLEL SPAWN (Single Message!) -[BatchTool]: - // IMPORTANT: Check CLI args for agent count, otherwise auto-decide based on task complexity - - mcp__claude-flow__swarm_init { - topology: "hierarchical", - maxAgents: CLI_ARGS.agents || AUTO_DECIDE(task_complexity), // Use CLI args or auto-decide - strategy: "parallel" - } - - // Spawn agents based on maxAgents count and task requirements - // If CLI specifies 3 agents, spawn 3. If no args, auto-decide optimal count (3-12) - - mcp__claude-flow__agent_spawn { type: "architect", name: "System Designer" } - - mcp__claude-flow__agent_spawn { type: "coder", name: "API Developer" } - - mcp__claude-flow__agent_spawn { type: "coder", name: "Frontend Dev" } - - mcp__claude-flow__agent_spawn { type: "analyst", name: "DB Designer" } - - mcp__claude-flow__agent_spawn { type: "tester", name: "QA Engineer" } - - mcp__claude-flow__agent_spawn { type: "researcher", name: "Tech Lead" } - - mcp__claude-flow__agent_spawn { type: "coordinator", name: "PM" } - - TodoWrite { todos: [multiple todos at once] } +- Always run tests before committing with parallel execution (`npm run test --parallel`) +- Use SPARC memory system with concurrent operations to maintain context across sessions +- Follow the Red-Green-Refactor cycle with parallel test generation during TDD phases +- Document architectural decisions with concurrent validation in memory +- Regular security reviews with parallel analysis for authentication or data handling code +- Claude Code slash commands provide quick access to batchtools-optimized SPARC modes +- Monitor system resources during parallel operations for optimal performance -STEP 2: PARALLEL TASK EXECUTION (Single Message!) -[BatchTool]: - - mcp__claude-flow__task_orchestrate { task: "main task", strategy: "parallel" } - - mcp__claude-flow__memory_usage { action: "store", key: "init", value: {...} } - - Multiple Read operations - - Multiple Write operations - - Multiple Bash commands +For more information about SPARC methodology and batchtools optimization, see: +- SPARC Guide: https://github.com/ruvnet/claude-code-flow/docs/sparc.md +- Batchtools Documentation: https://github.com/ruvnet/claude-code-flow/docs/batchtools.md -STEP 3: CONTINUE PARALLEL WORK (Never Sequential!) -``` - -### 📊 VISUAL TASK TRACKING FORMAT - -Use this format when displaying task progress: - -``` -📊 Progress Overview - ├── Total Tasks: X - ├── ✅ Completed: X (X%) - ├── 🔄 In Progress: X (X%) - ├── ⭕ Todo: X (X%) - └── ❌ Blocked: X (X%) - -📋 Todo (X) - └── 🔴 001: [Task description] [PRIORITY] ▶ - -🔄 In progress (X) - ├── 🟡 002: [Task description] ↳ X deps ▶ - └── 🔴 003: [Task description] [PRIORITY] ▶ - -✅ Completed (X) - ├── ✅ 004: [Task description] - └── ... (more completed tasks) - -Priority indicators: 🔴 HIGH/CRITICAL, 🟡 MEDIUM, 🟢 LOW -Dependencies: ↳ X deps | Actionable: ▶ -``` - -### 🎯 REAL EXAMPLE: Full-Stack App Development - -**Task**: "Build a complete REST API with authentication, database, and tests" - -**🚨 MANDATORY APPROACH - Everything in Parallel:** - -```javascript -// ✅ CORRECT: SINGLE MESSAGE with ALL operations -[BatchTool - Message 1]: - // Initialize and spawn ALL agents at once - mcp__claude-flow__swarm_init { topology: "hierarchical", maxAgents: 8, strategy: "parallel" } - mcp__claude-flow__agent_spawn { type: "architect", name: "System Designer" } - mcp__claude-flow__agent_spawn { type: "coder", name: "API Developer" } - mcp__claude-flow__agent_spawn { type: "coder", name: "Auth Expert" } - mcp__claude-flow__agent_spawn { type: "analyst", name: "DB Designer" } - mcp__claude-flow__agent_spawn { type: "tester", name: "Test Engineer" } - mcp__claude-flow__agent_spawn { type: "coordinator", name: "Lead" } - - // Update ALL todos at once - NEVER split todos! - TodoWrite { todos: [ - { id: "design", content: "Design API architecture", status: "in_progress", priority: "high" }, - { id: "auth", content: "Implement authentication", status: "pending", priority: "high" }, - { id: "db", content: "Design database schema", status: "pending", priority: "high" }, - { id: "api", content: "Build REST endpoints", status: "pending", priority: "high" }, - { id: "tests", content: "Write comprehensive tests", status: "pending", priority: "medium" }, - { id: "docs", content: "Document API endpoints", status: "pending", priority: "low" }, - { id: "deploy", content: "Setup deployment pipeline", status: "pending", priority: "medium" }, - { id: "monitor", content: "Add monitoring", status: "pending", priority: "medium" } - ]} - - // Start orchestration - mcp__claude-flow__task_orchestrate { task: "Build REST API", strategy: "parallel" } - - // Store initial memory - mcp__claude-flow__memory_usage { action: "store", key: "project/init", value: { started: Date.now() } } - -[BatchTool - Message 2]: - // Create ALL directories at once - Bash("mkdir -p test-app/{src,tests,docs,config}") - Bash("mkdir -p test-app/src/{models,routes,middleware,services}") - Bash("mkdir -p test-app/tests/{unit,integration}") - - // Write ALL base files at once - Write("test-app/package.json", packageJsonContent) - Write("test-app/.env.example", envContent) - Write("test-app/README.md", readmeContent) - Write("test-app/src/server.js", serverContent) - Write("test-app/src/config/database.js", dbConfigContent) - -[BatchTool - Message 3]: - // Read multiple files for context - Read("test-app/package.json") - Read("test-app/src/server.js") - Read("test-app/.env.example") - - // Run multiple commands - Bash("cd test-app && npm install") - Bash("cd test-app && npm run lint") - Bash("cd test-app && npm test") -``` - -### 🚫 NEVER DO THIS (Sequential = WRONG): -```javascript -// ❌ WRONG: Multiple messages, one operation each -Message 1: mcp__claude-flow__swarm_init -Message 2: mcp__claude-flow__agent_spawn (just one agent) -Message 3: mcp__claude-flow__agent_spawn (another agent) -Message 4: TodoWrite (single todo) -Message 5: Write (single file) -// This is 5x slower and wastes swarm coordination! -``` - -### 🔄 MEMORY COORDINATION PATTERN - -Every agent coordination step MUST use memory: - -``` -// After each major decision or implementation -mcp__claude-flow__memory_usage - action: "store" - key: "swarm-{id}/agent-{name}/{step}" - value: { - timestamp: Date.now(), - decision: "what was decided", - implementation: "what was built", - nextSteps: ["step1", "step2"], - dependencies: ["dep1", "dep2"] - } - -// To retrieve coordination data -mcp__claude-flow__memory_usage - action: "retrieve" - key: "swarm-{id}/agent-{name}/{step}" - -// To check all swarm progress -mcp__claude-flow__memory_usage - action: "list" - pattern: "swarm-{id}/*" -``` - -### ⚡ PERFORMANCE TIPS - -1. **Batch Everything**: Never operate on single files when multiple are needed -2. **Parallel First**: Always think "what can run simultaneously?" -3. **Memory is Key**: Use memory for ALL cross-agent coordination -4. **Monitor Progress**: Use mcp__claude-flow__swarm_monitor for real-time tracking -5. **Auto-Optimize**: Let hooks handle topology and agent selection - -### 🎨 VISUAL SWARM STATUS - -When showing swarm status, use this format: - -``` -🐝 Swarm Status: ACTIVE -├── 🏗️ Topology: hierarchical -├── 👥 Agents: 6/8 active -├── ⚡ Mode: parallel execution -├── 📊 Tasks: 12 total (4 complete, 6 in-progress, 2 pending) -└── 🧠 Memory: 15 coordination points stored - -Agent Activity: -├── 🟢 architect: Designing database schema... -├── 🟢 coder-1: Implementing auth endpoints... -├── 🟢 coder-2: Building user CRUD operations... -├── 🟢 analyst: Optimizing query performance... -├── 🟡 tester: Waiting for auth completion... -└── 🟢 coordinator: Monitoring progress... -``` - -## 📝 CRITICAL: TODOWRITE AND TASK TOOL BATCHING - -### 🚨 MANDATORY BATCHING RULES FOR TODOS AND TASKS - -**TodoWrite Tool Requirements:** -1. **ALWAYS** include 5-10+ todos in a SINGLE TodoWrite call -2. **NEVER** call TodoWrite multiple times in sequence -3. **BATCH** all todo updates together - status changes, new todos, completions -4. **INCLUDE** all priority levels (high, medium, low) in one call - -**Task Tool Requirements:** -1. **SPAWN** all agents using Task tool in ONE message -2. **NEVER** spawn agents one by one across multiple messages -3. **INCLUDE** full task descriptions and coordination instructions -4. **BATCH** related Task calls together for parallel execution - -**Example of CORRECT TodoWrite usage:** -```javascript -// ✅ CORRECT - All todos in ONE call -TodoWrite { todos: [ - { id: "1", content: "Initialize system", status: "completed", priority: "high" }, - { id: "2", content: "Analyze requirements", status: "in_progress", priority: "high" }, - { id: "3", content: "Design architecture", status: "pending", priority: "high" }, - { id: "4", content: "Implement core", status: "pending", priority: "high" }, - { id: "5", content: "Build features", status: "pending", priority: "medium" }, - { id: "6", content: "Write tests", status: "pending", priority: "medium" }, - { id: "7", content: "Add monitoring", status: "pending", priority: "medium" }, - { id: "8", content: "Documentation", status: "pending", priority: "low" }, - { id: "9", content: "Performance tuning", status: "pending", priority: "low" }, - { id: "10", content: "Deploy to production", status: "pending", priority: "high" } -]} -``` - -**Example of WRONG TodoWrite usage:** -```javascript -// ❌ WRONG - Multiple TodoWrite calls -Message 1: TodoWrite { todos: [{ id: "1", content: "Task 1", ... }] } -Message 2: TodoWrite { todos: [{ id: "2", content: "Task 2", ... }] } -Message 3: TodoWrite { todos: [{ id: "3", content: "Task 3", ... }] } -// This breaks parallel coordination! -``` - -## Support - -- Documentation: https://github.com/ruvnet/claude-flow -- Issues: https://github.com/ruvnet/claude-flow/issues -- Examples: https://github.com/ruvnet/claude-flow/tree/main/examples - ---- - -Remember: **Claude Flow coordinates, Claude Code creates!** Start with `mcp__claude-flow__swarm_init` to enhance your development workflow. - -don't save md or tests in root folder. \ No newline at end of file +# important-instruction-reminders +Do what has been asked; nothing more, nothing less. +NEVER create files unless they're absolutely necessary for achieving your goal. +ALWAYS prefer editing an existing file to creating a new one. +NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User. diff --git a/alpha-61-init/.claude/commands/analysis/README.md b/alpha-61-init/.claude/commands/analysis/README.md new file mode 100644 index 0000000000..1eb295c1a8 --- /dev/null +++ b/alpha-61-init/.claude/commands/analysis/README.md @@ -0,0 +1,9 @@ +# Analysis Commands + +Commands for analysis operations in Claude Flow. + +## Available Commands + +- [bottleneck-detect](./bottleneck-detect.md) +- [token-usage](./token-usage.md) +- [performance-report](./performance-report.md) diff --git a/alpha-61-init/.claude/commands/analysis/bottleneck-detect.md b/alpha-61-init/.claude/commands/analysis/bottleneck-detect.md new file mode 100644 index 0000000000..0cee44d1db --- /dev/null +++ b/alpha-61-init/.claude/commands/analysis/bottleneck-detect.md @@ -0,0 +1,150 @@ +# bottleneck detect + +Analyze performance bottlenecks in swarm operations and suggest optimizations. + +## Usage + +```bash +npx claude-flow bottleneck detect [options] +``` + +## Options + +- `--swarm-id, -s ` - Analyze specific swarm (default: current) +- `--time-range, -t ` - Analysis period: 1h, 24h, 7d, all (default: 1h) +- `--threshold ` - Bottleneck threshold percentage (default: 20) +- `--export, -e ` - Export analysis to file +- `--fix` - Apply automatic optimizations + +## Examples + +### Basic bottleneck detection +```bash +npx claude-flow bottleneck detect +``` + +### Analyze specific swarm +```bash +npx claude-flow bottleneck detect --swarm-id swarm-123 +``` + +### Last 24 hours with export +```bash +npx claude-flow bottleneck detect -t 24h -e bottlenecks.json +``` + +### Auto-fix detected issues +```bash +npx claude-flow bottleneck detect --fix --threshold 15 +``` + +## Metrics Analyzed + +### Communication Bottlenecks +- Message queue delays +- Agent response times +- Coordination overhead +- Memory access patterns + +### Processing Bottlenecks +- Task completion times +- Agent utilization rates +- Parallel execution efficiency +- Resource contention + +### Memory Bottlenecks +- Cache hit rates +- Memory access patterns +- Storage I/O performance +- Neural pattern loading + +### Network Bottlenecks +- API call latency +- MCP communication delays +- External service timeouts +- Concurrent request limits + +## Output Format + +``` +🔍 Bottleneck Analysis Report +━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +📊 Summary +├── Time Range: Last 1 hour +├── Agents Analyzed: 6 +├── Tasks Processed: 42 +└── Critical Issues: 2 + +🚨 Critical Bottlenecks +1. Agent Communication (35% impact) + └── coordinator → coder-1 messages delayed by 2.3s avg + +2. Memory Access (28% impact) + └── Neural pattern loading taking 1.8s per access + +⚠️ Warning Bottlenecks +1. Task Queue (18% impact) + └── 5 tasks waiting > 10s for assignment + +💡 Recommendations +1. Switch to hierarchical topology (est. 40% improvement) +2. Enable memory caching (est. 25% improvement) +3. Increase agent concurrency to 8 (est. 20% improvement) + +✅ Quick Fixes Available +Run with --fix to apply: +- Enable smart caching +- Optimize message routing +- Adjust agent priorities +``` + +## Automatic Fixes + +When using `--fix`, the following optimizations may be applied: + +1. **Topology Optimization** + - Switch to more efficient topology + - Adjust communication patterns + - Reduce coordination overhead + +2. **Caching Enhancement** + - Enable memory caching + - Optimize cache strategies + - Preload common patterns + +3. **Concurrency Tuning** + - Adjust agent counts + - Optimize parallel execution + - Balance workload distribution + +4. **Priority Adjustment** + - Reorder task queues + - Prioritize critical paths + - Reduce wait times + +## Performance Impact + +Typical improvements after bottleneck resolution: +- **Communication**: 30-50% faster message delivery +- **Processing**: 20-40% reduced task completion time +- **Memory**: 40-60% fewer cache misses +- **Overall**: 25-45% performance improvement + +## Integration with Claude Code + +```javascript +// Check for bottlenecks in Claude Code +mcp__claude-flow__bottleneck_detect { + timeRange: "1h", + threshold: 20, + autoFix: false +} +``` + +## See Also + +- `performance report` - Detailed performance analysis +- `token usage` - Token optimization analysis +- `swarm monitor` - Real-time monitoring +- `cache manage` - Cache optimization \ No newline at end of file diff --git a/alpha-61-init/.claude/commands/analysis/performance-report.md b/alpha-61-init/.claude/commands/analysis/performance-report.md new file mode 100644 index 0000000000..04b8d9e9ac --- /dev/null +++ b/alpha-61-init/.claude/commands/analysis/performance-report.md @@ -0,0 +1,25 @@ +# performance-report + +Generate comprehensive performance reports for swarm operations. + +## Usage +```bash +npx claude-flow analysis performance-report [options] +``` + +## Options +- `--format ` - Report format (json, html, markdown) +- `--include-metrics` - Include detailed metrics +- `--compare ` - Compare with previous swarm + +## Examples +```bash +# Generate HTML report +npx claude-flow analysis performance-report --format html + +# Compare swarms +npx claude-flow analysis performance-report --compare swarm-123 + +# Full metrics report +npx claude-flow analysis performance-report --include-metrics --format markdown +``` diff --git a/alpha-61-init/.claude/commands/analysis/token-usage.md b/alpha-61-init/.claude/commands/analysis/token-usage.md new file mode 100644 index 0000000000..5d6f2b9cff --- /dev/null +++ b/alpha-61-init/.claude/commands/analysis/token-usage.md @@ -0,0 +1,25 @@ +# token-usage + +Analyze token usage patterns and optimize for efficiency. + +## Usage +```bash +npx claude-flow analysis token-usage [options] +``` + +## Options +- `--period