@claude-flow/cli 3.0.0-alpha.2 → 3.0.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +172 -6
- package/bin/cli.js +0 -0
- package/dist/src/commands/agent.d.ts.map +1 -1
- package/dist/src/commands/agent.js +43 -27
- package/dist/src/commands/agent.js.map +1 -1
- package/dist/src/commands/analyze.d.ts +19 -0
- package/dist/src/commands/analyze.d.ts.map +1 -0
- package/dist/src/commands/analyze.js +1823 -0
- package/dist/src/commands/analyze.js.map +1 -0
- package/dist/src/commands/claims.d.ts +10 -0
- package/dist/src/commands/claims.d.ts.map +1 -0
- package/dist/src/commands/claims.js +288 -0
- package/dist/src/commands/claims.js.map +1 -0
- package/dist/src/commands/completions.d.ts +10 -0
- package/dist/src/commands/completions.d.ts.map +1 -0
- package/dist/src/commands/completions.js +539 -0
- package/dist/src/commands/completions.js.map +1 -0
- package/dist/src/commands/config.js +2 -2
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/daemon.d.ts +8 -0
- package/dist/src/commands/daemon.d.ts.map +1 -0
- package/dist/src/commands/daemon.js +545 -0
- package/dist/src/commands/daemon.js.map +1 -0
- package/dist/src/commands/deployment.d.ts +10 -0
- package/dist/src/commands/deployment.d.ts.map +1 -0
- package/dist/src/commands/deployment.js +289 -0
- package/dist/src/commands/deployment.js.map +1 -0
- package/dist/src/commands/doctor.d.ts +10 -0
- package/dist/src/commands/doctor.d.ts.map +1 -0
- package/dist/src/commands/doctor.js +429 -0
- package/dist/src/commands/doctor.js.map +1 -0
- package/dist/src/commands/embeddings.d.ts +18 -0
- package/dist/src/commands/embeddings.d.ts.map +1 -0
- package/dist/src/commands/embeddings.js +616 -0
- package/dist/src/commands/embeddings.js.map +1 -0
- package/dist/src/commands/hive-mind.d.ts.map +1 -1
- package/dist/src/commands/hive-mind.js +252 -35
- package/dist/src/commands/hive-mind.js.map +1 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +326 -2
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/index.d.ts +13 -0
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +52 -1
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/mcp.js +4 -4
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/memory.d.ts.map +1 -1
- package/dist/src/commands/memory.js +236 -170
- package/dist/src/commands/memory.js.map +1 -1
- package/dist/src/commands/migrate.js +1 -1
- package/dist/src/commands/migrate.js.map +1 -1
- package/dist/src/commands/neural.d.ts +10 -0
- package/dist/src/commands/neural.d.ts.map +1 -0
- package/dist/src/commands/neural.js +224 -0
- package/dist/src/commands/neural.js.map +1 -0
- package/dist/src/commands/performance.d.ts +10 -0
- package/dist/src/commands/performance.d.ts.map +1 -0
- package/dist/src/commands/performance.js +262 -0
- package/dist/src/commands/performance.js.map +1 -0
- package/dist/src/commands/plugins.d.ts +10 -0
- package/dist/src/commands/plugins.d.ts.map +1 -0
- package/dist/src/commands/plugins.js +280 -0
- package/dist/src/commands/plugins.js.map +1 -0
- package/dist/src/commands/process.d.ts.map +1 -1
- package/dist/src/commands/process.js +95 -20
- package/dist/src/commands/process.js.map +1 -1
- package/dist/src/commands/providers.d.ts +10 -0
- package/dist/src/commands/providers.d.ts.map +1 -0
- package/dist/src/commands/providers.js +232 -0
- package/dist/src/commands/providers.js.map +1 -0
- package/dist/src/commands/route.d.ts +16 -0
- package/dist/src/commands/route.d.ts.map +1 -0
- package/dist/src/commands/route.js +603 -0
- package/dist/src/commands/route.js.map +1 -0
- package/dist/src/commands/security.d.ts +10 -0
- package/dist/src/commands/security.d.ts.map +1 -0
- package/dist/src/commands/security.js +261 -0
- package/dist/src/commands/security.js.map +1 -0
- package/dist/src/commands/start.js +2 -2
- package/dist/src/commands/start.js.map +1 -1
- package/dist/src/commands/status.d.ts.map +1 -1
- package/dist/src/commands/status.js +26 -2
- package/dist/src/commands/status.js.map +1 -1
- package/dist/src/commands/swarm.js +6 -6
- package/dist/src/commands/swarm.js.map +1 -1
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +63 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/init/claudemd-generator.d.ts.map +1 -1
- package/dist/src/init/claudemd-generator.js +218 -362
- package/dist/src/init/claudemd-generator.js.map +1 -1
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +5 -0
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/settings-generator.d.ts.map +1 -1
- package/dist/src/init/settings-generator.js +22 -12
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/mcp-client.d.ts.map +1 -1
- package/dist/src/mcp-client.js +17 -1
- package/dist/src/mcp-client.js.map +1 -1
- package/dist/src/mcp-server.d.ts.map +1 -1
- package/dist/src/mcp-server.js +5 -0
- package/dist/src/mcp-server.js.map +1 -1
- package/dist/src/mcp-tools/agent-tools.d.ts +1 -1
- package/dist/src/mcp-tools/agent-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/agent-tools.js +350 -14
- package/dist/src/mcp-tools/agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/analyze-tools.d.ts +38 -0
- package/dist/src/mcp-tools/analyze-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/analyze-tools.js +317 -0
- package/dist/src/mcp-tools/analyze-tools.js.map +1 -0
- package/dist/src/mcp-tools/config-tools.d.ts +1 -1
- package/dist/src/mcp-tools/config-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/config-tools.js +262 -15
- package/dist/src/mcp-tools/config-tools.js.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.d.ts +8 -0
- package/dist/src/mcp-tools/hive-mind-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/hive-mind-tools.js +447 -0
- package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -0
- package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.js +80 -15
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/mcp-tools/index.d.ts +6 -0
- package/dist/src/mcp-tools/index.d.ts.map +1 -1
- package/dist/src/mcp-tools/index.js +6 -0
- package/dist/src/mcp-tools/index.js.map +1 -1
- package/dist/src/mcp-tools/memory-tools.d.ts +1 -1
- package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/memory-tools.js +157 -9
- package/dist/src/mcp-tools/memory-tools.js.map +1 -1
- package/dist/src/mcp-tools/session-tools.d.ts +8 -0
- package/dist/src/mcp-tools/session-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/session-tools.js +315 -0
- package/dist/src/mcp-tools/session-tools.js.map +1 -0
- package/dist/src/mcp-tools/swarm-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/swarm-tools.js +37 -2
- package/dist/src/mcp-tools/swarm-tools.js.map +1 -1
- package/dist/src/mcp-tools/task-tools.d.ts +8 -0
- package/dist/src/mcp-tools/task-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/task-tools.js +302 -0
- package/dist/src/mcp-tools/task-tools.js.map +1 -0
- package/dist/src/mcp-tools/workflow-tools.d.ts +8 -0
- package/dist/src/mcp-tools/workflow-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/workflow-tools.js +481 -0
- package/dist/src/mcp-tools/workflow-tools.js.map +1 -0
- package/dist/src/output.d.ts +16 -0
- package/dist/src/output.d.ts.map +1 -1
- package/dist/src/output.js +42 -0
- package/dist/src/output.js.map +1 -1
- package/dist/src/ruvector/ast-analyzer.d.ts +67 -0
- package/dist/src/ruvector/ast-analyzer.d.ts.map +1 -0
- package/dist/src/ruvector/ast-analyzer.js +277 -0
- package/dist/src/ruvector/ast-analyzer.js.map +1 -0
- package/dist/src/ruvector/coverage-router.d.ts +145 -0
- package/dist/src/ruvector/coverage-router.d.ts.map +1 -0
- package/dist/src/ruvector/coverage-router.js +451 -0
- package/dist/src/ruvector/coverage-router.js.map +1 -0
- package/dist/src/ruvector/coverage-tools.d.ts +33 -0
- package/dist/src/ruvector/coverage-tools.d.ts.map +1 -0
- package/dist/src/ruvector/coverage-tools.js +157 -0
- package/dist/src/ruvector/coverage-tools.js.map +1 -0
- package/dist/src/ruvector/diff-classifier.d.ts +175 -0
- package/dist/src/ruvector/diff-classifier.d.ts.map +1 -0
- package/dist/src/ruvector/diff-classifier.js +662 -0
- package/dist/src/ruvector/diff-classifier.js.map +1 -0
- package/dist/src/ruvector/graph-analyzer.d.ts +174 -0
- package/dist/src/ruvector/graph-analyzer.d.ts.map +1 -0
- package/dist/src/ruvector/graph-analyzer.js +878 -0
- package/dist/src/ruvector/graph-analyzer.js.map +1 -0
- package/dist/src/ruvector/index.d.ts +27 -0
- package/dist/src/ruvector/index.d.ts.map +1 -0
- package/dist/src/ruvector/index.js +49 -0
- package/dist/src/ruvector/index.js.map +1 -0
- package/dist/src/ruvector/q-learning-router.d.ts +211 -0
- package/dist/src/ruvector/q-learning-router.d.ts.map +1 -0
- package/dist/src/ruvector/q-learning-router.js +681 -0
- package/dist/src/ruvector/q-learning-router.js.map +1 -0
- package/dist/src/ruvector/vector-db.d.ts +69 -0
- package/dist/src/ruvector/vector-db.d.ts.map +1 -0
- package/dist/src/ruvector/vector-db.js +243 -0
- package/dist/src/ruvector/vector-db.js.map +1 -0
- package/dist/src/services/index.d.ts +7 -0
- package/dist/src/services/index.d.ts.map +1 -0
- package/dist/src/services/index.js +6 -0
- package/dist/src/services/index.js.map +1 -0
- package/dist/src/services/worker-daemon.d.ts +153 -0
- package/dist/src/services/worker-daemon.d.ts.map +1 -0
- package/dist/src/services/worker-daemon.js +567 -0
- package/dist/src/services/worker-daemon.js.map +1 -0
- package/dist/src/suggest.d.ts +53 -0
- package/dist/src/suggest.d.ts.map +1 -0
- package/dist/src/suggest.js +200 -0
- package/dist/src/suggest.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +28 -6
- package/.agentic-flow/intelligence.json +0 -16
- package/.claude-flow/metrics/agent-metrics.json +0 -1
- package/.claude-flow/metrics/performance.json +0 -87
- package/.claude-flow/metrics/task-metrics.json +0 -10
- package/__tests__/README.md +0 -140
- package/__tests__/TEST_SUMMARY.md +0 -144
- package/__tests__/cli.test.ts +0 -558
- package/__tests__/commands.test.ts +0 -726
- package/__tests__/config-adapter.test.ts +0 -362
- package/__tests__/config-loading.test.ts +0 -106
- package/__tests__/coverage/.tmp/coverage-0.json +0 -1
- package/__tests__/coverage/.tmp/coverage-1.json +0 -1
- package/__tests__/coverage/.tmp/coverage-2.json +0 -1
- package/__tests__/coverage/.tmp/coverage-3.json +0 -1
- package/__tests__/coverage/.tmp/coverage-4.json +0 -1
- package/__tests__/coverage/.tmp/coverage-5.json +0 -1
- package/__tests__/mcp-client.test.ts +0 -480
- package/__tests__/p1-commands.test.ts +0 -1064
- package/docs/CONFIG_LOADING.md +0 -236
- package/docs/IMPLEMENTATION_COMPLETE.md +0 -421
- package/docs/MCP_CLIENT_GUIDE.md +0 -620
- package/docs/REFACTORING_SUMMARY.md +0 -247
- package/src/commands/agent.ts +0 -941
- package/src/commands/config.ts +0 -452
- package/src/commands/hive-mind.ts +0 -762
- package/src/commands/hooks.ts +0 -2603
- package/src/commands/index.ts +0 -115
- package/src/commands/init.ts +0 -597
- package/src/commands/mcp.ts +0 -753
- package/src/commands/memory.ts +0 -1063
- package/src/commands/migrate.ts +0 -447
- package/src/commands/process.ts +0 -617
- package/src/commands/session.ts +0 -891
- package/src/commands/start.ts +0 -457
- package/src/commands/status.ts +0 -705
- package/src/commands/swarm.ts +0 -648
- package/src/commands/task.ts +0 -792
- package/src/commands/workflow.ts +0 -742
- package/src/config-adapter.ts +0 -210
- package/src/index.ts +0 -383
- package/src/infrastructure/in-memory-repositories.ts +0 -310
- package/src/init/claudemd-generator.ts +0 -631
- package/src/init/executor.ts +0 -756
- package/src/init/helpers-generator.ts +0 -628
- package/src/init/index.ts +0 -60
- package/src/init/mcp-generator.ts +0 -83
- package/src/init/settings-generator.ts +0 -274
- package/src/init/statusline-generator.ts +0 -211
- package/src/init/types.ts +0 -447
- package/src/mcp-client.ts +0 -227
- package/src/mcp-server.ts +0 -571
- package/src/mcp-tools/agent-tools.ts +0 -92
- package/src/mcp-tools/config-tools.ts +0 -88
- package/src/mcp-tools/hooks-tools.ts +0 -1819
- package/src/mcp-tools/index.ts +0 -12
- package/src/mcp-tools/memory-tools.ts +0 -89
- package/src/mcp-tools/swarm-tools.ts +0 -69
- package/src/mcp-tools/types.ts +0 -33
- package/src/output.ts +0 -593
- package/src/parser.ts +0 -417
- package/src/prompt.ts +0 -619
- package/src/types.ts +0 -287
- package/tmp.json +0 -0
- package/tsconfig.json +0 -16
- package/tsconfig.tsbuildinfo +0 -1
- package/vitest.config.ts +0 -13
|
@@ -9,7 +9,7 @@ export function generateClaudeMd(options) {
|
|
|
9
9
|
const topology = options.runtime.topology;
|
|
10
10
|
const maxAgents = options.runtime.maxAgents;
|
|
11
11
|
const memoryBackend = options.runtime.memoryBackend;
|
|
12
|
-
return `# Claude Code Configuration -
|
|
12
|
+
return `# Claude Code Configuration - Claude Flow V3
|
|
13
13
|
|
|
14
14
|
## 🚨 AUTOMATIC SWARM ORCHESTRATION
|
|
15
15
|
|
|
@@ -70,15 +70,14 @@ mcp__claude-flow__memory_usage({
|
|
|
70
70
|
|
|
71
71
|
### 📋 Agent Routing by Task Type
|
|
72
72
|
|
|
73
|
-
**Automatically select agents based on task:**
|
|
74
|
-
|
|
75
73
|
| Task Type | Required Agents | Topology |
|
|
76
74
|
|-----------|-----------------|----------|
|
|
77
75
|
| Bug Fix | researcher, coder, tester | mesh |
|
|
78
76
|
| New Feature | coordinator, architect, coder, tester, reviewer | hierarchical |
|
|
79
77
|
| Refactoring | architect, coder, reviewer | mesh |
|
|
80
|
-
| Performance | researcher,
|
|
81
|
-
| Security Audit | security-
|
|
78
|
+
| Performance | researcher, performance-engineer, coder | hierarchical |
|
|
79
|
+
| Security Audit | security-architect, security-auditor, reviewer | hierarchical |
|
|
80
|
+
| Memory Optimization | memory-specialist, performance-engineer | mesh |
|
|
82
81
|
| Documentation | researcher, api-docs | mesh |
|
|
83
82
|
|
|
84
83
|
### 🎯 Task Complexity Detection
|
|
@@ -99,36 +98,6 @@ mcp__claude-flow__memory_usage({
|
|
|
99
98
|
- Configuration changes
|
|
100
99
|
- Quick questions/exploration
|
|
101
100
|
|
|
102
|
-
### 🔧 Settings Configuration
|
|
103
|
-
|
|
104
|
-
The following settings are auto-configured in \`.claude/settings.json\`:
|
|
105
|
-
|
|
106
|
-
\`\`\`json
|
|
107
|
-
{
|
|
108
|
-
"hooks": {
|
|
109
|
-
"PreToolUse": [{
|
|
110
|
-
"matcher": "Task",
|
|
111
|
-
"commands": ["npx claude-flow@v3alpha hooks pre-task --tool Task"]
|
|
112
|
-
}],
|
|
113
|
-
"PostToolUse": [{
|
|
114
|
-
"matcher": "Task",
|
|
115
|
-
"commands": ["npx claude-flow@v3alpha hooks post-task --tool Task"]
|
|
116
|
-
}],
|
|
117
|
-
"UserPromptSubmit": [{
|
|
118
|
-
"matcher": ".*",
|
|
119
|
-
"commands": ["npx claude-flow@v3alpha hooks route-task"]
|
|
120
|
-
}]
|
|
121
|
-
},
|
|
122
|
-
"permissions": {
|
|
123
|
-
"allow": [
|
|
124
|
-
"Bash(npx claude-flow:*)",
|
|
125
|
-
"mcp__claude-flow__*",
|
|
126
|
-
"mcp__ruv-swarm__*"
|
|
127
|
-
]
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
\`\`\`
|
|
131
|
-
|
|
132
101
|
## 🚨 CRITICAL: CONCURRENT EXECUTION & FILE MANAGEMENT
|
|
133
102
|
|
|
134
103
|
**ABSOLUTE RULES**:
|
|
@@ -146,24 +115,6 @@ The following settings are auto-configured in \`.claude/settings.json\`:
|
|
|
146
115
|
- **Bash commands**: ALWAYS batch ALL terminal operations in ONE message
|
|
147
116
|
- **Memory operations**: ALWAYS batch ALL memory store/retrieve in ONE message
|
|
148
117
|
|
|
149
|
-
### 🎯 CRITICAL: Claude Code Task Tool for Agent Execution
|
|
150
|
-
|
|
151
|
-
**Claude Code's Task tool is the PRIMARY way to spawn agents:**
|
|
152
|
-
\`\`\`javascript
|
|
153
|
-
// ✅ CORRECT: Use Claude Code's Task tool for parallel agent execution
|
|
154
|
-
[Single Message]:
|
|
155
|
-
Task("Research agent", "Analyze requirements and patterns...", "researcher")
|
|
156
|
-
Task("Coder agent", "Implement core features...", "coder")
|
|
157
|
-
Task("Tester agent", "Create comprehensive tests...", "tester")
|
|
158
|
-
Task("Reviewer agent", "Review code quality...", "reviewer")
|
|
159
|
-
Task("Architect agent", "Design system architecture...", "system-architect")
|
|
160
|
-
\`\`\`
|
|
161
|
-
|
|
162
|
-
**MCP tools are ONLY for coordination setup:**
|
|
163
|
-
- \`mcp__claude-flow__swarm_init\` - Initialize coordination topology
|
|
164
|
-
- \`mcp__claude-flow__agent_spawn\` - Define agent types for coordination
|
|
165
|
-
- \`mcp__claude-flow__task_orchestrate\` - Orchestrate high-level workflows
|
|
166
|
-
|
|
167
118
|
### 📁 File Organization Rules
|
|
168
119
|
|
|
169
120
|
**NEVER save to root folder. Use these directories:**
|
|
@@ -180,30 +131,81 @@ This project is configured with Claude Flow V3:
|
|
|
180
131
|
- **Topology**: ${topology}
|
|
181
132
|
- **Max Agents**: ${maxAgents}
|
|
182
133
|
- **Memory Backend**: ${memoryBackend}
|
|
183
|
-
- **HNSW Indexing**: ${options.runtime.enableHNSW ? 'Enabled' : 'Disabled'}
|
|
184
|
-
- **Neural Learning**: ${options.runtime.enableNeural ? 'Enabled' : 'Disabled'}
|
|
134
|
+
- **HNSW Indexing**: ${options.runtime.enableHNSW ? 'Enabled (150x-12,500x faster)' : 'Disabled'}
|
|
135
|
+
- **Neural Learning**: ${options.runtime.enableNeural ? 'Enabled (SONA)' : 'Disabled'}
|
|
136
|
+
|
|
137
|
+
## 🚀 V3 CLI Commands (26 Commands, 140+ Subcommands)
|
|
138
|
+
|
|
139
|
+
### Core Commands
|
|
140
|
+
|
|
141
|
+
| Command | Subcommands | Description |
|
|
142
|
+
|---------|-------------|-------------|
|
|
143
|
+
| \`init\` | 4 | Project initialization with wizard, presets, skills, hooks |
|
|
144
|
+
| \`agent\` | 8 | Agent lifecycle (spawn, list, status, stop, metrics, pool, health, logs) |
|
|
145
|
+
| \`swarm\` | 6 | Multi-agent swarm coordination and orchestration |
|
|
146
|
+
| \`memory\` | 11 | AgentDB memory with vector search (150x-12,500x faster) |
|
|
147
|
+
| \`mcp\` | 9 | MCP server management and tool execution |
|
|
148
|
+
| \`task\` | 6 | Task creation, assignment, and lifecycle |
|
|
149
|
+
| \`session\` | 7 | Session state management and persistence |
|
|
150
|
+
| \`config\` | 7 | Configuration management and provider setup |
|
|
151
|
+
| \`status\` | 3 | System status monitoring with watch mode |
|
|
152
|
+
| \`workflow\` | 6 | Workflow execution and template management |
|
|
153
|
+
| \`hooks\` | 17 | Self-learning hooks + 12 background workers |
|
|
154
|
+
| \`hive-mind\` | 6 | Queen-led Byzantine fault-tolerant consensus |
|
|
155
|
+
|
|
156
|
+
### Advanced Commands
|
|
157
|
+
|
|
158
|
+
| Command | Subcommands | Description |
|
|
159
|
+
|---------|-------------|-------------|
|
|
160
|
+
| \`daemon\` | 5 | Background worker daemon (start, stop, status, trigger, enable) |
|
|
161
|
+
| \`neural\` | 5 | Neural pattern training (train, status, patterns, predict, optimize) |
|
|
162
|
+
| \`security\` | 6 | Security scanning (scan, audit, cve, threats, validate, report) |
|
|
163
|
+
| \`performance\` | 5 | Performance profiling (benchmark, profile, metrics, optimize, report) |
|
|
164
|
+
| \`providers\` | 5 | AI providers (list, add, remove, test, configure) |
|
|
165
|
+
| \`plugins\` | 5 | Plugin management (list, install, uninstall, enable, disable) |
|
|
166
|
+
| \`deployment\` | 5 | Deployment management (deploy, rollback, status, environments, release) |
|
|
167
|
+
| \`embeddings\` | 4 | Vector embeddings (embed, batch, search, init) - 75x faster with agentic-flow |
|
|
168
|
+
| \`claims\` | 4 | Claims-based authorization (check, grant, revoke, list) |
|
|
169
|
+
| \`migrate\` | 5 | V2 to V3 migration with rollback support |
|
|
170
|
+
| \`doctor\` | 1 | System diagnostics with health checks |
|
|
171
|
+
| \`completions\` | 4 | Shell completions (bash, zsh, fish, powershell) |
|
|
172
|
+
|
|
173
|
+
### Quick CLI Examples
|
|
185
174
|
|
|
186
|
-
|
|
175
|
+
\`\`\`bash
|
|
176
|
+
# Initialize project
|
|
177
|
+
npx claude-flow@v3alpha init --wizard
|
|
178
|
+
|
|
179
|
+
# Start daemon with background workers
|
|
180
|
+
npx claude-flow@v3alpha daemon start
|
|
181
|
+
|
|
182
|
+
# Spawn an agent
|
|
183
|
+
npx claude-flow@v3alpha agent spawn -t coder --name my-coder
|
|
187
184
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
3. **Architecture** - System design (\`sparc run architect\`)
|
|
191
|
-
4. **Refinement** - TDD implementation (\`sparc tdd\`)
|
|
192
|
-
5. **Completion** - Integration (\`sparc run integration\`)
|
|
185
|
+
# Initialize swarm
|
|
186
|
+
npx claude-flow@v3alpha swarm init --v3-mode
|
|
193
187
|
|
|
194
|
-
|
|
188
|
+
# Search memory (HNSW-indexed)
|
|
189
|
+
npx claude-flow@v3alpha memory search -q "authentication patterns"
|
|
195
190
|
|
|
196
|
-
|
|
197
|
-
-
|
|
198
|
-
- **Test-First**: Write tests before implementation
|
|
199
|
-
- **Clean Architecture**: Separate concerns
|
|
200
|
-
- **Documentation**: Keep updated
|
|
191
|
+
# System diagnostics
|
|
192
|
+
npx claude-flow@v3alpha doctor --fix
|
|
201
193
|
|
|
202
|
-
|
|
194
|
+
# Security scan
|
|
195
|
+
npx claude-flow@v3alpha security scan --depth full
|
|
196
|
+
|
|
197
|
+
# Performance benchmark
|
|
198
|
+
npx claude-flow@v3alpha performance benchmark --suite all
|
|
199
|
+
\`\`\`
|
|
200
|
+
|
|
201
|
+
## 🚀 Available Agents (60+ Types)
|
|
203
202
|
|
|
204
203
|
### Core Development
|
|
205
204
|
\`coder\`, \`reviewer\`, \`tester\`, \`planner\`, \`researcher\`
|
|
206
205
|
|
|
206
|
+
### V3 Specialized Agents
|
|
207
|
+
\`security-architect\`, \`security-auditor\`, \`memory-specialist\`, \`performance-engineer\`
|
|
208
|
+
|
|
207
209
|
### Swarm Coordination
|
|
208
210
|
\`hierarchical-coordinator\`, \`mesh-coordinator\`, \`adaptive-coordinator\`, \`collective-intelligence-coordinator\`, \`swarm-memory-manager\`
|
|
209
211
|
|
|
@@ -225,277 +227,67 @@ This project is configured with Claude Flow V3:
|
|
|
225
227
|
### Testing & Validation
|
|
226
228
|
\`tdd-london-swarm\`, \`production-validator\`
|
|
227
229
|
|
|
228
|
-
##
|
|
229
|
-
|
|
230
|
-
### Claude Code Handles ALL EXECUTION:
|
|
231
|
-
- **Task tool**: Spawn and run agents concurrently for actual work
|
|
232
|
-
- File operations (Read, Write, Edit, MultiEdit, Glob, Grep)
|
|
233
|
-
- Code generation and programming
|
|
234
|
-
- Bash commands and system operations
|
|
235
|
-
- Implementation work
|
|
236
|
-
- Project navigation and analysis
|
|
237
|
-
- TodoWrite and task management
|
|
238
|
-
- Git operations
|
|
239
|
-
- Package management
|
|
240
|
-
- Testing and debugging
|
|
241
|
-
|
|
242
|
-
### MCP Tools ONLY COORDINATE:
|
|
243
|
-
- Swarm initialization (topology setup)
|
|
244
|
-
- Agent type definitions (coordination patterns)
|
|
245
|
-
- Task orchestration (high-level planning)
|
|
246
|
-
- Memory management
|
|
247
|
-
- Neural features
|
|
248
|
-
- Performance tracking
|
|
249
|
-
- GitHub integration
|
|
250
|
-
|
|
251
|
-
**KEY**: MCP coordinates the strategy, Claude Code's Task tool executes with real agents.
|
|
252
|
-
|
|
253
|
-
## 🚀 Quick Setup
|
|
254
|
-
|
|
255
|
-
\`\`\`bash
|
|
256
|
-
# Add MCP servers (Claude Flow required, others optional)
|
|
257
|
-
claude mcp add claude-flow npx claude-flow@v3alpha mcp start
|
|
258
|
-
claude mcp add ruv-swarm npx ruv-swarm mcp start # Optional: Enhanced coordination
|
|
259
|
-
claude mcp add flow-nexus npx flow-nexus@latest mcp start # Optional: Cloud features
|
|
260
|
-
\`\`\`
|
|
261
|
-
|
|
262
|
-
## MCP Tool Categories
|
|
263
|
-
|
|
264
|
-
### Coordination
|
|
265
|
-
\`swarm_init\`, \`agent_spawn\`, \`task_orchestrate\`
|
|
266
|
-
|
|
267
|
-
### Monitoring
|
|
268
|
-
\`swarm_status\`, \`agent_list\`, \`agent_metrics\`, \`task_status\`, \`task_results\`
|
|
269
|
-
|
|
270
|
-
### Memory & Neural
|
|
271
|
-
\`memory_usage\`, \`neural_status\`, \`neural_train\`, \`neural_patterns\`
|
|
272
|
-
|
|
273
|
-
### GitHub Integration
|
|
274
|
-
\`github_swarm\`, \`repo_analyze\`, \`pr_enhance\`, \`issue_triage\`, \`code_review\`
|
|
275
|
-
|
|
276
|
-
### System
|
|
277
|
-
\`benchmark_run\`, \`features_detect\`, \`swarm_monitor\`
|
|
278
|
-
|
|
279
|
-
## 🚀 Agent Execution Flow with Claude Code
|
|
280
|
-
|
|
281
|
-
### The Correct Pattern:
|
|
282
|
-
|
|
283
|
-
1. **Optional**: Use MCP tools to set up coordination topology
|
|
284
|
-
2. **REQUIRED**: Use Claude Code's Task tool to spawn agents that do actual work
|
|
285
|
-
3. **REQUIRED**: Each agent runs hooks for coordination
|
|
286
|
-
4. **REQUIRED**: Batch all operations in single messages
|
|
287
|
-
|
|
288
|
-
### Example Full-Stack Development:
|
|
289
|
-
|
|
290
|
-
\`\`\`javascript
|
|
291
|
-
// Single message with all agent spawning via Claude Code's Task tool
|
|
292
|
-
[Parallel Agent Execution]:
|
|
293
|
-
Task("Backend Developer", "Build REST API with Express. Use hooks for coordination.", "backend-dev")
|
|
294
|
-
Task("Frontend Developer", "Create React UI. Coordinate with backend via memory.", "coder")
|
|
295
|
-
Task("Database Architect", "Design PostgreSQL schema. Store schema in memory.", "code-analyzer")
|
|
296
|
-
Task("Test Engineer", "Write Jest tests. Check memory for API contracts.", "tester")
|
|
297
|
-
Task("DevOps Engineer", "Setup Docker and CI/CD. Document in memory.", "cicd-engineer")
|
|
298
|
-
Task("Security Auditor", "Review authentication. Report findings via hooks.", "reviewer")
|
|
299
|
-
|
|
300
|
-
// All todos batched together
|
|
301
|
-
TodoWrite { todos: [...8-10 todos...] }
|
|
302
|
-
|
|
303
|
-
// All file operations together
|
|
304
|
-
Write "backend/server.js"
|
|
305
|
-
Write "frontend/App.jsx"
|
|
306
|
-
Write "database/schema.sql"
|
|
307
|
-
\`\`\`
|
|
308
|
-
|
|
309
|
-
## 📋 Agent Coordination Protocol
|
|
310
|
-
|
|
311
|
-
### Every Agent Spawned via Task Tool MUST:
|
|
312
|
-
|
|
313
|
-
**1️⃣ BEFORE Work:**
|
|
314
|
-
\`\`\`bash
|
|
315
|
-
npx claude-flow@v3alpha hooks pre-task --description "[task]"
|
|
316
|
-
npx claude-flow@v3alpha hooks session-restore --session-id "swarm-[id]"
|
|
317
|
-
\`\`\`
|
|
318
|
-
|
|
319
|
-
**2️⃣ DURING Work:**
|
|
320
|
-
\`\`\`bash
|
|
321
|
-
npx claude-flow@v3alpha hooks post-edit --file "[file]" --memory-key "swarm/[agent]/[step]"
|
|
322
|
-
npx claude-flow@v3alpha hooks notify --message "[what was done]"
|
|
323
|
-
\`\`\`
|
|
324
|
-
|
|
325
|
-
**3️⃣ AFTER Work:**
|
|
326
|
-
\`\`\`bash
|
|
327
|
-
npx claude-flow@v3alpha hooks post-task --task-id "[task]"
|
|
328
|
-
npx claude-flow@v3alpha hooks session-end --export-metrics true
|
|
329
|
-
\`\`\`
|
|
330
|
-
|
|
331
|
-
## 🚀 Swarm Lifecycle Management
|
|
332
|
-
|
|
333
|
-
### Session Start (AUTOMATIC)
|
|
334
|
-
When beginning ANY development task, Claude Code should:
|
|
335
|
-
|
|
336
|
-
\`\`\`javascript
|
|
337
|
-
// 1. Check for existing swarm session
|
|
338
|
-
mcp__claude-flow__swarm_status({})
|
|
339
|
-
|
|
340
|
-
// 2. If no active swarm, initialize one
|
|
341
|
-
mcp__claude-flow__swarm_init({ topology: "${topology}", maxAgents: ${maxAgents} })
|
|
342
|
-
|
|
343
|
-
// 3. Restore previous context if available
|
|
344
|
-
mcp__claude-flow__memory_usage({ action: "retrieve", namespace: "swarm", key: "last-session" })
|
|
345
|
-
\`\`\`
|
|
346
|
-
|
|
347
|
-
### Task Execution (AUTOMATIC)
|
|
348
|
-
For each significant task:
|
|
349
|
-
|
|
350
|
-
\`\`\`javascript
|
|
351
|
-
// 1. Create task orchestration
|
|
352
|
-
mcp__claude-flow__task_orchestrate({
|
|
353
|
-
task: "[task description]",
|
|
354
|
-
priority: "high",
|
|
355
|
-
strategy: "adaptive"
|
|
356
|
-
})
|
|
357
|
-
|
|
358
|
-
// 2. Spawn appropriate agents via Task tool (PARALLEL)
|
|
359
|
-
Task("Agent1", "...", "agent-type")
|
|
360
|
-
Task("Agent2", "...", "agent-type")
|
|
361
|
-
Task("Agent3", "...", "agent-type")
|
|
362
|
-
|
|
363
|
-
// 3. Monitor progress via MCP
|
|
364
|
-
mcp__claude-flow__swarm_status({ includeAgents: true, includeMetrics: true })
|
|
365
|
-
\`\`\`
|
|
366
|
-
|
|
367
|
-
### Session End (AUTOMATIC)
|
|
368
|
-
When task completes or user ends session:
|
|
369
|
-
|
|
370
|
-
\`\`\`javascript
|
|
371
|
-
// 1. Save session state
|
|
372
|
-
mcp__claude-flow__memory_usage({
|
|
373
|
-
action: "store",
|
|
374
|
-
namespace: "swarm",
|
|
375
|
-
key: "last-session",
|
|
376
|
-
value: JSON.stringify({ completedAt: new Date().toISOString(), summary: "..." })
|
|
377
|
-
})
|
|
378
|
-
|
|
379
|
-
// 2. Export metrics if enabled
|
|
380
|
-
mcp__claude-flow__agent_metrics({})
|
|
381
|
-
|
|
382
|
-
// 3. Graceful shutdown (only if explicitly requested)
|
|
383
|
-
// mcp__claude-flow__swarm_destroy({ swarmId: "..." })
|
|
384
|
-
\`\`\`
|
|
385
|
-
|
|
386
|
-
## 🎯 Concurrent Execution Examples
|
|
387
|
-
|
|
388
|
-
### ✅ CORRECT WORKFLOW: MCP Coordinates, Claude Code Executes
|
|
389
|
-
|
|
390
|
-
\`\`\`javascript
|
|
391
|
-
// Step 1: MCP tools set up coordination (optional, for complex tasks)
|
|
392
|
-
[Single Message - Coordination Setup]:
|
|
393
|
-
mcp__claude-flow__swarm_init { topology: "${topology}", maxAgents: ${maxAgents} }
|
|
394
|
-
mcp__claude-flow__agent_spawn { type: "researcher" }
|
|
395
|
-
mcp__claude-flow__agent_spawn { type: "coder" }
|
|
396
|
-
mcp__claude-flow__agent_spawn { type: "tester" }
|
|
397
|
-
|
|
398
|
-
// Step 2: Claude Code Task tool spawns ACTUAL agents that do the work
|
|
399
|
-
[Single Message - Parallel Agent Execution]:
|
|
400
|
-
// Claude Code's Task tool spawns real agents concurrently
|
|
401
|
-
Task("Research agent", "Analyze API requirements and best practices. Check memory for prior decisions.", "researcher")
|
|
402
|
-
Task("Coder agent", "Implement REST endpoints with authentication. Coordinate via hooks.", "coder")
|
|
403
|
-
Task("Database agent", "Design and implement database schema. Store decisions in memory.", "code-analyzer")
|
|
404
|
-
Task("Tester agent", "Create comprehensive test suite with 90% coverage.", "tester")
|
|
405
|
-
Task("Reviewer agent", "Review code quality and security. Document findings.", "reviewer")
|
|
406
|
-
|
|
407
|
-
// Batch ALL todos in ONE call
|
|
408
|
-
TodoWrite { todos: [
|
|
409
|
-
{id: "1", content: "Research API patterns", status: "in_progress", priority: "high"},
|
|
410
|
-
{id: "2", content: "Design database schema", status: "in_progress", priority: "high"},
|
|
411
|
-
{id: "3", content: "Implement authentication", status: "pending", priority: "high"},
|
|
412
|
-
{id: "4", content: "Build REST endpoints", status: "pending", priority: "high"},
|
|
413
|
-
{id: "5", content: "Write unit tests", status: "pending", priority: "medium"},
|
|
414
|
-
{id: "6", content: "Integration tests", status: "pending", priority: "medium"},
|
|
415
|
-
{id: "7", content: "API documentation", status: "pending", priority: "low"},
|
|
416
|
-
{id: "8", content: "Performance optimization", status: "pending", priority: "low"}
|
|
417
|
-
]}
|
|
418
|
-
|
|
419
|
-
// Parallel file operations
|
|
420
|
-
Bash "mkdir -p app/{src,tests,docs,config}"
|
|
421
|
-
Write "app/package.json"
|
|
422
|
-
Write "app/src/server.js"
|
|
423
|
-
Write "app/tests/server.test.js"
|
|
424
|
-
Write "app/docs/API.md"
|
|
425
|
-
\`\`\`
|
|
426
|
-
|
|
427
|
-
### ❌ WRONG (Multiple Messages):
|
|
428
|
-
\`\`\`javascript
|
|
429
|
-
Message 1: mcp__claude-flow__swarm_init
|
|
430
|
-
Message 2: Task("agent 1")
|
|
431
|
-
Message 3: TodoWrite { todos: [single todo] }
|
|
432
|
-
Message 4: Write "file.js"
|
|
433
|
-
// This breaks parallel coordination!
|
|
434
|
-
\`\`\`
|
|
435
|
-
|
|
436
|
-
## V3 Performance Targets
|
|
437
|
-
|
|
438
|
-
- **2.49x-7.47x** Flash Attention speedup
|
|
439
|
-
- **150x-12,500x** search improvements with HNSW
|
|
440
|
-
- **50-75%** memory reduction with quantization
|
|
441
|
-
- **Sub-100ms** MCP response times
|
|
442
|
-
|
|
443
|
-
## 🪝 V3 Hooks System (26 Hooks)
|
|
444
|
-
|
|
445
|
-
Claude Flow V3 provides 26 hooks for comprehensive agent coordination and self-learning.
|
|
230
|
+
## 🪝 V3 Hooks System (17 Hooks + 12 Workers)
|
|
446
231
|
|
|
447
232
|
### Hook Categories
|
|
448
233
|
|
|
449
234
|
| Category | Hooks | Purpose |
|
|
450
235
|
|----------|-------|---------|
|
|
451
236
|
| **Core** | \`pre-edit\`, \`post-edit\`, \`pre-command\`, \`post-command\`, \`pre-task\`, \`post-task\` | Tool lifecycle |
|
|
452
|
-
| **Routing** | \`route\`, \`metrics\`, \`list\` | Task analysis |
|
|
453
|
-
| **Intelligence** | \`explain\`, \`pretrain\`, \`build-agents\`, \`transfer\`, \`init\` | Neural learning |
|
|
454
237
|
| **Session** | \`session-start\`, \`session-end\`, \`session-restore\`, \`notify\` | Context management |
|
|
455
|
-
| **
|
|
456
|
-
| **
|
|
238
|
+
| **Intelligence** | \`route\`, \`explain\`, \`pretrain\`, \`build-agents\`, \`transfer\` | Neural learning |
|
|
239
|
+
| **Learning** | \`intelligence\` (trajectory-start/step/end, pattern-store/search, stats, attention) | Reinforcement |
|
|
240
|
+
|
|
241
|
+
### 12 Background Workers
|
|
242
|
+
|
|
243
|
+
| Worker | Priority | Description |
|
|
244
|
+
|--------|----------|-------------|
|
|
245
|
+
| \`ultralearn\` | normal | Deep knowledge acquisition |
|
|
246
|
+
| \`optimize\` | high | Performance optimization |
|
|
247
|
+
| \`consolidate\` | low | Memory consolidation |
|
|
248
|
+
| \`predict\` | normal | Predictive preloading |
|
|
249
|
+
| \`audit\` | critical | Security analysis |
|
|
250
|
+
| \`map\` | normal | Codebase mapping |
|
|
251
|
+
| \`preload\` | low | Resource preloading |
|
|
252
|
+
| \`deepdive\` | normal | Deep code analysis |
|
|
253
|
+
| \`document\` | normal | Auto-documentation |
|
|
254
|
+
| \`refactor\` | normal | Refactoring suggestions |
|
|
255
|
+
| \`benchmark\` | normal | Performance benchmarking |
|
|
256
|
+
| \`testgaps\` | normal | Test coverage analysis |
|
|
457
257
|
|
|
458
258
|
### Essential Hook Commands
|
|
459
259
|
|
|
460
260
|
\`\`\`bash
|
|
461
|
-
# Core hooks
|
|
261
|
+
# Core hooks
|
|
462
262
|
npx claude-flow@v3alpha hooks pre-task --description "[task]"
|
|
463
263
|
npx claude-flow@v3alpha hooks post-task --task-id "[id]" --success true
|
|
464
264
|
npx claude-flow@v3alpha hooks post-edit --file "[file]" --train-patterns
|
|
465
265
|
|
|
466
266
|
# Session management
|
|
467
267
|
npx claude-flow@v3alpha hooks session-start --session-id "[id]"
|
|
468
|
-
npx claude-flow@v3alpha hooks session-end --export-metrics true
|
|
268
|
+
npx claude-flow@v3alpha hooks session-end --export-metrics true
|
|
469
269
|
npx claude-flow@v3alpha hooks session-restore --session-id "[id]"
|
|
470
270
|
|
|
471
271
|
# Intelligence routing
|
|
472
|
-
npx claude-flow@v3alpha hooks route --task "[task]"
|
|
473
|
-
npx claude-flow@v3alpha hooks explain --topic "[topic]"
|
|
272
|
+
npx claude-flow@v3alpha hooks route --task "[task]"
|
|
273
|
+
npx claude-flow@v3alpha hooks explain --topic "[topic]"
|
|
474
274
|
|
|
475
275
|
# Neural learning
|
|
476
276
|
npx claude-flow@v3alpha hooks pretrain --model-type moe --epochs 10
|
|
477
|
-
npx claude-flow@v3alpha hooks build-agents --agent-types coder,tester
|
|
478
|
-
|
|
479
|
-
# Trajectory learning (reinforcement)
|
|
480
|
-
npx claude-flow@v3alpha hooks intelligence trajectory-start --session "[session]"
|
|
481
|
-
npx claude-flow@v3alpha hooks intelligence trajectory-step --action "[action]" --reward "[reward]"
|
|
482
|
-
npx claude-flow@v3alpha hooks intelligence trajectory-end --verdict success
|
|
277
|
+
npx claude-flow@v3alpha hooks build-agents --agent-types coder,tester
|
|
483
278
|
|
|
484
|
-
#
|
|
485
|
-
npx claude-flow@v3alpha hooks
|
|
486
|
-
npx claude-flow@v3alpha hooks
|
|
487
|
-
|
|
488
|
-
# Learning stats & attention
|
|
489
|
-
npx claude-flow@v3alpha hooks intelligence stats
|
|
490
|
-
npx claude-flow@v3alpha hooks intelligence attention --focus "[task]"
|
|
279
|
+
# Background workers
|
|
280
|
+
npx claude-flow@v3alpha hooks worker list
|
|
281
|
+
npx claude-flow@v3alpha hooks worker dispatch --trigger audit
|
|
282
|
+
npx claude-flow@v3alpha hooks worker status
|
|
491
283
|
\`\`\`
|
|
492
284
|
|
|
493
|
-
|
|
285
|
+
## 🧠 Intelligence System (RuVector)
|
|
494
286
|
|
|
495
|
-
V3 includes the RuVector Intelligence System
|
|
496
|
-
- **SONA**: Self-Optimizing Neural Architecture
|
|
287
|
+
V3 includes the RuVector Intelligence System:
|
|
288
|
+
- **SONA**: Self-Optimizing Neural Architecture (<0.05ms adaptation)
|
|
497
289
|
- **MoE**: Mixture of Experts for specialized routing
|
|
498
|
-
- **HNSW**: 150x faster pattern search
|
|
290
|
+
- **HNSW**: 150x-12,500x faster pattern search
|
|
499
291
|
- **EWC++**: Elastic Weight Consolidation (prevents forgetting)
|
|
500
292
|
- **Flash Attention**: 2.49x-7.47x speedup
|
|
501
293
|
|
|
@@ -505,67 +297,112 @@ The 4-step intelligence pipeline:
|
|
|
505
297
|
3. **DISTILL** - Extract key learnings via LoRA
|
|
506
298
|
4. **CONSOLIDATE** - Prevent catastrophic forgetting via EWC++
|
|
507
299
|
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
300
|
+
## 📦 Embeddings Package (v3.0.0-alpha.12)
|
|
301
|
+
|
|
302
|
+
Features:
|
|
303
|
+
- **sql.js**: Cross-platform SQLite persistent cache (WASM, no native compilation)
|
|
304
|
+
- **Document chunking**: Configurable overlap and size
|
|
305
|
+
- **Normalization**: L2, L1, min-max, z-score
|
|
306
|
+
- **Hyperbolic embeddings**: Poincaré ball model for hierarchical data
|
|
307
|
+
- **75x faster**: With agentic-flow ONNX integration
|
|
308
|
+
- **Neural substrate**: Integration with RuVector
|
|
309
|
+
|
|
310
|
+
## 🐝 Hive-Mind Consensus
|
|
311
|
+
|
|
312
|
+
### Topologies
|
|
313
|
+
- \`hierarchical\` - Queen controls workers directly
|
|
314
|
+
- \`mesh\` - Fully connected peer network
|
|
315
|
+
- \`hierarchical-mesh\` - Hybrid (recommended)
|
|
316
|
+
- \`adaptive\` - Dynamic based on load
|
|
317
|
+
|
|
318
|
+
### Consensus Strategies
|
|
319
|
+
- \`byzantine\` - BFT (tolerates f < n/3 faulty)
|
|
320
|
+
- \`raft\` - Leader-based (tolerates f < n/2)
|
|
321
|
+
- \`gossip\` - Epidemic for eventual consistency
|
|
322
|
+
- \`crdt\` - Conflict-free replicated data types
|
|
323
|
+
- \`quorum\` - Configurable quorum-based
|
|
324
|
+
|
|
325
|
+
## V3 Performance Targets
|
|
326
|
+
|
|
327
|
+
| Metric | Target |
|
|
328
|
+
|--------|--------|
|
|
329
|
+
| Flash Attention | 2.49x-7.47x speedup |
|
|
330
|
+
| HNSW Search | 150x-12,500x faster |
|
|
331
|
+
| Memory Reduction | 50-75% with quantization |
|
|
332
|
+
| MCP Response | <100ms |
|
|
333
|
+
| CLI Startup | <500ms |
|
|
334
|
+
| SONA Adaptation | <0.05ms |
|
|
335
|
+
|
|
336
|
+
## 🔧 Environment Variables
|
|
337
|
+
|
|
338
|
+
\`\`\`bash
|
|
339
|
+
# Configuration
|
|
340
|
+
CLAUDE_FLOW_CONFIG=./claude-flow.config.json
|
|
341
|
+
CLAUDE_FLOW_LOG_LEVEL=info
|
|
342
|
+
|
|
343
|
+
# Provider API Keys
|
|
344
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
345
|
+
OPENAI_API_KEY=sk-...
|
|
346
|
+
GOOGLE_API_KEY=...
|
|
347
|
+
|
|
348
|
+
# MCP Server
|
|
349
|
+
CLAUDE_FLOW_MCP_PORT=3000
|
|
350
|
+
CLAUDE_FLOW_MCP_HOST=localhost
|
|
351
|
+
CLAUDE_FLOW_MCP_TRANSPORT=stdio
|
|
352
|
+
|
|
353
|
+
# Memory
|
|
354
|
+
CLAUDE_FLOW_MEMORY_BACKEND=hybrid
|
|
355
|
+
CLAUDE_FLOW_MEMORY_PATH=./data/memory
|
|
529
356
|
\`\`\`
|
|
530
357
|
|
|
531
|
-
|
|
358
|
+
## 🔍 Doctor Health Checks
|
|
532
359
|
|
|
533
|
-
|
|
360
|
+
Run \`npx claude-flow@v3alpha doctor\` to check:
|
|
361
|
+
- Node.js version (20+)
|
|
362
|
+
- npm version (9+)
|
|
363
|
+
- Git installation
|
|
364
|
+
- Config file validity
|
|
365
|
+
- Daemon status
|
|
366
|
+
- Memory database
|
|
367
|
+
- API keys
|
|
368
|
+
- MCP servers
|
|
369
|
+
- Disk space
|
|
370
|
+
- TypeScript installation
|
|
534
371
|
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
372
|
+
## 🚀 Quick Setup
|
|
373
|
+
|
|
374
|
+
\`\`\`bash
|
|
375
|
+
# Add MCP servers
|
|
376
|
+
claude mcp add claude-flow npx claude-flow@v3alpha mcp start
|
|
377
|
+
claude mcp add ruv-swarm npx ruv-swarm mcp start # Optional
|
|
378
|
+
claude mcp add flow-nexus npx flow-nexus@latest mcp start # Optional
|
|
539
379
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
- To notify others: npx claude-flow@v3alpha hooks notify --message "[update]"
|
|
380
|
+
# Start daemon
|
|
381
|
+
npx claude-flow@v3alpha daemon start
|
|
543
382
|
|
|
544
|
-
|
|
545
|
-
|
|
383
|
+
# Run doctor
|
|
384
|
+
npx claude-flow@v3alpha doctor --fix
|
|
546
385
|
\`\`\`
|
|
547
386
|
|
|
548
|
-
##
|
|
387
|
+
## 🎯 Claude Code vs MCP Tools
|
|
549
388
|
|
|
550
|
-
|
|
551
|
-
-
|
|
552
|
-
-
|
|
553
|
-
-
|
|
554
|
-
-
|
|
555
|
-
-
|
|
556
|
-
-
|
|
557
|
-
- 🔗 GitHub Integration
|
|
558
|
-
- 🔐 Security-Hardened Architecture
|
|
389
|
+
### Claude Code Handles ALL EXECUTION:
|
|
390
|
+
- **Task tool**: Spawn and run agents concurrently
|
|
391
|
+
- File operations (Read, Write, Edit, MultiEdit, Glob, Grep)
|
|
392
|
+
- Code generation and programming
|
|
393
|
+
- Bash commands and system operations
|
|
394
|
+
- TodoWrite and task management
|
|
395
|
+
- Git operations
|
|
559
396
|
|
|
560
|
-
|
|
397
|
+
### MCP Tools ONLY COORDINATE:
|
|
398
|
+
- Swarm initialization (topology setup)
|
|
399
|
+
- Agent type definitions
|
|
400
|
+
- Task orchestration
|
|
401
|
+
- Memory management
|
|
402
|
+
- Neural features
|
|
403
|
+
- Performance tracking
|
|
561
404
|
|
|
562
|
-
|
|
563
|
-
2. Scale agents gradually
|
|
564
|
-
3. Use memory for context
|
|
565
|
-
4. Monitor progress regularly
|
|
566
|
-
5. Train patterns from success
|
|
567
|
-
6. Enable hooks automation
|
|
568
|
-
7. Use GitHub tools first
|
|
405
|
+
**KEY**: MCP coordinates the strategy, Claude Code's Task tool executes with real agents.
|
|
569
406
|
|
|
570
407
|
## Support
|
|
571
408
|
|
|
@@ -582,19 +419,22 @@ NEVER create files unless they're absolutely necessary for achieving your goal.
|
|
|
582
419
|
ALWAYS prefer editing an existing file to creating a new one.
|
|
583
420
|
NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.
|
|
584
421
|
Never save working files, text/mds and tests to the root folder.
|
|
422
|
+
After spawning a swarm, wait, don't continuously check status.
|
|
585
423
|
`;
|
|
586
424
|
}
|
|
587
425
|
/**
|
|
588
426
|
* Generate minimal CLAUDE.md content
|
|
589
427
|
*/
|
|
590
428
|
export function generateMinimalClaudeMd(options) {
|
|
591
|
-
return `# Claude Code Configuration
|
|
429
|
+
return `# Claude Code Configuration - Claude Flow V3
|
|
592
430
|
|
|
593
431
|
## Quick Reference
|
|
594
432
|
|
|
595
433
|
- **Topology**: ${options.runtime.topology}
|
|
596
434
|
- **Max Agents**: ${options.runtime.maxAgents}
|
|
597
435
|
- **Memory**: ${options.runtime.memoryBackend}
|
|
436
|
+
- **HNSW**: ${options.runtime.enableHNSW ? 'Enabled' : 'Disabled'}
|
|
437
|
+
- **Neural**: ${options.runtime.enableNeural ? 'Enabled' : 'Disabled'}
|
|
598
438
|
|
|
599
439
|
## Key Rules
|
|
600
440
|
|
|
@@ -612,6 +452,22 @@ Task("Coder", "Implement features...", "coder")
|
|
|
612
452
|
Task("Tester", "Write tests...", "tester")
|
|
613
453
|
\`\`\`
|
|
614
454
|
|
|
455
|
+
## 26 CLI Commands
|
|
456
|
+
|
|
457
|
+
\`\`\`bash
|
|
458
|
+
# Core
|
|
459
|
+
npx claude-flow@v3alpha init --wizard
|
|
460
|
+
npx claude-flow@v3alpha agent spawn -t coder
|
|
461
|
+
npx claude-flow@v3alpha swarm init --v3-mode
|
|
462
|
+
npx claude-flow@v3alpha memory search -q "query"
|
|
463
|
+
|
|
464
|
+
# Advanced
|
|
465
|
+
npx claude-flow@v3alpha daemon start
|
|
466
|
+
npx claude-flow@v3alpha doctor --fix
|
|
467
|
+
npx claude-flow@v3alpha security scan
|
|
468
|
+
npx claude-flow@v3alpha performance benchmark
|
|
469
|
+
\`\`\`
|
|
470
|
+
|
|
615
471
|
## MCP Setup
|
|
616
472
|
|
|
617
473
|
\`\`\`bash
|