snow-flow 1.4.25 → 1.4.26
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/CLAUDE.md +254 -1248
- package/README.md +120 -37
- package/dist/mcp/start-all-mcp-servers.js +36 -0
- package/dist/mcp/start-all-mcp-servers.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CLAUDE.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Claude Code Configuration -
|
|
1
|
+
# Claude Code Configuration - Snow-Flow Development Environment
|
|
2
2
|
|
|
3
3
|
## 🚨 CRITICAL: CONCURRENT EXECUTION FOR ALL ACTIONS
|
|
4
4
|
|
|
@@ -14,1042 +14,185 @@
|
|
|
14
14
|
|
|
15
15
|
### ⚡ GOLDEN RULE: "1 MESSAGE = ALL RELATED OPERATIONS"
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
**✅ CORRECT: Everything in ONE message**
|
|
19
18
|
```javascript
|
|
20
|
-
// ✅ CORRECT: Everything in ONE message
|
|
21
19
|
[Single Message]:
|
|
22
20
|
- TodoWrite { todos: [10+ todos with all statuses/priorities] }
|
|
23
21
|
- Task("Agent 1 with full instructions and hooks")
|
|
24
22
|
- Task("Agent 2 with full instructions and hooks")
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
- Read("file2.js")
|
|
28
|
-
- Write("output1.js", content)
|
|
29
|
-
- Write("output2.js", content)
|
|
30
|
-
- Bash("npm install")
|
|
31
|
-
- Bash("npm test")
|
|
32
|
-
- Bash("npm run build")
|
|
23
|
+
- Multiple Read/Write operations
|
|
24
|
+
- Multiple Bash commands
|
|
33
25
|
```
|
|
34
26
|
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
**❌ WRONG: Multiple messages (NEVER DO THIS)**
|
|
37
28
|
```javascript
|
|
38
|
-
// ❌ WRONG: Multiple messages (NEVER DO THIS)
|
|
39
29
|
Message 1: TodoWrite { todos: [single todo] }
|
|
40
30
|
Message 2: Task("Agent 1")
|
|
41
|
-
Message 3:
|
|
42
|
-
|
|
43
|
-
Message 5: Write("output1.js")
|
|
44
|
-
Message 6: Bash("npm install")
|
|
45
|
-
// This is 6x slower and breaks coordination!
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### 🎯 CONCURRENT EXECUTION CHECKLIST:
|
|
49
|
-
|
|
50
|
-
Before sending ANY message, ask yourself:
|
|
51
|
-
|
|
52
|
-
- ✅ Are ALL related TodoWrite operations batched together?
|
|
53
|
-
- ✅ Are ALL Task spawning operations in ONE message?
|
|
54
|
-
- ✅ Are ALL file operations (Read/Write/Edit) batched together?
|
|
55
|
-
- ✅ Are ALL bash commands grouped in ONE message?
|
|
56
|
-
- ✅ Are ALL memory operations concurrent?
|
|
57
|
-
|
|
58
|
-
If ANY answer is "No", you MUST combine operations into a single message!
|
|
59
|
-
|
|
60
|
-
## Project Overview
|
|
61
|
-
|
|
62
|
-
This project combines the SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) methodology with **Real ServiceNow Integration** for systematic Test-Driven Development with AI assistance.
|
|
63
|
-
|
|
64
|
-
**🚀 Batchtools Optimization Enabled**: This configuration includes optimized prompts and parallel processing capabilities for improved performance and efficiency.
|
|
65
|
-
|
|
66
|
-
## 🏔️ **SNOW-FLOW: COMPLETE MCP TOOLKIT**
|
|
67
|
-
|
|
68
|
-
**Production-Ready ServiceNow Integration + AI Orchestration via Natural Language**
|
|
69
|
-
|
|
70
|
-
Snow-Flow provides comprehensive MCP tools for ServiceNow integration and AI orchestration. All tools work directly with your ServiceNow instance using OAuth authentication and are accessible through the natural language swarm interface.
|
|
71
|
-
|
|
72
|
-
### **🛠️ Complete Snow-Flow MCP Tools**
|
|
73
|
-
|
|
74
|
-
#### **🐝 AI Swarm Orchestration** (4 tools working)
|
|
75
|
-
- `swarm_init` - Initialize AI swarm coordination topology
|
|
76
|
-
- `agent_spawn` - Create specialized AI agents for different tasks
|
|
77
|
-
- `memory_usage` - Persistent memory across sessions
|
|
78
|
-
- `neural_status` - Neural network pattern effectiveness
|
|
79
|
-
|
|
80
|
-
#### **📊 ServiceNow Operations** (12/15 tools working)
|
|
81
|
-
- ✅ `snow_operational_metrics` - Retrieve operational metrics and analytics
|
|
82
|
-
- ✅ `snow_user_lookup` - Analyze user information with groups and roles
|
|
83
|
-
- ✅ `snow_query_incidents` - Advanced incident querying with filters
|
|
84
|
-
- ✅ `snow_catalog_item_search` - Search catalog items with fuzzy matching
|
|
85
|
-
- ✅ `snow_catalog_item_manager` - Manage service catalog items
|
|
86
|
-
- ✅ `snow_test_flow_with_mock` - Test flows with mock data
|
|
87
|
-
- ✅ `snow_link_catalog_to_flow` - Link catalog items to flows
|
|
88
|
-
- ✅ `snow_cleanup_test_artifacts` - Clean test artifacts safely
|
|
89
|
-
- ✅ `snow_create_user_group` - Create ServiceNow user groups
|
|
90
|
-
- ✅ `snow_create_user` - Create ServiceNow users
|
|
91
|
-
- ✅ `snow_assign_user_to_group` - Manage group memberships
|
|
92
|
-
- ✅ `snow_list_group_members` - List group members
|
|
93
|
-
- ⚠️ `snow_analyze_incident` - Incident analysis (needs verification)
|
|
94
|
-
- ⚠️ `snow_auto_resolve_incident` - Auto incident resolution (needs verification)
|
|
95
|
-
- ⚠️ `snow_query_requests` - Service request queries (needs verification)
|
|
96
|
-
|
|
97
|
-
#### **🔧 Platform Development** (2/2 tools working)
|
|
98
|
-
- ✅ `snow_discover_platform_tables` - Discover UI, script, policy tables
|
|
99
|
-
- ✅ `snow_table_schema_discovery` - Comprehensive table schema analysis
|
|
100
|
-
|
|
101
|
-
#### **🔗 Integration** (10+ tools)
|
|
102
|
-
- ✅ `snow_discover_integration_endpoints` - Find REST/SOAP endpoints
|
|
103
|
-
- `snow_create_rest_message` - Create REST Message endpoints
|
|
104
|
-
- `snow_create_rest_method` - Create REST methods
|
|
105
|
-
- `snow_create_transform_map` - Create Transform Maps
|
|
106
|
-
- `snow_create_field_map` - Create Field Maps
|
|
107
|
-
- `snow_create_import_set` - Create Import Set tables
|
|
108
|
-
- `snow_create_web_service` - Create Web Services
|
|
109
|
-
- `snow_create_email_config` - Create Email configurations
|
|
110
|
-
- `snow_test_integration` - Test integration endpoints
|
|
111
|
-
- `snow_discover_data_sources` - Discover data sources
|
|
112
|
-
|
|
113
|
-
#### **📈 Reporting & Analytics** (12+ tools)
|
|
114
|
-
- ✅ `snow_discover_reporting_tables` - Table discovery for reporting
|
|
115
|
-
- ✅ `snow_analyze_data_quality` - Data quality assessment
|
|
116
|
-
- `snow_create_report` - Create reports with dynamic discovery
|
|
117
|
-
- `snow_create_dashboard` - Create dashboards
|
|
118
|
-
- `snow_create_kpi` - Create KPIs
|
|
119
|
-
- `snow_create_data_visualization` - Create data visualizations
|
|
120
|
-
- `snow_create_performance_analytics` - Performance analytics
|
|
121
|
-
- `snow_create_scheduled_report` - Scheduled reports
|
|
122
|
-
- `snow_discover_report_fields` - Discover report fields
|
|
123
|
-
- `snow_generate_insights` - Generate data insights
|
|
124
|
-
- `snow_export_report_data` - Export report data
|
|
125
|
-
|
|
126
|
-
#### **⚙️ Automation** (11+ tools)
|
|
127
|
-
- ✅ `snow_discover_automation_jobs` - Find scheduled jobs, notifications, SLAs
|
|
128
|
-
- ✅ `snow_discover_events` - Discover ServiceNow events
|
|
129
|
-
- ✅ `snow_discover_schedules` - Find system schedules
|
|
130
|
-
- `snow_create_scheduled_job` - Create scheduled jobs
|
|
131
|
-
- `snow_create_event_rule` - Create event rules
|
|
132
|
-
- `snow_create_notification` - Create notifications
|
|
133
|
-
- `snow_create_sla_definition` - Create SLA definitions
|
|
134
|
-
- `snow_create_escalation_rule` - Create escalation rules
|
|
135
|
-
- `snow_create_workflow_activity` - Create workflow activities
|
|
136
|
-
- `snow_test_scheduled_job` - Test scheduled job execution
|
|
137
|
-
|
|
138
|
-
#### **🛡️ Security & Compliance** (12+ tools)
|
|
139
|
-
- `snow_create_security_policy` - Create security policies
|
|
140
|
-
- `snow_create_compliance_rule` - Create compliance rules
|
|
141
|
-
- `snow_create_audit_rule` - Create audit rules
|
|
142
|
-
- `snow_create_access_control` - Create access controls
|
|
143
|
-
- `snow_create_data_policy` - Create data policies
|
|
144
|
-
- `snow_create_vulnerability_scan` - Create vulnerability scans
|
|
145
|
-
- `snow_discover_security_frameworks` - Discover frameworks
|
|
146
|
-
- `snow_discover_security_policies` - Discover policies
|
|
147
|
-
- `snow_run_compliance_scan` - Run compliance scans
|
|
148
|
-
- `snow_audit_trail_analysis` - Analyze audit trails
|
|
149
|
-
- `snow_security_risk_assessment` - Security risk assessment
|
|
150
|
-
|
|
151
|
-
#### **📦 Update Set Management** (9+ tools)
|
|
152
|
-
- ✅ `snow_update_set_current` - Get current update set
|
|
153
|
-
- ✅ `snow_update_set_list` - List update sets
|
|
154
|
-
- `snow_update_set_create` - Create new update sets
|
|
155
|
-
- `snow_update_set_switch` - Switch update sets
|
|
156
|
-
- `snow_update_set_complete` - Mark update sets complete
|
|
157
|
-
- `snow_update_set_add_artifact` - Track artifacts
|
|
158
|
-
- `snow_update_set_preview` - Preview changes
|
|
159
|
-
- `snow_update_set_export` - Export update sets
|
|
160
|
-
- `snow_ensure_active_update_set` - Ensure active session
|
|
161
|
-
|
|
162
|
-
#### **🚀 Deployment & Development** (15+ tools)
|
|
163
|
-
- ✅ `snow_preview_widget` - Preview widget rendering
|
|
164
|
-
- ✅ `snow_validate_deployment` - Validate deployments
|
|
165
|
-
- ⚠️ `snow_deploy` - Deploy artifacts (permission issues)
|
|
166
|
-
- ⚠️ `snow_widget_test` - Test widgets (404 errors)
|
|
167
|
-
- `snow_auth_diagnostics` - Authentication diagnostics
|
|
168
|
-
- `snow_create_ui_page` - Create UI pages
|
|
169
|
-
- `snow_create_script_include` - Create script includes
|
|
170
|
-
- `snow_create_business_rule` - Create business rules
|
|
171
|
-
- `snow_create_client_script` - Create client scripts
|
|
172
|
-
- `snow_create_ui_policy` - Create UI policies
|
|
173
|
-
- `snow_create_ui_action` - Create UI actions
|
|
174
|
-
- `snow_rollback_deployment` - Rollback deployments
|
|
175
|
-
- `snow_deployment_status` - Check deployment status
|
|
176
|
-
- `snow_export_artifact` - Export artifacts
|
|
177
|
-
- `snow_import_artifact` - Import artifacts
|
|
178
|
-
|
|
179
|
-
### **🎯 Natural Language Interface**
|
|
180
|
-
|
|
181
|
-
Access all 50+ tools through the swarm command:
|
|
182
|
-
|
|
183
|
-
```bash
|
|
184
|
-
# AI Orchestration
|
|
185
|
-
snow-flow swarm "Initialize a development swarm with 5 agents to analyze my ServiceNow instance"
|
|
186
|
-
|
|
187
|
-
# User and group management
|
|
188
|
-
snow-flow swarm "Create a new user group for incident managers and add users"
|
|
189
|
-
|
|
190
|
-
# Advanced analytics
|
|
191
|
-
snow-flow swarm "Create a performance dashboard for incident resolution metrics"
|
|
192
|
-
|
|
193
|
-
# Integration setup
|
|
194
|
-
snow-flow swarm "Set up REST integration with external system for data import"
|
|
195
|
-
|
|
196
|
-
# Security analysis
|
|
197
|
-
snow-flow swarm "Run comprehensive security scan and create compliance report"
|
|
198
|
-
|
|
199
|
-
# Automation deployment
|
|
200
|
-
snow-flow swarm "Create automated notification rules for high priority incidents"
|
|
31
|
+
Message 3: Read("file1.js")
|
|
32
|
+
// This is 3x slower and breaks coordination!
|
|
201
33
|
```
|
|
202
34
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
- **✅ Working Tools**: 35+ tools (70% success rate)
|
|
206
|
-
- **⚠️ Limited Tools**: 8 tools (permission/config issues)
|
|
207
|
-
- **🔧 In Development**: 5+ tools (under development)
|
|
208
|
-
|
|
209
|
-
### **🔧 Technical Details**
|
|
210
|
-
|
|
211
|
-
- **OAuth Authentication** with ServiceNow instances
|
|
212
|
-
- **50+ MCP tools** across 8 categories
|
|
213
|
-
- **AI Swarm Orchestration** for complex workflows
|
|
214
|
-
- **TypeScript implementation** with comprehensive error handling
|
|
215
|
-
- **Real-time API integration** - no mock data or demos
|
|
216
|
-
- **Natural language interface** for all operations
|
|
217
|
-
|
|
218
|
-
## SPARC Development Commands
|
|
219
|
-
|
|
220
|
-
### Core SPARC Commands
|
|
221
|
-
|
|
222
|
-
- `npx snow-flow sparc modes`: List all available SPARC development modes
|
|
223
|
-
- `npx snow-flow sparc run <mode> "<task>"`: Execute specific SPARC mode for a task
|
|
224
|
-
- `npx snow-flow sparc tdd "<feature>"`: Run complete TDD workflow using SPARC methodology
|
|
225
|
-
- `npx snow-flow sparc info <mode>`: Get detailed information about a specific mode
|
|
226
|
-
|
|
227
|
-
### Batchtools Commands (Optimized)
|
|
228
|
-
|
|
229
|
-
- `npx snow-flow sparc batch <modes> "<task>"`: Execute multiple SPARC modes in parallel
|
|
230
|
-
- `npx snow-flow sparc pipeline "<task>"`: Execute full SPARC pipeline with parallel processing
|
|
231
|
-
- `npx snow-flow sparc concurrent <mode> "<tasks-file>"`: Process multiple tasks concurrently
|
|
232
|
-
|
|
233
|
-
### Standard Build Commands
|
|
234
|
-
|
|
35
|
+
## Build Commands
|
|
235
36
|
- `npm run build`: Build the project
|
|
236
|
-
- `npm run test`: Run the test suite
|
|
237
|
-
- `npm run lint`: Run
|
|
37
|
+
- `npm run test`: Run the full test suite
|
|
38
|
+
- `npm run lint`: Run ESLint and format checks
|
|
238
39
|
- `npm run typecheck`: Run TypeScript type checking
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
40
|
+
- `./snow-flow --help`: Show all available commands
|
|
41
|
+
|
|
42
|
+
## Snow-Flow Complete Command Reference
|
|
43
|
+
|
|
44
|
+
### Core System Commands
|
|
45
|
+
- `./snow-flow start [--ui] [--port 3000]`: Start orchestration system
|
|
46
|
+
- `./snow-flow status`: Show comprehensive system status
|
|
47
|
+
- `./snow-flow config <subcommand>`: Configuration management
|
|
48
|
+
|
|
49
|
+
### Agent Management
|
|
50
|
+
- `./snow-flow agent spawn <type>`: Create AI agents
|
|
51
|
+
- `./snow-flow agent list`: List all active agents
|
|
52
|
+
|
|
53
|
+
### Task Orchestration
|
|
54
|
+
- `./snow-flow task create <type>`: Create and manage tasks
|
|
55
|
+
- `./snow-flow workflow <file>`: Execute workflow automation
|
|
56
|
+
|
|
57
|
+
### Memory Management
|
|
58
|
+
- `./snow-flow memory store <key> <data>`: Store persistent data
|
|
59
|
+
- `./snow-flow memory get <key>`: Retrieve stored information
|
|
60
|
+
- `./snow-flow memory list`: List all memory keys
|
|
61
|
+
|
|
62
|
+
### SPARC Development Modes
|
|
63
|
+
- `./snow-flow sparc "<task>"`: Run orchestrator mode (default)
|
|
64
|
+
- `./snow-flow sparc run <mode> "<task>"`: Run specific SPARC mode
|
|
65
|
+
- `./snow-flow sparc tdd "<feature>"`: Test-driven development mode
|
|
66
|
+
|
|
67
|
+
### Swarm Coordination - 🚀 Enhanced with Complete Solution
|
|
68
|
+
- `./snow-flow swarm "<objective>" [options]`: Multi-agent swarm coordination - één command voor alles!
|
|
69
|
+
- `--strategy`: research, development, analysis, testing, optimization, maintenance
|
|
70
|
+
- `--mode`: centralized, distributed, hierarchical, mesh, hybrid
|
|
71
|
+
- `--max-agents <n>`: Maximum number of agents (default: 5)
|
|
72
|
+
- `--parallel`: Enable parallel execution
|
|
73
|
+
- `--monitor`: Real-time monitoring
|
|
74
|
+
|
|
75
|
+
**🧠 Intelligent Features (enabled by default):**
|
|
76
|
+
- `--smart-discovery`: Smart artifact discovery and reuse (default: **true**)
|
|
77
|
+
- `--live-testing`: Enable live testing during development (default: **true**)
|
|
78
|
+
- `--auto-deploy`: Automatic deployment when ready (default: **true**)
|
|
79
|
+
- `--shared-memory`: Enable shared memory between agents (default: **true**)
|
|
80
|
+
|
|
81
|
+
## Quick Start Workflows
|
|
82
|
+
|
|
83
|
+
### 🚀 Intelligent Development Workflow
|
|
244
84
|
```bash
|
|
245
|
-
#
|
|
246
|
-
|
|
85
|
+
# Simple usage - all intelligent features enabled by default!
|
|
86
|
+
./snow-flow swarm "Create incident management dashboard with real-time updates"
|
|
87
|
+
# This automatically:
|
|
88
|
+
# ✅ Discovers existing artifacts to reuse
|
|
89
|
+
# ✅ Tests in real-time on your ServiceNow instance
|
|
90
|
+
# ✅ Deploys automatically when ready
|
|
91
|
+
# ✅ Shares context between all agents
|
|
247
92
|
```
|
|
248
93
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
### 2. Pseudocode Phase (Concurrent Logic Design)
|
|
252
|
-
|
|
94
|
+
### Research Workflow
|
|
253
95
|
```bash
|
|
254
|
-
|
|
255
|
-
|
|
96
|
+
./snow-flow swarm "Research modern web frameworks" --strategy research --mode distributed --parallel
|
|
97
|
+
./snow-flow sparc run researcher "Analyze React vs Vue performance"
|
|
98
|
+
./snow-flow memory store "research_findings" "Key insights"
|
|
256
99
|
```
|
|
257
100
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
### 3. Architecture Phase (Parallel Component Design)
|
|
261
|
-
|
|
262
|
-
```bash
|
|
263
|
-
# Design system architecture with concurrent component analysis
|
|
264
|
-
npx snow-flow sparc run architect "Design authentication service architecture" --parallel
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
**Batchtools Optimization**: Generate multiple architectural alternatives simultaneously, validate integration points in parallel, and create comprehensive documentation concurrently.
|
|
268
|
-
|
|
269
|
-
### 4. Refinement Phase (Parallel TDD Implementation)
|
|
270
|
-
|
|
101
|
+
### Development Workflow
|
|
271
102
|
```bash
|
|
272
|
-
|
|
273
|
-
|
|
103
|
+
./snow-flow start --ui --port 3000
|
|
104
|
+
./snow-flow sparc tdd "User authentication system with JWT tokens"
|
|
105
|
+
./snow-flow swarm "Build e-commerce API" --strategy development --max-agents 8
|
|
274
106
|
```
|
|
275
107
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
### 5. Completion Phase (Concurrent Integration)
|
|
108
|
+
## Integration Patterns
|
|
279
109
|
|
|
110
|
+
### Memory-Driven Coordination
|
|
280
111
|
```bash
|
|
281
|
-
#
|
|
282
|
-
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
**Batchtools Optimization**: Run integration tests in parallel, generate documentation concurrently, and validate requirements simultaneously.
|
|
286
|
-
|
|
287
|
-
## Batchtools Integration Features
|
|
288
|
-
|
|
289
|
-
### Parallel Processing Capabilities
|
|
290
|
-
|
|
291
|
-
- **Concurrent File Operations**: Read, analyze, and modify multiple files simultaneously
|
|
292
|
-
- **Parallel Code Analysis**: Analyze dependencies, patterns, and architecture concurrently
|
|
293
|
-
- **Batch Test Generation**: Create comprehensive test suites in parallel
|
|
294
|
-
- **Concurrent Documentation**: Generate multiple documentation formats simultaneously
|
|
295
|
-
|
|
296
|
-
### Performance Optimizations
|
|
297
|
-
|
|
298
|
-
- **Smart Batching**: Group related operations for optimal performance
|
|
299
|
-
- **Pipeline Processing**: Chain dependent operations with parallel stages
|
|
300
|
-
- **Resource Management**: Efficient utilization of system resources
|
|
301
|
-
- **Error Resilience**: Robust error handling with parallel recovery
|
|
302
|
-
|
|
303
|
-
## Performance Benchmarks
|
|
304
|
-
|
|
305
|
-
### Batchtools Performance Improvements
|
|
112
|
+
# Store architecture decisions
|
|
113
|
+
./snow-flow memory store "system_architecture" "Microservices with API Gateway"
|
|
306
114
|
|
|
307
|
-
|
|
308
|
-
-
|
|
309
|
-
- **Test Generation**: 400% faster with parallel test creation
|
|
310
|
-
- **Documentation**: 200% improvement with concurrent content generation
|
|
311
|
-
- **Memory Operations**: 180% faster with batched read/write operations
|
|
312
|
-
|
|
313
|
-
## Code Style and Best Practices (Batchtools Enhanced)
|
|
314
|
-
|
|
315
|
-
### SPARC Development Principles with Batchtools
|
|
316
|
-
|
|
317
|
-
- **Modular Design**: Keep files under 500 lines, optimize with parallel analysis
|
|
318
|
-
- **Environment Safety**: Never hardcode secrets, validate with concurrent checks
|
|
319
|
-
- **Test-First**: Always write tests before implementation using parallel generation
|
|
320
|
-
- **Clean Architecture**: Separate concerns with concurrent validation
|
|
321
|
-
- **Parallel Documentation**: Maintain clear, up-to-date documentation with concurrent updates
|
|
322
|
-
|
|
323
|
-
### Batchtools Best Practices
|
|
324
|
-
|
|
325
|
-
- **Parallel Operations**: Use batchtools for independent tasks
|
|
326
|
-
- **Concurrent Validation**: Validate multiple aspects simultaneously
|
|
327
|
-
- **Batch Processing**: Group similar operations for efficiency
|
|
328
|
-
- **Pipeline Optimization**: Chain operations with parallel stages
|
|
329
|
-
- **Resource Management**: Monitor and optimize resource usage
|
|
330
|
-
|
|
331
|
-
## Important Notes (Enhanced)
|
|
332
|
-
|
|
333
|
-
- Always run tests before committing with parallel execution (`npm run test --parallel`)
|
|
334
|
-
- Use SPARC memory system with concurrent operations to maintain context across sessions
|
|
335
|
-
- Follow the Red-Green-Refactor cycle with parallel test generation during TDD phases
|
|
336
|
-
- Document architectural decisions with concurrent validation in memory
|
|
337
|
-
- Regular security reviews with parallel analysis for authentication or data handling code
|
|
338
|
-
- Claude Code slash commands provide quick access to batchtools-optimized SPARC modes
|
|
339
|
-
- Monitor system resources during parallel operations for optimal performance
|
|
340
|
-
|
|
341
|
-
## Available Agents (54 Total)
|
|
342
|
-
|
|
343
|
-
### 🚀 Concurrent Agent Usage
|
|
344
|
-
|
|
345
|
-
**CRITICAL**: Always spawn multiple agents concurrently using the Task tool in a single message:
|
|
346
|
-
|
|
347
|
-
```javascript
|
|
348
|
-
// ✅ CORRECT: Concurrent agent deployment
|
|
349
|
-
[Single Message]:
|
|
350
|
-
- Task("Agent 1", "full instructions", "agent-type-1")
|
|
351
|
-
- Task("Agent 2", "full instructions", "agent-type-2")
|
|
352
|
-
- Task("Agent 3", "full instructions", "agent-type-3")
|
|
353
|
-
- Task("Agent 4", "full instructions", "agent-type-4")
|
|
354
|
-
- Task("Agent 5", "full instructions", "agent-type-5")
|
|
115
|
+
# All subsequent operations reference this decision
|
|
116
|
+
./snow-flow sparc run coder "Implement user service based on system_architecture"
|
|
355
117
|
```
|
|
356
118
|
|
|
357
|
-
###
|
|
358
|
-
|
|
359
|
-
#### **Core Development Agents**
|
|
360
|
-
|
|
361
|
-
- `coder` - Implementation specialist
|
|
362
|
-
- `reviewer` - Code quality assurance
|
|
363
|
-
- `tester` - Test creation and validation
|
|
364
|
-
- `planner` - Strategic planning
|
|
365
|
-
- `researcher` - Information gathering
|
|
366
|
-
|
|
367
|
-
**Concurrent Usage:**
|
|
368
|
-
|
|
119
|
+
### Multi-Stage Development
|
|
369
120
|
```bash
|
|
370
|
-
#
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
Task("Implement features", "...", "coder")
|
|
374
|
-
Task("Create tests", "...", "tester")
|
|
375
|
-
Task("Review code", "...", "reviewer")
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
#### **Swarm Coordination Agents**
|
|
121
|
+
# Stage 1: Research and planning
|
|
122
|
+
./snow-flow sparc run researcher "Research authentication best practices"
|
|
123
|
+
./snow-flow sparc run architect "Design authentication system"
|
|
379
124
|
|
|
380
|
-
|
|
381
|
-
-
|
|
382
|
-
- `adaptive-coordinator` - Dynamic topology
|
|
383
|
-
- `collective-intelligence-coordinator` - Hive-mind intelligence
|
|
384
|
-
- `swarm-memory-manager` - Distributed memory
|
|
125
|
+
# Stage 2: Implementation
|
|
126
|
+
./snow-flow sparc tdd "User registration and login functionality"
|
|
385
127
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
```bash
|
|
389
|
-
# Deploy multi-topology coordination
|
|
390
|
-
Task("Hierarchical coordination", "...", "hierarchical-coordinator")
|
|
391
|
-
Task("Mesh network backup", "...", "mesh-coordinator")
|
|
392
|
-
Task("Adaptive optimization", "...", "adaptive-coordinator")
|
|
128
|
+
# Stage 3: Testing and deployment
|
|
129
|
+
./snow-flow sparc run tester "Comprehensive security testing"
|
|
393
130
|
```
|
|
394
131
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
- `byzantine-coordinator` - Byzantine fault tolerance
|
|
398
|
-
- `raft-manager` - Leader election protocols
|
|
399
|
-
- `gossip-coordinator` - Epidemic dissemination
|
|
400
|
-
- `consensus-builder` - Decision-making algorithms
|
|
401
|
-
- `crdt-synchronizer` - Conflict-free replication
|
|
402
|
-
- `quorum-manager` - Dynamic quorum management
|
|
403
|
-
- `security-manager` - Cryptographic security
|
|
404
|
-
|
|
405
|
-
#### **Performance & Optimization**
|
|
406
|
-
|
|
407
|
-
- `perf-analyzer` - Bottleneck identification
|
|
408
|
-
- `performance-benchmarker` - Performance testing
|
|
409
|
-
- `task-orchestrator` - Workflow optimization
|
|
410
|
-
- `memory-coordinator` - Memory management
|
|
411
|
-
- `smart-agent` - Intelligent coordination
|
|
412
|
-
|
|
413
|
-
#### **GitHub & Repository Management**
|
|
414
|
-
|
|
415
|
-
- `github-modes` - Comprehensive GitHub integration
|
|
416
|
-
- `pr-manager` - Pull request management
|
|
417
|
-
- `code-review-swarm` - Multi-agent code review
|
|
418
|
-
- `issue-tracker` - Issue management
|
|
419
|
-
- `release-manager` - Release coordination
|
|
420
|
-
- `workflow-automation` - CI/CD automation
|
|
421
|
-
- `project-board-sync` - Project tracking
|
|
422
|
-
- `repo-architect` - Repository optimization
|
|
423
|
-
- `multi-repo-swarm` - Cross-repository coordination
|
|
424
|
-
|
|
425
|
-
#### **SPARC Methodology Agents**
|
|
426
|
-
|
|
427
|
-
- `sparc-coord` - SPARC orchestration
|
|
428
|
-
- `sparc-coder` - TDD implementation
|
|
429
|
-
- `specification` - Requirements analysis
|
|
430
|
-
- `pseudocode` - Algorithm design
|
|
431
|
-
- `architecture` - System design
|
|
432
|
-
- `refinement` - Iterative improvement
|
|
132
|
+
## Advanced Batch Tool Patterns
|
|
433
133
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
- `backend-dev` - API development
|
|
437
|
-
- `mobile-dev` - React Native development
|
|
438
|
-
- `ml-developer` - Machine learning
|
|
439
|
-
- `cicd-engineer` - CI/CD pipelines
|
|
440
|
-
- `api-docs` - OpenAPI documentation
|
|
441
|
-
- `system-architect` - High-level design
|
|
442
|
-
- `code-analyzer` - Code quality analysis
|
|
443
|
-
- `base-template-generator` - Boilerplate creation
|
|
444
|
-
|
|
445
|
-
#### **Testing & Validation**
|
|
446
|
-
|
|
447
|
-
- `tdd-london-swarm` - Mock-driven TDD
|
|
448
|
-
- `production-validator` - Real implementation validation
|
|
449
|
-
|
|
450
|
-
#### **Migration & Planning**
|
|
451
|
-
|
|
452
|
-
- `migration-planner` - System migrations
|
|
453
|
-
- `swarm-init` - Topology initialization
|
|
454
|
-
|
|
455
|
-
### 🎯 Concurrent Agent Patterns
|
|
456
|
-
|
|
457
|
-
#### **Full-Stack Development Swarm (8 agents)**
|
|
458
|
-
|
|
459
|
-
```bash
|
|
460
|
-
Task("System architecture", "...", "system-architect")
|
|
461
|
-
Task("Backend APIs", "...", "backend-dev")
|
|
462
|
-
Task("Frontend mobile", "...", "mobile-dev")
|
|
463
|
-
Task("Database design", "...", "coder")
|
|
464
|
-
Task("API documentation", "...", "api-docs")
|
|
465
|
-
Task("CI/CD pipeline", "...", "cicd-engineer")
|
|
466
|
-
Task("Performance testing", "...", "performance-benchmarker")
|
|
467
|
-
Task("Production validation", "...", "production-validator")
|
|
468
|
-
```
|
|
469
|
-
|
|
470
|
-
#### **Distributed System Swarm (6 agents)**
|
|
471
|
-
|
|
472
|
-
```bash
|
|
473
|
-
Task("Byzantine consensus", "...", "byzantine-coordinator")
|
|
474
|
-
Task("Raft coordination", "...", "raft-manager")
|
|
475
|
-
Task("Gossip protocols", "...", "gossip-coordinator")
|
|
476
|
-
Task("CRDT synchronization", "...", "crdt-synchronizer")
|
|
477
|
-
Task("Security management", "...", "security-manager")
|
|
478
|
-
Task("Performance monitoring", "...", "perf-analyzer")
|
|
479
|
-
```
|
|
480
|
-
|
|
481
|
-
#### **GitHub Workflow Swarm (5 agents)**
|
|
482
|
-
|
|
483
|
-
```bash
|
|
484
|
-
Task("PR management", "...", "pr-manager")
|
|
485
|
-
Task("Code review", "...", "code-review-swarm")
|
|
486
|
-
Task("Issue tracking", "...", "issue-tracker")
|
|
487
|
-
Task("Release coordination", "...", "release-manager")
|
|
488
|
-
Task("Workflow automation", "...", "workflow-automation")
|
|
489
|
-
```
|
|
490
|
-
|
|
491
|
-
#### **SPARC TDD Swarm (7 agents)**
|
|
492
|
-
|
|
493
|
-
```bash
|
|
494
|
-
Task("Requirements spec", "...", "specification")
|
|
495
|
-
Task("Algorithm design", "...", "pseudocode")
|
|
496
|
-
Task("System architecture", "...", "architecture")
|
|
497
|
-
Task("TDD implementation", "...", "sparc-coder")
|
|
498
|
-
Task("London school tests", "...", "tdd-london-swarm")
|
|
499
|
-
Task("Iterative refinement", "...", "refinement")
|
|
500
|
-
Task("Production validation", "...", "production-validator")
|
|
501
|
-
```
|
|
502
|
-
|
|
503
|
-
### ⚡ Performance Optimization
|
|
504
|
-
|
|
505
|
-
**Agent Selection Strategy:**
|
|
506
|
-
|
|
507
|
-
- **High Priority**: Use 3-5 agents max for critical path
|
|
508
|
-
- **Medium Priority**: Use 5-8 agents for complex features
|
|
509
|
-
- **Large Projects**: Use 8+ agents with proper coordination
|
|
510
|
-
|
|
511
|
-
**Memory Management:**
|
|
512
|
-
|
|
513
|
-
- Use `memory-coordinator` for cross-agent state
|
|
514
|
-
- Implement `swarm-memory-manager` for distributed coordination
|
|
515
|
-
- Apply `collective-intelligence-coordinator` for decision-making
|
|
516
|
-
|
|
517
|
-
For more information about SPARC methodology and batchtools optimization, see:
|
|
518
|
-
|
|
519
|
-
- SPARC Guide: https://github.com/ruvnet/claude-code-flow/docs/sparc.md
|
|
520
|
-
- Batchtools Documentation: https://github.com/ruvnet/claude-code-flow/docs/batchtools.md
|
|
521
|
-
|
|
522
|
-
# important-instruction-reminders
|
|
523
|
-
|
|
524
|
-
Message 3: Task("Agent 2")
|
|
525
|
-
Message 4: Read("file1.js")
|
|
526
|
-
Message 5: Write("output1.js")
|
|
527
|
-
Message 6: Bash("npm install")
|
|
528
|
-
// This is 6x slower and breaks coordination!
|
|
529
|
-
|
|
530
|
-
```
|
|
531
|
-
|
|
532
|
-
### 🎯 CONCURRENT EXECUTION CHECKLIST:
|
|
533
|
-
|
|
534
|
-
Before sending ANY message, ask yourself:
|
|
535
|
-
|
|
536
|
-
- ✅ Are ALL related TodoWrite operations batched together?
|
|
537
|
-
- ✅ Are ALL Task spawning operations in ONE message?
|
|
538
|
-
- ✅ Are ALL file operations (Read/Write/Edit) batched together?
|
|
539
|
-
- ✅ Are ALL bash commands grouped in ONE message?
|
|
540
|
-
- ✅ Are ALL memory operations concurrent?
|
|
541
|
-
|
|
542
|
-
If ANY answer is "No", you MUST combine operations into a single message!
|
|
543
|
-
|
|
544
|
-
## 🚀 CRITICAL: Claude Code Does ALL Real Work
|
|
545
|
-
|
|
546
|
-
### 🎯 CLAUDE CODE IS THE ONLY EXECUTOR
|
|
547
|
-
|
|
548
|
-
**ABSOLUTE RULE**: Claude Code performs ALL actual work:
|
|
549
|
-
|
|
550
|
-
### ✅ Claude Code ALWAYS Handles:
|
|
551
|
-
|
|
552
|
-
- 🔧 **ALL file operations** (Read, Write, Edit, MultiEdit, Glob, Grep)
|
|
553
|
-
- 💻 **ALL code generation** and programming tasks
|
|
554
|
-
- 🖥️ **ALL bash commands** and system operations
|
|
555
|
-
- 🏗️ **ALL actual implementation** work
|
|
556
|
-
- 🔍 **ALL project navigation** and code analysis
|
|
557
|
-
- 📝 **ALL TodoWrite** and task management
|
|
558
|
-
- 🔄 **ALL git operations** (commit, push, merge)
|
|
559
|
-
- 📦 **ALL package management** (npm, pip, etc.)
|
|
560
|
-
- 🧪 **ALL testing** and validation
|
|
561
|
-
- 🔧 **ALL debugging** and troubleshooting
|
|
562
|
-
|
|
563
|
-
### 🧠 Claude Flow MCP Tools ONLY Handle:
|
|
564
|
-
|
|
565
|
-
- 🎯 **Coordination only** - Planning Claude Code's actions
|
|
566
|
-
- 💾 **Memory management** - Storing decisions and context
|
|
567
|
-
- 🤖 **Neural features** - Learning from Claude Code's work
|
|
568
|
-
- 📊 **Performance tracking** - Monitoring Claude Code's efficiency
|
|
569
|
-
- 🐝 **Swarm orchestration** - Coordinating multiple Claude Code instances
|
|
570
|
-
- 🔗 **GitHub integration** - Advanced repository coordination
|
|
571
|
-
|
|
572
|
-
### 🚨 CRITICAL SEPARATION OF CONCERNS:
|
|
573
|
-
|
|
574
|
-
**❌ MCP Tools NEVER:**
|
|
575
|
-
|
|
576
|
-
- Write files or create content
|
|
577
|
-
- Execute bash commands
|
|
578
|
-
- Generate code
|
|
579
|
-
- Perform file operations
|
|
580
|
-
- Handle TodoWrite operations
|
|
581
|
-
- Execute system commands
|
|
582
|
-
- Do actual implementation work
|
|
583
|
-
|
|
584
|
-
**✅ MCP Tools ONLY:**
|
|
585
|
-
|
|
586
|
-
- Coordinate and plan
|
|
587
|
-
- Store memory and context
|
|
588
|
-
- Track performance
|
|
589
|
-
- Orchestrate workflows
|
|
590
|
-
- Provide intelligence insights
|
|
591
|
-
|
|
592
|
-
### ⚠️ Key Principle:
|
|
593
|
-
|
|
594
|
-
**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.
|
|
595
|
-
|
|
596
|
-
### 🔄 WORKFLOW EXECUTION PATTERN:
|
|
597
|
-
|
|
598
|
-
**✅ CORRECT Workflow:**
|
|
599
|
-
|
|
600
|
-
1. **MCP**: `mcp__snow-flow__swarm_init` (coordination setup)
|
|
601
|
-
2. **MCP**: `mcp__snow-flow__agent_spawn` (planning agents)
|
|
602
|
-
3. **MCP**: `mcp__snow-flow__task_orchestrate` (task coordination)
|
|
603
|
-
4. **Claude Code**: `Task` tool to spawn agents with coordination instructions
|
|
604
|
-
5. **Claude Code**: `TodoWrite` with ALL todos batched (5-10+ in ONE call)
|
|
605
|
-
6. **Claude Code**: `Read`, `Write`, `Edit`, `Bash` (actual work)
|
|
606
|
-
7. **MCP**: `mcp__snow-flow__memory_usage` (store results)
|
|
607
|
-
|
|
608
|
-
**❌ WRONG Workflow:**
|
|
609
|
-
|
|
610
|
-
1. **MCP**: `mcp__snow-flow__terminal_execute` (DON'T DO THIS)
|
|
611
|
-
2. **MCP**: File creation via MCP (DON'T DO THIS)
|
|
612
|
-
3. **MCP**: Code generation via MCP (DON'T DO THIS)
|
|
613
|
-
4. **Claude Code**: Sequential Task calls (DON'T DO THIS)
|
|
614
|
-
5. **Claude Code**: Individual TodoWrite calls (DON'T DO THIS)
|
|
615
|
-
|
|
616
|
-
### 🚨 REMEMBER:
|
|
617
|
-
|
|
618
|
-
- **MCP tools** = Coordination, planning, memory, intelligence
|
|
619
|
-
- **Claude Code** = All actual execution, coding, file operations
|
|
620
|
-
|
|
621
|
-
## 🚀 CRITICAL: Parallel Execution & Batch Operations
|
|
622
|
-
|
|
623
|
-
### 🚨 MANDATORY RULE #1: BATCH EVERYTHING
|
|
624
|
-
|
|
625
|
-
**When using swarms, you MUST use BatchTool for ALL operations:**
|
|
626
|
-
|
|
627
|
-
1. **NEVER** send multiple messages for related operations
|
|
628
|
-
2. **ALWAYS** combine multiple tool calls in ONE message
|
|
629
|
-
3. **PARALLEL** execution is MANDATORY, not optional
|
|
630
|
-
|
|
631
|
-
### ⚡ THE GOLDEN RULE OF SWARMS
|
|
632
|
-
|
|
633
|
-
```
|
|
634
|
-
|
|
635
|
-
If you need to do X operations, they should be in 1 message, not X messages
|
|
636
|
-
|
|
637
|
-
````
|
|
638
|
-
|
|
639
|
-
### 🚨 MANDATORY TODO AND TASK BATCHING
|
|
640
|
-
|
|
641
|
-
**CRITICAL RULE FOR TODOS AND TASKS:**
|
|
642
|
-
|
|
643
|
-
1. **TodoWrite** MUST ALWAYS include ALL todos in ONE call (5-10+ todos)
|
|
644
|
-
2. **Task** tool calls MUST be batched - spawn multiple agents in ONE message
|
|
645
|
-
3. **NEVER** update todos one by one - this breaks parallel coordination
|
|
646
|
-
4. **NEVER** spawn agents sequentially - ALL agents spawn together
|
|
647
|
-
|
|
648
|
-
### 📦 BATCH TOOL EXAMPLES
|
|
649
|
-
|
|
650
|
-
**✅ CORRECT - Everything in ONE Message:**
|
|
134
|
+
### TodoWrite Coordination
|
|
135
|
+
Always use TodoWrite for complex task coordination:
|
|
651
136
|
|
|
652
137
|
```javascript
|
|
653
|
-
[
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
Write "app/src/index.js"
|
|
674
|
-
````
|
|
675
|
-
|
|
676
|
-
**❌ WRONG - Multiple Messages (NEVER DO THIS):**
|
|
677
|
-
|
|
678
|
-
```javascript
|
|
679
|
-
Message 1: mcp__snow-flow__swarm_init
|
|
680
|
-
Message 2: Task("researcher agent")
|
|
681
|
-
Message 3: Task("coder agent")
|
|
682
|
-
Message 4: TodoWrite({ todo: "single todo" })
|
|
683
|
-
Message 5: Bash "mkdir src"
|
|
684
|
-
Message 6: Write "package.json"
|
|
685
|
-
// This is 6x slower and breaks parallel coordination!
|
|
686
|
-
```
|
|
687
|
-
|
|
688
|
-
### 🎯 BATCH OPERATIONS BY TYPE
|
|
689
|
-
|
|
690
|
-
**Todo and Task Operations (Single Message):**
|
|
691
|
-
|
|
692
|
-
- **TodoWrite** → ALWAYS include 5-10+ todos in ONE call
|
|
693
|
-
- **Task agents** → Spawn ALL agents with full instructions in ONE message
|
|
694
|
-
- **Agent coordination** → ALL Task calls must include coordination hooks
|
|
695
|
-
- **Status updates** → Update ALL todo statuses together
|
|
696
|
-
- **NEVER** split todos or Task calls across messages!
|
|
697
|
-
|
|
698
|
-
**File Operations (Single Message):**
|
|
699
|
-
|
|
700
|
-
- Read 10 files? → One message with 10 Read calls
|
|
701
|
-
- Write 5 files? → One message with 5 Write calls
|
|
702
|
-
- Edit 1 file many times? → One MultiEdit call
|
|
703
|
-
|
|
704
|
-
**Swarm Operations (Single Message):**
|
|
705
|
-
|
|
706
|
-
- Need 8 agents? → One message with swarm_init + 8 agent_spawn calls
|
|
707
|
-
- Multiple memories? → One message with all memory_usage calls
|
|
708
|
-
- Task + monitoring? → One message with task_orchestrate + swarm_monitor
|
|
709
|
-
|
|
710
|
-
**Command Operations (Single Message):**
|
|
711
|
-
|
|
712
|
-
- Multiple directories? → One message with all mkdir commands
|
|
713
|
-
- Install + test + lint? → One message with all npm commands
|
|
714
|
-
- Git operations? → One message with all git commands
|
|
715
|
-
|
|
716
|
-
## 🚀 Quick Setup (Stdio MCP - Recommended)
|
|
717
|
-
|
|
718
|
-
### 1. Add MCP Server (Stdio - No Port Needed)
|
|
719
|
-
|
|
720
|
-
```bash
|
|
721
|
-
# Add Snow Flow MCP server to Claude Code using stdio
|
|
722
|
-
claude mcp add snow-flow npx snow-flow mcp start
|
|
138
|
+
TodoWrite([
|
|
139
|
+
{
|
|
140
|
+
id: "architecture_design",
|
|
141
|
+
content: "Design system architecture and component interfaces",
|
|
142
|
+
status: "pending",
|
|
143
|
+
priority: "high",
|
|
144
|
+
dependencies: [],
|
|
145
|
+
estimatedTime: "60min",
|
|
146
|
+
assignedAgent: "architect"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: "frontend_development",
|
|
150
|
+
content: "Develop React components and user interface",
|
|
151
|
+
status: "pending",
|
|
152
|
+
priority: "medium",
|
|
153
|
+
dependencies: ["architecture_design"],
|
|
154
|
+
estimatedTime: "120min",
|
|
155
|
+
assignedAgent: "frontend_team"
|
|
156
|
+
}
|
|
157
|
+
]);
|
|
723
158
|
```
|
|
724
159
|
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
- Use
|
|
732
|
-
-
|
|
733
|
-
- This creates a coordination framework for Claude Code's work
|
|
734
|
-
|
|
735
|
-
**Spawn agents:**
|
|
736
|
-
|
|
737
|
-
- Use `mcp__snow-flow__agent_spawn` tool to create specialized coordinators
|
|
738
|
-
- Agent types represent different thinking patterns, not actual coders
|
|
739
|
-
- They help Claude Code approach problems from different angles
|
|
740
|
-
|
|
741
|
-
**Orchestrate tasks:**
|
|
742
|
-
|
|
743
|
-
- Use `mcp__snow-flow__task_orchestrate` tool to coordinate complex workflows
|
|
744
|
-
- This breaks down tasks for Claude Code to execute systematically
|
|
745
|
-
- The agents don't write code - they coordinate Claude Code's actions
|
|
746
|
-
|
|
747
|
-
## Available MCP Tools for Coordination
|
|
748
|
-
|
|
749
|
-
### Coordination Tools:
|
|
750
|
-
|
|
751
|
-
- `mcp__snow-flow__swarm_init` - Set up coordination topology for Claude Code
|
|
752
|
-
- `mcp__snow-flow__agent_spawn` - Create cognitive patterns to guide Claude Code
|
|
753
|
-
- `mcp__snow-flow__task_orchestrate` - Break down and coordinate complex tasks
|
|
754
|
-
|
|
755
|
-
### Monitoring Tools:
|
|
756
|
-
|
|
757
|
-
- `mcp__snow-flow__swarm_status` - Monitor coordination effectiveness
|
|
758
|
-
- `mcp__snow-flow__agent_list` - View active cognitive patterns
|
|
759
|
-
- `mcp__snow-flow__agent_metrics` - Track coordination performance
|
|
760
|
-
- `mcp__snow-flow__task_status` - Check workflow progress
|
|
761
|
-
- `mcp__snow-flow__task_results` - Review coordination outcomes
|
|
762
|
-
|
|
763
|
-
### Memory & Neural Tools:
|
|
764
|
-
|
|
765
|
-
- `mcp__snow-flow__memory_usage` - Persistent memory across sessions
|
|
766
|
-
- `mcp__snow-flow__neural_status` - Neural pattern effectiveness
|
|
767
|
-
- `mcp__snow-flow__neural_train` - Improve coordination patterns
|
|
768
|
-
- `mcp__snow-flow__neural_patterns` - Analyze thinking approaches
|
|
769
|
-
|
|
770
|
-
### GitHub Integration Tools (NEW!):
|
|
771
|
-
|
|
772
|
-
- `mcp__snow-flow__github_swarm` - Create specialized GitHub management swarms
|
|
773
|
-
- `mcp__snow-flow__repo_analyze` - Deep repository analysis with AI
|
|
774
|
-
- `mcp__snow-flow__pr_enhance` - AI-powered pull request improvements
|
|
775
|
-
- `mcp__snow-flow__issue_triage` - Intelligent issue classification
|
|
776
|
-
- `mcp__snow-flow__code_review` - Automated code review with swarms
|
|
777
|
-
|
|
778
|
-
### System Tools:
|
|
779
|
-
|
|
780
|
-
- `mcp__snow-flow__benchmark_run` - Measure coordination efficiency
|
|
781
|
-
- `mcp__snow-flow__features_detect` - Available capabilities
|
|
782
|
-
- `mcp__snow-flow__swarm_monitor` - Real-time coordination tracking
|
|
783
|
-
|
|
784
|
-
## Workflow Examples (Coordination-Focused)
|
|
785
|
-
|
|
786
|
-
### Research Coordination Example
|
|
787
|
-
|
|
788
|
-
**Context:** Claude Code needs to research a complex topic systematically
|
|
789
|
-
|
|
790
|
-
**Step 1:** Set up research coordination
|
|
791
|
-
|
|
792
|
-
- Tool: `mcp__snow-flow__swarm_init`
|
|
793
|
-
- Parameters: `{"topology": "mesh", "maxAgents": 5, "strategy": "balanced"}`
|
|
794
|
-
- Result: Creates a mesh topology for comprehensive exploration
|
|
795
|
-
|
|
796
|
-
**Step 2:** Define research perspectives
|
|
797
|
-
|
|
798
|
-
- Tool: `mcp__snow-flow__agent_spawn`
|
|
799
|
-
- Parameters: `{"type": "researcher", "name": "Literature Review"}`
|
|
800
|
-
- Tool: `mcp__snow-flow__agent_spawn`
|
|
801
|
-
- Parameters: `{"type": "analyst", "name": "Data Analysis"}`
|
|
802
|
-
- Result: Different cognitive patterns for Claude Code to use
|
|
803
|
-
|
|
804
|
-
**Step 3:** Coordinate research execution
|
|
805
|
-
|
|
806
|
-
- Tool: `mcp__snow-flow__task_orchestrate`
|
|
807
|
-
- Parameters: `{"task": "Research neural architecture search papers", "strategy": "adaptive"}`
|
|
808
|
-
- Result: Claude Code systematically searches, reads, and analyzes papers
|
|
809
|
-
|
|
810
|
-
**What Actually Happens:**
|
|
811
|
-
|
|
812
|
-
1. The swarm sets up a coordination framework
|
|
813
|
-
2. Each agent MUST use Snow Flow hooks for coordination:
|
|
814
|
-
- `npx snow-flow hooks pre-task` before starting
|
|
815
|
-
- `npx snow-flow hooks post-edit` after each file operation
|
|
816
|
-
- `npx snow-flow hooks notify` to share decisions
|
|
817
|
-
3. Claude Code uses its native Read, WebSearch, and Task tools
|
|
818
|
-
4. The swarm coordinates through shared memory and hooks
|
|
819
|
-
5. Results are synthesized by Claude Code with full coordination history
|
|
820
|
-
|
|
821
|
-
### Development Coordination Example
|
|
822
|
-
|
|
823
|
-
**Context:** Claude Code needs to build a complex system with multiple components
|
|
824
|
-
|
|
825
|
-
**Step 1:** Set up development coordination
|
|
826
|
-
|
|
827
|
-
- Tool: `mcp__snow-flow__swarm_init`
|
|
828
|
-
- Parameters: `{"topology": "hierarchical", "maxAgents": 8, "strategy": "specialized"}`
|
|
829
|
-
- Result: Hierarchical structure for organized development
|
|
830
|
-
|
|
831
|
-
**Step 2:** Define development perspectives
|
|
832
|
-
|
|
833
|
-
- Tool: `mcp__snow-flow__agent_spawn`
|
|
834
|
-
- Parameters: `{"type": "architect", "name": "System Design"}`
|
|
835
|
-
- Result: Architectural thinking pattern for Claude Code
|
|
836
|
-
|
|
837
|
-
**Step 3:** Coordinate implementation
|
|
838
|
-
|
|
839
|
-
- Tool: `mcp__snow-flow__task_orchestrate`
|
|
840
|
-
- Parameters: `{"task": "Implement user authentication with JWT", "strategy": "parallel"}`
|
|
841
|
-
- Result: Claude Code implements features using its native tools
|
|
842
|
-
|
|
843
|
-
**What Actually Happens:**
|
|
844
|
-
|
|
845
|
-
1. The swarm creates a development coordination plan
|
|
846
|
-
2. Each agent coordinates using mandatory hooks:
|
|
847
|
-
- Pre-task hooks for context loading
|
|
848
|
-
- Post-edit hooks for progress tracking
|
|
849
|
-
- Memory storage for cross-agent coordination
|
|
850
|
-
3. Claude Code uses Write, Edit, Bash tools for implementation
|
|
851
|
-
4. Agents share progress through Claude Flow memory
|
|
852
|
-
5. All code is written by Claude Code with full coordination
|
|
853
|
-
|
|
854
|
-
### GitHub Repository Management Example (NEW!)
|
|
855
|
-
|
|
856
|
-
**Context:** Claude Code needs to manage a complex GitHub repository
|
|
857
|
-
|
|
858
|
-
**Step 1:** Initialize GitHub swarm
|
|
859
|
-
|
|
860
|
-
- Tool: `mcp__snow-flow__github_swarm`
|
|
861
|
-
- Parameters: `{"repository": "owner/repo", "agents": 5, "focus": "maintenance"}`
|
|
862
|
-
- Result: Specialized swarm for repository management
|
|
863
|
-
|
|
864
|
-
**Step 2:** Analyze repository health
|
|
865
|
-
|
|
866
|
-
- Tool: `mcp__snow-flow__repo_analyze`
|
|
867
|
-
- Parameters: `{"deep": true, "include": ["issues", "prs", "code"]}`
|
|
868
|
-
- Result: Comprehensive repository analysis
|
|
869
|
-
|
|
870
|
-
**Step 3:** Enhance pull requests
|
|
871
|
-
|
|
872
|
-
- Tool: `mcp__snow-flow__pr_enhance`
|
|
873
|
-
- Parameters: `{"pr_number": 123, "add_tests": true, "improve_docs": true}`
|
|
874
|
-
- Result: AI-powered PR improvements
|
|
875
|
-
|
|
876
|
-
## Best Practices for Coordination
|
|
877
|
-
|
|
878
|
-
### ✅ DO:
|
|
879
|
-
|
|
880
|
-
- Use MCP tools to coordinate Claude Code's approach to complex tasks
|
|
881
|
-
- Let the swarm break down problems into manageable pieces
|
|
882
|
-
- Use memory tools to maintain context across sessions
|
|
883
|
-
- Monitor coordination effectiveness with status tools
|
|
884
|
-
- Train neural patterns for better coordination over time
|
|
885
|
-
- Leverage GitHub tools for repository management
|
|
886
|
-
|
|
887
|
-
### ❌ DON'T:
|
|
888
|
-
|
|
889
|
-
- Expect agents to write code (Claude Code does all implementation)
|
|
890
|
-
- Use MCP tools for file operations (use Claude Code's native tools)
|
|
891
|
-
- Try to make agents execute bash commands (Claude Code handles this)
|
|
892
|
-
- Confuse coordination with execution (MCP coordinates, Claude executes)
|
|
893
|
-
|
|
894
|
-
## Memory and Persistence
|
|
895
|
-
|
|
896
|
-
The swarm provides persistent memory that helps Claude Code:
|
|
897
|
-
|
|
898
|
-
- Remember project context across sessions
|
|
899
|
-
- Track decisions and rationale
|
|
900
|
-
- Maintain consistency in large projects
|
|
901
|
-
- Learn from previous coordination patterns
|
|
902
|
-
- Store GitHub workflow preferences
|
|
903
|
-
|
|
904
|
-
## Performance Benefits
|
|
905
|
-
|
|
906
|
-
When using Claude Flow coordination with Claude Code:
|
|
907
|
-
|
|
908
|
-
- **84.8% SWE-Bench solve rate** - Better problem-solving through coordination
|
|
909
|
-
- **32.3% token reduction** - Efficient task breakdown reduces redundancy
|
|
910
|
-
- **2.8-4.4x speed improvement** - Parallel coordination strategies
|
|
911
|
-
- **27+ neural models** - Diverse cognitive approaches
|
|
912
|
-
- **GitHub automation** - Streamlined repository management
|
|
913
|
-
|
|
914
|
-
## Claude Code Hooks Integration
|
|
915
|
-
|
|
916
|
-
Claude Flow includes powerful hooks that automate coordination:
|
|
917
|
-
|
|
918
|
-
### Pre-Operation Hooks
|
|
919
|
-
|
|
920
|
-
- **Auto-assign agents** before file edits based on file type
|
|
921
|
-
- **Validate commands** before execution for safety
|
|
922
|
-
- **Prepare resources** automatically for complex operations
|
|
923
|
-
- **Optimize topology** based on task complexity analysis
|
|
924
|
-
- **Cache searches** for improved performance
|
|
925
|
-
- **GitHub context** loading for repository operations
|
|
926
|
-
|
|
927
|
-
### Post-Operation Hooks
|
|
928
|
-
|
|
929
|
-
- **Auto-format code** using language-specific formatters
|
|
930
|
-
- **Train neural patterns** from successful operations
|
|
931
|
-
- **Update memory** with operation context
|
|
932
|
-
- **Analyze performance** and identify bottlenecks
|
|
933
|
-
- **Track token usage** for efficiency metrics
|
|
934
|
-
- **Sync GitHub** state for consistency
|
|
935
|
-
|
|
936
|
-
### Session Management
|
|
937
|
-
|
|
938
|
-
- **Generate summaries** at session end
|
|
939
|
-
- **Persist state** across Claude Code sessions
|
|
940
|
-
- **Track metrics** for continuous improvement
|
|
941
|
-
- **Restore previous** session context automatically
|
|
942
|
-
- **Export workflows** for reuse
|
|
943
|
-
|
|
944
|
-
### Advanced Features (v2.0.0!)
|
|
945
|
-
|
|
946
|
-
- **🚀 Automatic Topology Selection** - Optimal swarm structure for each task
|
|
947
|
-
- **⚡ Parallel Execution** - 2.8-4.4x speed improvements
|
|
948
|
-
- **🧠 Neural Training** - Continuous learning from operations
|
|
949
|
-
- **📊 Bottleneck Analysis** - Real-time performance optimization
|
|
950
|
-
- **🤖 Smart Auto-Spawning** - Zero manual agent management
|
|
951
|
-
- **🛡️ Self-Healing Workflows** - Automatic error recovery
|
|
952
|
-
- **💾 Cross-Session Memory** - Persistent learning & context
|
|
953
|
-
- **🔗 GitHub Integration** - Repository-aware swarms
|
|
954
|
-
|
|
955
|
-
### Configuration
|
|
956
|
-
|
|
957
|
-
Hooks are pre-configured in `.claude/settings.json`. Key features:
|
|
958
|
-
|
|
959
|
-
- Automatic agent assignment for different file types
|
|
960
|
-
- Code formatting on save
|
|
961
|
-
- Neural pattern learning from edits
|
|
962
|
-
- Session state persistence
|
|
963
|
-
- Performance tracking and optimization
|
|
964
|
-
- Intelligent caching and token reduction
|
|
965
|
-
- GitHub workflow automation
|
|
966
|
-
|
|
967
|
-
See `.claude/commands/` for detailed documentation on all features.
|
|
968
|
-
|
|
969
|
-
## Integration Tips
|
|
970
|
-
|
|
971
|
-
1. **Start Simple**: Begin with basic swarm init and single agent
|
|
972
|
-
2. **Scale Gradually**: Add more agents as task complexity increases
|
|
973
|
-
3. **Use Memory**: Store important decisions and context
|
|
974
|
-
4. **Monitor Progress**: Regular status checks ensure effective coordination
|
|
975
|
-
5. **Train Patterns**: Let neural agents learn from successful coordinations
|
|
976
|
-
6. **Enable Hooks**: Use the pre-configured hooks for automation
|
|
977
|
-
7. **GitHub First**: Use GitHub tools for repository management
|
|
978
|
-
|
|
979
|
-
## 🧠 SWARM ORCHESTRATION PATTERN
|
|
980
|
-
|
|
981
|
-
### You are the SWARM ORCHESTRATOR. **IMMEDIATELY SPAWN AGENTS IN PARALLEL** to execute tasks
|
|
982
|
-
|
|
983
|
-
### 🚨 CRITICAL INSTRUCTION: You are the SWARM ORCHESTRATOR
|
|
984
|
-
|
|
985
|
-
**MANDATORY**: When using swarms, you MUST:
|
|
160
|
+
## Code Style Preferences
|
|
161
|
+
- Use ES modules (import/export) syntax
|
|
162
|
+
- Destructure imports when possible
|
|
163
|
+
- Use TypeScript for all new code
|
|
164
|
+
- Follow existing naming conventions
|
|
165
|
+
- Add JSDoc comments for public APIs
|
|
166
|
+
- Use async/await instead of Promise chains
|
|
167
|
+
- Prefer const/let over var
|
|
986
168
|
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
169
|
+
## Workflow Guidelines
|
|
170
|
+
- Always run typecheck after making code changes
|
|
171
|
+
- Run tests before committing changes
|
|
172
|
+
- Use meaningful commit messages
|
|
173
|
+
- Create feature branches for new functionality
|
|
174
|
+
- Ensure all tests pass before merging
|
|
991
175
|
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
**CRITICAL: Dynamic Agent Count Rules**
|
|
995
|
-
|
|
996
|
-
1. **Check CLI Arguments First**: If user runs `npx snow-flow --agents 5`, use 5 agents
|
|
997
|
-
2. **Auto-Decide if No Args**: Without CLI args, analyze task complexity:
|
|
998
|
-
- Simple tasks (1-3 components): 3-4 agents
|
|
999
|
-
- Medium tasks (4-6 components): 5-7 agents
|
|
1000
|
-
- Complex tasks (7+ components): 8-12 agents
|
|
1001
|
-
3. **Agent Type Distribution**: Balance agent types based on task:
|
|
1002
|
-
- Always include 1 coordinator
|
|
1003
|
-
- For code-heavy tasks: more coders
|
|
1004
|
-
- For design tasks: more architects/analysts
|
|
1005
|
-
- For quality tasks: more testers/reviewers
|
|
1006
|
-
|
|
1007
|
-
**Example Auto-Decision Logic:**
|
|
1008
|
-
|
|
1009
|
-
```javascript
|
|
1010
|
-
// If CLI args provided: npx snow-flow --agents 6
|
|
1011
|
-
maxAgents = CLI_ARGS.agents || determineAgentCount(task);
|
|
1012
|
-
|
|
1013
|
-
function determineAgentCount(task) {
|
|
1014
|
-
// Analyze task complexity
|
|
1015
|
-
if (task.includes(['API', 'database', 'auth', 'tests'])) return 8;
|
|
1016
|
-
if (task.includes(['frontend', 'backend'])) return 6;
|
|
1017
|
-
if (task.includes(['simple', 'script'])) return 3;
|
|
1018
|
-
return 5; // default
|
|
1019
|
-
}
|
|
1020
|
-
```
|
|
1021
|
-
|
|
1022
|
-
## 📋 MANDATORY AGENT COORDINATION PROTOCOL
|
|
176
|
+
## 📊 MANDATORY AGENT COORDINATION PROTOCOL
|
|
1023
177
|
|
|
1024
178
|
### 🔴 CRITICAL: Every Agent MUST Follow This Protocol
|
|
1025
179
|
|
|
1026
180
|
When you spawn an agent using the Task tool, that agent MUST:
|
|
1027
181
|
|
|
1028
182
|
**1️⃣ BEFORE Starting Work:**
|
|
1029
|
-
|
|
1030
183
|
```bash
|
|
1031
|
-
# Check previous work and load context
|
|
1032
184
|
npx snow-flow hooks pre-task --description "[agent task]" --auto-spawn-agents false
|
|
1033
185
|
npx snow-flow hooks session-restore --session-id "swarm-[id]" --load-memory true
|
|
1034
186
|
```
|
|
1035
187
|
|
|
1036
188
|
**2️⃣ DURING Work (After EVERY Major Step):**
|
|
1037
|
-
|
|
1038
189
|
```bash
|
|
1039
|
-
# Store progress in memory after each file operation
|
|
1040
190
|
npx snow-flow hooks post-edit --file "[filepath]" --memory-key "swarm/[agent]/[step]"
|
|
1041
|
-
|
|
1042
|
-
# Store decisions and findings
|
|
1043
191
|
npx snow-flow hooks notify --message "[what was done]" --telemetry true
|
|
1044
|
-
|
|
1045
|
-
# Check coordination with other agents
|
|
1046
|
-
npx snow-flow hooks pre-search --query "[what to check]" --cache-results true
|
|
1047
192
|
```
|
|
1048
193
|
|
|
1049
194
|
**3️⃣ AFTER Completing Work:**
|
|
1050
|
-
|
|
1051
195
|
```bash
|
|
1052
|
-
# Save all results and learnings
|
|
1053
196
|
npx snow-flow hooks post-task --task-id "[task]" --analyze-performance true
|
|
1054
197
|
npx snow-flow hooks session-end --export-metrics true --generate-summary true
|
|
1055
198
|
```
|
|
@@ -1063,30 +206,18 @@ You are the [Agent Type] agent in a coordinated swarm.
|
|
|
1063
206
|
|
|
1064
207
|
MANDATORY COORDINATION:
|
|
1065
208
|
1. START: Run `npx snow-flow hooks pre-task --description "[your task]"`
|
|
1066
|
-
2. DURING: After EVERY file operation, run `npx snow-flow hooks post-edit --file "[file]"
|
|
209
|
+
2. DURING: After EVERY file operation, run `npx snow-flow hooks post-edit --file "[file]"`
|
|
1067
210
|
3. MEMORY: Store ALL decisions using `npx snow-flow hooks notify --message "[decision]"`
|
|
1068
|
-
4. END: Run `npx snow-flow hooks post-task --task-id "[task]"
|
|
211
|
+
4. END: Run `npx snow-flow hooks post-task --task-id "[task]"`
|
|
1069
212
|
|
|
1070
213
|
Your specific task: [detailed task description]
|
|
1071
214
|
|
|
1072
215
|
REMEMBER: Coordinate with other agents by checking memory BEFORE making decisions!
|
|
1073
216
|
```
|
|
1074
217
|
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
**THIS IS WRONG ❌ (Sequential - NEVER DO THIS):**
|
|
1078
|
-
|
|
1079
|
-
```
|
|
1080
|
-
Message 1: Initialize swarm
|
|
1081
|
-
Message 2: Spawn agent 1
|
|
1082
|
-
Message 3: Spawn agent 2
|
|
1083
|
-
Message 4: TodoWrite (single todo)
|
|
1084
|
-
Message 5: Create file 1
|
|
1085
|
-
Message 6: TodoWrite (another single todo)
|
|
1086
|
-
```
|
|
1087
|
-
|
|
1088
|
-
**THIS IS CORRECT ✅ (Parallel - ALWAYS DO THIS):**
|
|
218
|
+
## ⚡ PARALLEL EXECUTION IS MANDATORY
|
|
1089
219
|
|
|
220
|
+
**✅ CORRECT (Parallel - ALWAYS DO THIS):**
|
|
1090
221
|
```
|
|
1091
222
|
Message 1: [BatchTool]
|
|
1092
223
|
// MCP coordination setup
|
|
@@ -1094,178 +225,34 @@ Message 1: [BatchTool]
|
|
|
1094
225
|
- mcp__snow-flow__agent_spawn (researcher)
|
|
1095
226
|
- mcp__snow-flow__agent_spawn (coder)
|
|
1096
227
|
- mcp__snow-flow__agent_spawn (analyst)
|
|
1097
|
-
- mcp__snow-flow__agent_spawn (tester)
|
|
1098
|
-
- mcp__snow-flow__agent_spawn (coordinator)
|
|
1099
228
|
|
|
1100
|
-
Message 2: [BatchTool - Claude Code execution]
|
|
1101
229
|
// Task agents with full coordination instructions
|
|
1102
|
-
- Task("You are researcher agent. MANDATORY: Run hooks
|
|
1103
|
-
- Task("You are coder agent. MANDATORY: Run hooks
|
|
1104
|
-
|
|
1105
|
-
- Task("You are tester agent. MANDATORY: Run hooks pre-task, post-edit, post-task. Task: Write comprehensive tests")
|
|
1106
|
-
|
|
230
|
+
- Task("You are researcher agent. MANDATORY: Run hooks. Task: Research API patterns")
|
|
231
|
+
- Task("You are coder agent. MANDATORY: Run hooks. Task: Implement REST endpoints")
|
|
232
|
+
|
|
1107
233
|
// TodoWrite with ALL todos batched
|
|
1108
234
|
- TodoWrite { todos: [
|
|
1109
235
|
{id: "research", content: "Research API patterns", status: "in_progress", priority: "high"},
|
|
1110
236
|
{id: "design", content: "Design database schema", status: "pending", priority: "high"},
|
|
1111
237
|
{id: "implement", content: "Build REST endpoints", status: "pending", priority: "high"},
|
|
1112
|
-
{id: "test", content: "Write unit tests", status: "pending", priority: "medium"}
|
|
1113
|
-
{id: "docs", content: "Create API documentation", status: "pending", priority: "low"},
|
|
1114
|
-
{id: "deploy", content: "Setup deployment", status: "pending", priority: "medium"}
|
|
238
|
+
{id: "test", content: "Write unit tests", status: "pending", priority: "medium"}
|
|
1115
239
|
]}
|
|
1116
240
|
|
|
1117
241
|
// File operations in parallel
|
|
1118
242
|
- Write "api/package.json"
|
|
1119
243
|
- Write "api/server.js"
|
|
1120
|
-
- Write "api/routes/users.js"
|
|
1121
244
|
- Bash "mkdir -p api/{routes,models,tests}"
|
|
1122
245
|
```
|
|
1123
246
|
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
When given ANY complex task with swarms:
|
|
1127
|
-
|
|
1128
|
-
```
|
|
1129
|
-
STEP 1: IMMEDIATE PARALLEL SPAWN (Single Message!)
|
|
1130
|
-
[BatchTool]:
|
|
1131
|
-
// IMPORTANT: Check CLI args for agent count, otherwise auto-decide based on task complexity
|
|
1132
|
-
- mcp__snow-flow__swarm_init {
|
|
1133
|
-
topology: "hierarchical",
|
|
1134
|
-
maxAgents: CLI_ARGS.agents || AUTO_DECIDE(task_complexity), // Use CLI args or auto-decide
|
|
1135
|
-
strategy: "parallel"
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
// Spawn agents based on maxAgents count and task requirements
|
|
1139
|
-
// If CLI specifies 3 agents, spawn 3. If no args, auto-decide optimal count (3-12)
|
|
1140
|
-
- mcp__snow-flow__agent_spawn { type: "architect", name: "System Designer" }
|
|
1141
|
-
- mcp__snow-flow__agent_spawn { type: "coder", name: "API Developer" }
|
|
1142
|
-
- mcp__snow-flow__agent_spawn { type: "coder", name: "Frontend Dev" }
|
|
1143
|
-
- mcp__snow-flow__agent_spawn { type: "analyst", name: "DB Designer" }
|
|
1144
|
-
- mcp__snow-flow__agent_spawn { type: "tester", name: "QA Engineer" }
|
|
1145
|
-
- mcp__snow-flow__agent_spawn { type: "researcher", name: "Tech Lead" }
|
|
1146
|
-
- mcp__snow-flow__agent_spawn { type: "coordinator", name: "PM" }
|
|
1147
|
-
- TodoWrite { todos: [multiple todos at once] }
|
|
1148
|
-
|
|
1149
|
-
STEP 2: PARALLEL TASK EXECUTION (Single Message!)
|
|
1150
|
-
[BatchTool]:
|
|
1151
|
-
- mcp__snow-flow__task_orchestrate { task: "main task", strategy: "parallel" }
|
|
1152
|
-
- mcp__snow-flow__memory_usage { action: "store", key: "init", value: {...} }
|
|
1153
|
-
- Multiple Read operations
|
|
1154
|
-
- Multiple Write operations
|
|
1155
|
-
- Multiple Bash commands
|
|
1156
|
-
|
|
1157
|
-
STEP 3: CONTINUE PARALLEL WORK (Never Sequential!)
|
|
1158
|
-
```
|
|
1159
|
-
|
|
1160
|
-
### 📊 VISUAL TASK TRACKING FORMAT
|
|
1161
|
-
|
|
1162
|
-
Use this format when displaying task progress:
|
|
1163
|
-
|
|
1164
|
-
```
|
|
1165
|
-
📊 Progress Overview
|
|
1166
|
-
├── Total Tasks: X
|
|
1167
|
-
├── ✅ Completed: X (X%)
|
|
1168
|
-
├── 🔄 In Progress: X (X%)
|
|
1169
|
-
├── ⭕ Todo: X (X%)
|
|
1170
|
-
└── ❌ Blocked: X (X%)
|
|
1171
|
-
|
|
1172
|
-
📋 Todo (X)
|
|
1173
|
-
└── 🔴 001: [Task description] [PRIORITY] ▶
|
|
1174
|
-
|
|
1175
|
-
🔄 In progress (X)
|
|
1176
|
-
├── 🟡 002: [Task description] ↳ X deps ▶
|
|
1177
|
-
└── 🔴 003: [Task description] [PRIORITY] ▶
|
|
1178
|
-
|
|
1179
|
-
✅ Completed (X)
|
|
1180
|
-
├── ✅ 004: [Task description]
|
|
1181
|
-
└── ... (more completed tasks)
|
|
1182
|
-
|
|
1183
|
-
Priority indicators: 🔴 HIGH/CRITICAL, 🟡 MEDIUM, 🟢 LOW
|
|
1184
|
-
Dependencies: ↳ X deps | Actionable: ▶
|
|
1185
|
-
```
|
|
1186
|
-
|
|
1187
|
-
### 🎯 REAL EXAMPLE: Full-Stack App Development
|
|
1188
|
-
|
|
1189
|
-
**Task**: "Build a complete REST API with authentication, database, and tests"
|
|
1190
|
-
|
|
1191
|
-
**🚨 MANDATORY APPROACH - Everything in Parallel:**
|
|
1192
|
-
|
|
1193
|
-
```javascript
|
|
1194
|
-
// ✅ CORRECT: SINGLE MESSAGE with ALL operations
|
|
1195
|
-
[BatchTool - Message 1]:
|
|
1196
|
-
// Initialize and spawn ALL agents at once
|
|
1197
|
-
mcp__snow-flow__swarm_init { topology: "hierarchical", maxAgents: 8, strategy: "parallel" }
|
|
1198
|
-
mcp__snow-flow__agent_spawn { type: "architect", name: "System Designer" }
|
|
1199
|
-
mcp__snow-flow__agent_spawn { type: "coder", name: "API Developer" }
|
|
1200
|
-
mcp__snow-flow__agent_spawn { type: "coder", name: "Auth Expert" }
|
|
1201
|
-
mcp__snow-flow__agent_spawn { type: "analyst", name: "DB Designer" }
|
|
1202
|
-
mcp__snow-flow__agent_spawn { type: "tester", name: "Test Engineer" }
|
|
1203
|
-
mcp__snow-flow__agent_spawn { type: "coordinator", name: "Lead" }
|
|
1204
|
-
|
|
1205
|
-
// Update ALL todos at once - NEVER split todos!
|
|
1206
|
-
TodoWrite { todos: [
|
|
1207
|
-
{ id: "design", content: "Design API architecture", status: "in_progress", priority: "high" },
|
|
1208
|
-
{ id: "auth", content: "Implement authentication", status: "pending", priority: "high" },
|
|
1209
|
-
{ id: "db", content: "Design database schema", status: "pending", priority: "high" },
|
|
1210
|
-
{ id: "api", content: "Build REST endpoints", status: "pending", priority: "high" },
|
|
1211
|
-
{ id: "tests", content: "Write comprehensive tests", status: "pending", priority: "medium" },
|
|
1212
|
-
{ id: "docs", content: "Document API endpoints", status: "pending", priority: "low" },
|
|
1213
|
-
{ id: "deploy", content: "Setup deployment pipeline", status: "pending", priority: "medium" },
|
|
1214
|
-
{ id: "monitor", content: "Add monitoring", status: "pending", priority: "medium" }
|
|
1215
|
-
]}
|
|
1216
|
-
|
|
1217
|
-
// Start orchestration
|
|
1218
|
-
mcp__snow-flow__task_orchestrate { task: "Build REST API", strategy: "parallel" }
|
|
1219
|
-
|
|
1220
|
-
// Store initial memory
|
|
1221
|
-
mcp__snow-flow__memory_usage { action: "store", key: "project/init", value: { started: Date.now() } }
|
|
1222
|
-
|
|
1223
|
-
[BatchTool - Message 2]:
|
|
1224
|
-
// Create ALL directories at once
|
|
1225
|
-
Bash("mkdir -p test-app/{src,tests,docs,config}")
|
|
1226
|
-
Bash("mkdir -p test-app/src/{models,routes,middleware,services}")
|
|
1227
|
-
Bash("mkdir -p test-app/tests/{unit,integration}")
|
|
1228
|
-
|
|
1229
|
-
// Write ALL base files at once
|
|
1230
|
-
Write("test-app/package.json", packageJsonContent)
|
|
1231
|
-
Write("test-app/.env.example", envContent)
|
|
1232
|
-
Write("test-app/README.md", readmeContent)
|
|
1233
|
-
Write("test-app/src/server.js", serverContent)
|
|
1234
|
-
Write("test-app/src/config/database.js", dbConfigContent)
|
|
1235
|
-
|
|
1236
|
-
[BatchTool - Message 3]:
|
|
1237
|
-
// Read multiple files for context
|
|
1238
|
-
Read("test-app/package.json")
|
|
1239
|
-
Read("test-app/src/server.js")
|
|
1240
|
-
Read("test-app/.env.example")
|
|
1241
|
-
|
|
1242
|
-
// Run multiple commands
|
|
1243
|
-
Bash("cd test-app && npm install")
|
|
1244
|
-
Bash("cd test-app && npm run lint")
|
|
1245
|
-
Bash("cd test-app && npm test")
|
|
1246
|
-
```
|
|
1247
|
-
|
|
1248
|
-
### 🚫 NEVER DO THIS (Sequential = WRONG):
|
|
1249
|
-
|
|
1250
|
-
```javascript
|
|
1251
|
-
// ❌ WRONG: Multiple messages, one operation each
|
|
1252
|
-
Message 1: mcp__snow-flow__swarm_init
|
|
1253
|
-
Message 2: mcp__snow-flow__agent_spawn (just one agent)
|
|
1254
|
-
Message 3: mcp__snow-flow__agent_spawn (another agent)
|
|
1255
|
-
Message 4: TodoWrite (single todo)
|
|
1256
|
-
Message 5: Write (single file)
|
|
1257
|
-
// This is 5x slower and wastes swarm coordination!
|
|
1258
|
-
```
|
|
1259
|
-
|
|
1260
|
-
### 🔄 MEMORY COORDINATION PATTERN
|
|
247
|
+
## 🔄 MEMORY COORDINATION PATTERN
|
|
1261
248
|
|
|
1262
249
|
Every agent coordination step MUST use memory:
|
|
1263
250
|
|
|
1264
|
-
```
|
|
251
|
+
```javascript
|
|
1265
252
|
// After each major decision or implementation
|
|
1266
|
-
mcp__snow-flow__memory_usage
|
|
1267
|
-
action: "store"
|
|
1268
|
-
key: "swarm-{id}/agent-{name}/{step}"
|
|
253
|
+
mcp__snow-flow__memory_usage({
|
|
254
|
+
action: "store",
|
|
255
|
+
key: "swarm-{id}/agent-{name}/{step}",
|
|
1269
256
|
value: {
|
|
1270
257
|
timestamp: Date.now(),
|
|
1271
258
|
decision: "what was decided",
|
|
@@ -1273,110 +260,129 @@ mcp__snow-flow__memory_usage
|
|
|
1273
260
|
nextSteps: ["step1", "step2"],
|
|
1274
261
|
dependencies: ["dep1", "dep2"]
|
|
1275
262
|
}
|
|
263
|
+
})
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
## Snow-Flow MCP Tools (100+ Total)
|
|
267
|
+
|
|
268
|
+
Snow-Flow provides comprehensive ServiceNow intelligence through 15 specialized MCP servers:
|
|
269
|
+
|
|
270
|
+
### 🧠 **Graph Memory & Dependency Analysis** (7 tools)
|
|
271
|
+
- `snow_graph_index_artifact` - Index artifacts in Neo4j with relationship mapping
|
|
272
|
+
- `snow_graph_find_related` - Find ALL connections & dependencies of any script/artifact
|
|
273
|
+
- `snow_graph_analyze_impact` - AI-powered impact analysis before making changes
|
|
274
|
+
- `snow_graph_suggest_artifacts` - Intelligent artifact suggestions based on patterns
|
|
275
|
+
- `snow_graph_pattern_analysis` - Advanced pattern recognition across all code
|
|
276
|
+
- `snow_graph_visualize` - Generate visual dependency graphs (Cypher/Mermaid)
|
|
277
|
+
- `snow_graph_export_knowledge` - Export learned patterns and relationships
|
|
278
|
+
|
|
279
|
+
### 🔄 **Process Mining & Workflow Analysis** (4 tools)
|
|
280
|
+
- `snow_discover_process` - Real process mining from ServiceNow audit logs
|
|
281
|
+
- `snow_analyze_workflow_execution` - Analyze how workflows REALLY work vs design
|
|
282
|
+
- `snow_discover_cross_table_process` - Discover end-to-end processes across tables
|
|
283
|
+
- `snow_monitor_process` - Real-time process monitoring with anomaly detection
|
|
284
|
+
|
|
285
|
+
### ⚡ **Advanced Analytics & Performance** (6 tools)
|
|
286
|
+
- `snow_batch_api` - 80% API call reduction through intelligent batching
|
|
287
|
+
- `snow_get_table_relationships` - Deep table relationship mapping with visualizations
|
|
288
|
+
- `snow_analyze_query` - Query performance analysis with optimization suggestions
|
|
289
|
+
- `snow_predict_change_impact` - AI-powered change impact prediction (90% accuracy)
|
|
290
|
+
- `snow_detect_code_patterns` - Security & performance anti-pattern detection
|
|
291
|
+
- `snow_generate_documentation` - Auto-generate documentation from code analysis
|
|
292
|
+
|
|
293
|
+
### 📊 **ServiceNow Operations** (15+ tools)
|
|
294
|
+
- Complete ITIL lifecycle management (Incident, Request, Problem, Change)
|
|
295
|
+
- CMDB and User management with intelligent analysis
|
|
296
|
+
- AI-powered incident analysis and auto-resolution capabilities
|
|
297
|
+
- Pattern recognition and predictive analytics
|
|
298
|
+
- Knowledge base integration with smart suggestions
|
|
299
|
+
|
|
300
|
+
### 🔧 **Platform Development** (8+ tools)
|
|
301
|
+
- UI component creation (Pages, scripts, policies, actions)
|
|
302
|
+
- Business rule management with dynamic rule creation
|
|
303
|
+
- Client script development and form automation
|
|
304
|
+
- Complete table schema discovery and analysis
|
|
305
|
+
- Field management with dynamic discovery
|
|
306
|
+
- Script include development for reusable code libraries
|
|
307
|
+
|
|
308
|
+
### 🔗 **Integration** (10+ tools)
|
|
309
|
+
- REST/SOAP endpoint discovery for external system integration
|
|
310
|
+
- Transform map creation and data transformation
|
|
311
|
+
- Import set management and data import automation
|
|
312
|
+
- Web service integration with WSDL-based connections
|
|
313
|
+
- Email configuration and communication integration
|
|
314
|
+
- Comprehensive data source discovery and analysis
|
|
315
|
+
|
|
316
|
+
### 📈 **Reporting & Analytics** (12+ tools)
|
|
317
|
+
- Dynamic report creation with no hardcoded configurations
|
|
318
|
+
- Interactive ServiceNow dashboard generation
|
|
319
|
+
- KPI management and business metrics tracking
|
|
320
|
+
- Advanced data visualization (charts, graphs, visual analytics)
|
|
321
|
+
- System performance monitoring and analytics
|
|
322
|
+
- Automated report delivery and scheduling
|
|
323
|
+
|
|
324
|
+
### ⚙️ **Automation** (11+ tools)
|
|
325
|
+
- Scheduled job management with dynamic schedule discovery
|
|
326
|
+
- Event rule creation and automated event handling
|
|
327
|
+
- Smart notification management and delivery
|
|
328
|
+
- SLA definition and service level automation
|
|
329
|
+
- Escalation rules and automated escalation processes
|
|
330
|
+
- Comprehensive workflow activities and process automation
|
|
331
|
+
|
|
332
|
+
### 🛡️ **Security & Compliance** (12+ tools)
|
|
333
|
+
- Security policy management with dynamic configurations
|
|
334
|
+
- Compliance rule enforcement (SOX, GDPR, HIPAA)
|
|
335
|
+
- Audit trail analysis and security incident detection
|
|
336
|
+
- Access control management and role/permission analysis
|
|
337
|
+
- Proactive vulnerability scanning and assessment
|
|
338
|
+
- Comprehensive security risk assessment and analysis
|
|
339
|
+
|
|
340
|
+
### 🔄 **XML Flow Generation** (5+ tools)
|
|
341
|
+
- XML-first flow creation to bypass API limitations
|
|
342
|
+
- Direct XML deployment with alternative deployment methods
|
|
343
|
+
- Flow template generation for standardized workflows
|
|
344
|
+
- Natural language mapping with AI-powered flow design
|
|
345
|
+
|
|
346
|
+
## Available Agents (25+ Total)
|
|
347
|
+
|
|
348
|
+
### Core Development Agents
|
|
349
|
+
- `coder` - Implementation specialist
|
|
350
|
+
- `reviewer` - Code quality assurance
|
|
351
|
+
- `tester` - Test creation and validation
|
|
352
|
+
- `planner` - Strategic planning
|
|
353
|
+
- `researcher` - Information gathering
|
|
1276
354
|
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
// To check all swarm progress
|
|
1283
|
-
mcp__snow-flow__memory_usage
|
|
1284
|
-
action: "list"
|
|
1285
|
-
pattern: "swarm-{id}/*"
|
|
1286
|
-
```
|
|
1287
|
-
|
|
1288
|
-
### ⚡ PERFORMANCE TIPS
|
|
1289
|
-
|
|
1290
|
-
1. **Batch Everything**: Never operate on single files when multiple are needed
|
|
1291
|
-
2. **Parallel First**: Always think "what can run simultaneously?"
|
|
1292
|
-
3. **Memory is Key**: Use memory for ALL cross-agent coordination
|
|
1293
|
-
4. **Monitor Progress**: Use mcp**snow-flow**swarm_monitor for real-time tracking
|
|
1294
|
-
5. **Auto-Optimize**: Let hooks handle topology and agent selection
|
|
1295
|
-
|
|
1296
|
-
### 🎨 VISUAL SWARM STATUS
|
|
1297
|
-
|
|
1298
|
-
When showing swarm status, use this format:
|
|
1299
|
-
|
|
1300
|
-
```
|
|
1301
|
-
🐝 Swarm Status: ACTIVE
|
|
1302
|
-
├── 🏗️ Topology: hierarchical
|
|
1303
|
-
├── 👥 Agents: 6/8 active
|
|
1304
|
-
├── ⚡ Mode: parallel execution
|
|
1305
|
-
├── 📊 Tasks: 12 total (4 complete, 6 in-progress, 2 pending)
|
|
1306
|
-
└── 🧠 Memory: 15 coordination points stored
|
|
1307
|
-
|
|
1308
|
-
Agent Activity:
|
|
1309
|
-
├── 🟢 architect: Designing database schema...
|
|
1310
|
-
├── 🟢 coder-1: Implementing auth endpoints...
|
|
1311
|
-
├── 🟢 coder-2: Building user CRUD operations...
|
|
1312
|
-
├── 🟢 analyst: Optimizing query performance...
|
|
1313
|
-
├── 🟡 tester: Waiting for auth completion...
|
|
1314
|
-
└── 🟢 coordinator: Monitoring progress...
|
|
1315
|
-
```
|
|
1316
|
-
|
|
1317
|
-
## 📝 CRITICAL: TODOWRITE AND TASK TOOL BATCHING
|
|
1318
|
-
|
|
1319
|
-
### 🚨 MANDATORY BATCHING RULES FOR TODOS AND TASKS
|
|
1320
|
-
|
|
1321
|
-
**TodoWrite Tool Requirements:**
|
|
1322
|
-
|
|
1323
|
-
1. **ALWAYS** include 5-10+ todos in a SINGLE TodoWrite call
|
|
1324
|
-
2. **NEVER** call TodoWrite multiple times in sequence
|
|
1325
|
-
3. **BATCH** all todo updates together - status changes, new todos, completions
|
|
1326
|
-
4. **INCLUDE** all priority levels (high, medium, low) in one call
|
|
1327
|
-
|
|
1328
|
-
**Task Tool Requirements:**
|
|
1329
|
-
|
|
1330
|
-
1. **SPAWN** all agents using Task tool in ONE message
|
|
1331
|
-
2. **NEVER** spawn agents one by one across multiple messages
|
|
1332
|
-
3. **INCLUDE** full task descriptions and coordination instructions
|
|
1333
|
-
4. **BATCH** related Task calls together for parallel execution
|
|
1334
|
-
|
|
1335
|
-
**Example of CORRECT TodoWrite usage:**
|
|
1336
|
-
|
|
1337
|
-
```javascript
|
|
1338
|
-
// ✅ CORRECT - All todos in ONE call
|
|
1339
|
-
TodoWrite { todos: [
|
|
1340
|
-
{ id: "1", content: "Initialize system", status: "completed", priority: "high" },
|
|
1341
|
-
{ id: "2", content: "Analyze requirements", status: "in_progress", priority: "high" },
|
|
1342
|
-
{ id: "3", content: "Design architecture", status: "pending", priority: "high" },
|
|
1343
|
-
{ id: "4", content: "Implement core", status: "pending", priority: "high" },
|
|
1344
|
-
{ id: "5", content: "Build features", status: "pending", priority: "medium" },
|
|
1345
|
-
{ id: "6", content: "Write tests", status: "pending", priority: "medium" },
|
|
1346
|
-
{ id: "7", content: "Add monitoring", status: "pending", priority: "medium" },
|
|
1347
|
-
{ id: "8", content: "Documentation", status: "pending", priority: "low" },
|
|
1348
|
-
{ id: "9", content: "Performance tuning", status: "pending", priority: "low" },
|
|
1349
|
-
{ id: "10", content: "Deploy to production", status: "pending", priority: "high" }
|
|
1350
|
-
]}
|
|
1351
|
-
```
|
|
1352
|
-
|
|
1353
|
-
**Example of WRONG TodoWrite usage:**
|
|
1354
|
-
|
|
1355
|
-
```javascript
|
|
1356
|
-
// ❌ WRONG - Multiple TodoWrite calls
|
|
1357
|
-
Message 1: TodoWrite { todos: [{ id: "1", content: "Task 1", ... }] }
|
|
1358
|
-
Message 2: TodoWrite { todos: [{ id: "2", content: "Task 2", ... }] }
|
|
1359
|
-
Message 3: TodoWrite { todos: [{ id: "3", content: "Task 3", ... }] }
|
|
1360
|
-
// This breaks parallel coordination!
|
|
1361
|
-
```
|
|
1362
|
-
|
|
1363
|
-
## Claude Flow v2.0.0 Features
|
|
1364
|
-
|
|
1365
|
-
Claude Flow extends the base coordination with:
|
|
355
|
+
### Swarm Coordination Agents
|
|
356
|
+
- `hierarchical-coordinator` - Queen-led coordination
|
|
357
|
+
- `mesh-coordinator` - Peer-to-peer networks
|
|
358
|
+
- `adaptive-coordinator` - Dynamic topology
|
|
359
|
+
- `collective-intelligence-coordinator` - Hive-mind intelligence
|
|
1366
360
|
|
|
1367
|
-
|
|
1368
|
-
-
|
|
1369
|
-
-
|
|
1370
|
-
-
|
|
1371
|
-
-
|
|
1372
|
-
-
|
|
361
|
+
### Specialized Development
|
|
362
|
+
- `backend-dev` - API development
|
|
363
|
+
- `mobile-dev` - React Native development
|
|
364
|
+
- `ml-developer` - Machine learning
|
|
365
|
+
- `system-architect` - High-level design
|
|
366
|
+
- `security-agent` - Security analysis
|
|
1373
367
|
|
|
1374
|
-
|
|
368
|
+
### GitHub & Repository Management
|
|
369
|
+
- `github-modes` - Comprehensive GitHub integration
|
|
370
|
+
- `pr-manager` - Pull request management
|
|
371
|
+
- `code-review-swarm` - Multi-agent code review
|
|
1375
372
|
|
|
1376
|
-
|
|
1377
|
-
-
|
|
1378
|
-
-
|
|
373
|
+
### SPARC Methodology Agents
|
|
374
|
+
- `sparc-coord` - SPARC orchestration
|
|
375
|
+
- `sparc-coder` - TDD implementation
|
|
376
|
+
- `specification` - Requirements analysis
|
|
377
|
+
- `architecture` - System design
|
|
1379
378
|
|
|
1380
|
-
|
|
379
|
+
## Important Notes
|
|
380
|
+
- **Use TodoWrite extensively** for all complex task coordination
|
|
381
|
+
- **Leverage Task tool** for parallel agent execution on independent work
|
|
382
|
+
- **Store all important information in Memory** for cross-agent coordination
|
|
383
|
+
- **Use batch file operations** whenever reading/writing multiple files
|
|
384
|
+
- **All swarm operations include automatic batch tool coordination**
|
|
385
|
+
- **Monitor progress** with TodoRead during long-running operations
|
|
386
|
+
- **Enable parallel execution** with --parallel flags for maximum efficiency
|
|
1381
387
|
|
|
1382
|
-
|
|
388
|
+
This configuration ensures optimal use of Claude Code's batch tools for swarm orchestration and parallel task execution with full Snow-Flow capabilities.
|