snow-flow 1.4.24 → 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 CHANGED
@@ -1,4 +1,4 @@
1
- # Claude Code Configuration - SPARC Development Environment (Batchtools Optimized)
1
+ # Claude Code Configuration - Snow-Flow Development Environment
2
2
 
3
3
  ## 🚨 CRITICAL: CONCURRENT EXECUTION FOR ALL ACTIONS
4
4
 
@@ -14,1182 +14,185 @@
14
14
 
15
15
  ### ⚡ GOLDEN RULE: "1 MESSAGE = ALL RELATED OPERATIONS"
16
16
 
17
- **Examples of CORRECT concurrent execution:**
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
- - Task("Agent 3 with full instructions and hooks")
26
- - Read("file1.js")
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
- **Examples of WRONG sequential execution:**
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: Task("Agent 2")
42
- Message 4: Read("file1.js")
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 **14 Advanced ServiceNow Features** for systematic Test-Driven Development with AI assistance through Claude-Flow orchestration.
63
-
64
- **🚀 Batchtools Optimization Enabled**: This configuration includes optimized prompts and parallel processing capabilities for improved performance and efficiency.
65
-
66
- ## 🔥 **NEW: 14 ADVANCED SERVICENOW FEATURES (100% WORKING)**
67
-
68
- **ZERO Mock Data - 100% Real ServiceNow API Integration**
69
-
70
- All features work directly with your ServiceNow instance using OAuth authentication. No placeholder code, no mock data, no demo implementations - everything is production-ready!
71
-
72
- ### **📊 Core Analytics & Performance (Features 1-4)**
73
-
74
- #### **1. Smart Batch API Operations (`snow_batch_api`)**
75
-
76
- - **80% API call reduction** through intelligent batching
77
- - **Parallel execution** with transaction support
78
- - **Query optimization** and result caching
79
- - **Real-time performance monitoring**
80
-
81
- ```javascript
82
- // Execute multiple operations in a single transaction
83
- snow_batch_api({
84
- operations: [
85
- {
86
- operation: 'query',
87
- table: 'incident',
88
- query: 'state=1',
89
- fields: ['number', 'short_description'],
90
- },
91
- { operation: 'update', table: 'incident', sys_id: 'xxx', data: { urgency: '1' } },
92
- { operation: 'insert', table: 'problem', data: { short_description: 'System issue' } },
93
- ],
94
- parallel: true,
95
- transactional: true,
96
- });
97
- ```
98
-
99
- #### **2. Table Relationship Mapping (`snow_get_table_relationships`)**
100
-
101
- - **Deep relationship discovery** across table hierarchies
102
- - **Visual relationship diagrams** (Mermaid format)
103
- - **Impact analysis** for schema changes
104
- - **Performance optimization** recommendations
105
-
106
- ```javascript
107
- // Discover all table relationships with visualization
108
- snow_get_table_relationships({
109
- table: 'incident',
110
- max_depth: 3,
111
- generate_visualization: true,
112
- include_counts: true,
113
- });
31
+ Message 3: Read("file1.js")
32
+ // This is 3x slower and breaks coordination!
114
33
  ```
115
34
 
116
- #### **3. Query Performance Analyzer (`snow_analyze_query`)**
117
-
118
- - **Query execution analysis** with bottleneck detection
119
- - **Index recommendations** for performance optimization
120
- - **Alternative query suggestions**
121
- - **Risk assessment** and execution time prediction
122
-
123
- ```javascript
124
- // Analyze query performance and get optimization suggestions
125
- snow_analyze_query({
126
- query: 'state=1^priority<=2^assigned_to.manager=javascript:gs.getUserID()',
127
- table: 'incident',
128
- analyze_indexes: true,
129
- suggest_optimizations: true,
130
- });
131
- ```
132
-
133
- #### **4. Field Usage Intelligence (`snow_analyze_field_usage`)**
134
-
135
- - **Comprehensive field usage analysis** across all ServiceNow components
136
- - **Unused field detection** with deprecation recommendations
137
- - **Technical debt scoring** and optimization opportunities
138
- - **Cross-component impact analysis**
139
-
140
- ```javascript
141
- // Analyze field usage patterns across all ServiceNow areas
142
- snow_analyze_field_usage({
143
- table: 'incident',
144
- analyze_queries: true,
145
- analyze_reports: true,
146
- analyze_business_rules: true,
147
- unused_threshold_days: 90,
148
- });
149
- ```
150
-
151
- ### **🔄 Migration & Architecture (Features 5-7)**
152
-
153
- #### **5. Migration Helper (`snow_create_migration_plan`)**
154
-
155
- - **Automated migration planning** with risk assessment
156
- - **Data transformation scripts** generation
157
- - **Performance impact estimation**
158
- - **Rollback strategy** creation
159
-
160
- ```javascript
161
- // Create comprehensive migration plan for table restructuring
162
- snow_create_migration_plan({
163
- migration_type: 'field_restructure',
164
- source_table: 'incident',
165
- target_table: 'incident',
166
- target_changes: {
167
- fields_to_add: [{ name: 'u_severity_score', type: 'integer' }],
168
- fields_to_modify: [{ name: 'urgency', new_type: 'choice' }],
169
- },
170
- });
171
- ```
172
-
173
- #### **6. Deep Table Analysis (`snow_analyze_table_deep`)**
174
-
175
- - **Multi-dimensional table analysis** (structure, data quality, performance)
176
- - **Security and compliance** assessment
177
- - **Usage pattern analysis** and optimization recommendations
178
- - **Risk scoring** and remediation guidance
179
-
180
- ```javascript
181
- // Perform comprehensive table analysis
182
- snow_analyze_table_deep({
183
- table_name: 'incident',
184
- analysis_scope: ['structure', 'data_quality', 'performance', 'security'],
185
- generate_recommendations: true,
186
- });
187
- ```
188
-
189
- #### **7. Code Pattern Detector (`snow_detect_code_patterns`)**
190
-
191
- - **Advanced pattern recognition** across all script types
192
- - **Performance anti-pattern detection**
193
- - **Security vulnerability scanning**
194
- - **Maintainability scoring** and refactoring suggestions
195
-
196
- ```javascript
197
- // Detect patterns across all ServiceNow scripts
198
- snow_detect_code_patterns({
199
- analysis_scope: ['business_rules', 'script_includes', 'workflows'],
200
- pattern_categories: ['performance', 'security', 'maintainability'],
201
- max_scripts: 100,
202
- });
203
- ```
204
-
205
- ### **🔮 AI-Powered Intelligence (Features 8-10)**
206
-
207
- #### **8. Predictive Impact Analysis (`snow_predict_change_impact`)**
208
-
209
- - **AI-powered change impact prediction**
210
- - **Risk assessment** with confidence scoring
211
- - **Dependency chain analysis**
212
- - **Rollback requirement prediction**
213
-
214
- ```javascript
215
- // Predict impact of field mandatory change
216
- snow_predict_change_impact({
217
- change_type: 'field_change',
218
- target_object: 'incident',
219
- change_details: {
220
- field_changes: ['urgency'],
221
- new_values: { mandatory: true },
222
- },
223
- });
224
- ```
225
-
226
- #### **9. Auto Documentation Generator (`snow_generate_documentation`)**
227
-
228
- - **Intelligent documentation generation** from code and configuration
229
- - **Multiple output formats** (Markdown, HTML, PDF)
230
- - **Relationship diagrams** and architecture documentation
231
- - **Usage examples** and best practices
232
-
233
- ```javascript
234
- // Generate comprehensive documentation automatically
235
- snow_generate_documentation({
236
- documentation_scope: ['tables', 'workflows', 'integrations'],
237
- target_objects: ['incident', 'problem'],
238
- output_format: 'markdown',
239
- include_diagrams: true,
240
- });
241
- ```
242
-
243
- #### **10. Intelligent Refactoring (`snow_refactor_code`)**
244
-
245
- - **AI-driven code refactoring** with performance optimization
246
- - **Modern JavaScript patterns** and best practices
247
- - **Security hardening** and error handling improvements
248
- - **Preview and validation** before applying changes
249
-
250
- ```javascript
251
- // Analyze and refactor ServiceNow scripts intelligently
252
- snow_refactor_code({
253
- refactoring_scope: ['business_rules', 'script_includes'],
254
- refactoring_goals: ['performance', 'security', 'readability'],
255
- generate_preview: true,
256
- });
257
- ```
258
-
259
- ### **⚙️ Process Mining & Workflow (Features 11-14)**
260
-
261
- #### **11. Process Mining Engine (`snow_discover_process`)**
262
-
263
- - **Real process discovery** from ServiceNow event logs
264
- - **Process variant analysis** and bottleneck identification
265
- - **Compliance checking** against reference models
266
- - **Optimization recommendations** with ROI calculation
267
-
268
- ```javascript
269
- // Discover actual incident management processes
270
- snow_discover_process({
271
- process_type: 'incident_management',
272
- analysis_period: '30d',
273
- include_variants: true,
274
- compliance_analysis: true,
275
- });
276
- ```
277
-
278
- #### **12. Workflow Reality Analyzer (`snow_analyze_workflow_execution`)**
279
-
280
- - **Real workflow execution analysis** vs. designed processes
281
- - **Performance bottleneck identification**
282
- - **SLA compliance monitoring**
283
- - **Resource utilization optimization**
284
-
285
- ```javascript
286
- // Analyze actual workflow execution patterns
287
- snow_analyze_workflow_execution({
288
- workflow_type: 'incident',
289
- analysis_period: '7d',
290
- include_performance_metrics: true,
291
- identify_bottlenecks: true,
292
- });
293
- ```
294
-
295
- #### **13. Cross Table Process Discovery (`snow_discover_cross_table_process`)**
296
-
297
- - **Multi-table process flow discovery**
298
- - **Data lineage and transformation tracking**
299
- - **Integration point analysis**
300
- - **Process automation opportunities**
301
-
302
- ```javascript
303
- // Discover processes spanning multiple tables
304
- snow_discover_cross_table_process({
305
- start_table: 'incident',
306
- end_tables: ['problem', 'change_request'],
307
- analysis_period: '90d',
308
- include_data_flow: true,
309
- });
310
- ```
311
-
312
- #### **14. Real Time Process Monitoring (`snow_monitor_process`)**
313
-
314
- - **Live process monitoring** with real-time alerts
315
- - **Anomaly detection** using machine learning
316
- - **Performance trend analysis**
317
- - **Predictive failure detection**
318
-
319
- ```javascript
320
- // Setup real-time process monitoring
321
- snow_monitor_process({
322
- process_name: 'incident_resolution',
323
- tables_to_monitor: ['incident', 'task'],
324
- monitoring_duration: '24h',
325
- enable_anomaly_detection: true,
326
- });
327
- ```
328
-
329
- ### **🚀 Performance Metrics & Benefits**
330
-
331
- - **80% API call reduction** through intelligent batching
332
- - **60% faster analysis** with parallel processing
333
- - **90% automation** of manual ServiceNow tasks
334
- - **100% real data** - no mocks or placeholders
335
- - **Zero configuration** - works with any ServiceNow instance
336
-
337
- ### **🔧 Technical Implementation**
338
-
339
- - **Real OAuth Authentication** with your ServiceNow instance
340
- - **82+ ServiceNow API calls** for comprehensive data gathering
341
- - **21 MCP-compliant responses** with proper formatting
342
- - **TypeScript implementation** with full type safety
343
- - **Comprehensive error handling** and retry logic
344
-
345
- ### **💡 Usage Examples**
346
-
347
- ```bash
348
- # Quick ServiceNow analysis
349
- npx snow-flow sparc run servicenow-analyzer "Analyze incident table performance and suggest optimizations"
350
-
351
- # Comprehensive process mining
352
- npx snow-flow swarm "Discover all incident management processes and identify bottlenecks" --strategy analysis --auto-deploy
353
-
354
- # Real-time monitoring setup
355
- npx snow-flow sparc run servicenow-monitor "Setup real-time monitoring for change management processes"
356
- ```
357
-
358
- ## SPARC Development Commands
359
-
360
- ### Core SPARC Commands
361
-
362
- - `npx snow-flow sparc modes`: List all available SPARC development modes
363
- - `npx snow-flow sparc run <mode> "<task>"`: Execute specific SPARC mode for a task
364
- - `npx snow-flow sparc tdd "<feature>"`: Run complete TDD workflow using SPARC methodology
365
- - `npx snow-flow sparc info <mode>`: Get detailed information about a specific mode
366
-
367
- ### Batchtools Commands (Optimized)
368
-
369
- - `npx snow-flow sparc batch <modes> "<task>"`: Execute multiple SPARC modes in parallel
370
- - `npx snow-flow sparc pipeline "<task>"`: Execute full SPARC pipeline with parallel processing
371
- - `npx snow-flow sparc concurrent <mode> "<tasks-file>"`: Process multiple tasks concurrently
372
-
373
- ### Standard Build Commands
374
-
35
+ ## Build Commands
375
36
  - `npm run build`: Build the project
376
- - `npm run test`: Run the test suite
377
- - `npm run lint`: Run linter and format checks
37
+ - `npm run test`: Run the full test suite
38
+ - `npm run lint`: Run ESLint and format checks
378
39
  - `npm run typecheck`: Run TypeScript type checking
379
-
380
- ## SPARC Methodology Workflow (Batchtools Enhanced)
381
-
382
- ### 1. Specification Phase (Parallel Analysis)
383
-
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
384
84
  ```bash
385
- # Create detailed specifications with concurrent requirements analysis
386
- npx snow-flow sparc run spec-pseudocode "Define user authentication requirements" --parallel
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
387
92
  ```
388
93
 
389
- **Batchtools Optimization**: Simultaneously analyze multiple requirement sources, validate constraints in parallel, and generate comprehensive specifications.
390
-
391
- ### 2. Pseudocode Phase (Concurrent Logic Design)
392
-
393
- ```bash
394
- # Develop algorithmic logic with parallel pattern analysis
395
- npx snow-flow sparc run spec-pseudocode "Create authentication flow pseudocode" --batch-optimize
396
- ```
397
-
398
- **Batchtools Optimization**: Process multiple algorithm patterns concurrently, validate logic flows in parallel, and optimize data structures simultaneously.
399
-
400
- ### 3. Architecture Phase (Parallel Component Design)
401
-
402
- ```bash
403
- # Design system architecture with concurrent component analysis
404
- npx snow-flow sparc run architect "Design authentication service architecture" --parallel
405
- ```
406
-
407
- **Batchtools Optimization**: Generate multiple architectural alternatives simultaneously, validate integration points in parallel, and create comprehensive documentation concurrently.
408
-
409
- ### 4. Refinement Phase (Parallel TDD Implementation)
410
-
411
- ```bash
412
- # Execute Test-Driven Development with parallel test generation
413
- npx snow-flow sparc tdd "implement user authentication system" --batch-tdd
414
- ```
415
-
416
- **Batchtools Optimization**: Generate multiple test scenarios simultaneously, implement and validate code in parallel, and optimize performance concurrently.
417
-
418
- ### 5. Completion Phase (Concurrent Integration)
419
-
420
- ```bash
421
- # Integration with parallel validation and documentation
422
- npx snow-flow sparc run integration "integrate authentication with user management" --parallel
423
- ```
424
-
425
- **Batchtools Optimization**: Run integration tests in parallel, generate documentation concurrently, and validate requirements simultaneously.
426
-
427
- ## Batchtools Integration Features
428
-
429
- ### Parallel Processing Capabilities
430
-
431
- - **Concurrent File Operations**: Read, analyze, and modify multiple files simultaneously
432
- - **Parallel Code Analysis**: Analyze dependencies, patterns, and architecture concurrently
433
- - **Batch Test Generation**: Create comprehensive test suites in parallel
434
- - **Concurrent Documentation**: Generate multiple documentation formats simultaneously
435
-
436
- ### Performance Optimizations
437
-
438
- - **Smart Batching**: Group related operations for optimal performance
439
- - **Pipeline Processing**: Chain dependent operations with parallel stages
440
- - **Resource Management**: Efficient utilization of system resources
441
- - **Error Resilience**: Robust error handling with parallel recovery
442
-
443
- ## Performance Benchmarks
444
-
445
- ### Batchtools Performance Improvements
446
-
447
- - **File Operations**: Up to 300% faster with parallel processing
448
- - **Code Analysis**: 250% improvement with concurrent pattern recognition
449
- - **Test Generation**: 400% faster with parallel test creation
450
- - **Documentation**: 200% improvement with concurrent content generation
451
- - **Memory Operations**: 180% faster with batched read/write operations
452
-
453
- ## Code Style and Best Practices (Batchtools Enhanced)
454
-
455
- ### SPARC Development Principles with Batchtools
456
-
457
- - **Modular Design**: Keep files under 500 lines, optimize with parallel analysis
458
- - **Environment Safety**: Never hardcode secrets, validate with concurrent checks
459
- - **Test-First**: Always write tests before implementation using parallel generation
460
- - **Clean Architecture**: Separate concerns with concurrent validation
461
- - **Parallel Documentation**: Maintain clear, up-to-date documentation with concurrent updates
462
-
463
- ### Batchtools Best Practices
464
-
465
- - **Parallel Operations**: Use batchtools for independent tasks
466
- - **Concurrent Validation**: Validate multiple aspects simultaneously
467
- - **Batch Processing**: Group similar operations for efficiency
468
- - **Pipeline Optimization**: Chain operations with parallel stages
469
- - **Resource Management**: Monitor and optimize resource usage
470
-
471
- ## Important Notes (Enhanced)
472
-
473
- - Always run tests before committing with parallel execution (`npm run test --parallel`)
474
- - Use SPARC memory system with concurrent operations to maintain context across sessions
475
- - Follow the Red-Green-Refactor cycle with parallel test generation during TDD phases
476
- - Document architectural decisions with concurrent validation in memory
477
- - Regular security reviews with parallel analysis for authentication or data handling code
478
- - Claude Code slash commands provide quick access to batchtools-optimized SPARC modes
479
- - Monitor system resources during parallel operations for optimal performance
480
-
481
- ## Available Agents (54 Total)
482
-
483
- ### 🚀 Concurrent Agent Usage
484
-
485
- **CRITICAL**: Always spawn multiple agents concurrently using the Task tool in a single message:
486
-
487
- ```javascript
488
- // ✅ CORRECT: Concurrent agent deployment
489
- [Single Message]:
490
- - Task("Agent 1", "full instructions", "agent-type-1")
491
- - Task("Agent 2", "full instructions", "agent-type-2")
492
- - Task("Agent 3", "full instructions", "agent-type-3")
493
- - Task("Agent 4", "full instructions", "agent-type-4")
494
- - Task("Agent 5", "full instructions", "agent-type-5")
495
- ```
496
-
497
- ### 📋 Agent Categories & Concurrent Patterns
498
-
499
- #### **Core Development Agents**
500
-
501
- - `coder` - Implementation specialist
502
- - `reviewer` - Code quality assurance
503
- - `tester` - Test creation and validation
504
- - `planner` - Strategic planning
505
- - `researcher` - Information gathering
506
-
507
- **Concurrent Usage:**
508
-
509
- ```bash
510
- # Deploy full development swarm
511
- Task("Research requirements", "...", "researcher")
512
- Task("Plan architecture", "...", "planner")
513
- Task("Implement features", "...", "coder")
514
- Task("Create tests", "...", "tester")
515
- Task("Review code", "...", "reviewer")
516
- ```
517
-
518
- #### **Swarm Coordination Agents**
519
-
520
- - `hierarchical-coordinator` - Queen-led coordination
521
- - `mesh-coordinator` - Peer-to-peer networks
522
- - `adaptive-coordinator` - Dynamic topology
523
- - `collective-intelligence-coordinator` - Hive-mind intelligence
524
- - `swarm-memory-manager` - Distributed memory
525
-
526
- **Concurrent Swarm Deployment:**
527
-
94
+ ### Research Workflow
528
95
  ```bash
529
- # Deploy multi-topology coordination
530
- Task("Hierarchical coordination", "...", "hierarchical-coordinator")
531
- Task("Mesh network backup", "...", "mesh-coordinator")
532
- Task("Adaptive optimization", "...", "adaptive-coordinator")
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"
533
99
  ```
534
100
 
535
- #### **Consensus & Distributed Systems**
536
-
537
- - `byzantine-coordinator` - Byzantine fault tolerance
538
- - `raft-manager` - Leader election protocols
539
- - `gossip-coordinator` - Epidemic dissemination
540
- - `consensus-builder` - Decision-making algorithms
541
- - `crdt-synchronizer` - Conflict-free replication
542
- - `quorum-manager` - Dynamic quorum management
543
- - `security-manager` - Cryptographic security
544
-
545
- #### **Performance & Optimization**
546
-
547
- - `perf-analyzer` - Bottleneck identification
548
- - `performance-benchmarker` - Performance testing
549
- - `task-orchestrator` - Workflow optimization
550
- - `memory-coordinator` - Memory management
551
- - `smart-agent` - Intelligent coordination
552
-
553
- #### **GitHub & Repository Management**
554
-
555
- - `github-modes` - Comprehensive GitHub integration
556
- - `pr-manager` - Pull request management
557
- - `code-review-swarm` - Multi-agent code review
558
- - `issue-tracker` - Issue management
559
- - `release-manager` - Release coordination
560
- - `workflow-automation` - CI/CD automation
561
- - `project-board-sync` - Project tracking
562
- - `repo-architect` - Repository optimization
563
- - `multi-repo-swarm` - Cross-repository coordination
564
-
565
- #### **SPARC Methodology Agents**
566
-
567
- - `sparc-coord` - SPARC orchestration
568
- - `sparc-coder` - TDD implementation
569
- - `specification` - Requirements analysis
570
- - `pseudocode` - Algorithm design
571
- - `architecture` - System design
572
- - `refinement` - Iterative improvement
573
-
574
- #### **Specialized Development**
575
-
576
- - `backend-dev` - API development
577
- - `mobile-dev` - React Native development
578
- - `ml-developer` - Machine learning
579
- - `cicd-engineer` - CI/CD pipelines
580
- - `api-docs` - OpenAPI documentation
581
- - `system-architect` - High-level design
582
- - `code-analyzer` - Code quality analysis
583
- - `base-template-generator` - Boilerplate creation
584
-
585
- #### **Testing & Validation**
586
-
587
- - `tdd-london-swarm` - Mock-driven TDD
588
- - `production-validator` - Real implementation validation
589
-
590
- #### **Migration & Planning**
591
-
592
- - `migration-planner` - System migrations
593
- - `swarm-init` - Topology initialization
594
-
595
- ### 🎯 Concurrent Agent Patterns
596
-
597
- #### **Full-Stack Development Swarm (8 agents)**
598
-
101
+ ### Development Workflow
599
102
  ```bash
600
- Task("System architecture", "...", "system-architect")
601
- Task("Backend APIs", "...", "backend-dev")
602
- Task("Frontend mobile", "...", "mobile-dev")
603
- Task("Database design", "...", "coder")
604
- Task("API documentation", "...", "api-docs")
605
- Task("CI/CD pipeline", "...", "cicd-engineer")
606
- Task("Performance testing", "...", "performance-benchmarker")
607
- Task("Production validation", "...", "production-validator")
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
608
106
  ```
609
107
 
610
- #### **Distributed System Swarm (6 agents)**
108
+ ## Integration Patterns
611
109
 
110
+ ### Memory-Driven Coordination
612
111
  ```bash
613
- Task("Byzantine consensus", "...", "byzantine-coordinator")
614
- Task("Raft coordination", "...", "raft-manager")
615
- Task("Gossip protocols", "...", "gossip-coordinator")
616
- Task("CRDT synchronization", "...", "crdt-synchronizer")
617
- Task("Security management", "...", "security-manager")
618
- Task("Performance monitoring", "...", "perf-analyzer")
619
- ```
620
-
621
- #### **GitHub Workflow Swarm (5 agents)**
112
+ # Store architecture decisions
113
+ ./snow-flow memory store "system_architecture" "Microservices with API Gateway"
622
114
 
623
- ```bash
624
- Task("PR management", "...", "pr-manager")
625
- Task("Code review", "...", "code-review-swarm")
626
- Task("Issue tracking", "...", "issue-tracker")
627
- Task("Release coordination", "...", "release-manager")
628
- Task("Workflow automation", "...", "workflow-automation")
115
+ # All subsequent operations reference this decision
116
+ ./snow-flow sparc run coder "Implement user service based on system_architecture"
629
117
  ```
630
118
 
631
- #### **SPARC TDD Swarm (7 agents)**
632
-
119
+ ### Multi-Stage Development
633
120
  ```bash
634
- Task("Requirements spec", "...", "specification")
635
- Task("Algorithm design", "...", "pseudocode")
636
- Task("System architecture", "...", "architecture")
637
- Task("TDD implementation", "...", "sparc-coder")
638
- Task("London school tests", "...", "tdd-london-swarm")
639
- Task("Iterative refinement", "...", "refinement")
640
- Task("Production validation", "...", "production-validator")
641
- ```
642
-
643
- ### ⚡ Performance Optimization
644
-
645
- **Agent Selection Strategy:**
646
-
647
- - **High Priority**: Use 3-5 agents max for critical path
648
- - **Medium Priority**: Use 5-8 agents for complex features
649
- - **Large Projects**: Use 8+ agents with proper coordination
650
-
651
- **Memory Management:**
652
-
653
- - Use `memory-coordinator` for cross-agent state
654
- - Implement `swarm-memory-manager` for distributed coordination
655
- - Apply `collective-intelligence-coordinator` for decision-making
656
-
657
- For more information about SPARC methodology and batchtools optimization, see:
658
-
659
- - SPARC Guide: https://github.com/ruvnet/claude-code-flow/docs/sparc.md
660
- - Batchtools Documentation: https://github.com/ruvnet/claude-code-flow/docs/batchtools.md
661
-
662
- # important-instruction-reminders
663
-
664
- Message 3: Task("Agent 2")
665
- Message 4: Read("file1.js")
666
- Message 5: Write("output1.js")
667
- Message 6: Bash("npm install")
668
- // This is 6x slower and breaks coordination!
669
-
670
- ```
671
-
672
- ### 🎯 CONCURRENT EXECUTION CHECKLIST:
673
-
674
- Before sending ANY message, ask yourself:
675
-
676
- - ✅ Are ALL related TodoWrite operations batched together?
677
- - ✅ Are ALL Task spawning operations in ONE message?
678
- - ✅ Are ALL file operations (Read/Write/Edit) batched together?
679
- - ✅ Are ALL bash commands grouped in ONE message?
680
- - ✅ Are ALL memory operations concurrent?
681
-
682
- If ANY answer is "No", you MUST combine operations into a single message!
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"
683
124
 
684
- ## 🚀 CRITICAL: Claude Code Does ALL Real Work
685
-
686
- ### 🎯 CLAUDE CODE IS THE ONLY EXECUTOR
687
-
688
- **ABSOLUTE RULE**: Claude Code performs ALL actual work:
689
-
690
- ### ✅ Claude Code ALWAYS Handles:
691
-
692
- - 🔧 **ALL file operations** (Read, Write, Edit, MultiEdit, Glob, Grep)
693
- - 💻 **ALL code generation** and programming tasks
694
- - 🖥️ **ALL bash commands** and system operations
695
- - 🏗️ **ALL actual implementation** work
696
- - 🔍 **ALL project navigation** and code analysis
697
- - 📝 **ALL TodoWrite** and task management
698
- - 🔄 **ALL git operations** (commit, push, merge)
699
- - 📦 **ALL package management** (npm, pip, etc.)
700
- - 🧪 **ALL testing** and validation
701
- - 🔧 **ALL debugging** and troubleshooting
702
-
703
- ### 🧠 Claude Flow MCP Tools ONLY Handle:
704
-
705
- - 🎯 **Coordination only** - Planning Claude Code's actions
706
- - 💾 **Memory management** - Storing decisions and context
707
- - 🤖 **Neural features** - Learning from Claude Code's work
708
- - 📊 **Performance tracking** - Monitoring Claude Code's efficiency
709
- - 🐝 **Swarm orchestration** - Coordinating multiple Claude Code instances
710
- - 🔗 **GitHub integration** - Advanced repository coordination
711
-
712
- ### 🚨 CRITICAL SEPARATION OF CONCERNS:
713
-
714
- **❌ MCP Tools NEVER:**
715
-
716
- - Write files or create content
717
- - Execute bash commands
718
- - Generate code
719
- - Perform file operations
720
- - Handle TodoWrite operations
721
- - Execute system commands
722
- - Do actual implementation work
723
-
724
- **✅ MCP Tools ONLY:**
725
-
726
- - Coordinate and plan
727
- - Store memory and context
728
- - Track performance
729
- - Orchestrate workflows
730
- - Provide intelligence insights
731
-
732
- ### ⚠️ Key Principle:
733
-
734
- **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.
735
-
736
- ### 🔄 WORKFLOW EXECUTION PATTERN:
737
-
738
- **✅ CORRECT Workflow:**
739
-
740
- 1. **MCP**: `mcp__snow-flow__swarm_init` (coordination setup)
741
- 2. **MCP**: `mcp__snow-flow__agent_spawn` (planning agents)
742
- 3. **MCP**: `mcp__snow-flow__task_orchestrate` (task coordination)
743
- 4. **Claude Code**: `Task` tool to spawn agents with coordination instructions
744
- 5. **Claude Code**: `TodoWrite` with ALL todos batched (5-10+ in ONE call)
745
- 6. **Claude Code**: `Read`, `Write`, `Edit`, `Bash` (actual work)
746
- 7. **MCP**: `mcp__snow-flow__memory_usage` (store results)
747
-
748
- **❌ WRONG Workflow:**
749
-
750
- 1. **MCP**: `mcp__snow-flow__terminal_execute` (DON'T DO THIS)
751
- 2. **MCP**: File creation via MCP (DON'T DO THIS)
752
- 3. **MCP**: Code generation via MCP (DON'T DO THIS)
753
- 4. **Claude Code**: Sequential Task calls (DON'T DO THIS)
754
- 5. **Claude Code**: Individual TodoWrite calls (DON'T DO THIS)
755
-
756
- ### 🚨 REMEMBER:
757
-
758
- - **MCP tools** = Coordination, planning, memory, intelligence
759
- - **Claude Code** = All actual execution, coding, file operations
760
-
761
- ## 🚀 CRITICAL: Parallel Execution & Batch Operations
762
-
763
- ### 🚨 MANDATORY RULE #1: BATCH EVERYTHING
764
-
765
- **When using swarms, you MUST use BatchTool for ALL operations:**
766
-
767
- 1. **NEVER** send multiple messages for related operations
768
- 2. **ALWAYS** combine multiple tool calls in ONE message
769
- 3. **PARALLEL** execution is MANDATORY, not optional
770
-
771
- ### ⚡ THE GOLDEN RULE OF SWARMS
125
+ # Stage 2: Implementation
126
+ ./snow-flow sparc tdd "User registration and login functionality"
772
127
 
128
+ # Stage 3: Testing and deployment
129
+ ./snow-flow sparc run tester "Comprehensive security testing"
773
130
  ```
774
131
 
775
- If you need to do X operations, they should be in 1 message, not X messages
776
-
777
- ````
778
-
779
- ### 🚨 MANDATORY TODO AND TASK BATCHING
780
-
781
- **CRITICAL RULE FOR TODOS AND TASKS:**
132
+ ## Advanced Batch Tool Patterns
782
133
 
783
- 1. **TodoWrite** MUST ALWAYS include ALL todos in ONE call (5-10+ todos)
784
- 2. **Task** tool calls MUST be batched - spawn multiple agents in ONE message
785
- 3. **NEVER** update todos one by one - this breaks parallel coordination
786
- 4. **NEVER** spawn agents sequentially - ALL agents spawn together
787
-
788
- ### 📦 BATCH TOOL EXAMPLES
789
-
790
- **✅ CORRECT - Everything in ONE Message:**
791
-
792
- ```javascript
793
- [Single Message with BatchTool]:
794
- // MCP coordination setup
795
- mcp__snow-flow__swarm_init { topology: "mesh", maxAgents: 6 }
796
- mcp__snow-flow__agent_spawn { type: "researcher" }
797
- mcp__snow-flow__agent_spawn { type: "coder" }
798
- mcp__snow-flow__agent_spawn { type: "analyst" }
799
- mcp__snow-flow__agent_spawn { type: "tester" }
800
- mcp__snow-flow__agent_spawn { type: "coordinator" }
801
-
802
- // Claude Code execution - ALL in parallel
803
- Task("You are researcher agent. MUST coordinate via hooks...")
804
- Task("You are coder agent. MUST coordinate via hooks...")
805
- Task("You are analyst agent. MUST coordinate via hooks...")
806
- Task("You are tester agent. MUST coordinate via hooks...")
807
- TodoWrite { todos: [5-10 todos with all priorities and statuses] }
808
-
809
- // File operations in parallel
810
- Bash "mkdir -p app/{src,tests,docs}"
811
- Write "app/package.json"
812
- Write "app/README.md"
813
- Write "app/src/index.js"
814
- ````
815
-
816
- **❌ WRONG - Multiple Messages (NEVER DO THIS):**
134
+ ### TodoWrite Coordination
135
+ Always use TodoWrite for complex task coordination:
817
136
 
818
137
  ```javascript
819
- Message 1: mcp__snow-flow__swarm_init
820
- Message 2: Task("researcher agent")
821
- Message 3: Task("coder agent")
822
- Message 4: TodoWrite({ todo: "single todo" })
823
- Message 5: Bash "mkdir src"
824
- Message 6: Write "package.json"
825
- // This is 6x slower and breaks parallel coordination!
826
- ```
827
-
828
- ### 🎯 BATCH OPERATIONS BY TYPE
829
-
830
- **Todo and Task Operations (Single Message):**
831
-
832
- - **TodoWrite** → ALWAYS include 5-10+ todos in ONE call
833
- - **Task agents** → Spawn ALL agents with full instructions in ONE message
834
- - **Agent coordination** → ALL Task calls must include coordination hooks
835
- - **Status updates** → Update ALL todo statuses together
836
- - **NEVER** split todos or Task calls across messages!
837
-
838
- **File Operations (Single Message):**
839
-
840
- - Read 10 files? → One message with 10 Read calls
841
- - Write 5 files? → One message with 5 Write calls
842
- - Edit 1 file many times? → One MultiEdit call
843
-
844
- **Swarm Operations (Single Message):**
845
-
846
- - Need 8 agents? → One message with swarm_init + 8 agent_spawn calls
847
- - Multiple memories? → One message with all memory_usage calls
848
- - Task + monitoring? → One message with task_orchestrate + swarm_monitor
849
-
850
- **Command Operations (Single Message):**
851
-
852
- - Multiple directories? → One message with all mkdir commands
853
- - Install + test + lint? → One message with all npm commands
854
- - Git operations? → One message with all git commands
855
-
856
- ## 🚀 Quick Setup (Stdio MCP - Recommended)
857
-
858
- ### 1. Add MCP Server (Stdio - No Port Needed)
859
-
860
- ```bash
861
- # Add Snow Flow MCP server to Claude Code using stdio
862
- 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
+ ]);
863
158
  ```
864
159
 
865
- ### 2. Use MCP Tools for Coordination in Claude Code
866
-
867
- Once configured, Claude Flow MCP tools enhance Claude Code's coordination:
868
-
869
- **Initialize a swarm:**
870
-
871
- - Use the `mcp__snow-flow__swarm_init` tool to set up coordination topology
872
- - Choose: mesh, hierarchical, ring, or star
873
- - This creates a coordination framework for Claude Code's work
874
-
875
- **Spawn agents:**
876
-
877
- - Use `mcp__snow-flow__agent_spawn` tool to create specialized coordinators
878
- - Agent types represent different thinking patterns, not actual coders
879
- - They help Claude Code approach problems from different angles
880
-
881
- **Orchestrate tasks:**
882
-
883
- - Use `mcp__snow-flow__task_orchestrate` tool to coordinate complex workflows
884
- - This breaks down tasks for Claude Code to execute systematically
885
- - The agents don't write code - they coordinate Claude Code's actions
886
-
887
- ## Available MCP Tools for Coordination
888
-
889
- ### Coordination Tools:
890
-
891
- - `mcp__snow-flow__swarm_init` - Set up coordination topology for Claude Code
892
- - `mcp__snow-flow__agent_spawn` - Create cognitive patterns to guide Claude Code
893
- - `mcp__snow-flow__task_orchestrate` - Break down and coordinate complex tasks
894
-
895
- ### Monitoring Tools:
896
-
897
- - `mcp__snow-flow__swarm_status` - Monitor coordination effectiveness
898
- - `mcp__snow-flow__agent_list` - View active cognitive patterns
899
- - `mcp__snow-flow__agent_metrics` - Track coordination performance
900
- - `mcp__snow-flow__task_status` - Check workflow progress
901
- - `mcp__snow-flow__task_results` - Review coordination outcomes
902
-
903
- ### Memory & Neural Tools:
904
-
905
- - `mcp__snow-flow__memory_usage` - Persistent memory across sessions
906
- - `mcp__snow-flow__neural_status` - Neural pattern effectiveness
907
- - `mcp__snow-flow__neural_train` - Improve coordination patterns
908
- - `mcp__snow-flow__neural_patterns` - Analyze thinking approaches
909
-
910
- ### GitHub Integration Tools (NEW!):
911
-
912
- - `mcp__snow-flow__github_swarm` - Create specialized GitHub management swarms
913
- - `mcp__snow-flow__repo_analyze` - Deep repository analysis with AI
914
- - `mcp__snow-flow__pr_enhance` - AI-powered pull request improvements
915
- - `mcp__snow-flow__issue_triage` - Intelligent issue classification
916
- - `mcp__snow-flow__code_review` - Automated code review with swarms
917
-
918
- ### System Tools:
919
-
920
- - `mcp__snow-flow__benchmark_run` - Measure coordination efficiency
921
- - `mcp__snow-flow__features_detect` - Available capabilities
922
- - `mcp__snow-flow__swarm_monitor` - Real-time coordination tracking
923
-
924
- ## Workflow Examples (Coordination-Focused)
925
-
926
- ### Research Coordination Example
927
-
928
- **Context:** Claude Code needs to research a complex topic systematically
929
-
930
- **Step 1:** Set up research coordination
931
-
932
- - Tool: `mcp__snow-flow__swarm_init`
933
- - Parameters: `{"topology": "mesh", "maxAgents": 5, "strategy": "balanced"}`
934
- - Result: Creates a mesh topology for comprehensive exploration
935
-
936
- **Step 2:** Define research perspectives
937
-
938
- - Tool: `mcp__snow-flow__agent_spawn`
939
- - Parameters: `{"type": "researcher", "name": "Literature Review"}`
940
- - Tool: `mcp__snow-flow__agent_spawn`
941
- - Parameters: `{"type": "analyst", "name": "Data Analysis"}`
942
- - Result: Different cognitive patterns for Claude Code to use
943
-
944
- **Step 3:** Coordinate research execution
945
-
946
- - Tool: `mcp__snow-flow__task_orchestrate`
947
- - Parameters: `{"task": "Research neural architecture search papers", "strategy": "adaptive"}`
948
- - Result: Claude Code systematically searches, reads, and analyzes papers
949
-
950
- **What Actually Happens:**
951
-
952
- 1. The swarm sets up a coordination framework
953
- 2. Each agent MUST use Snow Flow hooks for coordination:
954
- - `npx snow-flow hooks pre-task` before starting
955
- - `npx snow-flow hooks post-edit` after each file operation
956
- - `npx snow-flow hooks notify` to share decisions
957
- 3. Claude Code uses its native Read, WebSearch, and Task tools
958
- 4. The swarm coordinates through shared memory and hooks
959
- 5. Results are synthesized by Claude Code with full coordination history
960
-
961
- ### Development Coordination Example
962
-
963
- **Context:** Claude Code needs to build a complex system with multiple components
964
-
965
- **Step 1:** Set up development coordination
966
-
967
- - Tool: `mcp__snow-flow__swarm_init`
968
- - Parameters: `{"topology": "hierarchical", "maxAgents": 8, "strategy": "specialized"}`
969
- - Result: Hierarchical structure for organized development
970
-
971
- **Step 2:** Define development perspectives
972
-
973
- - Tool: `mcp__snow-flow__agent_spawn`
974
- - Parameters: `{"type": "architect", "name": "System Design"}`
975
- - Result: Architectural thinking pattern for Claude Code
976
-
977
- **Step 3:** Coordinate implementation
978
-
979
- - Tool: `mcp__snow-flow__task_orchestrate`
980
- - Parameters: `{"task": "Implement user authentication with JWT", "strategy": "parallel"}`
981
- - Result: Claude Code implements features using its native tools
982
-
983
- **What Actually Happens:**
984
-
985
- 1. The swarm creates a development coordination plan
986
- 2. Each agent coordinates using mandatory hooks:
987
- - Pre-task hooks for context loading
988
- - Post-edit hooks for progress tracking
989
- - Memory storage for cross-agent coordination
990
- 3. Claude Code uses Write, Edit, Bash tools for implementation
991
- 4. Agents share progress through Claude Flow memory
992
- 5. All code is written by Claude Code with full coordination
993
-
994
- ### GitHub Repository Management Example (NEW!)
995
-
996
- **Context:** Claude Code needs to manage a complex GitHub repository
997
-
998
- **Step 1:** Initialize GitHub swarm
999
-
1000
- - Tool: `mcp__snow-flow__github_swarm`
1001
- - Parameters: `{"repository": "owner/repo", "agents": 5, "focus": "maintenance"}`
1002
- - Result: Specialized swarm for repository management
1003
-
1004
- **Step 2:** Analyze repository health
1005
-
1006
- - Tool: `mcp__snow-flow__repo_analyze`
1007
- - Parameters: `{"deep": true, "include": ["issues", "prs", "code"]}`
1008
- - Result: Comprehensive repository analysis
1009
-
1010
- **Step 3:** Enhance pull requests
1011
-
1012
- - Tool: `mcp__snow-flow__pr_enhance`
1013
- - Parameters: `{"pr_number": 123, "add_tests": true, "improve_docs": true}`
1014
- - Result: AI-powered PR improvements
1015
-
1016
- ## Best Practices for Coordination
1017
-
1018
- ### ✅ DO:
1019
-
1020
- - Use MCP tools to coordinate Claude Code's approach to complex tasks
1021
- - Let the swarm break down problems into manageable pieces
1022
- - Use memory tools to maintain context across sessions
1023
- - Monitor coordination effectiveness with status tools
1024
- - Train neural patterns for better coordination over time
1025
- - Leverage GitHub tools for repository management
1026
-
1027
- ### ❌ DON'T:
1028
-
1029
- - Expect agents to write code (Claude Code does all implementation)
1030
- - Use MCP tools for file operations (use Claude Code's native tools)
1031
- - Try to make agents execute bash commands (Claude Code handles this)
1032
- - Confuse coordination with execution (MCP coordinates, Claude executes)
1033
-
1034
- ## Memory and Persistence
1035
-
1036
- The swarm provides persistent memory that helps Claude Code:
1037
-
1038
- - Remember project context across sessions
1039
- - Track decisions and rationale
1040
- - Maintain consistency in large projects
1041
- - Learn from previous coordination patterns
1042
- - Store GitHub workflow preferences
1043
-
1044
- ## Performance Benefits
1045
-
1046
- When using Claude Flow coordination with Claude Code:
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
1047
168
 
1048
- - **84.8% SWE-Bench solve rate** - Better problem-solving through coordination
1049
- - **32.3% token reduction** - Efficient task breakdown reduces redundancy
1050
- - **2.8-4.4x speed improvement** - Parallel coordination strategies
1051
- - **27+ neural models** - Diverse cognitive approaches
1052
- - **GitHub automation** - Streamlined repository management
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
1053
175
 
1054
- ## Claude Code Hooks Integration
1055
-
1056
- Claude Flow includes powerful hooks that automate coordination:
1057
-
1058
- ### Pre-Operation Hooks
1059
-
1060
- - **Auto-assign agents** before file edits based on file type
1061
- - **Validate commands** before execution for safety
1062
- - **Prepare resources** automatically for complex operations
1063
- - **Optimize topology** based on task complexity analysis
1064
- - **Cache searches** for improved performance
1065
- - **GitHub context** loading for repository operations
1066
-
1067
- ### Post-Operation Hooks
1068
-
1069
- - **Auto-format code** using language-specific formatters
1070
- - **Train neural patterns** from successful operations
1071
- - **Update memory** with operation context
1072
- - **Analyze performance** and identify bottlenecks
1073
- - **Track token usage** for efficiency metrics
1074
- - **Sync GitHub** state for consistency
1075
-
1076
- ### Session Management
1077
-
1078
- - **Generate summaries** at session end
1079
- - **Persist state** across Claude Code sessions
1080
- - **Track metrics** for continuous improvement
1081
- - **Restore previous** session context automatically
1082
- - **Export workflows** for reuse
1083
-
1084
- ### Advanced Features (v2.0.0!)
1085
-
1086
- - **🚀 Automatic Topology Selection** - Optimal swarm structure for each task
1087
- - **⚡ Parallel Execution** - 2.8-4.4x speed improvements
1088
- - **🧠 Neural Training** - Continuous learning from operations
1089
- - **📊 Bottleneck Analysis** - Real-time performance optimization
1090
- - **🤖 Smart Auto-Spawning** - Zero manual agent management
1091
- - **🛡️ Self-Healing Workflows** - Automatic error recovery
1092
- - **💾 Cross-Session Memory** - Persistent learning & context
1093
- - **🔗 GitHub Integration** - Repository-aware swarms
1094
-
1095
- ### Configuration
1096
-
1097
- Hooks are pre-configured in `.claude/settings.json`. Key features:
1098
-
1099
- - Automatic agent assignment for different file types
1100
- - Code formatting on save
1101
- - Neural pattern learning from edits
1102
- - Session state persistence
1103
- - Performance tracking and optimization
1104
- - Intelligent caching and token reduction
1105
- - GitHub workflow automation
1106
-
1107
- See `.claude/commands/` for detailed documentation on all features.
1108
-
1109
- ## Integration Tips
1110
-
1111
- 1. **Start Simple**: Begin with basic swarm init and single agent
1112
- 2. **Scale Gradually**: Add more agents as task complexity increases
1113
- 3. **Use Memory**: Store important decisions and context
1114
- 4. **Monitor Progress**: Regular status checks ensure effective coordination
1115
- 5. **Train Patterns**: Let neural agents learn from successful coordinations
1116
- 6. **Enable Hooks**: Use the pre-configured hooks for automation
1117
- 7. **GitHub First**: Use GitHub tools for repository management
1118
-
1119
- ## 🧠 SWARM ORCHESTRATION PATTERN
1120
-
1121
- ### You are the SWARM ORCHESTRATOR. **IMMEDIATELY SPAWN AGENTS IN PARALLEL** to execute tasks
1122
-
1123
- ### 🚨 CRITICAL INSTRUCTION: You are the SWARM ORCHESTRATOR
1124
-
1125
- **MANDATORY**: When using swarms, you MUST:
1126
-
1127
- 1. **SPAWN ALL AGENTS IN ONE BATCH** - Use multiple tool calls in a SINGLE message
1128
- 2. **EXECUTE TASKS IN PARALLEL** - Never wait for one task before starting another
1129
- 3. **USE BATCHTOOL FOR EVERYTHING** - Multiple operations = Single message with multiple tools
1130
- 4. **ALL AGENTS MUST USE COORDINATION TOOLS** - Every spawned agent MUST use snow-flow hooks and memory
1131
-
1132
- ### 🎯 AGENT COUNT CONFIGURATION
1133
-
1134
- **CRITICAL: Dynamic Agent Count Rules**
1135
-
1136
- 1. **Check CLI Arguments First**: If user runs `npx snow-flow --agents 5`, use 5 agents
1137
- 2. **Auto-Decide if No Args**: Without CLI args, analyze task complexity:
1138
- - Simple tasks (1-3 components): 3-4 agents
1139
- - Medium tasks (4-6 components): 5-7 agents
1140
- - Complex tasks (7+ components): 8-12 agents
1141
- 3. **Agent Type Distribution**: Balance agent types based on task:
1142
- - Always include 1 coordinator
1143
- - For code-heavy tasks: more coders
1144
- - For design tasks: more architects/analysts
1145
- - For quality tasks: more testers/reviewers
1146
-
1147
- **Example Auto-Decision Logic:**
1148
-
1149
- ```javascript
1150
- // If CLI args provided: npx snow-flow --agents 6
1151
- maxAgents = CLI_ARGS.agents || determineAgentCount(task);
1152
-
1153
- function determineAgentCount(task) {
1154
- // Analyze task complexity
1155
- if (task.includes(['API', 'database', 'auth', 'tests'])) return 8;
1156
- if (task.includes(['frontend', 'backend'])) return 6;
1157
- if (task.includes(['simple', 'script'])) return 3;
1158
- return 5; // default
1159
- }
1160
- ```
1161
-
1162
- ## 📋 MANDATORY AGENT COORDINATION PROTOCOL
176
+ ## 📊 MANDATORY AGENT COORDINATION PROTOCOL
1163
177
 
1164
178
  ### 🔴 CRITICAL: Every Agent MUST Follow This Protocol
1165
179
 
1166
180
  When you spawn an agent using the Task tool, that agent MUST:
1167
181
 
1168
182
  **1️⃣ BEFORE Starting Work:**
1169
-
1170
183
  ```bash
1171
- # Check previous work and load context
1172
184
  npx snow-flow hooks pre-task --description "[agent task]" --auto-spawn-agents false
1173
185
  npx snow-flow hooks session-restore --session-id "swarm-[id]" --load-memory true
1174
186
  ```
1175
187
 
1176
188
  **2️⃣ DURING Work (After EVERY Major Step):**
1177
-
1178
189
  ```bash
1179
- # Store progress in memory after each file operation
1180
190
  npx snow-flow hooks post-edit --file "[filepath]" --memory-key "swarm/[agent]/[step]"
1181
-
1182
- # Store decisions and findings
1183
191
  npx snow-flow hooks notify --message "[what was done]" --telemetry true
1184
-
1185
- # Check coordination with other agents
1186
- npx snow-flow hooks pre-search --query "[what to check]" --cache-results true
1187
192
  ```
1188
193
 
1189
194
  **3️⃣ AFTER Completing Work:**
1190
-
1191
195
  ```bash
1192
- # Save all results and learnings
1193
196
  npx snow-flow hooks post-task --task-id "[task]" --analyze-performance true
1194
197
  npx snow-flow hooks session-end --export-metrics true --generate-summary true
1195
198
  ```
@@ -1203,30 +206,18 @@ You are the [Agent Type] agent in a coordinated swarm.
1203
206
 
1204
207
  MANDATORY COORDINATION:
1205
208
  1. START: Run `npx snow-flow hooks pre-task --description "[your task]"`
1206
- 2. DURING: After EVERY file operation, run `npx snow-flow hooks post-edit --file "[file]" --memory-key "agent/[step]"`
209
+ 2. DURING: After EVERY file operation, run `npx snow-flow hooks post-edit --file "[file]"`
1207
210
  3. MEMORY: Store ALL decisions using `npx snow-flow hooks notify --message "[decision]"`
1208
- 4. END: Run `npx snow-flow hooks post-task --task-id "[task]" --analyze-performance true`
211
+ 4. END: Run `npx snow-flow hooks post-task --task-id "[task]"`
1209
212
 
1210
213
  Your specific task: [detailed task description]
1211
214
 
1212
215
  REMEMBER: Coordinate with other agents by checking memory BEFORE making decisions!
1213
216
  ```
1214
217
 
1215
- ### ⚡ PARALLEL EXECUTION IS MANDATORY
1216
-
1217
- **THIS IS WRONG ❌ (Sequential - NEVER DO THIS):**
1218
-
1219
- ```
1220
- Message 1: Initialize swarm
1221
- Message 2: Spawn agent 1
1222
- Message 3: Spawn agent 2
1223
- Message 4: TodoWrite (single todo)
1224
- Message 5: Create file 1
1225
- Message 6: TodoWrite (another single todo)
1226
- ```
1227
-
1228
- **THIS IS CORRECT ✅ (Parallel - ALWAYS DO THIS):**
218
+ ## ⚡ PARALLEL EXECUTION IS MANDATORY
1229
219
 
220
+ **✅ CORRECT (Parallel - ALWAYS DO THIS):**
1230
221
  ```
1231
222
  Message 1: [BatchTool]
1232
223
  // MCP coordination setup
@@ -1234,178 +225,34 @@ Message 1: [BatchTool]
1234
225
  - mcp__snow-flow__agent_spawn (researcher)
1235
226
  - mcp__snow-flow__agent_spawn (coder)
1236
227
  - mcp__snow-flow__agent_spawn (analyst)
1237
- - mcp__snow-flow__agent_spawn (tester)
1238
- - mcp__snow-flow__agent_spawn (coordinator)
1239
228
 
1240
- Message 2: [BatchTool - Claude Code execution]
1241
229
  // Task agents with full coordination instructions
1242
- - Task("You are researcher agent. MANDATORY: Run hooks pre-task, post-edit, post-task. Task: Research API patterns")
1243
- - Task("You are coder agent. MANDATORY: Run hooks pre-task, post-edit, post-task. Task: Implement REST endpoints")
1244
- - Task("You are analyst agent. MANDATORY: Run hooks pre-task, post-edit, post-task. Task: Analyze performance")
1245
- - Task("You are tester agent. MANDATORY: Run hooks pre-task, post-edit, post-task. Task: Write comprehensive tests")
1246
-
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
+
1247
233
  // TodoWrite with ALL todos batched
1248
234
  - TodoWrite { todos: [
1249
235
  {id: "research", content: "Research API patterns", status: "in_progress", priority: "high"},
1250
236
  {id: "design", content: "Design database schema", status: "pending", priority: "high"},
1251
237
  {id: "implement", content: "Build REST endpoints", status: "pending", priority: "high"},
1252
- {id: "test", content: "Write unit tests", status: "pending", priority: "medium"},
1253
- {id: "docs", content: "Create API documentation", status: "pending", priority: "low"},
1254
- {id: "deploy", content: "Setup deployment", status: "pending", priority: "medium"}
238
+ {id: "test", content: "Write unit tests", status: "pending", priority: "medium"}
1255
239
  ]}
1256
240
 
1257
241
  // File operations in parallel
1258
242
  - Write "api/package.json"
1259
243
  - Write "api/server.js"
1260
- - Write "api/routes/users.js"
1261
244
  - Bash "mkdir -p api/{routes,models,tests}"
1262
245
  ```
1263
246
 
1264
- ### 🎯 MANDATORY SWARM PATTERN
1265
-
1266
- When given ANY complex task with swarms:
1267
-
1268
- ```
1269
- STEP 1: IMMEDIATE PARALLEL SPAWN (Single Message!)
1270
- [BatchTool]:
1271
- // IMPORTANT: Check CLI args for agent count, otherwise auto-decide based on task complexity
1272
- - mcp__snow-flow__swarm_init {
1273
- topology: "hierarchical",
1274
- maxAgents: CLI_ARGS.agents || AUTO_DECIDE(task_complexity), // Use CLI args or auto-decide
1275
- strategy: "parallel"
1276
- }
1277
-
1278
- // Spawn agents based on maxAgents count and task requirements
1279
- // If CLI specifies 3 agents, spawn 3. If no args, auto-decide optimal count (3-12)
1280
- - mcp__snow-flow__agent_spawn { type: "architect", name: "System Designer" }
1281
- - mcp__snow-flow__agent_spawn { type: "coder", name: "API Developer" }
1282
- - mcp__snow-flow__agent_spawn { type: "coder", name: "Frontend Dev" }
1283
- - mcp__snow-flow__agent_spawn { type: "analyst", name: "DB Designer" }
1284
- - mcp__snow-flow__agent_spawn { type: "tester", name: "QA Engineer" }
1285
- - mcp__snow-flow__agent_spawn { type: "researcher", name: "Tech Lead" }
1286
- - mcp__snow-flow__agent_spawn { type: "coordinator", name: "PM" }
1287
- - TodoWrite { todos: [multiple todos at once] }
1288
-
1289
- STEP 2: PARALLEL TASK EXECUTION (Single Message!)
1290
- [BatchTool]:
1291
- - mcp__snow-flow__task_orchestrate { task: "main task", strategy: "parallel" }
1292
- - mcp__snow-flow__memory_usage { action: "store", key: "init", value: {...} }
1293
- - Multiple Read operations
1294
- - Multiple Write operations
1295
- - Multiple Bash commands
1296
-
1297
- STEP 3: CONTINUE PARALLEL WORK (Never Sequential!)
1298
- ```
1299
-
1300
- ### 📊 VISUAL TASK TRACKING FORMAT
1301
-
1302
- Use this format when displaying task progress:
1303
-
1304
- ```
1305
- 📊 Progress Overview
1306
- ├── Total Tasks: X
1307
- ├── ✅ Completed: X (X%)
1308
- ├── 🔄 In Progress: X (X%)
1309
- ├── ⭕ Todo: X (X%)
1310
- └── ❌ Blocked: X (X%)
1311
-
1312
- 📋 Todo (X)
1313
- └── 🔴 001: [Task description] [PRIORITY] ▶
1314
-
1315
- 🔄 In progress (X)
1316
- ├── 🟡 002: [Task description] ↳ X deps ▶
1317
- └── 🔴 003: [Task description] [PRIORITY] ▶
1318
-
1319
- ✅ Completed (X)
1320
- ├── ✅ 004: [Task description]
1321
- └── ... (more completed tasks)
1322
-
1323
- Priority indicators: 🔴 HIGH/CRITICAL, 🟡 MEDIUM, 🟢 LOW
1324
- Dependencies: ↳ X deps | Actionable: ▶
1325
- ```
1326
-
1327
- ### 🎯 REAL EXAMPLE: Full-Stack App Development
1328
-
1329
- **Task**: "Build a complete REST API with authentication, database, and tests"
1330
-
1331
- **🚨 MANDATORY APPROACH - Everything in Parallel:**
1332
-
1333
- ```javascript
1334
- // ✅ CORRECT: SINGLE MESSAGE with ALL operations
1335
- [BatchTool - Message 1]:
1336
- // Initialize and spawn ALL agents at once
1337
- mcp__snow-flow__swarm_init { topology: "hierarchical", maxAgents: 8, strategy: "parallel" }
1338
- mcp__snow-flow__agent_spawn { type: "architect", name: "System Designer" }
1339
- mcp__snow-flow__agent_spawn { type: "coder", name: "API Developer" }
1340
- mcp__snow-flow__agent_spawn { type: "coder", name: "Auth Expert" }
1341
- mcp__snow-flow__agent_spawn { type: "analyst", name: "DB Designer" }
1342
- mcp__snow-flow__agent_spawn { type: "tester", name: "Test Engineer" }
1343
- mcp__snow-flow__agent_spawn { type: "coordinator", name: "Lead" }
1344
-
1345
- // Update ALL todos at once - NEVER split todos!
1346
- TodoWrite { todos: [
1347
- { id: "design", content: "Design API architecture", status: "in_progress", priority: "high" },
1348
- { id: "auth", content: "Implement authentication", status: "pending", priority: "high" },
1349
- { id: "db", content: "Design database schema", status: "pending", priority: "high" },
1350
- { id: "api", content: "Build REST endpoints", status: "pending", priority: "high" },
1351
- { id: "tests", content: "Write comprehensive tests", status: "pending", priority: "medium" },
1352
- { id: "docs", content: "Document API endpoints", status: "pending", priority: "low" },
1353
- { id: "deploy", content: "Setup deployment pipeline", status: "pending", priority: "medium" },
1354
- { id: "monitor", content: "Add monitoring", status: "pending", priority: "medium" }
1355
- ]}
1356
-
1357
- // Start orchestration
1358
- mcp__snow-flow__task_orchestrate { task: "Build REST API", strategy: "parallel" }
1359
-
1360
- // Store initial memory
1361
- mcp__snow-flow__memory_usage { action: "store", key: "project/init", value: { started: Date.now() } }
1362
-
1363
- [BatchTool - Message 2]:
1364
- // Create ALL directories at once
1365
- Bash("mkdir -p test-app/{src,tests,docs,config}")
1366
- Bash("mkdir -p test-app/src/{models,routes,middleware,services}")
1367
- Bash("mkdir -p test-app/tests/{unit,integration}")
1368
-
1369
- // Write ALL base files at once
1370
- Write("test-app/package.json", packageJsonContent)
1371
- Write("test-app/.env.example", envContent)
1372
- Write("test-app/README.md", readmeContent)
1373
- Write("test-app/src/server.js", serverContent)
1374
- Write("test-app/src/config/database.js", dbConfigContent)
1375
-
1376
- [BatchTool - Message 3]:
1377
- // Read multiple files for context
1378
- Read("test-app/package.json")
1379
- Read("test-app/src/server.js")
1380
- Read("test-app/.env.example")
1381
-
1382
- // Run multiple commands
1383
- Bash("cd test-app && npm install")
1384
- Bash("cd test-app && npm run lint")
1385
- Bash("cd test-app && npm test")
1386
- ```
1387
-
1388
- ### 🚫 NEVER DO THIS (Sequential = WRONG):
1389
-
1390
- ```javascript
1391
- // ❌ WRONG: Multiple messages, one operation each
1392
- Message 1: mcp__snow-flow__swarm_init
1393
- Message 2: mcp__snow-flow__agent_spawn (just one agent)
1394
- Message 3: mcp__snow-flow__agent_spawn (another agent)
1395
- Message 4: TodoWrite (single todo)
1396
- Message 5: Write (single file)
1397
- // This is 5x slower and wastes swarm coordination!
1398
- ```
1399
-
1400
- ### 🔄 MEMORY COORDINATION PATTERN
247
+ ## 🔄 MEMORY COORDINATION PATTERN
1401
248
 
1402
249
  Every agent coordination step MUST use memory:
1403
250
 
1404
- ```
251
+ ```javascript
1405
252
  // After each major decision or implementation
1406
- mcp__snow-flow__memory_usage
1407
- action: "store"
1408
- key: "swarm-{id}/agent-{name}/{step}"
253
+ mcp__snow-flow__memory_usage({
254
+ action: "store",
255
+ key: "swarm-{id}/agent-{name}/{step}",
1409
256
  value: {
1410
257
  timestamp: Date.now(),
1411
258
  decision: "what was decided",
@@ -1413,110 +260,129 @@ mcp__snow-flow__memory_usage
1413
260
  nextSteps: ["step1", "step2"],
1414
261
  dependencies: ["dep1", "dep2"]
1415
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
1416
354
 
1417
- // To retrieve coordination data
1418
- mcp__snow-flow__memory_usage
1419
- action: "retrieve"
1420
- key: "swarm-{id}/agent-{name}/{step}"
1421
-
1422
- // To check all swarm progress
1423
- mcp__snow-flow__memory_usage
1424
- action: "list"
1425
- pattern: "swarm-{id}/*"
1426
- ```
1427
-
1428
- ### ⚡ PERFORMANCE TIPS
1429
-
1430
- 1. **Batch Everything**: Never operate on single files when multiple are needed
1431
- 2. **Parallel First**: Always think "what can run simultaneously?"
1432
- 3. **Memory is Key**: Use memory for ALL cross-agent coordination
1433
- 4. **Monitor Progress**: Use mcp**snow-flow**swarm_monitor for real-time tracking
1434
- 5. **Auto-Optimize**: Let hooks handle topology and agent selection
1435
-
1436
- ### 🎨 VISUAL SWARM STATUS
1437
-
1438
- When showing swarm status, use this format:
1439
-
1440
- ```
1441
- 🐝 Swarm Status: ACTIVE
1442
- ├── 🏗️ Topology: hierarchical
1443
- ├── 👥 Agents: 6/8 active
1444
- ├── ⚡ Mode: parallel execution
1445
- ├── 📊 Tasks: 12 total (4 complete, 6 in-progress, 2 pending)
1446
- └── 🧠 Memory: 15 coordination points stored
1447
-
1448
- Agent Activity:
1449
- ├── 🟢 architect: Designing database schema...
1450
- ├── 🟢 coder-1: Implementing auth endpoints...
1451
- ├── 🟢 coder-2: Building user CRUD operations...
1452
- ├── 🟢 analyst: Optimizing query performance...
1453
- ├── 🟡 tester: Waiting for auth completion...
1454
- └── 🟢 coordinator: Monitoring progress...
1455
- ```
1456
-
1457
- ## 📝 CRITICAL: TODOWRITE AND TASK TOOL BATCHING
1458
-
1459
- ### 🚨 MANDATORY BATCHING RULES FOR TODOS AND TASKS
1460
-
1461
- **TodoWrite Tool Requirements:**
1462
-
1463
- 1. **ALWAYS** include 5-10+ todos in a SINGLE TodoWrite call
1464
- 2. **NEVER** call TodoWrite multiple times in sequence
1465
- 3. **BATCH** all todo updates together - status changes, new todos, completions
1466
- 4. **INCLUDE** all priority levels (high, medium, low) in one call
1467
-
1468
- **Task Tool Requirements:**
1469
-
1470
- 1. **SPAWN** all agents using Task tool in ONE message
1471
- 2. **NEVER** spawn agents one by one across multiple messages
1472
- 3. **INCLUDE** full task descriptions and coordination instructions
1473
- 4. **BATCH** related Task calls together for parallel execution
1474
-
1475
- **Example of CORRECT TodoWrite usage:**
1476
-
1477
- ```javascript
1478
- // ✅ CORRECT - All todos in ONE call
1479
- TodoWrite { todos: [
1480
- { id: "1", content: "Initialize system", status: "completed", priority: "high" },
1481
- { id: "2", content: "Analyze requirements", status: "in_progress", priority: "high" },
1482
- { id: "3", content: "Design architecture", status: "pending", priority: "high" },
1483
- { id: "4", content: "Implement core", status: "pending", priority: "high" },
1484
- { id: "5", content: "Build features", status: "pending", priority: "medium" },
1485
- { id: "6", content: "Write tests", status: "pending", priority: "medium" },
1486
- { id: "7", content: "Add monitoring", status: "pending", priority: "medium" },
1487
- { id: "8", content: "Documentation", status: "pending", priority: "low" },
1488
- { id: "9", content: "Performance tuning", status: "pending", priority: "low" },
1489
- { id: "10", content: "Deploy to production", status: "pending", priority: "high" }
1490
- ]}
1491
- ```
1492
-
1493
- **Example of WRONG TodoWrite usage:**
1494
-
1495
- ```javascript
1496
- // ❌ WRONG - Multiple TodoWrite calls
1497
- Message 1: TodoWrite { todos: [{ id: "1", content: "Task 1", ... }] }
1498
- Message 2: TodoWrite { todos: [{ id: "2", content: "Task 2", ... }] }
1499
- Message 3: TodoWrite { todos: [{ id: "3", content: "Task 3", ... }] }
1500
- // This breaks parallel coordination!
1501
- ```
1502
-
1503
- ## Claude Flow v2.0.0 Features
1504
-
1505
- 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
1506
360
 
1507
- - **🔗 GitHub Integration** - Deep repository management
1508
- - **🎯 Project Templates** - Quick-start for common projects
1509
- - **📊 Advanced Analytics** - Detailed performance insights
1510
- - **🤖 Custom Agent Types** - Domain-specific coordinators
1511
- - **🔄 Workflow Automation** - Reusable task sequences
1512
- - **🛡️ Enhanced Security** - Safer command execution
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
1513
367
 
1514
- ## Support
368
+ ### GitHub & Repository Management
369
+ - `github-modes` - Comprehensive GitHub integration
370
+ - `pr-manager` - Pull request management
371
+ - `code-review-swarm` - Multi-agent code review
1515
372
 
1516
- - Documentation: https://github.com/groeimetai/snow-flow
1517
- - Issues: https://github.com/groeimetai/snow-flow/issues
1518
- - Examples: https://github.com/groeimetai/snow-flow/tree/main/examples
373
+ ### SPARC Methodology Agents
374
+ - `sparc-coord` - SPARC orchestration
375
+ - `sparc-coder` - TDD implementation
376
+ - `specification` - Requirements analysis
377
+ - `architecture` - System design
1519
378
 
1520
- ---
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
1521
387
 
1522
- Remember: **Snow-Flow coordinates, Claude Code creates!** Start with `mcp__snow-flow__swarm_init` to enhance your development workflow.
388
+ This configuration ensures optimal use of Claude Code's batch tools for swarm orchestration and parallel task execution with full Snow-Flow capabilities.