agentic-flow 1.1.1 → 1.1.3

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.
Files changed (32) hide show
  1. package/README.md +305 -158
  2. package/dist/agents/directApiAgent.js +108 -22
  3. package/dist/cli-proxy.js +120 -22
  4. package/dist/proxy/anthropic-to-openrouter.js +5 -1
  5. package/dist/router/providers/gemini.js +102 -0
  6. package/dist/router/router.js +65 -7
  7. package/dist/utils/logger.js +4 -0
  8. package/dist/utils/modelOptimizer.js +22 -22
  9. package/docs/PACKAGE_STRUCTURE.md +199 -0
  10. package/package.json +2 -1
  11. package/.claude/commands/coordination/README.md +0 -9
  12. package/.claude/commands/coordination/agent-spawn.md +0 -25
  13. package/.claude/commands/coordination/init.md +0 -44
  14. package/.claude/commands/coordination/orchestrate.md +0 -43
  15. package/.claude/commands/coordination/spawn.md +0 -45
  16. package/.claude/commands/coordination/swarm-init.md +0 -85
  17. package/.claude/commands/coordination/task-orchestrate.md +0 -25
  18. package/.claude/commands/memory/README.md +0 -9
  19. package/.claude/commands/memory/memory-persist.md +0 -25
  20. package/.claude/commands/memory/memory-search.md +0 -25
  21. package/.claude/commands/memory/memory-usage.md +0 -25
  22. package/.claude/commands/memory/neural.md +0 -47
  23. package/.claude/commands/memory/usage.md +0 -46
  24. package/dist/cli.js +0 -158
  25. package/dist/coordination/parallelSwarm.js +0 -226
  26. package/dist/index-with-proxy.js +0 -101
  27. package/dist/mcp/fastmcp/tools/memory/retrieve.js +0 -38
  28. package/dist/mcp/fastmcp/tools/memory/search.js +0 -41
  29. package/dist/mcp/fastmcp/tools/memory/store.js +0 -56
  30. package/docs/.claude-flow/metrics/agent-metrics.json +0 -1
  31. package/docs/.claude-flow/metrics/performance.json +0 -9
  32. package/docs/.claude-flow/metrics/task-metrics.json +0 -10
@@ -5,6 +5,7 @@ import { join } from 'path';
5
5
  import { OpenRouterProvider } from './providers/openrouter.js';
6
6
  import { AnthropicProvider } from './providers/anthropic.js';
7
7
  import { ONNXLocalProvider } from './providers/onnx-local.js';
8
+ import { GeminiProvider } from './providers/gemini.js';
8
9
  export class ModelRouter {
9
10
  config;
10
11
  providers = new Map();
@@ -20,6 +21,7 @@ export class ModelRouter {
20
21
  process.env.AGENTIC_FLOW_ROUTER_CONFIG,
21
22
  join(homedir(), '.agentic-flow', 'router.config.json'),
22
23
  join(process.cwd(), 'router.config.json'),
24
+ join(process.cwd(), 'config', 'router.config.json'),
23
25
  join(process.cwd(), 'router.config.example.json')
24
26
  ].filter(Boolean);
25
27
  for (const path of paths) {
@@ -30,7 +32,43 @@ export class ModelRouter {
30
32
  return this.substituteEnvVars(config);
31
33
  }
32
34
  }
33
- throw new Error('No router configuration file found');
35
+ // If no config file found, create config from environment variables
36
+ return this.createConfigFromEnv();
37
+ }
38
+ createConfigFromEnv() {
39
+ // Create minimal config from environment variables
40
+ const config = {
41
+ version: '1.0',
42
+ defaultProvider: process.env.PROVIDER || 'anthropic',
43
+ routing: { mode: 'manual' },
44
+ providers: {}
45
+ };
46
+ // Add Anthropic if API key exists
47
+ if (process.env.ANTHROPIC_API_KEY) {
48
+ config.providers.anthropic = {
49
+ apiKey: process.env.ANTHROPIC_API_KEY,
50
+ baseUrl: process.env.ANTHROPIC_BASE_URL
51
+ };
52
+ }
53
+ // Add OpenRouter if API key exists
54
+ if (process.env.OPENROUTER_API_KEY) {
55
+ config.providers.openrouter = {
56
+ apiKey: process.env.OPENROUTER_API_KEY,
57
+ baseUrl: process.env.OPENROUTER_BASE_URL
58
+ };
59
+ }
60
+ // Add Gemini if API key exists
61
+ if (process.env.GOOGLE_GEMINI_API_KEY) {
62
+ config.providers.gemini = {
63
+ apiKey: process.env.GOOGLE_GEMINI_API_KEY
64
+ };
65
+ }
66
+ // ONNX is always available (no API key needed)
67
+ config.providers.onnx = {
68
+ modelPath: process.env.ONNX_MODEL_PATH,
69
+ executionProviders: ['cpu']
70
+ };
71
+ return config;
34
72
  }
35
73
  substituteEnvVars(obj) {
36
74
  if (typeof obj === 'string') {
@@ -53,15 +91,18 @@ export class ModelRouter {
53
91
  return obj;
54
92
  }
55
93
  initializeProviders() {
94
+ const verbose = process.env.ROUTER_VERBOSE === 'true';
56
95
  // Initialize Anthropic
57
96
  if (this.config.providers.anthropic) {
58
97
  try {
59
98
  const provider = new AnthropicProvider(this.config.providers.anthropic);
60
99
  this.providers.set('anthropic', provider);
61
- console.log('✅ Anthropic provider initialized');
100
+ if (verbose)
101
+ console.log('✅ Anthropic provider initialized');
62
102
  }
63
103
  catch (error) {
64
- console.error('❌ Failed to initialize Anthropic:', error);
104
+ if (verbose)
105
+ console.error('❌ Failed to initialize Anthropic:', error);
65
106
  }
66
107
  }
67
108
  // Initialize OpenRouter
@@ -69,10 +110,12 @@ export class ModelRouter {
69
110
  try {
70
111
  const provider = new OpenRouterProvider(this.config.providers.openrouter);
71
112
  this.providers.set('openrouter', provider);
72
- console.log('✅ OpenRouter provider initialized');
113
+ if (verbose)
114
+ console.log('✅ OpenRouter provider initialized');
73
115
  }
74
116
  catch (error) {
75
- console.error('❌ Failed to initialize OpenRouter:', error);
117
+ if (verbose)
118
+ console.error('❌ Failed to initialize OpenRouter:', error);
76
119
  }
77
120
  }
78
121
  // Initialize ONNX Local
@@ -85,10 +128,25 @@ export class ModelRouter {
85
128
  temperature: this.config.providers.onnx.temperature || 0.7
86
129
  });
87
130
  this.providers.set('onnx', provider);
88
- console.log('✅ ONNX Local provider initialized');
131
+ if (verbose)
132
+ console.log('✅ ONNX Local provider initialized');
133
+ }
134
+ catch (error) {
135
+ if (verbose)
136
+ console.error('❌ Failed to initialize ONNX:', error);
137
+ }
138
+ }
139
+ // Initialize Gemini
140
+ if (this.config.providers.gemini) {
141
+ try {
142
+ const provider = new GeminiProvider(this.config.providers.gemini);
143
+ this.providers.set('gemini', provider);
144
+ if (verbose)
145
+ console.log('✅ Gemini provider initialized');
89
146
  }
90
147
  catch (error) {
91
- console.error('❌ Failed to initialize ONNX:', error);
148
+ if (verbose)
149
+ console.error('❌ Failed to initialize Gemini:', error);
92
150
  }
93
151
  }
94
152
  // TODO: Initialize other providers (OpenAI, Ollama, LiteLLM)
@@ -26,6 +26,10 @@ class Logger {
26
26
  }
27
27
  }
28
28
  debug(message, data) {
29
+ // Skip debug logs unless DEBUG or VERBOSE environment variable is set
30
+ if (!process.env.DEBUG && !process.env.VERBOSE) {
31
+ return;
32
+ }
29
33
  this.log('debug', message, data);
30
34
  }
31
35
  info(message, data) {
@@ -51,29 +51,29 @@ const MODEL_DATABASE = {
51
51
  // Tier 2: Cost-Effective Champions
52
52
  'deepseek-r1': {
53
53
  provider: 'openrouter',
54
- model: 'deepseek/deepseek-r1',
54
+ model: 'deepseek/deepseek-r1-0528:free',
55
55
  modelName: 'DeepSeek R1',
56
- cost_per_1m_input: 0.55,
57
- cost_per_1m_output: 2.19,
56
+ cost_per_1m_input: 0.00,
57
+ cost_per_1m_output: 0.00,
58
58
  quality_score: 90,
59
59
  speed_score: 80,
60
- cost_score: 85,
60
+ cost_score: 100,
61
61
  tier: 'cost-effective',
62
- strengths: ['reasoning', 'coding', 'math', 'value'],
62
+ strengths: ['reasoning', 'coding', 'math', 'value', 'free'],
63
63
  weaknesses: ['newer-model'],
64
64
  bestFor: ['coder', 'pseudocode', 'specification', 'refinement', 'tester']
65
65
  },
66
66
  'deepseek-chat-v3': {
67
67
  provider: 'openrouter',
68
- model: 'deepseek/deepseek-chat',
69
- modelName: 'DeepSeek Chat V3',
70
- cost_per_1m_input: 0.14,
71
- cost_per_1m_output: 0.28,
68
+ model: 'deepseek/deepseek-chat-v3.1:free',
69
+ modelName: 'DeepSeek Chat V3.1',
70
+ cost_per_1m_input: 0.00,
71
+ cost_per_1m_output: 0.00,
72
72
  quality_score: 82,
73
73
  speed_score: 90,
74
- cost_score: 98,
74
+ cost_score: 100,
75
75
  tier: 'cost-effective',
76
- strengths: ['cost', 'speed', 'coding', 'development'],
76
+ strengths: ['cost', 'speed', 'coding', 'development', 'free'],
77
77
  weaknesses: ['complex-reasoning'],
78
78
  bestFor: ['coder', 'reviewer', 'tester', 'backend-dev', 'cicd-engineer']
79
79
  },
@@ -92,19 +92,19 @@ const MODEL_DATABASE = {
92
92
  weaknesses: ['quality'],
93
93
  bestFor: ['researcher', 'planner', 'smart-agent']
94
94
  },
95
- 'llama-3-3-70b': {
95
+ 'llama-3-3-8b': {
96
96
  provider: 'openrouter',
97
- model: 'meta-llama/llama-3.3-70b-instruct',
98
- modelName: 'Llama 3.3 70B',
99
- cost_per_1m_input: 0.35,
100
- cost_per_1m_output: 0.40,
101
- quality_score: 80,
102
- speed_score: 85,
103
- cost_score: 90,
97
+ model: 'meta-llama/llama-3.3-8b-instruct:free',
98
+ modelName: 'Llama 3.3 8B',
99
+ cost_per_1m_input: 0.00,
100
+ cost_per_1m_output: 0.00,
101
+ quality_score: 72,
102
+ speed_score: 95,
103
+ cost_score: 100,
104
104
  tier: 'balanced',
105
- strengths: ['open-source', 'versatile', 'coding'],
106
- weaknesses: ['verbosity'],
107
- bestFor: ['coder', 'reviewer', 'base-template-generator']
105
+ strengths: ['open-source', 'versatile', 'coding', 'free', 'fast'],
106
+ weaknesses: ['smaller-model'],
107
+ bestFor: ['coder', 'reviewer', 'base-template-generator', 'tester']
108
108
  },
109
109
  'qwen-2-5-72b': {
110
110
  provider: 'openrouter',
@@ -0,0 +1,199 @@
1
+ # agentic-flow Package Structure
2
+
3
+ ## Overview
4
+
5
+ The `agentic-flow` npm package includes all necessary files for agent execution, including 76 pre-built agent definitions in the `.claude/agents/` directory.
6
+
7
+ ## Package Contents
8
+
9
+ When you install `agentic-flow` via npm, you get:
10
+
11
+ ```
12
+ agentic-flow/
13
+ ├── dist/ # Compiled JavaScript
14
+ │ ├── cli-proxy.js # Main CLI entry point
15
+ │ ├── agents/ # Agent implementations
16
+ │ ├── router/ # Multi-provider router
17
+ │ └── utils/ # Utilities
18
+ ├── .claude/ # Agent definitions (76 files)
19
+ │ └── agents/
20
+ │ ├── core/ # Core agents (coder, planner, reviewer, etc.)
21
+ │ ├── consensus/ # Distributed consensus agents
22
+ │ ├── github/ # GitHub integration agents
23
+ │ ├── flow-nexus/ # Flow Nexus cloud agents
24
+ │ ├── sparc/ # SPARC methodology agents
25
+ │ └── ... # More specialized categories
26
+ ├── docs/ # Documentation
27
+ ├── README.md
28
+ └── LICENSE
29
+ ```
30
+
31
+ ## Agent Loading System
32
+
33
+ ### Package Agents (Bundled)
34
+
35
+ All 76 agent definitions are included in the npm package at:
36
+ ```
37
+ node_modules/agentic-flow/.claude/agents/
38
+ ```
39
+
40
+ These are automatically loaded when you run `npx agentic-flow`.
41
+
42
+ ### Local Agents (User Custom)
43
+
44
+ You can create custom agents in your project:
45
+ ```
46
+ your-project/
47
+ └── .claude/
48
+ └── agents/
49
+ └── custom/
50
+ └── my-agent.md
51
+ ```
52
+
53
+ **Local agents override package agents** with the same relative path.
54
+
55
+ ## Agent Discovery Order
56
+
57
+ 1. **Package agents**: Load from `node_modules/agentic-flow/.claude/agents/`
58
+ 2. **Local agents**: Load from `./claude/agents/` (overrides package agents if same path)
59
+ 3. **Custom directory**: Use `--agents-dir` flag to specify alternative location
60
+
61
+ ## Verification
62
+
63
+ To verify your installation includes all agents:
64
+
65
+ ```bash
66
+ # List all available agents
67
+ npx agentic-flow --list
68
+
69
+ # Should show 73 agents (76 files, some without proper frontmatter)
70
+ ```
71
+
72
+ ## Custom Agent Creation
73
+
74
+ Create custom agents that augment or replace package agents:
75
+
76
+ ```bash
77
+ # Interactive creation
78
+ npx agentic-flow agent create
79
+
80
+ # Manual creation
81
+ mkdir -p .claude/agents/custom
82
+ cat > .claude/agents/custom/my-agent.md << 'EOF'
83
+ ---
84
+ name: my-agent
85
+ description: My custom agent
86
+ ---
87
+
88
+ You are a specialized agent for [purpose].
89
+ Follow these guidelines:
90
+ - [guideline 1]
91
+ - [guideline 2]
92
+ EOF
93
+ ```
94
+
95
+ ## Package Maintenance
96
+
97
+ ### Building
98
+
99
+ ```bash
100
+ npm run build
101
+ ```
102
+
103
+ ### Verifying Package Structure
104
+
105
+ ```bash
106
+ ./scripts/verify-package.sh
107
+ ```
108
+
109
+ ### Creating Package
110
+
111
+ ```bash
112
+ npm pack
113
+ ```
114
+
115
+ ### Testing Installation
116
+
117
+ ```bash
118
+ # Install in test directory
119
+ mkdir -p /tmp/test-install
120
+ cd /tmp/test-install
121
+ npm install /path/to/agentic-flow-1.1.2.tgz
122
+
123
+ # Verify agents loaded
124
+ ./node_modules/.bin/agentic-flow --list
125
+ ```
126
+
127
+ ## Environment Configuration
128
+
129
+ The package automatically loads `.env` files from:
130
+ 1. Current directory
131
+ 2. Parent directories (recursively up to root)
132
+
133
+ This ensures API keys work from any directory:
134
+
135
+ ```bash
136
+ # Works from project root
137
+ cd /workspaces/myproject
138
+ npx agentic-flow --agent coder --task "test" --provider gemini
139
+
140
+ # Also works from subdirectory (finds parent .env)
141
+ cd /workspaces/myproject/src
142
+ npx agentic-flow --agent coder --task "test" --provider gemini
143
+ ```
144
+
145
+ ## Files Included in Package
146
+
147
+ See `package.json`:
148
+ ```json
149
+ {
150
+ "files": [
151
+ "dist",
152
+ "docs",
153
+ ".claude",
154
+ "README.md",
155
+ "LICENSE"
156
+ ]
157
+ }
158
+ ```
159
+
160
+ ## Files Excluded (.npmignore)
161
+
162
+ - Source files (`src/`, `*.ts`)
163
+ - Tests (`tests/`, `validation/`)
164
+ - Development files (`.env`, `tsconfig.json`)
165
+ - Runtime state directories (`.claude-flow/`, `.swarm/`, `memory/`)
166
+ - ONNX models (`*.onnx`, `models/`)
167
+
168
+ ## Agent Categories
169
+
170
+ The 76 included agents span:
171
+
172
+ - **Core** (5): coder, planner, researcher, reviewer, tester
173
+ - **Consensus** (7): Byzantine, CRDT, Gossip, Raft, Quorum, etc.
174
+ - **GitHub** (14): PR management, issue tracking, release automation
175
+ - **Flow Nexus** (9): Cloud sandboxes, neural networks, workflows
176
+ - **SPARC** (4): Specification, Pseudocode, Architecture, Refinement
177
+ - **Optimization** (5): Resource allocation, load balancing, benchmarks
178
+ - **Goal Planning** (2): GOAP, sublinear algorithms
179
+ - **Swarm** (3): Hierarchical, mesh, adaptive coordination
180
+ - **Payments** (1): Agentic payment authorization
181
+ - **Templates** (10): Automation, orchestration, migration
182
+ - **Testing** (2): TDD, production validation
183
+ - **Specialized** (varies): Analysis, architecture, data, development, DevOps, documentation
184
+
185
+ ## Total Agent Count
186
+
187
+ - **76 agent files** in `.claude/agents/`
188
+ - **73 valid agents** (3 files missing required frontmatter)
189
+ - **All core agents** (coder, planner, researcher, reviewer, tester) working
190
+
191
+ ## Summary
192
+
193
+ ✅ All 76 agent definitions are packaged and distributed via npm
194
+ ✅ Agent loading works automatically from `node_modules/`
195
+ ✅ Local `.claude/agents/` can override package agents
196
+ ✅ Environment variable loading works recursively
197
+ ✅ Package structure verified and tested
198
+
199
+ The `.claude/` directory is a first-class part of the npm package, ensuring all users have immediate access to the complete agent library upon installation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-flow",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Production-ready AI agent orchestration platform with 66 specialized agents, 111 MCP tools, and autonomous multi-agent swarms. Built by @ruvnet with Claude Agent SDK, neural networks, memory persistence, GitHub integration, and distributed consensus protocols.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -110,6 +110,7 @@
110
110
  "dependencies": {
111
111
  "@anthropic-ai/claude-agent-sdk": "^0.1.5",
112
112
  "@anthropic-ai/sdk": "^0.65.0",
113
+ "@google/genai": "^1.22.0",
113
114
  "agentic-payments": "^0.1.3",
114
115
  "axios": "^1.12.2",
115
116
  "claude-flow": "^2.0.0",
@@ -1,9 +0,0 @@
1
- # Coordination Commands
2
-
3
- Commands for coordination operations in Claude Flow.
4
-
5
- ## Available Commands
6
-
7
- - [swarm-init](./swarm-init.md)
8
- - [agent-spawn](./agent-spawn.md)
9
- - [task-orchestrate](./task-orchestrate.md)
@@ -1,25 +0,0 @@
1
- # agent-spawn
2
-
3
- Spawn a new agent in the current swarm.
4
-
5
- ## Usage
6
- ```bash
7
- npx claude-flow agent spawn [options]
8
- ```
9
-
10
- ## Options
11
- - `--type <type>` - Agent type (coder, researcher, analyst, tester, coordinator)
12
- - `--name <name>` - Custom agent name
13
- - `--skills <list>` - Specific skills (comma-separated)
14
-
15
- ## Examples
16
- ```bash
17
- # Spawn coder agent
18
- npx claude-flow agent spawn --type coder
19
-
20
- # With custom name
21
- npx claude-flow agent spawn --type researcher --name "API Expert"
22
-
23
- # With specific skills
24
- npx claude-flow agent spawn --type coder --skills "python,fastapi,testing"
25
- ```
@@ -1,44 +0,0 @@
1
- # Initialize Coordination Framework
2
-
3
- ## 🎯 Key Principle
4
- **This tool coordinates Claude Code's actions. It does NOT write code or create content.**
5
-
6
- ## MCP Tool Usage in Claude Code
7
-
8
- **Tool:** `mcp__claude-flow__swarm_init`
9
-
10
- ## Parameters
11
- ```json
12
- {"topology": "mesh", "maxAgents": 5, "strategy": "balanced"}
13
- ```
14
-
15
- ## Description
16
- Set up a coordination topology to guide Claude Code's approach to complex tasks
17
-
18
- ## Details
19
- This tool creates a coordination framework that helps Claude Code:
20
- - Break down complex problems systematically
21
- - Approach tasks from multiple perspectives
22
- - Maintain consistency across large projects
23
- - Work more efficiently through structured coordination
24
-
25
- Remember: This does NOT create actual coding agents. It creates a coordination pattern for Claude Code to follow.
26
-
27
- ## Example Usage
28
-
29
- **In Claude Code:**
30
- 1. Use the tool: `mcp__claude-flow__swarm_init`
31
- 2. With parameters: `{"topology": "mesh", "maxAgents": 5, "strategy": "balanced"}`
32
- 3. Claude Code then executes the coordinated plan using its native tools
33
-
34
- ## Important Reminders
35
- - ✅ This tool provides coordination and structure
36
- - ✅ Claude Code performs all actual implementation
37
- - ❌ The tool does NOT write code
38
- - ❌ The tool does NOT access files directly
39
- - ❌ The tool does NOT execute commands
40
-
41
- ## See Also
42
- - Main documentation: /claude.md
43
- - Other commands in this category
44
- - Workflow examples in /workflows/
@@ -1,43 +0,0 @@
1
- # Coordinate Task Execution
2
-
3
- ## 🎯 Key Principle
4
- **This tool coordinates Claude Code's actions. It does NOT write code or create content.**
5
-
6
- ## MCP Tool Usage in Claude Code
7
-
8
- **Tool:** `mcp__claude-flow__task_orchestrate`
9
-
10
- ## Parameters
11
- ```json
12
- {"task": "Implement authentication system", "strategy": "parallel", "priority": "high"}
13
- ```
14
-
15
- ## Description
16
- Break down and coordinate complex tasks for systematic execution by Claude Code
17
-
18
- ## Details
19
- Orchestration strategies:
20
- - **parallel**: Claude Code works on independent components simultaneously
21
- - **sequential**: Step-by-step execution for dependent tasks
22
- - **adaptive**: Dynamically adjusts based on task complexity
23
-
24
- The orchestrator creates a plan that Claude Code follows using its native tools.
25
-
26
- ## Example Usage
27
-
28
- **In Claude Code:**
29
- 1. Use the tool: `mcp__claude-flow__task_orchestrate`
30
- 2. With parameters: `{"task": "Implement authentication system", "strategy": "parallel", "priority": "high"}`
31
- 3. Claude Code then executes the coordinated plan using its native tools
32
-
33
- ## Important Reminders
34
- - ✅ This tool provides coordination and structure
35
- - ✅ Claude Code performs all actual implementation
36
- - ❌ The tool does NOT write code
37
- - ❌ The tool does NOT access files directly
38
- - ❌ The tool does NOT execute commands
39
-
40
- ## See Also
41
- - Main documentation: /claude.md
42
- - Other commands in this category
43
- - Workflow examples in /workflows/
@@ -1,45 +0,0 @@
1
- # Create Cognitive Patterns
2
-
3
- ## 🎯 Key Principle
4
- **This tool coordinates Claude Code's actions. It does NOT write code or create content.**
5
-
6
- ## MCP Tool Usage in Claude Code
7
-
8
- **Tool:** `mcp__claude-flow__agent_spawn`
9
-
10
- ## Parameters
11
- ```json
12
- {"type": "researcher", "name": "Literature Analysis", "capabilities": ["deep-analysis"]}
13
- ```
14
-
15
- ## Description
16
- Define cognitive patterns that represent different approaches Claude Code can take
17
-
18
- ## Details
19
- Agent types represent thinking patterns, not actual coders:
20
- - **researcher**: Systematic exploration approach
21
- - **coder**: Implementation-focused thinking
22
- - **analyst**: Data-driven decision making
23
- - **architect**: Big-picture system design
24
- - **reviewer**: Quality and consistency checking
25
-
26
- These patterns guide how Claude Code approaches different aspects of your task.
27
-
28
- ## Example Usage
29
-
30
- **In Claude Code:**
31
- 1. Use the tool: `mcp__claude-flow__agent_spawn`
32
- 2. With parameters: `{"type": "researcher", "name": "Literature Analysis", "capabilities": ["deep-analysis"]}`
33
- 3. Claude Code then executes the coordinated plan using its native tools
34
-
35
- ## Important Reminders
36
- - ✅ This tool provides coordination and structure
37
- - ✅ Claude Code performs all actual implementation
38
- - ❌ The tool does NOT write code
39
- - ❌ The tool does NOT access files directly
40
- - ❌ The tool does NOT execute commands
41
-
42
- ## See Also
43
- - Main documentation: /claude.md
44
- - Other commands in this category
45
- - Workflow examples in /workflows/
@@ -1,85 +0,0 @@
1
- # swarm init
2
-
3
- Initialize a Claude Flow swarm with specified topology and configuration.
4
-
5
- ## Usage
6
-
7
- ```bash
8
- npx claude-flow swarm init [options]
9
- ```
10
-
11
- ## Options
12
-
13
- - `--topology, -t <type>` - Swarm topology: mesh, hierarchical, ring, star (default: hierarchical)
14
- - `--max-agents, -m <number>` - Maximum number of agents (default: 8)
15
- - `--strategy, -s <type>` - Execution strategy: balanced, parallel, sequential (default: parallel)
16
- - `--auto-spawn` - Automatically spawn agents based on task complexity
17
- - `--memory` - Enable cross-session memory persistence
18
- - `--github` - Enable GitHub integration features
19
-
20
- ## Examples
21
-
22
- ### Basic initialization
23
-
24
- ```bash
25
- npx claude-flow swarm init
26
- ```
27
-
28
- ### Mesh topology for research
29
-
30
- ```bash
31
- npx claude-flow swarm init --topology mesh --max-agents 5 --strategy balanced
32
- ```
33
-
34
- ### Hierarchical for development
35
-
36
- ```bash
37
- npx claude-flow swarm init --topology hierarchical --max-agents 10 --strategy parallel --auto-spawn
38
- ```
39
-
40
- ### GitHub-focused swarm
41
-
42
- ```bash
43
- npx claude-flow swarm init --topology star --github --memory
44
- ```
45
-
46
- ## Topologies
47
-
48
- ### Mesh
49
-
50
- - All agents connect to all others
51
- - Best for: Research, exploration, brainstorming
52
- - Communication: High overhead, maximum information sharing
53
-
54
- ### Hierarchical
55
-
56
- - Tree structure with clear command chain
57
- - Best for: Development, structured tasks, large projects
58
- - Communication: Efficient, clear responsibilities
59
-
60
- ### Ring
61
-
62
- - Agents connect in a circle
63
- - Best for: Pipeline processing, sequential workflows
64
- - Communication: Low overhead, ordered processing
65
-
66
- ### Star
67
-
68
- - Central coordinator with satellite agents
69
- - Best for: Simple tasks, centralized control
70
- - Communication: Minimal overhead, clear coordination
71
-
72
- ## Integration with Claude Code
73
-
74
- Once initialized, use MCP tools in Claude Code:
75
-
76
- ```javascript
77
- mcp__claude-flow__swarm_init { topology: "hierarchical", maxAgents: 8 }
78
- ```
79
-
80
- ## See Also
81
-
82
- - `agent spawn` - Create swarm agents
83
- - `task orchestrate` - Coordinate task execution
84
- - `swarm status` - Check swarm state
85
- - `swarm monitor` - Real-time monitoring