fix: Improve auth debugging and temp directory handling
continuous-integration/drone/push Build is passing

- Add detailed logging for password verification to diagnose auth issues
- Validate bcrypt hash format before attempting comparison
- Use /tmp/minio-webui-temp as default temp directory (Docker-prepared)
- Add comment about escaping $ in bcrypt hashes for docker-compose
This commit is contained in:
Paul Nothaft
2026-01-05 09:32:12 +01:00
parent fc9898c59b
commit 6beb4ae03c
73 changed files with 111 additions and 6012 deletions
-1
View File
@@ -1 +0,0 @@
{}
-9
View File
@@ -1,9 +0,0 @@
{
"startTime": 1755633733445,
"totalTasks": 1,
"successfulTasks": 1,
"failedTasks": 0,
"totalAgents": 0,
"activeAgents": 0,
"neuralEvents": 0
}
File diff suppressed because it is too large Load Diff
-10
View File
@@ -1,10 +0,0 @@
[
{
"id": "cmd-hooks-1755633733484",
"type": "hooks",
"success": true,
"duration": 4.695624999999993,
"timestamp": 1755633733488,
"metadata": {}
}
]
-9
View File
@@ -1,9 +0,0 @@
# 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)
@@ -1,162 +0,0 @@
# bottleneck detect
Analyze performance bottlenecks in swarm operations and suggest optimizations.
## Usage
```bash
npx claude-flow bottleneck detect [options]
```
## Options
- `--swarm-id, -s <id>` - Analyze specific swarm (default: current)
- `--time-range, -t <range>` - Analysis period: 1h, 24h, 7d, all (default: 1h)
- `--threshold <percent>` - Bottleneck threshold percentage (default: 20)
- `--export, -e <file>` - 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
@@ -1,25 +0,0 @@
# performance-report
Generate comprehensive performance reports for swarm operations.
## Usage
```bash
npx claude-flow analysis performance-report [options]
```
## Options
- `--format <type>` - Report format (json, html, markdown)
- `--include-metrics` - Include detailed metrics
- `--compare <id>` - 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
```
-25
View File
@@ -1,25 +0,0 @@
# token-usage
Analyze token usage patterns and optimize for efficiency.
## Usage
```bash
npx claude-flow analysis token-usage [options]
```
## Options
- `--period <time>` - Analysis period (1h, 24h, 7d, 30d)
- `--by-agent` - Break down by agent
- `--by-operation` - Break down by operation type
## Examples
```bash
# Last 24 hours token usage
npx claude-flow analysis token-usage --period 24h
# By agent breakdown
npx claude-flow analysis token-usage --by-agent
# Export detailed report
npx claude-flow analysis token-usage --period 7d --export tokens.csv
```
-9
View File
@@ -1,9 +0,0 @@
# Automation Commands
Commands for automation operations in Claude Flow.
## Available Commands
- [auto-agent](./auto-agent.md)
- [smart-spawn](./smart-spawn.md)
- [workflow-select](./workflow-select.md)
-122
View File
@@ -1,122 +0,0 @@
# auto agent
Automatically spawn and manage agents based on task requirements.
## Usage
```bash
npx claude-flow auto agent [options]
```
## Options
- `--task, -t <description>` - Task description for agent analysis
- `--max-agents, -m <number>` - Maximum agents to spawn (default: auto)
- `--min-agents <number>` - Minimum agents required (default: 1)
- `--strategy, -s <type>` - Selection strategy: optimal, minimal, balanced
- `--no-spawn` - Analyze only, don't spawn agents
## Examples
### Basic auto-spawning
```bash
npx claude-flow auto agent --task "Build a REST API with authentication"
```
### Constrained spawning
```bash
npx claude-flow auto agent -t "Debug performance issue" --max-agents 3
```
### Analysis only
```bash
npx claude-flow auto agent -t "Refactor codebase" --no-spawn
```
### Minimal strategy
```bash
npx claude-flow auto agent -t "Fix bug in login" -s minimal
```
## How It Works
1. **Task Analysis**
- Parses task description
- Identifies required skills
- Estimates complexity
- Determines parallelization opportunities
2. **Agent Selection**
- Matches skills to agent types
- Considers task dependencies
- Optimizes for efficiency
- Respects constraints
3. **Topology Selection**
- Chooses optimal swarm structure
- Configures communication patterns
- Sets up coordination rules
- Enables monitoring
4. **Automatic Spawning**
- Creates selected agents
- Assigns specific roles
- Distributes subtasks
- Initiates coordination
## Agent Types Selected
- **Architect**: System design, architecture decisions
- **Coder**: Implementation, code generation
- **Tester**: Test creation, quality assurance
- **Analyst**: Performance, optimization
- **Researcher**: Documentation, best practices
- **Coordinator**: Task management, progress tracking
## Strategies
### Optimal
- Maximum efficiency
- May spawn more agents
- Best for complex tasks
- Highest resource usage
### Minimal
- Minimum viable agents
- Conservative approach
- Good for simple tasks
- Lowest resource usage
### Balanced
- Middle ground
- Adaptive to complexity
- Default strategy
- Good performance/resource ratio
## Integration with Claude Code
```javascript
// In Claude Code after auto-spawning
mcp__claude-flow__auto_agent {
task: "Build authentication system",
strategy: "balanced",
maxAgents: 6
}
```
## See Also
- `agent spawn` - Manual agent creation
- `swarm init` - Initialize swarm manually
- `smart spawn` - Intelligent agent spawning
- `workflow select` - Choose predefined workflows
@@ -1,25 +0,0 @@
# smart-spawn
Intelligently spawn agents based on workload analysis.
## Usage
```bash
npx claude-flow automation smart-spawn [options]
```
## Options
- `--analyze` - Analyze before spawning
- `--threshold <n>` - Spawn threshold
- `--topology <type>` - Preferred topology
## Examples
```bash
# Smart spawn with analysis
npx claude-flow automation smart-spawn --analyze
# Set spawn threshold
npx claude-flow automation smart-spawn --threshold 5
# Force topology
npx claude-flow automation smart-spawn --topology hierarchical
```
@@ -1,25 +0,0 @@
# workflow-select
Automatically select optimal workflow based on task type.
## Usage
```bash
npx claude-flow automation workflow-select [options]
```
## Options
- `--task <description>` - Task description
- `--constraints <list>` - Workflow constraints
- `--preview` - Preview without executing
## Examples
```bash
# Select workflow for task
npx claude-flow automation workflow-select --task "Deploy to production"
# With constraints
npx claude-flow automation workflow-select --constraints "no-downtime,rollback"
# Preview mode
npx claude-flow automation workflow-select --task "Database migration" --preview
```
-9
View File
@@ -1,9 +0,0 @@
# Coordination Commands
Commands for coordination operations in Claude Flow.
## Available Commands
- [swarm-init](./swarm-init.md)
- [agent-spawn](./agent-spawn.md)
- [task-orchestrate](./task-orchestrate.md)
@@ -1,25 +0,0 @@
# agent-spawn
Spawn a new agent in the current swarm.
## Usage
```bash
npx claude-flow agent spawn [options]
```
## Options
- `--type <type>` - Agent type (coder, researcher, analyst, tester, coordinator)
- `--name <name>` - Custom agent name
- `--skills <list>` - Specific skills (comma-separated)
## Examples
```bash
# Spawn coder agent
npx claude-flow agent spawn --type coder
# With custom name
npx claude-flow agent spawn --type researcher --name "API Expert"
# With specific skills
npx claude-flow agent spawn --type coder --skills "python,fastapi,testing"
```
@@ -1,85 +0,0 @@
# swarm init
Initialize a Claude Flow swarm with specified topology and configuration.
## Usage
```bash
npx claude-flow swarm init [options]
```
## Options
- `--topology, -t <type>` - Swarm topology: mesh, hierarchical, ring, star (default: hierarchical)
- `--max-agents, -m <number>` - Maximum number of agents (default: 8)
- `--strategy, -s <type>` - Execution strategy: balanced, parallel, sequential (default: parallel)
- `--auto-spawn` - Automatically spawn agents based on task complexity
- `--memory` - Enable cross-session memory persistence
- `--github` - Enable GitHub integration features
## Examples
### Basic initialization
```bash
npx claude-flow swarm init
```
### Mesh topology for research
```bash
npx claude-flow swarm init --topology mesh --max-agents 5 --strategy balanced
```
### Hierarchical for development
```bash
npx claude-flow swarm init --topology hierarchical --max-agents 10 --strategy parallel --auto-spawn
```
### GitHub-focused swarm
```bash
npx claude-flow swarm init --topology star --github --memory
```
## Topologies
### Mesh
- All agents connect to all others
- Best for: Research, exploration, brainstorming
- Communication: High overhead, maximum information sharing
### Hierarchical
- Tree structure with clear command chain
- Best for: Development, structured tasks, large projects
- Communication: Efficient, clear responsibilities
### Ring
- Agents connect in a circle
- Best for: Pipeline processing, sequential workflows
- Communication: Low overhead, ordered processing
### Star
- Central coordinator with satellite agents
- Best for: Simple tasks, centralized control
- Communication: Minimal overhead, clear coordination
## Integration with Claude Code
Once initialized, use MCP tools in Claude Code:
```javascript
mcp__claude-flow__swarm_init { topology: "hierarchical", maxAgents: 8 }
```
## See Also
- `agent spawn` - Create swarm agents
- `task orchestrate` - Coordinate task execution
- `swarm status` - Check swarm state
- `swarm monitor` - Real-time monitoring
@@ -1,25 +0,0 @@
# task-orchestrate
Orchestrate complex tasks across the swarm.
## Usage
```bash
npx claude-flow task orchestrate [options]
```
## Options
- `--task <description>` - Task description
- `--strategy <type>` - Orchestration strategy
- `--priority <level>` - Task priority (low, medium, high, critical)
## Examples
```bash
# Orchestrate development task
npx claude-flow task orchestrate --task "Implement user authentication"
# High priority task
npx claude-flow task orchestrate --task "Fix production bug" --priority critical
# With specific strategy
npx claude-flow task orchestrate --task "Refactor codebase" --strategy parallel
```
-11
View File
@@ -1,11 +0,0 @@
# Github Commands
Commands for github operations in Claude Flow.
## Available Commands
- [github-swarm](./github-swarm.md)
- [repo-analyze](./repo-analyze.md)
- [pr-enhance](./pr-enhance.md)
- [issue-triage](./issue-triage.md)
- [code-review](./code-review.md)
-25
View File
@@ -1,25 +0,0 @@
# code-review
Automated code review with swarm intelligence.
## Usage
```bash
npx claude-flow github code-review [options]
```
## Options
- `--pr-number <n>` - Pull request to review
- `--focus <areas>` - Review focus (security, performance, style)
- `--suggest-fixes` - Suggest code fixes
## Examples
```bash
# Review PR
npx claude-flow github code-review --pr-number 456
# Security focus
npx claude-flow github code-review --pr-number 456 --focus security
# With fix suggestions
npx claude-flow github code-review --pr-number 456 --suggest-fixes
```
-121
View File
@@ -1,121 +0,0 @@
# github swarm
Create a specialized swarm for GitHub repository management.
## Usage
```bash
npx claude-flow github swarm [options]
```
## Options
- `--repository, -r <owner/repo>` - Target GitHub repository
- `--agents, -a <number>` - Number of specialized agents (default: 5)
- `--focus, -f <type>` - Focus area: maintenance, development, review, triage
- `--auto-pr` - Enable automatic pull request enhancements
- `--issue-labels` - Auto-categorize and label issues
- `--code-review` - Enable AI-powered code reviews
## Examples
### Basic GitHub swarm
```bash
npx claude-flow github swarm --repository owner/repo
```
### Maintenance-focused swarm
```bash
npx claude-flow github swarm -r owner/repo -f maintenance --issue-labels
```
### Development swarm with PR automation
```bash
npx claude-flow github swarm -r owner/repo -f development --auto-pr --code-review
```
### Full-featured triage swarm
```bash
npx claude-flow github swarm -r owner/repo -a 8 -f triage --issue-labels --auto-pr
```
## Agent Types
### Issue Triager
- Analyzes and categorizes issues
- Suggests labels and priorities
- Identifies duplicates and related issues
### PR Reviewer
- Reviews code changes
- Suggests improvements
- Checks for best practices
### Documentation Agent
- Updates README files
- Creates API documentation
- Maintains changelog
### Test Agent
- Identifies missing tests
- Suggests test cases
- Validates test coverage
### Security Agent
- Scans for vulnerabilities
- Reviews dependencies
- Suggests security improvements
## Workflows
### Issue Triage Workflow
1. Scan all open issues
2. Categorize by type and priority
3. Apply appropriate labels
4. Suggest assignees
5. Link related issues
### PR Enhancement Workflow
1. Analyze PR changes
2. Suggest missing tests
3. Improve documentation
4. Format code consistently
5. Add helpful comments
### Repository Health Check
1. Analyze code quality metrics
2. Review dependency status
3. Check test coverage
4. Assess documentation completeness
5. Generate health report
## Integration with Claude Code
Use in Claude Code with MCP tools:
```javascript
mcp__claude-flow__github_swarm {
repository: "owner/repo",
agents: 6,
focus: "maintenance"
}
```
## See Also
- `repo analyze` - Deep repository analysis
- `pr enhance` - Enhance pull requests
- `issue triage` - Intelligent issue management
- `code review` - Automated reviews
-25
View File
@@ -1,25 +0,0 @@
# issue-triage
Intelligent issue classification and triage.
## Usage
```bash
npx claude-flow github issue-triage [options]
```
## Options
- `--repository <owner/repo>` - Target repository
- `--auto-label` - Automatically apply labels
- `--assign` - Auto-assign to team members
## Examples
```bash
# Triage issues
npx claude-flow github issue-triage --repository myorg/myrepo
# With auto-labeling
npx claude-flow github issue-triage --repository myorg/myrepo --auto-label
# Full automation
npx claude-flow github issue-triage --repository myorg/myrepo --auto-label --assign
```
-26
View File
@@ -1,26 +0,0 @@
# pr-enhance
AI-powered pull request enhancements.
## Usage
```bash
npx claude-flow github pr-enhance [options]
```
## Options
- `--pr-number <n>` - Pull request number
- `--add-tests` - Add missing tests
- `--improve-docs` - Improve documentation
- `--check-security` - Security review
## Examples
```bash
# Enhance PR
npx claude-flow github pr-enhance --pr-number 123
# Add tests
npx claude-flow github pr-enhance --pr-number 123 --add-tests
# Full enhancement
npx claude-flow github pr-enhance --pr-number 123 --add-tests --improve-docs
```
-25
View File
@@ -1,25 +0,0 @@
# repo-analyze
Deep analysis of GitHub repository with AI insights.
## Usage
```bash
npx claude-flow github repo-analyze [options]
```
## Options
- `--repository <owner/repo>` - Repository to analyze
- `--deep` - Enable deep analysis
- `--include <areas>` - Include specific areas (issues, prs, code, commits)
## Examples
```bash
# Basic analysis
npx claude-flow github repo-analyze --repository myorg/myrepo
# Deep analysis
npx claude-flow github repo-analyze --repository myorg/myrepo --deep
# Specific areas
npx claude-flow github repo-analyze --repository myorg/myrepo --include issues,prs
```
-11
View File
@@ -1,11 +0,0 @@
# Hooks Commands
Commands for hooks operations in Claude Flow.
## Available Commands
- [pre-task](./pre-task.md)
- [post-task](./post-task.md)
- [pre-edit](./pre-edit.md)
- [post-edit](./post-edit.md)
- [session-end](./session-end.md)
-117
View File
@@ -1,117 +0,0 @@
# hook post-edit
Execute post-edit processing including formatting, validation, and memory updates.
## Usage
```bash
npx claude-flow hook post-edit [options]
```
## Options
- `--file, -f <path>` - File path that was edited
- `--auto-format` - Automatically format code (default: true)
- `--memory-key, -m <key>` - Store edit context in memory
- `--train-patterns` - Train neural patterns from edit
- `--validate-output` - Validate edited file
## Examples
### Basic post-edit hook
```bash
npx claude-flow hook post-edit --file "src/components/Button.jsx"
```
### With memory storage
```bash
npx claude-flow hook post-edit -f "api/auth.js" --memory-key "auth/login-implementation"
```
### Format and validate
```bash
npx claude-flow hook post-edit -f "config/webpack.js" --auto-format --validate-output
```
### Neural training
```bash
npx claude-flow hook post-edit -f "utils/helpers.ts" --train-patterns --memory-key "utils/refactor"
```
## Features
### Auto Formatting
- Language-specific formatters
- Prettier for JS/TS/JSON
- Black for Python
- gofmt for Go
- Maintains consistency
### Memory Storage
- Saves edit context
- Records decisions made
- Tracks implementation details
- Enables knowledge sharing
### Pattern Training
- Learns from successful edits
- Improves future suggestions
- Adapts to coding style
- Enhances coordination
### Output Validation
- Checks syntax correctness
- Runs linting rules
- Validates formatting
- Ensures quality
## Integration
This hook is automatically called by Claude Code when:
- After Edit tool completes
- Following MultiEdit operations
- During file saves
- After code generation
Manual usage in agents:
```bash
# After editing files
npx claude-flow hook post-edit --file "path/to/edited.js" --memory-key "feature/step1"
```
## Output
Returns JSON with:
```json
{
"file": "src/components/Button.jsx",
"formatted": true,
"formatterUsed": "prettier",
"lintPassed": true,
"memorySaved": "component/button-refactor",
"patternsTrained": 3,
"warnings": [],
"stats": {
"linesChanged": 45,
"charactersAdded": 234
}
}
```
## See Also
- `hook pre-edit` - Pre-edit preparation
- `Edit` - File editing tool
- `memory usage` - Memory management
- `neural train` - Pattern training
-112
View File
@@ -1,112 +0,0 @@
# hook post-task
Execute post-task cleanup, performance analysis, and memory storage.
## Usage
```bash
npx claude-flow hook post-task [options]
```
## Options
- `--task-id, -t <id>` - Task identifier for tracking
- `--analyze-performance` - Generate performance metrics (default: true)
- `--store-decisions` - Save task decisions to memory
- `--export-learnings` - Export neural pattern learnings
- `--generate-report` - Create task completion report
## Examples
### Basic post-task hook
```bash
npx claude-flow hook post-task --task-id "auth-implementation"
```
### With full analysis
```bash
npx claude-flow hook post-task -t "api-refactor" --analyze-performance --generate-report
```
### Memory storage
```bash
npx claude-flow hook post-task -t "bug-fix-123" --store-decisions --export-learnings
```
### Quick cleanup
```bash
npx claude-flow hook post-task -t "minor-update" --analyze-performance false
```
## Features
### Performance Analysis
- Measures execution time
- Tracks token usage
- Identifies bottlenecks
- Suggests optimizations
### Decision Storage
- Saves key decisions made
- Records implementation choices
- Stores error resolutions
- Maintains knowledge base
### Neural Learning
- Exports successful patterns
- Updates coordination models
- Improves future performance
- Trains on task outcomes
### Report Generation
- Creates completion summary
- Documents changes made
- Lists files modified
- Tracks metrics achieved
## Integration
This hook is automatically called by Claude Code when:
- Completing a task
- Switching to a new task
- Ending a work session
- After major milestones
Manual usage in agents:
```bash
# In agent coordination
npx claude-flow hook post-task --task-id "your-task-id" --analyze-performance true
```
## Output
Returns JSON with:
```json
{
"taskId": "auth-implementation",
"duration": 1800000,
"tokensUsed": 45000,
"filesModified": 12,
"performanceScore": 0.92,
"learningsExported": true,
"reportPath": "/reports/task-auth-implementation.md"
}
```
## See Also
- `hook pre-task` - Pre-task setup
- `performance report` - Detailed metrics
- `memory usage` - Memory management
- `neural patterns` - Pattern analysis
-113
View File
@@ -1,113 +0,0 @@
# hook pre-edit
Execute pre-edit validations and agent assignment before file modifications.
## Usage
```bash
npx claude-flow hook pre-edit [options]
```
## Options
- `--file, -f <path>` - File path to be edited
- `--auto-assign-agent` - Automatically assign best agent (default: true)
- `--validate-syntax` - Pre-validate syntax before edit
- `--check-conflicts` - Check for merge conflicts
- `--backup-file` - Create backup before editing
## Examples
### Basic pre-edit hook
```bash
npx claude-flow hook pre-edit --file "src/auth/login.js"
```
### With validation
```bash
npx claude-flow hook pre-edit -f "config/database.js" --validate-syntax
```
### Manual agent assignment
```bash
npx claude-flow hook pre-edit -f "api/users.ts" --auto-assign-agent false
```
### Safe editing with backup
```bash
npx claude-flow hook pre-edit -f "production.env" --backup-file --check-conflicts
```
## Features
### Auto Agent Assignment
- Analyzes file type and content
- Assigns specialist agents
- TypeScript → TypeScript expert
- Database → Data specialist
- Tests → QA engineer
### Syntax Validation
- Pre-checks syntax validity
- Identifies potential errors
- Suggests corrections
- Prevents broken code
### Conflict Detection
- Checks for git conflicts
- Identifies concurrent edits
- Warns about stale files
- Suggests merge strategies
### File Backup
- Creates safety backups
- Enables quick rollback
- Tracks edit history
- Preserves originals
## Integration
This hook is automatically called by Claude Code when:
- Using Edit or MultiEdit tools
- Before file modifications
- During refactoring operations
- When updating critical files
Manual usage in agents:
```bash
# Before editing files
npx claude-flow hook pre-edit --file "path/to/file.js" --validate-syntax
```
## Output
Returns JSON with:
```json
{
"continue": true,
"file": "src/auth/login.js",
"assignedAgent": "auth-specialist",
"syntaxValid": true,
"conflicts": false,
"backupPath": ".backups/login.js.bak",
"warnings": []
}
```
## See Also
- `hook post-edit` - Post-edit processing
- `Edit` - File editing tool
- `MultiEdit` - Multiple edits tool
- `agent spawn` - Manual agent creation
-111
View File
@@ -1,111 +0,0 @@
# hook pre-task
Execute pre-task preparations and context loading.
## Usage
```bash
npx claude-flow hook pre-task [options]
```
## Options
- `--description, -d <text>` - Task description for context
- `--auto-spawn-agents` - Automatically spawn required agents (default: true)
- `--load-memory` - Load relevant memory from previous sessions
- `--optimize-topology` - Select optimal swarm topology
- `--estimate-complexity` - Analyze task complexity
## Examples
### Basic pre-task hook
```bash
npx claude-flow hook pre-task --description "Implement user authentication"
```
### With memory loading
```bash
npx claude-flow hook pre-task -d "Continue API development" --load-memory
```
### Manual agent control
```bash
npx claude-flow hook pre-task -d "Debug issue #123" --auto-spawn-agents false
```
### Full optimization
```bash
npx claude-flow hook pre-task -d "Refactor codebase" --optimize-topology --estimate-complexity
```
## Features
### Auto Agent Assignment
- Analyzes task requirements
- Determines needed agent types
- Spawns agents automatically
- Configures agent parameters
### Memory Loading
- Retrieves relevant past decisions
- Loads previous task contexts
- Restores agent configurations
- Maintains continuity
### Topology Optimization
- Analyzes task structure
- Selects best swarm topology
- Configures communication patterns
- Optimizes for performance
### Complexity Estimation
- Evaluates task difficulty
- Estimates time requirements
- Suggests agent count
- Identifies dependencies
## Integration
This hook is automatically called by Claude Code when:
- Starting a new task
- Resuming work after a break
- Switching between projects
- Beginning complex operations
Manual usage in agents:
```bash
# In agent coordination
npx claude-flow hook pre-task --description "Your task here"
```
## Output
Returns JSON with:
```json
{
"continue": true,
"topology": "hierarchical",
"agentsSpawned": 5,
"complexity": "medium",
"estimatedMinutes": 30,
"memoryLoaded": true
}
```
## See Also
- `hook post-task` - Post-task cleanup
- `agent spawn` - Manual agent creation
- `memory usage` - Memory management
- `swarm init` - Swarm initialization
-118
View File
@@ -1,118 +0,0 @@
# hook session-end
Cleanup and persist session state before ending work.
## Usage
```bash
npx claude-flow hook session-end [options]
```
## Options
- `--session-id, -s <id>` - Session identifier to end
- `--save-state` - Save current session state (default: true)
- `--export-metrics` - Export session metrics
- `--generate-summary` - Create session summary
- `--cleanup-temp` - Remove temporary files
## Examples
### Basic session end
```bash
npx claude-flow hook session-end --session-id "dev-session-2024"
```
### With full export
```bash
npx claude-flow hook session-end -s "feature-auth" --export-metrics --generate-summary
```
### Quick close
```bash
npx claude-flow hook session-end -s "quick-fix" --save-state false --cleanup-temp
```
### Complete persistence
```bash
npx claude-flow hook session-end -s "major-refactor" --save-state --export-metrics --generate-summary
```
## Features
### State Persistence
- Saves current context
- Stores open files
- Preserves task progress
- Maintains decisions
### Metric Export
- Session duration
- Commands executed
- Files modified
- Tokens consumed
- Performance data
### Summary Generation
- Work accomplished
- Key decisions made
- Problems solved
- Next steps identified
### Cleanup Operations
- Removes temp files
- Clears caches
- Frees resources
- Optimizes storage
## Integration
This hook is automatically called by Claude Code when:
- Ending a conversation
- Closing work session
- Before shutdown
- Switching contexts
Manual usage in agents:
```bash
# At session end
npx claude-flow hook session-end --session-id "your-session" --generate-summary
```
## Output
Returns JSON with:
```json
{
"sessionId": "dev-session-2024",
"duration": 7200000,
"saved": true,
"metrics": {
"commandsRun": 145,
"filesModified": 23,
"tokensUsed": 85000,
"tasksCompleted": 8
},
"summaryPath": "/sessions/dev-session-2024-summary.md",
"cleanedUp": true,
"nextSession": "dev-session-2025"
}
```
## See Also
- `hook session-start` - Session initialization
- `hook session-restore` - Session restoration
- `performance report` - Detailed metrics
- `memory backup` - State backup
-9
View File
@@ -1,9 +0,0 @@
# Memory Commands
Commands for memory operations in Claude Flow.
## Available Commands
- [memory-usage](./memory-usage.md)
- [memory-persist](./memory-persist.md)
- [memory-search](./memory-search.md)
-25
View File
@@ -1,25 +0,0 @@
# memory-persist
Persist memory across sessions.
## Usage
```bash
npx claude-flow memory persist [options]
```
## Options
- `--export <file>` - Export to file
- `--import <file>` - Import from file
- `--compress` - Compress memory data
## Examples
```bash
# Export memory
npx claude-flow memory persist --export memory-backup.json
# Import memory
npx claude-flow memory persist --import memory-backup.json
# Compressed export
npx claude-flow memory persist --export memory.gz --compress
```
-25
View File
@@ -1,25 +0,0 @@
# memory-search
Search through stored memory.
## Usage
```bash
npx claude-flow memory search [options]
```
## Options
- `--query <text>` - Search query
- `--pattern <regex>` - Pattern matching
- `--limit <n>` - Result limit
## Examples
```bash
# Search memory
npx claude-flow memory search --query "authentication"
# Pattern search
npx claude-flow memory search --pattern "api-.*"
# Limited results
npx claude-flow memory search --query "config" --limit 10
```
-25
View File
@@ -1,25 +0,0 @@
# memory-usage
Manage persistent memory storage.
## Usage
```bash
npx claude-flow memory usage [options]
```
## Options
- `--action <type>` - Action (store, retrieve, list, clear)
- `--key <key>` - Memory key
- `--value <data>` - Data to store (JSON)
## Examples
```bash
# Store memory
npx claude-flow memory usage --action store --key "project-config" --value '{"api": "v2"}'
# Retrieve memory
npx claude-flow memory usage --action retrieve --key "project-config"
# List all keys
npx claude-flow memory usage --action list
```
-9
View File
@@ -1,9 +0,0 @@
# Monitoring Commands
Commands for monitoring operations in Claude Flow.
## Available Commands
- [swarm-monitor](./swarm-monitor.md)
- [agent-metrics](./agent-metrics.md)
- [real-time-view](./real-time-view.md)
@@ -1,25 +0,0 @@
# agent-metrics
View agent performance metrics.
## Usage
```bash
npx claude-flow agent metrics [options]
```
## Options
- `--agent-id <id>` - Specific agent
- `--period <time>` - Time period
- `--format <type>` - Output format
## Examples
```bash
# All agents metrics
npx claude-flow agent metrics
# Specific agent
npx claude-flow agent metrics --agent-id agent-001
# Last hour
npx claude-flow agent metrics --period 1h
```
@@ -1,25 +0,0 @@
# real-time-view
Real-time view of swarm activity.
## Usage
```bash
npx claude-flow monitoring real-time-view [options]
```
## Options
- `--filter <type>` - Filter view
- `--highlight <pattern>` - Highlight pattern
- `--tail <n>` - Show last N events
## Examples
```bash
# Start real-time view
npx claude-flow monitoring real-time-view
# Filter errors
npx claude-flow monitoring real-time-view --filter errors
# Highlight pattern
npx claude-flow monitoring real-time-view --highlight "API"
```
@@ -1,25 +0,0 @@
# swarm-monitor
Real-time swarm monitoring.
## Usage
```bash
npx claude-flow swarm monitor [options]
```
## Options
- `--interval <ms>` - Update interval
- `--metrics` - Show detailed metrics
- `--export` - Export monitoring data
## Examples
```bash
# Start monitoring
npx claude-flow swarm monitor
# Custom interval
npx claude-flow swarm monitor --interval 5000
# With metrics
npx claude-flow swarm monitor --metrics
```
-9
View File
@@ -1,9 +0,0 @@
# Optimization Commands
Commands for optimization operations in Claude Flow.
## Available Commands
- [topology-optimize](./topology-optimize.md)
- [parallel-execute](./parallel-execute.md)
- [cache-manage](./cache-manage.md)
@@ -1,25 +0,0 @@
# cache-manage
Manage operation cache for performance.
## Usage
```bash
npx claude-flow optimization cache-manage [options]
```
## Options
- `--action <type>` - Action (view, clear, optimize)
- `--max-size <mb>` - Maximum cache size
- `--ttl <seconds>` - Time to live
## Examples
```bash
# View cache stats
npx claude-flow optimization cache-manage --action view
# Clear cache
npx claude-flow optimization cache-manage --action clear
# Set limits
npx claude-flow optimization cache-manage --max-size 100 --ttl 3600
```
@@ -1,25 +0,0 @@
# parallel-execute
Execute tasks in parallel for maximum efficiency.
## Usage
```bash
npx claude-flow optimization parallel-execute [options]
```
## Options
- `--tasks <file>` - Task list file
- `--max-parallel <n>` - Maximum parallel tasks
- `--strategy <type>` - Execution strategy
## Examples
```bash
# Execute task list
npx claude-flow optimization parallel-execute --tasks tasks.json
# Limit parallelism
npx claude-flow optimization parallel-execute --tasks tasks.json --max-parallel 5
# Custom strategy
npx claude-flow optimization parallel-execute --strategy adaptive
```
@@ -1,25 +0,0 @@
# topology-optimize
Optimize swarm topology for current workload.
## Usage
```bash
npx claude-flow optimization topology-optimize [options]
```
## Options
- `--analyze-first` - Analyze before optimizing
- `--target <metric>` - Optimization target
- `--apply` - Apply optimizations
## Examples
```bash
# Analyze and suggest
npx claude-flow optimization topology-optimize --analyze-first
# Optimize for speed
npx claude-flow optimization topology-optimize --target speed
# Apply changes
npx claude-flow optimization topology-optimize --target efficiency --apply
```
-166
View File
@@ -1,166 +0,0 @@
---
name: sparc
description: Execute SPARC methodology workflows with Claude-Flow
---
# ⚡️ SPARC Development Methodology
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.
## SPARC Workflow
Follow SPARC:
1. Specification: Clarify objectives and scope. Never allow hard-coded env vars.
2. Pseudocode: Request high-level logic with TDD anchors.
3. Architecture: Ensure extensible system diagrams and service boundaries.
4. Refinement: Use TDD, debugging, security, and optimization flows.
5. Completion: Integrate, document, and monitor for continuous improvement.
Use `new_task` to assign:
- spec-pseudocode
## Available SPARC Modes
- `/sparc-architect` - 🏗️ Architect
- `/sparc-code` - 🧠 Auto-Coder
- `/sparc-tdd` - 🧪 Tester (TDD)
- `/sparc-debug` - 🪲 Debugger
- `/sparc-security-review` - 🛡️ Security Reviewer
- `/sparc-docs-writer` - 📚 Documentation Writer
- `/sparc-integration` - 🔗 System Integrator
- `/sparc-post-deployment-monitoring-mode` - 📈 Deployment Monitor
- `/sparc-refinement-optimization-mode` - 🧹 Optimizer
- `/sparc-ask` - ❓Ask
- `/sparc-devops` - 🚀 DevOps
- `/sparc-tutorial` - 📘 SPARC Tutorial
- `/sparc-supabase-admin` - 🔐 Supabase Admin
- `/sparc-spec-pseudocode` - 📋 Specification Writer
- `/sparc-mcp` - ♾️ MCP Integration
- `/sparc-sparc` - ⚡️ SPARC Orchestrator
## Quick Start
### Option 1: Using MCP Tools (Preferred in Claude Code)
```javascript
// Run SPARC orchestrator (default)
mcp__claude-flow__sparc_mode {
mode: "sparc",
task_description: "build complete authentication system"
}
// Run a specific mode
mcp__claude-flow__sparc_mode {
mode: "architect",
task_description: "design API structure"
}
// TDD workflow
mcp__claude-flow__sparc_mode {
mode: "tdd",
task_description: "implement user authentication",
options: {workflow: "full"}
}
```
### Option 2: Using NPX CLI (Fallback when MCP not available)
```bash
# Run SPARC orchestrator (default)
npx claude-flow sparc "build complete authentication system"
# Run a specific mode
npx claude-flow sparc run architect "design API structure"
npx claude-flow sparc run tdd "implement user service"
# Execute full TDD workflow
npx claude-flow sparc tdd "implement user authentication"
# List all modes with details
npx claude-flow sparc modes --verbose
# For alpha features
npx claude-flow@alpha sparc run <mode> "your task"
```
### Option 3: Local Installation
```bash
# If claude-flow is installed locally
./claude-flow sparc "build complete authentication system"
./claude-flow sparc run architect "design API structure"
```
## SPARC Methodology Phases
1. **📋 Specification**: Define requirements, constraints, and acceptance criteria
2. **🧠 Pseudocode**: Create detailed logic flows and algorithmic planning
3. **🏗️ Architecture**: Design system structure, APIs, and component boundaries
4. **🔄 Refinement**: Implement with TDD (Red-Green-Refactor cycle)
5. **✅ Completion**: Integrate, document, and validate against requirements
## Memory Integration
### Using MCP Tools (Preferred)
```javascript
// Store specifications
mcp__claude-flow__memory_usage {
action: "store",
key: "spec_auth",
value: "OAuth2 + JWT requirements",
namespace: "spec"
}
// Store architectural decisions
mcp__claude-flow__memory_usage {
action: "store",
key: "arch_decisions",
value: "Microservices with API Gateway",
namespace: "architecture"
}
```
### Using NPX CLI (Fallback)
```bash
# Store specifications
npx claude-flow memory store "spec_auth" "OAuth2 + JWT requirements" --namespace spec
# Store architectural decisions
./claude-flow memory store "arch_api" "RESTful microservices design" --namespace arch
# Query previous work
./claude-flow memory query "authentication" --limit 10
# Export project memory
./claude-flow memory export sparc-project-backup.json
```
## Advanced Swarm Mode
For complex tasks requiring multiple agents with timeout-free execution:
```bash
# Development swarm with monitoring
./claude-flow swarm "Build e-commerce platform" --strategy development --monitor --review
# Background optimization swarm
./claude-flow swarm "Optimize system performance" --strategy optimization --background
# Distributed research swarm
./claude-flow swarm "Analyze market trends" --strategy research --distributed --ui
```
## Non-Interactive Mode
For CI/CD integration and automation:
```bash
./claude-flow sparc run code "implement API" --non-interactive
./claude-flow sparc tdd "user tests" --non-interactive --enable-permissions
```
## Best Practices
**Modular Design**: Keep files under 500 lines
**Environment Safety**: Never hardcode secrets or env values
**Test-First**: Always write tests before implementation
**Memory Usage**: Store important decisions and context
**Task Completion**: All tasks should end with `attempt_completion`
See `/claude-flow-help` for all available commands.
-80
View File
@@ -1,80 +0,0 @@
---
name: sparc-architect
description: 🏗️ Architect - You design scalable, secure, and modular architectures based on functional specs and user needs. ...
---
# 🏗️ Architect
## Role Definition
You design scalable, secure, and modular architectures based on functional specs and user needs. You define responsibilities across services, APIs, and components.
## Custom Instructions
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.
## Available Tools
- **read**: File reading and viewing
- **edit**: File modification and creation
## Usage
### Option 1: Using MCP Tools (Preferred in Claude Code)
```javascript
mcp__claude-flow__sparc_mode {
mode: "architect",
task_description: "design microservices architecture",
options: {
namespace: "architect",
non_interactive: false
}
}
```
### Option 2: Using NPX CLI (Fallback when MCP not available)
```bash
# Use when running from terminal or MCP tools unavailable
npx claude-flow sparc run architect "design microservices architecture"
# For alpha features
npx claude-flow@alpha sparc run architect "design microservices architecture"
# With namespace
npx claude-flow sparc run architect "your task" --namespace architect
# Non-interactive mode
npx claude-flow sparc run architect "your task" --non-interactive
```
### Option 3: Local Installation
```bash
# If claude-flow is installed locally
./claude-flow sparc run architect "design microservices architecture"
```
## Memory Integration
### Using MCP Tools (Preferred)
```javascript
// Store mode-specific context
mcp__claude-flow__memory_usage {
action: "store",
key: "architect_context",
value: "important decisions",
namespace: "architect"
}
// Query previous work
mcp__claude-flow__memory_search {
pattern: "architect",
namespace: "architect",
limit: 5
}
```
### Using NPX CLI (Fallback)
```bash
# Store mode-specific context
npx claude-flow memory store "architect_context" "important decisions" --namespace architect
# Query previous work
npx claude-flow memory query "architect" --limit 5
```
-97
View File
@@ -1,97 +0,0 @@
---
name: sparc-ask
description: ❓Ask - You are a task-formulation guide that helps users navigate, ask, and delegate tasks to the correc...
---
# ❓Ask
## Role Definition
You are a task-formulation guide that helps users navigate, ask, and delegate tasks to the correct SPARC modes.
## Custom Instructions
Guide users to ask questions using SPARC methodology:
• 📋 `spec-pseudocode` logic plans, pseudocode, flow outlines
• 🏗️ `architect` system diagrams, API boundaries
• 🧠 `code` implement features with env abstraction
• 🧪 `tdd` test-first development, coverage tasks
• 🪲 `debug` isolate runtime issues
• 🛡️ `security-review` check for secrets, exposure
• 📚 `docs-writer` create markdown guides
• 🔗 `integration` link services, ensure cohesion
• 📈 `post-deployment-monitoring-mode` observe production
• 🧹 `refinement-optimization-mode` refactor & optimize
• 🔐 `supabase-admin` manage Supabase database, auth, and storage
Help users craft `new_task` messages to delegate effectively, and always remind them:
✅ Modular
✅ Env-safe
✅ Files < 500 lines
✅ Use `attempt_completion`
## Available Tools
- **read**: File reading and viewing
## Usage
### Option 1: Using MCP Tools (Preferred in Claude Code)
```javascript
mcp__claude-flow__sparc_mode {
mode: "ask",
task_description: "help me choose the right mode",
options: {
namespace: "ask",
non_interactive: false
}
}
```
### Option 2: Using NPX CLI (Fallback when MCP not available)
```bash
# Use when running from terminal or MCP tools unavailable
npx claude-flow sparc run ask "help me choose the right mode"
# For alpha features
npx claude-flow@alpha sparc run ask "help me choose the right mode"
# With namespace
npx claude-flow sparc run ask "your task" --namespace ask
# Non-interactive mode
npx claude-flow sparc run ask "your task" --non-interactive
```
### Option 3: Local Installation
```bash
# If claude-flow is installed locally
./claude-flow sparc run ask "help me choose the right mode"
```
## Memory Integration
### Using MCP Tools (Preferred)
```javascript
// Store mode-specific context
mcp__claude-flow__memory_usage {
action: "store",
key: "ask_context",
value: "important decisions",
namespace: "ask"
}
// Query previous work
mcp__claude-flow__memory_search {
pattern: "ask",
namespace: "ask",
limit: 5
}
```
### Using NPX CLI (Fallback)
```bash
# Store mode-specific context
npx claude-flow memory store "ask_context" "important decisions" --namespace ask
# Query previous work
npx claude-flow memory query "ask" --limit 5
```
-89
View File
@@ -1,89 +0,0 @@
---
name: sparc-code
description: 🧠 Auto-Coder - You write clean, efficient, modular code based on pseudocode and architecture. You use configurat...
---
# 🧠 Auto-Coder
## Role Definition
You write clean, efficient, modular code based on pseudocode and architecture. You use configuration for environments and break large components into maintainable files.
## Custom Instructions
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`.
## Tool Usage Guidelines:
- Use `insert_content` when creating new files or when the target file is empty
- Use `apply_diff` when modifying existing code, always with complete search and replace blocks
- Only use `search_and_replace` as a last resort and always include both search and replace parameters
- Always verify all required parameters are included before executing any tool
## Available Tools
- **read**: File reading and viewing
- **edit**: File modification and creation
- **browser**: Web browsing capabilities
- **mcp**: Model Context Protocol tools
- **command**: Command execution
## Usage
### Option 1: Using MCP Tools (Preferred in Claude Code)
```javascript
mcp__claude-flow__sparc_mode {
mode: "code",
task_description: "implement REST API endpoints",
options: {
namespace: "code",
non_interactive: false
}
}
```
### Option 2: Using NPX CLI (Fallback when MCP not available)
```bash
# Use when running from terminal or MCP tools unavailable
npx claude-flow sparc run code "implement REST API endpoints"
# For alpha features
npx claude-flow@alpha sparc run code "implement REST API endpoints"
# With namespace
npx claude-flow sparc run code "your task" --namespace code
# Non-interactive mode
npx claude-flow sparc run code "your task" --non-interactive
```
### Option 3: Local Installation
```bash
# If claude-flow is installed locally
./claude-flow sparc run code "implement REST API endpoints"
```
## Memory Integration
### Using MCP Tools (Preferred)
```javascript
// Store mode-specific context
mcp__claude-flow__memory_usage {
action: "store",
key: "code_context",
value: "important decisions",
namespace: "code"
}
// Query previous work
mcp__claude-flow__memory_search {
pattern: "code",
namespace: "code",
limit: 5
}
```
### Using NPX CLI (Fallback)
```bash
# Store mode-specific context
npx claude-flow memory store "code_context" "important decisions" --namespace code
# Query previous work
npx claude-flow memory query "code" --limit 5
```
-83
View File
@@ -1,83 +0,0 @@
---
name: sparc-debug
description: 🪲 Debugger - You troubleshoot runtime bugs, logic errors, or integration failures by tracing, inspecting, and ...
---
# 🪲 Debugger
## Role Definition
You troubleshoot runtime bugs, logic errors, or integration failures by tracing, inspecting, and analyzing behavior.
## Custom Instructions
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`.
## Available Tools
- **read**: File reading and viewing
- **edit**: File modification and creation
- **browser**: Web browsing capabilities
- **mcp**: Model Context Protocol tools
- **command**: Command execution
## Usage
### Option 1: Using MCP Tools (Preferred in Claude Code)
```javascript
mcp__claude-flow__sparc_mode {
mode: "debug",
task_description: "fix memory leak in service",
options: {
namespace: "debug",
non_interactive: false
}
}
```
### Option 2: Using NPX CLI (Fallback when MCP not available)
```bash
# Use when running from terminal or MCP tools unavailable
npx claude-flow sparc run debug "fix memory leak in service"
# For alpha features
npx claude-flow@alpha sparc run debug "fix memory leak in service"
# With namespace
npx claude-flow sparc run debug "your task" --namespace debug
# Non-interactive mode
npx claude-flow sparc run debug "your task" --non-interactive
```
### Option 3: Local Installation
```bash
# If claude-flow is installed locally
./claude-flow sparc run debug "fix memory leak in service"
```
## Memory Integration
### Using MCP Tools (Preferred)
```javascript
// Store mode-specific context
mcp__claude-flow__memory_usage {
action: "store",
key: "debug_context",
value: "important decisions",
namespace: "debug"
}
// Query previous work
mcp__claude-flow__memory_search {
pattern: "debug",
namespace: "debug",
limit: 5
}
```
### Using NPX CLI (Fallback)
```bash
# Store mode-specific context
npx claude-flow memory store "debug_context" "important decisions" --namespace debug
# Query previous work
npx claude-flow memory query "debug" --limit 5
```
-109
View File
@@ -1,109 +0,0 @@
---
name: sparc-devops
description: 🚀 DevOps - You are the DevOps automation and infrastructure specialist responsible for deploying, managing, ...
---
# 🚀 DevOps
## Role Definition
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.
## Custom Instructions
Start by running uname. You are responsible for deployment, automation, and infrastructure operations. You:
• Provision infrastructure (cloud functions, containers, edge runtimes)
• Deploy services using CI/CD tools or shell commands
• Configure environment variables using secret managers or config layers
• Set up domains, routing, TLS, and monitoring integrations
• Clean up legacy or orphaned resources
• Enforce infra best practices:
- Immutable deployments
- Rollbacks and blue-green strategies
- Never hard-code credentials or tokens
- Use managed secrets
Use `new_task` to:
- Delegate credential setup to Security Reviewer
- Trigger test flows via TDD or Monitoring agents
- Request logs or metrics triage
- Coordinate post-deployment verification
Return `attempt_completion` with:
- Deployment status
- Environment details
- CLI output summaries
- Rollback instructions (if relevant)
⚠️ Always ensure that sensitive data is abstracted and config values are pulled from secrets managers or environment injection layers.
✅ Modular deploy targets (edge, container, lambda, service mesh)
✅ Secure by default (no public keys, secrets, tokens in code)
✅ Verified, traceable changes with summary notes
## Available Tools
- **read**: File reading and viewing
- **edit**: File modification and creation
- **command**: Command execution
## Usage
### Option 1: Using MCP Tools (Preferred in Claude Code)
```javascript
mcp__claude-flow__sparc_mode {
mode: "devops",
task_description: "deploy to AWS Lambda",
options: {
namespace: "devops",
non_interactive: false
}
}
```
### Option 2: Using NPX CLI (Fallback when MCP not available)
```bash
# Use when running from terminal or MCP tools unavailable
npx claude-flow sparc run devops "deploy to AWS Lambda"
# For alpha features
npx claude-flow@alpha sparc run devops "deploy to AWS Lambda"
# With namespace
npx claude-flow sparc run devops "your task" --namespace devops
# Non-interactive mode
npx claude-flow sparc run devops "your task" --non-interactive
```
### Option 3: Local Installation
```bash
# If claude-flow is installed locally
./claude-flow sparc run devops "deploy to AWS Lambda"
```
## Memory Integration
### Using MCP Tools (Preferred)
```javascript
// Store mode-specific context
mcp__claude-flow__memory_usage {
action: "store",
key: "devops_context",
value: "important decisions",
namespace: "devops"
}
// Query previous work
mcp__claude-flow__memory_search {
pattern: "devops",
namespace: "devops",
limit: 5
}
```
### Using NPX CLI (Fallback)
```bash
# Store mode-specific context
npx claude-flow memory store "devops_context" "important decisions" --namespace devops
# Query previous work
npx claude-flow memory query "devops" --limit 5
```
-80
View File
@@ -1,80 +0,0 @@
---
name: sparc-docs-writer
description: 📚 Documentation Writer - You write concise, clear, and modular Markdown documentation that explains usage, integration, se...
---
# 📚 Documentation Writer
## Role Definition
You write concise, clear, and modular Markdown documentation that explains usage, integration, setup, and configuration.
## Custom Instructions
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`.
## Available Tools
- **read**: File reading and viewing
- **edit**: Markdown files only (Files matching: \.md$)
## Usage
### Option 1: Using MCP Tools (Preferred in Claude Code)
```javascript
mcp__claude-flow__sparc_mode {
mode: "docs-writer",
task_description: "create API documentation",
options: {
namespace: "docs-writer",
non_interactive: false
}
}
```
### Option 2: Using NPX CLI (Fallback when MCP not available)
```bash
# Use when running from terminal or MCP tools unavailable
npx claude-flow sparc run docs-writer "create API documentation"
# For alpha features
npx claude-flow@alpha sparc run docs-writer "create API documentation"
# With namespace
npx claude-flow sparc run docs-writer "your task" --namespace docs-writer
# Non-interactive mode
npx claude-flow sparc run docs-writer "your task" --non-interactive
```
### Option 3: Local Installation
```bash
# If claude-flow is installed locally
./claude-flow sparc run docs-writer "create API documentation"
```
## Memory Integration
### Using MCP Tools (Preferred)
```javascript
// Store mode-specific context
mcp__claude-flow__memory_usage {
action: "store",
key: "docs-writer_context",
value: "important decisions",
namespace: "docs-writer"
}
// Query previous work
mcp__claude-flow__memory_search {
pattern: "docs-writer",
namespace: "docs-writer",
limit: 5
}
```
### Using NPX CLI (Fallback)
```bash
# Store mode-specific context
npx claude-flow memory store "docs-writer_context" "important decisions" --namespace docs-writer
# Query previous work
npx claude-flow memory query "docs-writer" --limit 5
```
-83
View File
@@ -1,83 +0,0 @@
---
name: sparc-integration
description: 🔗 System Integrator - You merge the outputs of all modes into a working, tested, production-ready system. You ensure co...
---
# 🔗 System Integrator
## Role Definition
You merge the outputs of all modes into a working, tested, production-ready system. You ensure consistency, cohesion, and modularity.
## Custom Instructions
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.
## Available Tools
- **read**: File reading and viewing
- **edit**: File modification and creation
- **browser**: Web browsing capabilities
- **mcp**: Model Context Protocol tools
- **command**: Command execution
## Usage
### Option 1: Using MCP Tools (Preferred in Claude Code)
```javascript
mcp__claude-flow__sparc_mode {
mode: "integration",
task_description: "connect payment service",
options: {
namespace: "integration",
non_interactive: false
}
}
```
### Option 2: Using NPX CLI (Fallback when MCP not available)
```bash
# Use when running from terminal or MCP tools unavailable
npx claude-flow sparc run integration "connect payment service"
# For alpha features
npx claude-flow@alpha sparc run integration "connect payment service"
# With namespace
npx claude-flow sparc run integration "your task" --namespace integration
# Non-interactive mode
npx claude-flow sparc run integration "your task" --non-interactive
```
### Option 3: Local Installation
```bash
# If claude-flow is installed locally
./claude-flow sparc run integration "connect payment service"
```
## Memory Integration
### Using MCP Tools (Preferred)
```javascript
// Store mode-specific context
mcp__claude-flow__memory_usage {
action: "store",
key: "integration_context",
value: "important decisions",
namespace: "integration"
}
// Query previous work
mcp__claude-flow__memory_search {
pattern: "integration",
namespace: "integration",
limit: 5
}
```
### Using NPX CLI (Fallback)
```bash
# Store mode-specific context
npx claude-flow memory store "integration_context" "important decisions" --namespace integration
# Query previous work
npx claude-flow memory query "integration" --limit 5
```
-117
View File
@@ -1,117 +0,0 @@
---
name: sparc-mcp
description: ♾️ MCP Integration - You are the MCP (Management Control Panel) integration specialist responsible for connecting to a...
---
# ♾️ MCP Integration
## Role Definition
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.
## Custom Instructions
You are responsible for integrating with external services through MCP interfaces. You:
• Connect to external APIs and services through MCP servers
• Configure authentication and authorization for service access
• Implement data transformation between systems
• Ensure secure handling of credentials and tokens
• Validate API responses and handle errors gracefully
• Optimize API usage patterns and request batching
• Implement retry mechanisms and circuit breakers
When using MCP tools:
• Always verify server availability before operations
• Use proper error handling for all API calls
• Implement appropriate validation for all inputs and outputs
• Document all integration points and dependencies
Tool Usage Guidelines:
• Always use `apply_diff` for code modifications with complete search and replace blocks
• Use `insert_content` for documentation and adding new content
• Only use `search_and_replace` when absolutely necessary and always include both search and replace parameters
• Always verify all required parameters are included before executing any tool
For MCP server operations, always use `use_mcp_tool` with complete parameters:
```
<use_mcp_tool>
<server_name>server_name</server_name>
<tool_name>tool_name</tool_name>
<arguments>{ "param1": "value1", "param2": "value2" }</arguments>
</use_mcp_tool>
```
For accessing MCP resources, use `access_mcp_resource` with proper URI:
```
<access_mcp_resource>
<server_name>server_name</server_name>
<uri>resource://path/to/resource</uri>
</access_mcp_resource>
```
## Available Tools
- **edit**: File modification and creation
- **mcp**: Model Context Protocol tools
## Usage
### Option 1: Using MCP Tools (Preferred in Claude Code)
```javascript
mcp__claude-flow__sparc_mode {
mode: "mcp",
task_description: "integrate with external API",
options: {
namespace: "mcp",
non_interactive: false
}
}
```
### Option 2: Using NPX CLI (Fallback when MCP not available)
```bash
# Use when running from terminal or MCP tools unavailable
npx claude-flow sparc run mcp "integrate with external API"
# For alpha features
npx claude-flow@alpha sparc run mcp "integrate with external API"
# With namespace
npx claude-flow sparc run mcp "your task" --namespace mcp
# Non-interactive mode
npx claude-flow sparc run mcp "your task" --non-interactive
```
### Option 3: Local Installation
```bash
# If claude-flow is installed locally
./claude-flow sparc run mcp "integrate with external API"
```
## Memory Integration
### Using MCP Tools (Preferred)
```javascript
// Store mode-specific context
mcp__claude-flow__memory_usage {
action: "store",
key: "mcp_context",
value: "important decisions",
namespace: "mcp"
}
// Query previous work
mcp__claude-flow__memory_search {
pattern: "mcp",
namespace: "mcp",
limit: 5
}
```
### Using NPX CLI (Fallback)
```bash
# Store mode-specific context
npx claude-flow memory store "mcp_context" "important decisions" --namespace mcp
# Query previous work
npx claude-flow memory query "mcp" --limit 5
```
@@ -1,83 +0,0 @@
---
name: sparc-post-deployment-monitoring-mode
description: 📈 Deployment Monitor - You observe the system post-launch, collecting performance, logs, and user feedback. You flag reg...
---
# 📈 Deployment Monitor
## Role Definition
You observe the system post-launch, collecting performance, logs, and user feedback. You flag regressions or unexpected behaviors.
## Custom Instructions
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`.
## Available Tools
- **read**: File reading and viewing
- **edit**: File modification and creation
- **browser**: Web browsing capabilities
- **mcp**: Model Context Protocol tools
- **command**: Command execution
## Usage
### Option 1: Using MCP Tools (Preferred in Claude Code)
```javascript
mcp__claude-flow__sparc_mode {
mode: "post-deployment-monitoring-mode",
task_description: "monitor production metrics",
options: {
namespace: "post-deployment-monitoring-mode",
non_interactive: false
}
}
```
### Option 2: Using NPX CLI (Fallback when MCP not available)
```bash
# Use when running from terminal or MCP tools unavailable
npx claude-flow sparc run post-deployment-monitoring-mode "monitor production metrics"
# For alpha features
npx claude-flow@alpha sparc run post-deployment-monitoring-mode "monitor production metrics"
# With namespace
npx claude-flow sparc run post-deployment-monitoring-mode "your task" --namespace post-deployment-monitoring-mode
# Non-interactive mode
npx claude-flow sparc run post-deployment-monitoring-mode "your task" --non-interactive
```
### Option 3: Local Installation
```bash
# If claude-flow is installed locally
./claude-flow sparc run post-deployment-monitoring-mode "monitor production metrics"
```
## Memory Integration
### Using MCP Tools (Preferred)
```javascript
// Store mode-specific context
mcp__claude-flow__memory_usage {
action: "store",
key: "post-deployment-monitoring-mode_context",
value: "important decisions",
namespace: "post-deployment-monitoring-mode"
}
// Query previous work
mcp__claude-flow__memory_search {
pattern: "post-deployment-monitoring-mode",
namespace: "post-deployment-monitoring-mode",
limit: 5
}
```
### Using NPX CLI (Fallback)
```bash
# Store mode-specific context
npx claude-flow memory store "post-deployment-monitoring-mode_context" "important decisions" --namespace post-deployment-monitoring-mode
# Query previous work
npx claude-flow memory query "post-deployment-monitoring-mode" --limit 5
```
@@ -1,83 +0,0 @@
---
name: sparc-refinement-optimization-mode
description: 🧹 Optimizer - You refactor, modularize, and improve system performance. You enforce file size limits, dependenc...
---
# 🧹 Optimizer
## Role Definition
You refactor, modularize, and improve system performance. You enforce file size limits, dependency decoupling, and configuration hygiene.
## Custom Instructions
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`.
## Available Tools
- **read**: File reading and viewing
- **edit**: File modification and creation
- **browser**: Web browsing capabilities
- **mcp**: Model Context Protocol tools
- **command**: Command execution
## Usage
### Option 1: Using MCP Tools (Preferred in Claude Code)
```javascript
mcp__claude-flow__sparc_mode {
mode: "refinement-optimization-mode",
task_description: "optimize database queries",
options: {
namespace: "refinement-optimization-mode",
non_interactive: false
}
}
```
### Option 2: Using NPX CLI (Fallback when MCP not available)
```bash
# Use when running from terminal or MCP tools unavailable
npx claude-flow sparc run refinement-optimization-mode "optimize database queries"
# For alpha features
npx claude-flow@alpha sparc run refinement-optimization-mode "optimize database queries"
# With namespace
npx claude-flow sparc run refinement-optimization-mode "your task" --namespace refinement-optimization-mode
# Non-interactive mode
npx claude-flow sparc run refinement-optimization-mode "your task" --non-interactive
```
### Option 3: Local Installation
```bash
# If claude-flow is installed locally
./claude-flow sparc run refinement-optimization-mode "optimize database queries"
```
## Memory Integration
### Using MCP Tools (Preferred)
```javascript
// Store mode-specific context
mcp__claude-flow__memory_usage {
action: "store",
key: "refinement-optimization-mode_context",
value: "important decisions",
namespace: "refinement-optimization-mode"
}
// Query previous work
mcp__claude-flow__memory_search {
pattern: "refinement-optimization-mode",
namespace: "refinement-optimization-mode",
limit: 5
}
```
### Using NPX CLI (Fallback)
```bash
# Store mode-specific context
npx claude-flow memory store "refinement-optimization-mode_context" "important decisions" --namespace refinement-optimization-mode
# Query previous work
npx claude-flow memory query "refinement-optimization-mode" --limit 5
```
-80
View File
@@ -1,80 +0,0 @@
---
name: sparc-security-review
description: 🛡️ Security Reviewer - You perform static and dynamic audits to ensure secure code practices. You flag secrets, poor mod...
---
# 🛡️ Security Reviewer
## Role Definition
You perform static and dynamic audits to ensure secure code practices. You flag secrets, poor modular boundaries, and oversized files.
## Custom Instructions
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`.
## Available Tools
- **read**: File reading and viewing
- **edit**: File modification and creation
## Usage
### Option 1: Using MCP Tools (Preferred in Claude Code)
```javascript
mcp__claude-flow__sparc_mode {
mode: "security-review",
task_description: "audit API security",
options: {
namespace: "security-review",
non_interactive: false
}
}
```
### Option 2: Using NPX CLI (Fallback when MCP not available)
```bash
# Use when running from terminal or MCP tools unavailable
npx claude-flow sparc run security-review "audit API security"
# For alpha features
npx claude-flow@alpha sparc run security-review "audit API security"
# With namespace
npx claude-flow sparc run security-review "your task" --namespace security-review
# Non-interactive mode
npx claude-flow sparc run security-review "your task" --non-interactive
```
### Option 3: Local Installation
```bash
# If claude-flow is installed locally
./claude-flow sparc run security-review "audit API security"
```
## Memory Integration
### Using MCP Tools (Preferred)
```javascript
// Store mode-specific context
mcp__claude-flow__memory_usage {
action: "store",
key: "security-review_context",
value: "important decisions",
namespace: "security-review"
}
// Query previous work
mcp__claude-flow__memory_search {
pattern: "security-review",
namespace: "security-review",
limit: 5
}
```
### Using NPX CLI (Fallback)
```bash
# Store mode-specific context
npx claude-flow memory store "security-review_context" "important decisions" --namespace security-review
# Query previous work
npx claude-flow memory query "security-review" --limit 5
```
-111
View File
@@ -1,111 +0,0 @@
---
name: sparc-sparc
description: ⚡️ SPARC Orchestrator - You are SPARC, the orchestrator of complex workflows. You break down large objectives into delega...
---
# ⚡️ SPARC Orchestrator
## Role Definition
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.
## Custom Instructions
Follow SPARC:
1. Specification: Clarify objectives and scope. Never allow hard-coded env vars.
2. Pseudocode: Request high-level logic with TDD anchors.
3. Architecture: Ensure extensible system diagrams and service boundaries.
4. Refinement: Use TDD, debugging, security, and optimization flows.
5. Completion: Integrate, document, and monitor for continuous improvement.
Use `new_task` to assign:
- spec-pseudocode
- architect
- code
- tdd
- debug
- security-review
- docs-writer
- integration
- post-deployment-monitoring-mode
- refinement-optimization-mode
- supabase-admin
## Tool Usage Guidelines:
- Always use `apply_diff` for code modifications with complete search and replace blocks
- Use `insert_content` for documentation and adding new content
- Only use `search_and_replace` when absolutely necessary and always include both search and replace parameters
- Verify all required parameters are included before executing any tool
Validate:
✅ Files < 500 lines
✅ No hard-coded env vars
✅ Modular, testable outputs
✅ 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.
use new_task for each new task as a sub-task.
## Available Tools
## Usage
### Option 1: Using MCP Tools (Preferred in Claude Code)
```javascript
mcp__claude-flow__sparc_mode {
mode: "sparc",
task_description: "orchestrate authentication system",
options: {
namespace: "sparc",
non_interactive: false
}
}
```
### Option 2: Using NPX CLI (Fallback when MCP not available)
```bash
# Use when running from terminal or MCP tools unavailable
npx claude-flow sparc run sparc "orchestrate authentication system"
# For alpha features
npx claude-flow@alpha sparc run sparc "orchestrate authentication system"
# With namespace
npx claude-flow sparc run sparc "your task" --namespace sparc
# Non-interactive mode
npx claude-flow sparc run sparc "your task" --non-interactive
```
### Option 3: Local Installation
```bash
# If claude-flow is installed locally
./claude-flow sparc run sparc "orchestrate authentication system"
```
## Memory Integration
### Using MCP Tools (Preferred)
```javascript
// Store mode-specific context
mcp__claude-flow__memory_usage {
action: "store",
key: "sparc_context",
value: "important decisions",
namespace: "sparc"
}
// Query previous work
mcp__claude-flow__memory_search {
pattern: "sparc",
namespace: "sparc",
limit: 5
}
```
### Using NPX CLI (Fallback)
```bash
# Store mode-specific context
npx claude-flow memory store "sparc_context" "important decisions" --namespace sparc
# Query previous work
npx claude-flow memory query "sparc" --limit 5
```
-80
View File
@@ -1,80 +0,0 @@
---
name: sparc-spec-pseudocode
description: 📋 Specification Writer - You capture full project context—functional requirements, edge cases, constraints—and translate t...
---
# 📋 Specification Writer
## Role Definition
You capture full project context—functional requirements, edge cases, constraints—and translate that into modular pseudocode with TDD anchors.
## Custom Instructions
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.
## Available Tools
- **read**: File reading and viewing
- **edit**: File modification and creation
## Usage
### Option 1: Using MCP Tools (Preferred in Claude Code)
```javascript
mcp__claude-flow__sparc_mode {
mode: "spec-pseudocode",
task_description: "define payment flow requirements",
options: {
namespace: "spec-pseudocode",
non_interactive: false
}
}
```
### Option 2: Using NPX CLI (Fallback when MCP not available)
```bash
# Use when running from terminal or MCP tools unavailable
npx claude-flow sparc run spec-pseudocode "define payment flow requirements"
# For alpha features
npx claude-flow@alpha sparc run spec-pseudocode "define payment flow requirements"
# With namespace
npx claude-flow sparc run spec-pseudocode "your task" --namespace spec-pseudocode
# Non-interactive mode
npx claude-flow sparc run spec-pseudocode "your task" --non-interactive
```
### Option 3: Local Installation
```bash
# If claude-flow is installed locally
./claude-flow sparc run spec-pseudocode "define payment flow requirements"
```
## Memory Integration
### Using MCP Tools (Preferred)
```javascript
// Store mode-specific context
mcp__claude-flow__memory_usage {
action: "store",
key: "spec-pseudocode_context",
value: "important decisions",
namespace: "spec-pseudocode"
}
// Query previous work
mcp__claude-flow__memory_search {
pattern: "spec-pseudocode",
namespace: "spec-pseudocode",
limit: 5
}
```
### Using NPX CLI (Fallback)
```bash
# Store mode-specific context
npx claude-flow memory store "spec-pseudocode_context" "important decisions" --namespace spec-pseudocode
# Query previous work
npx claude-flow memory query "spec-pseudocode" --limit 5
```
-348
View File
@@ -1,348 +0,0 @@
---
name: sparc-supabase-admin
description: 🔐 Supabase Admin - You are the Supabase database, authentication, and storage specialist. You design and implement d...
---
# 🔐 Supabase Admin
## Role Definition
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.
## Custom Instructions
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:
• Design PostgreSQL database schemas optimized for Supabase
• Implement Row Level Security (RLS) policies for data protection
• Create database triggers and functions for data integrity
• Set up authentication flows and user management
• Configure storage buckets and access controls
• Implement Edge Functions for serverless operations
• Optimize database queries and performance
When using the Supabase MCP tools:
• Always list available organizations before creating projects
• Get cost information before creating resources
• Confirm costs with the user before proceeding
• Use apply_migration for DDL operations
• Use execute_sql for DML operations
• Test policies thoroughly before applying
Detailed Supabase MCP tools guide:
1. Project Management:
• list_projects - Lists all Supabase projects for the user
• get_project - Gets details for a project (requires id parameter)
• list_organizations - Lists all organizations the user belongs to
• get_organization - Gets organization details including subscription plan (requires id parameter)
2. Project Creation & Lifecycle:
• get_cost - Gets cost information (requires type, organization_id parameters)
• confirm_cost - Confirms cost understanding (requires type, recurrence, amount parameters)
• create_project - Creates a new project (requires name, organization_id, confirm_cost_id parameters)
• pause_project - Pauses a project (requires project_id parameter)
• restore_project - Restores a paused project (requires project_id parameter)
3. Database Operations:
• list_tables - Lists tables in schemas (requires project_id, optional schemas parameter)
• list_extensions - Lists all database extensions (requires project_id parameter)
• list_migrations - Lists all migrations (requires project_id parameter)
• apply_migration - Applies DDL operations (requires project_id, name, query parameters)
• execute_sql - Executes DML operations (requires project_id, query parameters)
4. Development Branches:
• create_branch - Creates a development branch (requires project_id, confirm_cost_id parameters)
• list_branches - Lists all development branches (requires project_id parameter)
• delete_branch - Deletes a branch (requires branch_id parameter)
• merge_branch - Merges branch to production (requires branch_id parameter)
• reset_branch - Resets branch migrations (requires branch_id, optional migration_version parameters)
• rebase_branch - Rebases branch on production (requires branch_id parameter)
5. Monitoring & Utilities:
• get_logs - Gets service logs (requires project_id, service parameters)
• get_project_url - Gets the API URL (requires project_id parameter)
• get_anon_key - Gets the anonymous API key (requires project_id parameter)
• generate_typescript_types - Generates TypeScript types (requires project_id parameter)
Return `attempt_completion` with:
• Schema implementation status
• RLS policy summary
• Authentication configuration
• SQL migration files created
⚠️ Never expose API keys or secrets in SQL or code.
✅ Implement proper RLS policies for all tables
✅ Use parameterized queries to prevent SQL injection
✅ Document all database objects and policies
✅ Create modular SQL migration files. Don't use apply_migration. Use execute_sql where possible.
# Supabase MCP
## Getting Started with Supabase MCP
The 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.
### How to Use MCP Services
1. **Authentication**: MCP services are pre-authenticated within this environment. No additional login is required.
2. **Basic Workflow**:
- Start by listing projects (`list_projects`) or organizations (`list_organizations`)
- Get details about specific resources using their IDs
- Always check costs before creating resources
- Confirm costs with users before proceeding
- Use appropriate tools for database operations (DDL vs DML)
3. **Best Practices**:
- Always use `apply_migration` for DDL operations (schema changes)
- Use `execute_sql` for DML operations (data manipulation)
- Check project status after creation with `get_project`
- Verify database changes after applying migrations
- Use development branches for testing changes before production
4. **Working with Branches**:
- Create branches for development work
- Test changes thoroughly on branches
- Merge only when changes are verified
- Rebase branches when production has newer migrations
5. **Security Considerations**:
- Never expose API keys in code or logs
- Implement proper RLS policies for all tables
- Test security policies thoroughly
### Current Project
```json
{"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"}
```
## Available Commands
### Project Management
#### `list_projects`
Lists all Supabase projects for the user.
#### `get_project`
Gets details for a Supabase project.
**Parameters:**
- `id`* - The project ID
#### `get_cost`
Gets the cost of creating a new project or branch. Never assume organization as costs can be different for each.
**Parameters:**
- `type`* - No description
- `organization_id`* - The organization ID. Always ask the user.
#### `confirm_cost`
Ask 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`.
**Parameters:**
- `type`* - No description
- `recurrence`* - No description
- `amount`* - No description
#### `create_project`
Creates 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.
**Parameters:**
- `name`* - The name of the project
- `region` - The region to create the project in. Defaults to the closest region.
- `organization_id`* - No description
- `confirm_cost_id`* - The cost confirmation ID. Call `confirm_cost` first.
#### `pause_project`
Pauses a Supabase project.
**Parameters:**
- `project_id`* - No description
#### `restore_project`
Restores a Supabase project.
**Parameters:**
- `project_id`* - No description
#### `list_organizations`
Lists all organizations that the user is a member of.
#### `get_organization`
Gets details for an organization. Includes subscription plan.
**Parameters:**
- `id`* - The organization ID
### Database Operations
#### `list_tables`
Lists all tables in a schema.
**Parameters:**
- `project_id`* - No description
- `schemas` - Optional list of schemas to include. Defaults to all schemas.
#### `list_extensions`
Lists all extensions in the database.
**Parameters:**
- `project_id`* - No description
#### `list_migrations`
Lists all migrations in the database.
**Parameters:**
- `project_id`* - No description
#### `apply_migration`
Applies a migration to the database. Use this when executing DDL operations.
**Parameters:**
- `project_id`* - No description
- `name`* - The name of the migration in snake_case
- `query`* - The SQL query to apply
#### `execute_sql`
Executes raw SQL in the Postgres database. Use `apply_migration` instead for DDL operations.
**Parameters:**
- `project_id`* - No description
- `query`* - The SQL query to execute
### Monitoring & Utilities
#### `get_logs`
Gets 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.
**Parameters:**
- `project_id`* - No description
- `service`* - The service to fetch logs for
#### `get_project_url`
Gets the API URL for a project.
**Parameters:**
- `project_id`* - No description
#### `get_anon_key`
Gets the anonymous API key for a project.
**Parameters:**
- `project_id`* - No description
#### `generate_typescript_types`
Generates TypeScript types for a project.
**Parameters:**
- `project_id`* - No description
### Development Branches
#### `create_branch`
Creates 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.
**Parameters:**
- `project_id`* - No description
- `name` - Name of the branch to create
- `confirm_cost_id`* - The cost confirmation ID. Call `confirm_cost` first.
#### `list_branches`
Lists 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.
**Parameters:**
- `project_id`* - No description
#### `delete_branch`
Deletes a development branch.
**Parameters:**
- `branch_id`* - No description
#### `merge_branch`
Merges migrations and edge functions from a development branch to production.
**Parameters:**
- `branch_id`* - No description
#### `reset_branch`
Resets migrations of a development branch. Any untracked data or schema changes will be lost.
**Parameters:**
- `branch_id`* - No description
- `migration_version` - Reset your development branch to a specific migration version.
#### `rebase_branch`
Rebases a development branch on production. This will effectively run any newer migrations from production onto this branch to help handle migration drift.
**Parameters:**
- `branch_id`* - No description
## Available Tools
- **read**: File reading and viewing
- **edit**: File modification and creation
- **mcp**: Model Context Protocol tools
## Usage
### Option 1: Using MCP Tools (Preferred in Claude Code)
```javascript
mcp__claude-flow__sparc_mode {
mode: "supabase-admin",
task_description: "create user authentication schema",
options: {
namespace: "supabase-admin",
non_interactive: false
}
}
```
### Option 2: Using NPX CLI (Fallback when MCP not available)
```bash
# Use when running from terminal or MCP tools unavailable
npx claude-flow sparc run supabase-admin "create user authentication schema"
# For alpha features
npx claude-flow@alpha sparc run supabase-admin "create user authentication schema"
# With namespace
npx claude-flow sparc run supabase-admin "your task" --namespace supabase-admin
# Non-interactive mode
npx claude-flow sparc run supabase-admin "your task" --non-interactive
```
### Option 3: Local Installation
```bash
# If claude-flow is installed locally
./claude-flow sparc run supabase-admin "create user authentication schema"
```
## Memory Integration
### Using MCP Tools (Preferred)
```javascript
// Store mode-specific context
mcp__claude-flow__memory_usage {
action: "store",
key: "supabase-admin_context",
value: "important decisions",
namespace: "supabase-admin"
}
// Query previous work
mcp__claude-flow__memory_search {
pattern: "supabase-admin",
namespace: "supabase-admin",
limit: 5
}
```
### Using NPX CLI (Fallback)
```bash
# Store mode-specific context
npx claude-flow memory store "supabase-admin_context" "important decisions" --namespace supabase-admin
# Query previous work
npx claude-flow memory query "supabase-admin" --limit 5
```
-83
View File
@@ -1,83 +0,0 @@
---
name: sparc-tdd
description: 🧪 Tester (TDD) - You implement Test-Driven Development (TDD, London School), writing tests first and refactoring a...
---
# 🧪 Tester (TDD)
## Role Definition
You implement Test-Driven Development (TDD, London School), writing tests first and refactoring after minimal implementation passes.
## Custom Instructions
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`.
## Available Tools
- **read**: File reading and viewing
- **edit**: File modification and creation
- **browser**: Web browsing capabilities
- **mcp**: Model Context Protocol tools
- **command**: Command execution
## Usage
### Option 1: Using MCP Tools (Preferred in Claude Code)
```javascript
mcp__claude-flow__sparc_mode {
mode: "tdd",
task_description: "create user authentication tests",
options: {
namespace: "tdd",
non_interactive: false
}
}
```
### Option 2: Using NPX CLI (Fallback when MCP not available)
```bash
# Use when running from terminal or MCP tools unavailable
npx claude-flow sparc run tdd "create user authentication tests"
# For alpha features
npx claude-flow@alpha sparc run tdd "create user authentication tests"
# With namespace
npx claude-flow sparc run tdd "your task" --namespace tdd
# Non-interactive mode
npx claude-flow sparc run tdd "your task" --non-interactive
```
### Option 3: Local Installation
```bash
# If claude-flow is installed locally
./claude-flow sparc run tdd "create user authentication tests"
```
## Memory Integration
### Using MCP Tools (Preferred)
```javascript
// Store mode-specific context
mcp__claude-flow__memory_usage {
action: "store",
key: "tdd_context",
value: "important decisions",
namespace: "tdd"
}
// Query previous work
mcp__claude-flow__memory_search {
pattern: "tdd",
namespace: "tdd",
limit: 5
}
```
### Using NPX CLI (Fallback)
```bash
# Store mode-specific context
npx claude-flow memory store "tdd_context" "important decisions" --namespace tdd
# Query previous work
npx claude-flow memory query "tdd" --limit 5
```
-79
View File
@@ -1,79 +0,0 @@
---
name: sparc-tutorial
description: 📘 SPARC Tutorial - You are the SPARC onboarding and education assistant. Your job is to guide users through the full...
---
# 📘 SPARC Tutorial
## Role Definition
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.
## Custom Instructions
You teach developers how to apply the SPARC methodology through actionable examples and mental models.
## Available Tools
- **read**: File reading and viewing
## Usage
### Option 1: Using MCP Tools (Preferred in Claude Code)
```javascript
mcp__claude-flow__sparc_mode {
mode: "tutorial",
task_description: "guide me through SPARC methodology",
options: {
namespace: "tutorial",
non_interactive: false
}
}
```
### Option 2: Using NPX CLI (Fallback when MCP not available)
```bash
# Use when running from terminal or MCP tools unavailable
npx claude-flow sparc run tutorial "guide me through SPARC methodology"
# For alpha features
npx claude-flow@alpha sparc run tutorial "guide me through SPARC methodology"
# With namespace
npx claude-flow sparc run tutorial "your task" --namespace tutorial
# Non-interactive mode
npx claude-flow sparc run tutorial "your task" --non-interactive
```
### Option 3: Local Installation
```bash
# If claude-flow is installed locally
./claude-flow sparc run tutorial "guide me through SPARC methodology"
```
## Memory Integration
### Using MCP Tools (Preferred)
```javascript
// Store mode-specific context
mcp__claude-flow__memory_usage {
action: "store",
key: "tutorial_context",
value: "important decisions",
namespace: "tutorial"
}
// Query previous work
mcp__claude-flow__memory_search {
pattern: "tutorial",
namespace: "tutorial",
limit: 5
}
```
### Using NPX CLI (Fallback)
```bash
# Store mode-specific context
npx claude-flow memory store "tutorial_context" "important decisions" --namespace tutorial
# Query previous work
npx claude-flow memory query "tutorial" --limit 5
```
-9
View File
@@ -1,9 +0,0 @@
# Training Commands
Commands for training operations in Claude Flow.
## Available Commands
- [neural-train](./neural-train.md)
- [pattern-learn](./pattern-learn.md)
- [model-update](./model-update.md)
-25
View File
@@ -1,25 +0,0 @@
# model-update
Update neural models with new data.
## Usage
```bash
npx claude-flow training model-update [options]
```
## Options
- `--model <name>` - Model to update
- `--incremental` - Incremental update
- `--validate` - Validate after update
## Examples
```bash
# Update all models
npx claude-flow training model-update
# Specific model
npx claude-flow training model-update --model agent-selector
# Incremental with validation
npx claude-flow training model-update --incremental --validate
```
-25
View File
@@ -1,25 +0,0 @@
# neural-train
Train neural patterns from operations.
## Usage
```bash
npx claude-flow training neural-train [options]
```
## Options
- `--data <source>` - Training data source
- `--model <name>` - Target model
- `--epochs <n>` - Training epochs
## Examples
```bash
# Train from recent ops
npx claude-flow training neural-train --data recent
# Specific model
npx claude-flow training neural-train --model task-predictor
# Custom epochs
npx claude-flow training neural-train --epochs 100
```
@@ -1,25 +0,0 @@
# pattern-learn
Learn patterns from successful operations.
## Usage
```bash
npx claude-flow training pattern-learn [options]
```
## Options
- `--source <type>` - Pattern source
- `--threshold <score>` - Success threshold
- `--save <name>` - Save pattern set
## Examples
```bash
# Learn from all ops
npx claude-flow training pattern-learn
# High success only
npx claude-flow training pattern-learn --threshold 0.9
# Save patterns
npx claude-flow training pattern-learn --save optimal-patterns
```
-9
View File
@@ -1,9 +0,0 @@
# Workflows Commands
Commands for workflows operations in Claude Flow.
## Available Commands
- [workflow-create](./workflow-create.md)
- [workflow-execute](./workflow-execute.md)
- [workflow-export](./workflow-export.md)
@@ -1,25 +0,0 @@
# workflow-create
Create reusable workflow templates.
## Usage
```bash
npx claude-flow workflow create [options]
```
## Options
- `--name <name>` - Workflow name
- `--from-history` - Create from history
- `--interactive` - Interactive creation
## Examples
```bash
# Create workflow
npx claude-flow workflow create --name "deploy-api"
# From history
npx claude-flow workflow create --name "test-suite" --from-history
# Interactive mode
npx claude-flow workflow create --interactive
```
@@ -1,25 +0,0 @@
# workflow-execute
Execute saved workflows.
## Usage
```bash
npx claude-flow workflow execute [options]
```
## Options
- `--name <name>` - Workflow name
- `--params <json>` - Workflow parameters
- `--dry-run` - Preview execution
## Examples
```bash
# Execute workflow
npx claude-flow workflow execute --name "deploy-api"
# With parameters
npx claude-flow workflow execute --name "test-suite" --params '{"env": "staging"}'
# Dry run
npx claude-flow workflow execute --name "deploy-api" --dry-run
```
@@ -1,25 +0,0 @@
# workflow-export
Export workflows for sharing.
## Usage
```bash
npx claude-flow workflow export [options]
```
## Options
- `--name <name>` - Workflow to export
- `--format <type>` - Export format
- `--include-history` - Include execution history
## Examples
```bash
# Export workflow
npx claude-flow workflow export --name "deploy-api"
# As YAML
npx claude-flow workflow export --name "test-suite" --format yaml
# With history
npx claude-flow workflow export --name "deploy-api" --include-history
```
-28
View File
@@ -1,28 +0,0 @@
#!/bin/bash
# Setup GitHub integration for Claude Flow
echo "🔗 Setting up GitHub integration..."
# Check for gh CLI
if ! command -v gh &> /dev/null; then
echo "⚠️ GitHub CLI (gh) not found"
echo "Install from: https://cli.github.com/"
echo "Continuing without GitHub features..."
else
echo "✅ GitHub CLI found"
# Check auth status
if gh auth status &> /dev/null; then
echo "✅ GitHub authentication active"
else
echo "⚠️ Not authenticated with GitHub"
echo "Run: gh auth login"
fi
fi
echo ""
echo "📦 GitHub swarm commands available:"
echo " - npx claude-flow github swarm"
echo " - npx claude-flow repo analyze"
echo " - npx claude-flow pr enhance"
echo " - npx claude-flow issue triage"
-19
View File
@@ -1,19 +0,0 @@
#!/bin/bash
# Quick start guide for Claude Flow
echo "🚀 Claude Flow Quick Start"
echo "=========================="
echo ""
echo "1. Initialize a swarm:"
echo " npx claude-flow swarm init --topology hierarchical"
echo ""
echo "2. Spawn agents:"
echo " npx claude-flow agent spawn --type coder --name "API Developer""
echo ""
echo "3. Orchestrate tasks:"
echo " npx claude-flow task orchestrate --task "Build REST API""
echo ""
echo "4. Monitor progress:"
echo " npx claude-flow swarm monitor"
echo ""
echo "📚 For more examples, see .claude/commands/"
-18
View File
@@ -1,18 +0,0 @@
#!/bin/bash
# Setup MCP server for Claude Flow
echo "🚀 Setting up Claude Flow MCP server..."
# Check if claude command exists
if ! command -v claude &> /dev/null; then
echo "❌ Error: Claude Code CLI not found"
echo "Please install Claude Code first"
exit 1
fi
# Add MCP server
echo "📦 Adding Claude Flow MCP server..."
claude mcp add claude-flow npx claude-flow mcp start
echo "✅ MCP server setup complete!"
echo "🎯 You can now use mcp__claude-flow__ tools in Claude Code"
-90
View File
@@ -1,90 +0,0 @@
{
"env": {
"CLAUDE_FLOW_AUTO_COMMIT": "false",
"CLAUDE_FLOW_AUTO_PUSH": "false",
"CLAUDE_FLOW_HOOKS_ENABLED": "true",
"CLAUDE_FLOW_TELEMETRY_ENABLED": "true",
"CLAUDE_FLOW_REMOTE_EXECUTION": "true",
"CLAUDE_FLOW_GITHUB_INTEGRATION": "true"
},
"permissions": {
"allow": [
"Bash(npx claude-flow *)",
"Bash(npm run lint)",
"Bash(npm run test:*)",
"Bash(npm test *)",
"Bash(git status)",
"Bash(git diff *)",
"Bash(git log *)",
"Bash(git add *)",
"Bash(git commit *)",
"Bash(git push)",
"Bash(git config *)",
"Bash(gh *)",
"Bash(node *)",
"Bash(which *)",
"Bash(pwd)",
"Bash(ls *)"
],
"deny": [
"Bash(rm -rf /)",
"Bash(curl * | bash)",
"Bash(wget * | sh)",
"Bash(eval *)"
]
},
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "cat | jq -r '.tool_input.command // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks pre-command --command '{}' --validate-safety true --prepare-resources true"
}
]
},
{
"matcher": "Write|Edit|MultiEdit",
"hooks": [
{
"type": "command",
"command": "cat | jq -r '.tool_input.file_path // .tool_input.path // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks pre-edit --file '{}' --auto-assign-agents true --load-context true"
}
]
}
],
"PostToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "cat | jq -r '.tool_input.command // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks post-command --command '{}' --track-metrics true --store-results true"
}
]
},
{
"matcher": "Write|Edit|MultiEdit",
"hooks": [
{
"type": "command",
"command": "cat | jq -r '.tool_input.file_path // .tool_input.path // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks post-edit --file '{}' --format true --update-memory true"
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "npx claude-flow@alpha hooks session-end --generate-summary true --persist-state true --export-metrics true"
}
]
}
]
},
"includeCoAuthoredBy": true,
"enabledMcpjsonServers": ["claude-flow", "ruv-swarm"]
}
+81 -880
View File
@@ -1,906 +1,107 @@
# Claude Code Configuration for Claude Flow
# CLAUDE.md
## 🚨 CRITICAL: PARALLEL EXECUTION AFTER SWARM INIT
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
**MANDATORY RULE**: Once swarm is initialized with memory, ALL subsequent operations MUST be parallel:
## Project Overview
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
MinIO WebUI is a secure web interface for managing MinIO object storage. It's a monorepo with separate frontend (React/TypeScript) and backend (Express/Node.js) applications that communicate via REST API.
## 🚨 CRITICAL: CONCURRENT EXECUTION FOR ALL ACTIONS
**ABSOLUTE RULE**: ALL operations MUST be concurrent/parallel in a single message:
### 🔴 MANDATORY CONCURRENT PATTERNS:
1. **TodoWrite**: ALWAYS batch ALL todos in ONE call (5-10+ todos minimum)
2. **Task tool**: ALWAYS spawn ALL agents in ONE message with full instructions
3. **File operations**: ALWAYS batch ALL reads/writes/edits in ONE message
4. **Bash commands**: ALWAYS batch ALL terminal operations in ONE message
5. **Memory operations**: ALWAYS batch ALL memory store/retrieve in ONE message
### ⚡ GOLDEN RULE: "1 MESSAGE = ALL RELATED OPERATIONS"
**Examples of CORRECT concurrent execution:**
```javascript
// ✅ CORRECT: Everything in ONE message
[Single Message]:
- TodoWrite { todos: [10+ todos with all statuses/priorities] }
- Task("Agent 1 with full instructions and hooks")
- Task("Agent 2 with full instructions and hooks")
- 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")
- Bash("npm test")
- Bash("npm run build")
```
**Examples of WRONG sequential execution:**
```javascript
// ❌ WRONG: Multiple messages (NEVER DO THIS)
Message 1: TodoWrite { todos: [single todo] }
Message 2: Task("Agent 1")
Message 3: Task("Agent 2")
Message 4: Read("file1.js")
Message 5: Write("output1.js")
Message 6: Bash("npm install")
// This is 6x slower and breaks coordination!
```
### 🎯 CONCURRENT EXECUTION CHECKLIST:
Before sending ANY message, ask yourself:
- ✅ Are ALL related TodoWrite operations batched together?
- ✅ Are ALL Task spawning operations in ONE message?
- ✅ Are ALL file operations (Read/Write/Edit) batched together?
- ✅ Are ALL bash commands grouped in ONE message?
- ✅ Are ALL memory operations concurrent?
If ANY answer is "No", you MUST combine operations into a single message!
## 🚀 CRITICAL: Claude Code Does ALL Real Work
### 🎯 CLAUDE CODE IS THE ONLY EXECUTOR
**ABSOLUTE RULE**: Claude Code performs ALL actual work:
### ✅ 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
### 🧠 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
### 🚨 CRITICAL SEPARATION OF CONCERNS:
**❌ 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
**✅ 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)
## Development Commands
### Backend (from `/backend`)
```bash
# Add Claude Flow MCP server to Claude Code using stdio
claude mcp add claude-flow npx claude-flow@alpha mcp start
npm run dev # Development with nodemon (hot reload)
npm run dev:node # Development with Node.js --watch
npm start # Production
npm test # Jest tests with coverage
npm run lint # ESLint check
npm run lint:fix # ESLint auto-fix
```
### 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
### GitHub Integration Tools (NEW!):
- `mcp__claude-flow__github_swarm` - Create specialized GitHub management swarms
- `mcp__claude-flow__repo_analyze` - Deep repository analysis with AI
- `mcp__claude-flow__pr_enhance` - AI-powered pull request improvements
- `mcp__claude-flow__issue_triage` - Intelligent issue classification
- `mcp__claude-flow__code_review` - Automated code review with swarms
### 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
### GitHub Repository Management Example (NEW!)
**Context:** Claude Code needs to manage a complex GitHub repository
**Step 1:** Initialize GitHub swarm
- Tool: `mcp__claude-flow__github_swarm`
- Parameters: `{"repository": "owner/repo", "agents": 5, "focus": "maintenance"}`
- Result: Specialized swarm for repository management
**Step 2:** Analyze repository health
- Tool: `mcp__claude-flow__repo_analyze`
- Parameters: `{"deep": true, "include": ["issues", "prs", "code"]}`
- Result: Comprehensive repository analysis
**Step 3:** Enhance pull requests
- Tool: `mcp__claude-flow__pr_enhance`
- Parameters: `{"pr_number": 123, "add_tests": true, "improve_docs": true}`
- Result: AI-powered PR improvements
## 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
- Leverage GitHub tools for repository management
### ❌ 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
- Store GitHub workflow preferences
## Performance Benefits
When using Claude Flow 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
- **GitHub automation** - Streamlined repository management
## Claude Code Hooks Integration
Claude Flow 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
- **GitHub context** loading for repository operations
### 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
- **Sync GitHub** state for consistency
### Session Management
- **Generate summaries** at session end
- **Persist state** across Claude Code sessions
- **Track metrics** for continuous improvement
- **Restore previous** session context automatically
- **Export workflows** for reuse
### Advanced Features (v2.0.0!)
- **🚀 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
- **🔗 GitHub Integration** - Repository-aware swarms
### 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
- GitHub workflow automation
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
7. **GitHub First**: Use GitHub tools for repository management
## 🧠 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:**
### Frontend (from `/frontend`)
```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
npm start # Development server (port 7511)
npm run build # Production build
npm test # React Testing Library tests
npm run lint # ESLint check
npm run lint:fix # ESLint auto-fix
```
**2️⃣ DURING Work (After EVERY Major Step):**
### Full Stack Development
```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
./dev.sh # Start both backend and frontend
./scripts/quickstart.sh # Interactive setup wizard
./scripts/setup.sh # Initial project setup
```
**3️⃣ AFTER Completing Work:**
### Docker
```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
docker-compose up -d # Start all services
docker-compose --profile proxy up -d # Start with Nginx SSL proxy
docker-compose logs -f # View logs
```
### 🎯 AGENT PROMPT TEMPLATE
When spawning agents, ALWAYS include these coordination instructions:
## Architecture
```
You are the [Agent Type] agent in a coordinated swarm.
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`
Your specific task: [detailed task description]
REMEMBER: Coordinate with other agents by checking memory BEFORE making decisions!
Browser (React) → Nginx (optional SSL) → Express API → MinIO CLI (mc) → MinIO Server
```
### ⚡ PARALLEL EXECUTION IS MANDATORY
### Backend (`/backend`)
- **Entry**: `src/app.js`
- **Services**: `src/services/` - Business logic (minio.service.js, auth.service.js, report.service.js)
- **Routes**: `src/api/` - REST endpoints (auth/, buckets/, users/, policies/, reports/)
- **Middleware**: `src/middleware/` - Auth, IP filtering, error handling
- **Config**: `src/config/index.js` - Environment configuration
**THIS IS WRONG ❌ (Sequential - NEVER DO THIS):**
### Frontend (`/frontend`)
- **Entry**: `src/index.tsx``src/App.tsx`
- **Components**: `src/components/` - Feature-based organization (Auth/, Buckets/, Users/, etc.)
- **State**: `src/store/authStore.ts` - Zustand for auth state with persistence
- **API**: `src/services/api.ts` - Axios instance
- **i18n**: `src/i18n.ts` - English and German translations in `src/locales/`
```
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)
### Key Patterns
- Backend uses MinIO CLI (`mc`) commands via child processes, not MinIO SDK
- JWT tokens stored in httpOnly cookies with IP binding
- Frontend proxies to backend at `http://localhost:7510` (see `frontend/package.json` proxy setting)
- Policy files are created temporarily in `backend/temp/` (falls back to OS temp on permission issues)
## Ports
- Backend API: 7510
- Frontend Dev: 7511
- Frontend Prod: 3000
- MinIO: 9000 (default)
## Environment Configuration
The `.env` file (created by `./scripts/setup.sh`) requires:
- `ADMIN_PASSWORD_HASH` - bcrypt hash (12 rounds)
- `JWT_SECRET` - Session signing key
- `DEFAULT_MINIO_ALIAS` - Typically `kopiaminio`
- `MINIO_ENDPOINT`, `MINIO_ACCESS_KEY`, `MINIO_SECRET_KEY`
Generate password hash: `cd backend && npm run hash-password`
## Security Implementation
- Rate limiting: 100 req/15min general, 5 req/15min for auth
- IP whitelist via `ALLOWED_IPS` (CIDR notation supported)
- All operations logged to `logs/` with daily rotation
- CSRF protection with secure cookies
- Helmet.js for HTTP security headers
## Testing
Backend tests use Jest + Supertest. Frontend tests use React Testing Library.
Run a single backend test:
```bash
cd backend && npm test -- --testPathPattern="auth"
```
**THIS IS CORRECT ✅ (Parallel - ALWAYS DO THIS):**
Run frontend tests in watch mode:
```bash
cd frontend && npm test
```
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)
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}"
```
### 🎯 MANDATORY SWARM PATTERN
When given ANY complex task with swarms:
```
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] }
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
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!
```
## Claude Flow v2.0.0 Features
Claude Flow extends the base coordination with:
- **🔗 GitHub Integration** - Deep repository management
- **🎯 Project Templates** - Quick-start for common projects
- **📊 Advanced Analytics** - Detailed performance insights
- **🤖 Custom Agent Types** - Domain-specific coordinators
- **🔄 Workflow Automation** - Reusable task sequences
- **🛡️ Enhanced Security** - Safer command execution
## 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.
+25 -13
View File
@@ -27,26 +27,38 @@ class AuthService {
async verifyPassword(password) {
try {
const hash = config.auth.adminPasswordHash;
// Debug logging in development
if (config.app.env === 'development') {
logger.debug(`Password verification debug:`, {
hashExists: !!hash,
hashLength: hash ? hash.length : 0,
hashPrefix: hash ? hash.substring(0, 7) : 'none',
passwordLength: password.length
});
}
// Debug logging for troubleshooting
logger.debug('Password verification attempt', {
hashExists: !!hash,
hashLength: hash ? hash.length : 0,
hashPrefix: hash ? hash.substring(0, 7) : 'none',
hashValid: hash ? hash.startsWith('$2') : false,
passwordLength: password ? password.length : 0
});
if (!hash) {
logger.error('No admin password hash configured');
return false;
}
// Validate hash format (bcrypt hashes start with $2a$, $2b$, or $2y$)
if (!hash.match(/^\$2[aby]\$\d{2}\$/)) {
logger.error('Invalid bcrypt hash format - hash may be corrupted by environment variable interpolation', {
hashPrefix: hash.substring(0, 20),
expectedFormat: '$2b$12$...'
});
return false;
}
const isValid = await bcrypt.compare(password, hash);
return isValid;
} catch (error) {
logger.error('Password verification error:', error);
logger.error('Password verification error', {
message: error.message,
code: error.code,
stack: error.stack
});
return false;
}
}
+2 -2
View File
@@ -14,8 +14,8 @@ const execAsync = util.promisify(exec);
class MinIOService {
constructor(alias = config.minio.defaultAlias) {
this.alias = alias;
// Use local temp directory by default, fallback to system temp if needed
this.tempDir = path.join(__dirname, '../../temp');
// Use Docker-prepared temp directory first, then fallback options
this.tempDir = process.env.TEMP_DIR || '/tmp/minio-webui-temp';
this.ensureTempDir();
}
+3
View File
@@ -20,8 +20,11 @@ services:
- NODE_ENV=production
- PORT=3000
- JWT_SECRET=${JWT_SECRET}
# IMPORTANT: bcrypt hashes contain $ characters. In your .env file,
# escape each $ as $$ (e.g., $$2b$$12$$... instead of $2b$12$...)
- ADMIN_PASSWORD_HASH=${ADMIN_PASSWORD_HASH}
- SESSION_TIMEOUT=${SESSION_TIMEOUT:-3600}
# Set to 'debug' for troubleshooting authentication issues
- LOG_LEVEL=${LOG_LEVEL:-info}
- REDIS_HOST=redis
- REDIS_PORT=6379