moflo 4.9.20 → 4.9.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/.claude/commands/{simplify.md → flo-simplify.md} +4 -4
  2. package/.claude/guidance/shipped/moflo-agent-rules.md +172 -0
  3. package/.claude/guidance/shipped/moflo-claude-swarm-cohesion.md +73 -265
  4. package/.claude/guidance/shipped/moflo-cli-reference.md +6 -6
  5. package/.claude/guidance/shipped/moflo-core-guidance.md +66 -184
  6. package/.claude/guidance/shipped/moflo-cross-platform.md +1 -1
  7. package/.claude/guidance/shipped/moflo-error-handling.md +3 -3
  8. package/.claude/guidance/shipped/moflo-guidance-rules.md +17 -7
  9. package/.claude/guidance/shipped/moflo-memory-strategy.md +76 -182
  10. package/.claude/guidance/shipped/moflo-memorydb-maintenance.md +6 -8
  11. package/.claude/guidance/shipped/moflo-settings-injection.md +7 -9
  12. package/.claude/guidance/shipped/moflo-source-hygiene.md +5 -5
  13. package/.claude/guidance/shipped/moflo-spell-connectors.md +3 -4
  14. package/.claude/guidance/shipped/moflo-spell-custom-steps.md +3 -4
  15. package/.claude/guidance/shipped/moflo-spell-engine.md +40 -162
  16. package/.claude/guidance/shipped/moflo-spell-runner.md +134 -0
  17. package/.claude/guidance/shipped/moflo-spell-sandboxing.md +10 -57
  18. package/.claude/guidance/shipped/moflo-spell-troubleshooting.md +149 -0
  19. package/.claude/guidance/shipped/moflo-subagents.md +43 -114
  20. package/.claude/guidance/shipped/moflo-task-icons.md +4 -4
  21. package/.claude/guidance/shipped/moflo-user-facing-language.md +3 -3
  22. package/.claude/guidance/shipped/moflo-verbose-command-filtering.md +3 -3
  23. package/.claude/guidance/shipped/moflo-yaml-reference.md +4 -5
  24. package/.claude/helpers/gate.cjs +124 -14
  25. package/.claude/helpers/prompt-hook.mjs +4 -38
  26. package/.claude/helpers/simplify-classify.cjs +32 -11
  27. package/.claude/helpers/subagent-bootstrap.json +1 -1
  28. package/.claude/helpers/subagent-start.cjs +1 -1
  29. package/.claude/skills/connector-builder/SKILL.md +42 -429
  30. package/.claude/skills/connector-builder/templates/connector.md +189 -0
  31. package/.claude/skills/connector-builder/templates/step-command.md +176 -0
  32. package/.claude/skills/eldar/SKILL.md +7 -7
  33. package/.claude/skills/fl/SKILL.md +3 -3
  34. package/.claude/skills/fl/execution-modes.md +3 -3
  35. package/.claude/skills/fl/phases.md +3 -3
  36. package/.claude/skills/{simplify → flo-simplify}/SKILL.md +11 -11
  37. package/.claude/skills/guidance/SKILL.md +17 -9
  38. package/.claude/skills/memory-patterns/SKILL.md +1 -1
  39. package/.claude/skills/publish/SKILL.md +121 -36
  40. package/.claude/skills/reset-epic/SKILL.md +2 -2
  41. package/.claude/skills/spell-builder/SKILL.md +39 -226
  42. package/.claude/skills/spell-builder/architecture.md +1 -1
  43. package/.claude/skills/spell-builder/permissions.md +107 -0
  44. package/.claude/skills/spell-builder/preflight.md +101 -0
  45. package/.claude/skills/spell-schedule/SKILL.md +2 -3
  46. package/bin/gate.cjs +124 -14
  47. package/bin/prompt-hook.mjs +4 -38
  48. package/bin/session-start-launcher.mjs +19 -1
  49. package/bin/setup-project.mjs +63 -69
  50. package/bin/simplify-classify.cjs +32 -11
  51. package/dist/src/cli/commands/doctor-checks-deep.js +4 -0
  52. package/dist/src/cli/init/claudemd-generator.js +30 -33
  53. package/dist/src/cli/init/executor.js +28 -16
  54. package/dist/src/cli/init/helpers-generator.js +101 -51
  55. package/dist/src/cli/init/moflo-init.js +41 -114
  56. package/dist/src/cli/init/settings-generator.js +32 -14
  57. package/dist/src/cli/services/hook-block-hash.js +7 -2
  58. package/dist/src/cli/services/hook-wiring.js +86 -3
  59. package/dist/src/cli/services/subagent-bootstrap.js +1 -1
  60. package/dist/src/cli/version.js +1 -1
  61. package/package.json +2 -2
  62. package/scripts/post-install-bootstrap.mjs +19 -0
  63. package/.claude/guidance/shipped/moflo-session-start.md +0 -154
  64. package/.claude/guidance/shipped/moflo-spell-engine-architecture.md +0 -145
  65. package/.claude/skills/browser/SKILL.md +0 -204
  66. package/.claude/skills/github-code-review/SKILL.md +0 -1140
  67. package/.claude/skills/github-multi-repo/SKILL.md +0 -866
  68. package/.claude/skills/github-project-management/SKILL.md +0 -1272
  69. package/.claude/skills/github-release-management/SKILL.md +0 -1074
  70. package/.claude/skills/github-workflow-automation/SKILL.md +0 -1060
  71. package/.claude/skills/hive-mind-advanced/SKILL.md +0 -712
  72. package/.claude/skills/hooks-automation/SKILL.md +0 -1193
  73. package/.claude/skills/pair-programming/SKILL.md +0 -1202
  74. package/.claude/skills/performance-analysis/SKILL.md +0 -563
  75. package/.claude/skills/skill-builder/SKILL.md +0 -910
  76. package/.claude/skills/sparc-methodology/SKILL.md +0 -904
  77. package/.claude/skills/stream-chain/SKILL.md +0 -563
  78. package/.claude/skills/swarm-advanced/SKILL.md +0 -811
  79. package/.claude/skills/swarm-orchestration/SKILL.md +0 -179
  80. package/.claude/skills/verification-quality/SKILL.md +0 -649
  81. package/.claude/skills/worker-benchmarks/skill.md +0 -135
  82. package/.claude/skills/worker-integration/skill.md +0 -154
@@ -1,811 +0,0 @@
1
- ---
2
- name: swarm-advanced
3
- description: Advanced swarm orchestration patterns for research, development, testing, and complex distributed workflows
4
- version: 2.0.0
5
- category: orchestration
6
- tags: [swarm, distributed, parallel, research, testing, development, coordination]
7
- author: Claude Flow Team
8
- ---
9
-
10
- # Advanced Swarm Orchestration
11
-
12
- Master advanced swarm patterns for distributed research, development, and testing workflows. This skill covers comprehensive orchestration strategies using both MCP tools and CLI commands.
13
-
14
- ## Quick Start
15
-
16
- ### Prerequisites
17
- ```bash
18
- # Ensure Claude Flow is installed
19
- npm install -g claude-flow@alpha
20
-
21
- # Add MCP server (if using MCP tools)
22
- claude mcp add moflo npx moflo mcp start
23
- ```
24
-
25
- ### Basic Pattern
26
- ```javascript
27
- // 1. Initialize swarm topology
28
- mcp__moflo__swarm_init({ topology: "mesh", maxAgents: 6 })
29
-
30
- // 2. Spawn specialized agents
31
- mcp__moflo__agent_spawn({ type: "researcher", name: "swarm-advanced" })
32
-
33
- // 3. Orchestrate tasks
34
- ```
35
-
36
- ### Dynamic Scaling
37
- Use `mcp__moflo__swarm_scale` to grow or shrink the agent pool to a target size
38
- without re-initializing the swarm. Three strategies are available:
39
-
40
- ```javascript
41
- // Burst-spawn 8 workers all at once (load test, big batch)
42
- mcp__moflo__swarm_scale({
43
- targetAgents: 8,
44
- scaleStrategy: "immediate",
45
- agentTypes: ["worker"],
46
- reason: "load-test ramp"
47
- })
48
-
49
- // Rate-limited ramp (1 agent / 200ms) — gentler on the coordinator
50
- mcp__moflo__swarm_scale({
51
- targetAgents: 12,
52
- scaleStrategy: "gradual",
53
- agentTypes: ["coder", "tester"]
54
- })
55
-
56
- // Adaptive: chunks scale with current coordinator load
57
- mcp__moflo__swarm_scale({ targetAgents: 4, scaleStrategy: "adaptive" })
58
- ```
59
-
60
- The tool returns `{ previousAgents, currentAgents, scalingStatus, addedAgents,
61
- removedAgents }` so callers can verify the swarm reached the target. Scale-down
62
- prefers idle agents first, then oldest by heartbeat.
63
-
64
- ### Task Orchestration
65
-
66
- The `task_*` family talks to the same UnifiedSwarmCoordinator that
67
- `swarm_init` / `agent_spawn` use, so tasks created here flow through the
68
- same scoring scheduler that load-balances across idle agents.
69
-
70
- ```javascript
71
- // Single task — coordinator picks the lowest-workload agent automatically
72
- mcp__moflo__task_create({
73
- type: "coding",
74
- description: "Implement OAuth refresh flow",
75
- priority: "high"
76
- })
77
-
78
- // Direct dispatch to a known agent (skip the scheduler)
79
- mcp__moflo__task_assign({
80
- taskId: "task_swarm-…_3",
81
- agentId: "agent-coder-…"
82
- })
83
-
84
- // Domain-routed dispatch (queen / security / core / integration / support)
85
- mcp__moflo__task_assign({
86
- taskId: "task_swarm-…_4",
87
- domain: "security"
88
- })
89
-
90
- // Submit a batch — load-balanced across available agents in one call.
91
- // 5 tasks across 3 idle agents → no agent ends up with more than 2.
92
- mcp__moflo__task_orchestrate({
93
- tasks: [
94
- { type: "coding", description: "endpoint A" },
95
- { type: "coding", description: "endpoint B" },
96
- { type: "testing", description: "tests for A" },
97
- { type: "testing", description: "tests for B" },
98
- { type: "review", description: "PR review" }
99
- ]
100
- })
101
-
102
- // Mark a task done and record its outcome
103
- mcp__moflo__task_complete({
104
- taskId: "task_swarm-…_3",
105
- result: { ok: true, summary: "merged in PR #842" }
106
- })
107
- ```
108
-
109
- `task_orchestrate` returns `{ submitted, assigned, queued, rejected, tasks,
110
- errors }` — `assigned` is the count whose agents accepted them on submit;
111
- the rest are queued and will be picked up as agents go idle.
112
-
113
- ## Core Concepts
114
-
115
- ### Swarm Topologies
116
-
117
- **Mesh Topology** - Peer-to-peer communication, best for research and analysis
118
- - All agents communicate directly
119
- - High flexibility and resilience
120
- - Use for: Research, analysis, brainstorming
121
-
122
- **Hierarchical Topology** - Coordinator with subordinates, best for development
123
- - Clear command structure
124
- - Sequential workflow support
125
- - Use for: Development, structured pipelines
126
-
127
- **Star Topology** - Central coordinator, best for testing
128
- - Centralized control and monitoring
129
- - Parallel execution with coordination
130
- - Use for: Testing, validation, quality assurance
131
-
132
- **Ring Topology** - Sequential processing chain
133
- - Step-by-step processing
134
- - Pipeline processing
135
- - Use for: Multi-stage processing, data pipelines
136
-
137
- ### Agent Strategies
138
-
139
- **Adaptive** - Dynamic adjustment based on task complexity
140
- **Balanced** - Equal distribution of work across agents
141
- **Specialized** - Task-specific agent assignment
142
- **Parallel** - Maximum concurrent execution
143
-
144
- ## Pattern 1: Research Swarm
145
-
146
- ### Purpose
147
- Deep research through parallel information gathering, analysis, and synthesis.
148
-
149
- ### Architecture
150
- ```javascript
151
- // Initialize research swarm
152
- mcp__moflo__swarm_init({
153
- "topology": "mesh",
154
- "maxAgents": 6,
155
- "strategy": "adaptive"
156
- })
157
-
158
- // Spawn research team
159
- const researchAgents = [
160
- {
161
- type: "researcher",
162
- name: "Web Researcher",
163
- capabilities: ["web-search", "content-extraction", "source-validation"]
164
- },
165
- {
166
- type: "researcher",
167
- name: "Academic Researcher",
168
- capabilities: ["paper-analysis", "citation-tracking", "literature-review"]
169
- },
170
- {
171
- type: "analyst",
172
- name: "Data Analyst",
173
- capabilities: ["data-processing", "statistical-analysis", "visualization"]
174
- },
175
- {
176
- type: "analyst",
177
- name: "Pattern Analyzer",
178
- capabilities: ["trend-detection", "correlation-analysis", "outlier-detection"]
179
- },
180
- {
181
- type: "documenter",
182
- name: "Report Writer",
183
- capabilities: ["synthesis", "technical-writing", "formatting"]
184
- }
185
- ]
186
-
187
- // Spawn all agents
188
- researchAgents.forEach(agent => {
189
- mcp__moflo__agent_spawn({
190
- type: agent.type,
191
- name: agent.name,
192
- capabilities: agent.capabilities
193
- })
194
- })
195
- ```
196
-
197
- ### Research Workflow
198
-
199
- #### Phase 1: Information Gathering
200
- ```javascript
201
- // Parallel information collection
202
- // Store research findings in memory
203
- mcp__moflo__memory_store({
204
- "action": "store",
205
- "key": "research-findings-" + Date.now(),
206
- "value": JSON.stringify(findings),
207
- "namespace": "research",
208
- "ttl": 604800 // 7 days
209
- })
210
- ```
211
-
212
- #### Phase 2: Analysis and Validation
213
- ```javascript
214
- // Pattern recognition in findings
215
- mcp__moflo__neural_patterns({
216
- "data": researchData,
217
- "patterns": ["trend", "correlation", "outlier", "emerging-pattern"]
218
- })
219
-
220
- // Cognitive analysis
221
- mcp__moflo__neural_predict({
222
- "behavior": "research-synthesis"
223
- })
224
-
225
- // Quality assessment
226
- // Cross-reference validation
227
- mcp__moflo__neural_patterns({
228
- "action": "analyze",
229
- "operation": "fact-checking",
230
- "metadata": { "sources": sourcesArray }
231
- })
232
- ```
233
-
234
- #### Phase 3: Knowledge Management
235
- ```javascript
236
- // Search existing knowledge base
237
- mcp__moflo__memory_search({
238
- "pattern": "topic X",
239
- "namespace": "research",
240
- "limit": 20
241
- })
242
-
243
- // Create knowledge graph connections
244
- mcp__moflo__neural_patterns({
245
- "action": "learn",
246
- "operation": "knowledge-graph",
247
- "metadata": {
248
- "topic": "X",
249
- "connections": relatedTopics,
250
- "depth": 3
251
- }
252
- })
253
-
254
- // Store connections for future use
255
- mcp__moflo__memory_store({
256
- "action": "store",
257
- "key": "knowledge-graph-X",
258
- "value": JSON.stringify(knowledgeGraph),
259
- "namespace": "research/graphs",
260
- "ttl": 2592000 // 30 days
261
- })
262
- ```
263
-
264
- #### Phase 4: Report Generation
265
- ```javascript
266
- // Orchestrate report generation
267
- // Monitor research progress
268
- mcp__moflo__swarm_status({
269
- "swarmId": "research-swarm"
270
- })
271
-
272
- // Generate final report
273
- mcp__moflo__spell_cast({
274
- "workflowId": "research-report-generation",
275
- "params": {
276
- "findings": findings,
277
- "format": "comprehensive",
278
- "sections": ["executive-summary", "methodology", "findings", "analysis", "conclusions", "references"]
279
- }
280
- })
281
- ```
282
-
283
- ### CLI Fallback
284
- ```bash
285
- # Quick research swarm
286
- npx claude-flow swarm "research AI trends in 2025" \
287
- --strategy research \
288
- --mode distributed \
289
- --max-agents 6 \
290
- --parallel \
291
- --output research-report.md
292
- ```
293
-
294
- ## Pattern 2: Development Swarm
295
-
296
- ### Purpose
297
- Full-stack development through coordinated specialist agents.
298
-
299
- ### Architecture
300
- ```javascript
301
- // Initialize development swarm with hierarchy
302
- mcp__moflo__swarm_init({
303
- "topology": "hierarchical",
304
- "maxAgents": 8,
305
- "strategy": "balanced"
306
- })
307
-
308
- // Spawn development team
309
- const devTeam = [
310
- { type: "architect", name: "System Architect", role: "coordinator" },
311
- { type: "coder", name: "Backend Developer", capabilities: ["node", "api", "database"] },
312
- { type: "coder", name: "Frontend Developer", capabilities: ["react", "ui", "ux"] },
313
- { type: "coder", name: "Database Engineer", capabilities: ["sql", "nosql", "optimization"] },
314
- { type: "tester", name: "QA Engineer", capabilities: ["unit", "integration", "e2e"] },
315
- { type: "reviewer", name: "Code Reviewer", capabilities: ["security", "performance", "best-practices"] },
316
- { type: "documenter", name: "Technical Writer", capabilities: ["api-docs", "guides", "tutorials"] },
317
- { type: "monitor", name: "DevOps Engineer", capabilities: ["ci-cd", "deployment", "monitoring"] }
318
- ]
319
-
320
- // Spawn all team members
321
- devTeam.forEach(member => {
322
- mcp__moflo__agent_spawn({
323
- type: member.type,
324
- name: member.name,
325
- capabilities: member.capabilities,
326
- swarmId: "dev-swarm"
327
- })
328
- })
329
- ```
330
-
331
- ### Development Workflow
332
-
333
- #### Phase 1: Architecture and Design
334
- ```javascript
335
- // System architecture design
336
- // Store architecture decisions
337
- mcp__moflo__memory_store({
338
- "action": "store",
339
- "key": "architecture-decisions",
340
- "value": JSON.stringify(architectureDoc),
341
- "namespace": "development/design"
342
- })
343
- ```
344
-
345
- #### Phase 2: Parallel Implementation
346
- ```javascript
347
- // Parallel development tasks
348
- // Monitor development progress
349
- mcp__moflo__swarm_status({
350
- "swarmId": "dev-swarm",
351
- "interval": 5000
352
- })
353
- ```
354
-
355
- #### Phase 3: Testing and Validation
356
- ```javascript
357
- // Comprehensive testing
358
- // Quality assessment
359
- ```
360
-
361
- #### Phase 4: Review and Deployment
362
- ```javascript
363
- // Code review workflow
364
- mcp__moflo__spell_cast({
365
- "workflowId": "code-review-process",
366
- "params": {
367
- "reviewers": ["Code Reviewer"],
368
- "criteria": ["security", "performance", "best-practices"]
369
- }
370
- })
371
-
372
- // CI/CD pipeline
373
- ```
374
-
375
- ### CLI Fallback
376
- ```bash
377
- # Quick development swarm
378
- npx claude-flow swarm "build REST API with authentication" \
379
- --strategy development \
380
- --mode hierarchical \
381
- --monitor \
382
- --output sqlite
383
- ```
384
-
385
- ## Pattern 3: Testing Swarm
386
-
387
- ### Purpose
388
- Comprehensive quality assurance through distributed testing.
389
-
390
- ### Architecture
391
- ```javascript
392
- // Initialize testing swarm with star topology
393
- mcp__moflo__swarm_init({
394
- "topology": "star",
395
- "maxAgents": 7,
396
- "strategy": "parallel"
397
- })
398
-
399
- // Spawn testing team
400
- const testingTeam = [
401
- {
402
- type: "tester",
403
- name: "Unit Test Coordinator",
404
- capabilities: ["unit-testing", "mocking", "coverage", "tdd"]
405
- },
406
- {
407
- type: "tester",
408
- name: "Integration Tester",
409
- capabilities: ["integration", "api-testing", "contract-testing"]
410
- },
411
- {
412
- type: "tester",
413
- name: "E2E Tester",
414
- capabilities: ["e2e", "ui-testing", "user-flows", "selenium"]
415
- },
416
- {
417
- type: "tester",
418
- name: "Performance Tester",
419
- capabilities: ["load-testing", "stress-testing", "benchmarking"]
420
- },
421
- {
422
- type: "monitor",
423
- name: "Security Tester",
424
- capabilities: ["security-testing", "penetration-testing", "vulnerability-scanning"]
425
- },
426
- {
427
- type: "analyst",
428
- name: "Test Analyst",
429
- capabilities: ["coverage-analysis", "test-optimization", "reporting"]
430
- },
431
- {
432
- type: "documenter",
433
- name: "Test Documenter",
434
- capabilities: ["test-documentation", "test-plans", "reports"]
435
- }
436
- ]
437
-
438
- // Spawn all testers
439
- testingTeam.forEach(tester => {
440
- mcp__moflo__agent_spawn({
441
- type: tester.type,
442
- name: tester.name,
443
- capabilities: tester.capabilities,
444
- swarmId: "testing-swarm"
445
- })
446
- })
447
- ```
448
-
449
- ### Testing Workflow
450
-
451
- #### Phase 1: Test Planning
452
- ```javascript
453
- // Analyze test coverage requirements
454
- // Identify test scenarios
455
- mcp__moflo__neural_patterns({
456
- "data": testScenarios,
457
- "patterns": [
458
- "edge-case",
459
- "boundary-condition",
460
- "error-path",
461
- "happy-path"
462
- ]
463
- })
464
-
465
- // Store test plan
466
- mcp__moflo__memory_store({
467
- "action": "store",
468
- "key": "test-plan-" + Date.now(),
469
- "value": JSON.stringify(testPlan),
470
- "namespace": "testing/plans"
471
- })
472
- ```
473
-
474
- #### Phase 2: Parallel Test Execution
475
- ```javascript
476
- // Execute all test suites in parallel
477
- // Batch process test suites
478
- ```
479
-
480
- #### Phase 3: Performance and Security
481
- ```javascript
482
- // Run performance benchmarks
483
- mcp__moflo__performance_benchmark({
484
- "suite": "comprehensive-performance"
485
- })
486
-
487
- // Bottleneck analysis
488
- mcp__moflo__performance_report({
489
- "component": "application",
490
- "metrics": ["response-time", "throughput", "memory", "cpu"]
491
- })
492
-
493
- // Security scanning
494
- mcp__moflo__aidefence_scan({
495
- "target": "application",
496
- "depth": "comprehensive"
497
- })
498
-
499
- // Vulnerability analysis
500
- ```
501
-
502
- #### Phase 4: Monitoring and Reporting
503
- ```javascript
504
- // Real-time test monitoring
505
- mcp__moflo__swarm_status({
506
- "swarmId": "testing-swarm",
507
- "interval": 2000
508
- })
509
-
510
- // Generate comprehensive test report
511
- mcp__moflo__performance_report({
512
- "format": "detailed",
513
- "timeframe": "current-run"
514
- })
515
-
516
- // Get test results
517
- mcp__moflo__task_status({
518
- "taskId": "test-execution-001"
519
- })
520
-
521
- // Trend analysis
522
- ```
523
-
524
- ### CLI Fallback
525
- ```bash
526
- # Quick testing swarm
527
- npx claude-flow swarm "test application comprehensively" \
528
- --strategy testing \
529
- --mode star \
530
- --parallel \
531
- --timeout 600
532
- ```
533
-
534
- ## Pattern 4: Analysis Swarm
535
-
536
- ### Purpose
537
- Deep code and system analysis through specialized analyzers.
538
-
539
- ### Architecture
540
- ```javascript
541
- // Initialize analysis swarm
542
- mcp__moflo__swarm_init({
543
- "topology": "mesh",
544
- "maxAgents": 5,
545
- "strategy": "adaptive"
546
- })
547
-
548
- // Spawn analysis specialists
549
- const analysisTeam = [
550
- {
551
- type: "analyst",
552
- name: "Code Analyzer",
553
- capabilities: ["static-analysis", "complexity-analysis", "dead-code-detection"]
554
- },
555
- {
556
- type: "analyst",
557
- name: "Security Analyzer",
558
- capabilities: ["security-scan", "vulnerability-detection", "dependency-audit"]
559
- },
560
- {
561
- type: "analyst",
562
- name: "Performance Analyzer",
563
- capabilities: ["profiling", "bottleneck-detection", "optimization"]
564
- },
565
- {
566
- type: "analyst",
567
- name: "Architecture Analyzer",
568
- capabilities: ["dependency-analysis", "coupling-detection", "modularity-assessment"]
569
- },
570
- {
571
- type: "documenter",
572
- name: "Analysis Reporter",
573
- capabilities: ["reporting", "visualization", "recommendations"]
574
- }
575
- ]
576
-
577
- // Spawn all analysts
578
- analysisTeam.forEach(analyst => {
579
- mcp__moflo__agent_spawn({
580
- type: analyst.type,
581
- name: analyst.name,
582
- capabilities: analyst.capabilities
583
- })
584
- })
585
- ```
586
-
587
- ### Analysis Workflow
588
- ```javascript
589
- // Parallel analysis execution
590
- // Generate comprehensive analysis report
591
- mcp__moflo__performance_report({
592
- "format": "detailed",
593
- "timeframe": "current"
594
- })
595
-
596
- // Cost analysis
597
- ```
598
-
599
- ## Advanced Techniques
600
-
601
- ### Error Handling and Fault Tolerance
602
-
603
- ```javascript
604
- // Setup fault tolerance for all agents
605
- // Error handling pattern
606
- try {
607
- } catch (error) {
608
- // Check swarm health
609
- const status = await mcp__moflo__swarm_status({})
610
-
611
- // Analyze error patterns
612
- // Auto-recovery attempt
613
- if (status.healthy) {
614
- }
615
- }
616
- ```
617
-
618
- ### Memory and State Management
619
-
620
- ```javascript
621
- // Cross-session persistence
622
- // Namespace management for different swarms
623
- // Create state snapshot
624
- // Restore from snapshot if needed
625
- // Backup memory stores
626
- ```
627
-
628
- ### Neural Pattern Learning
629
-
630
- ```javascript
631
- // Train neural patterns from successful workflows
632
- mcp__moflo__neural_train({
633
- "pattern_type": "coordination",
634
- "training_data": JSON.stringify(successfulWorkflows),
635
- "epochs": 50
636
- })
637
-
638
- // Adaptive learning from experience
639
- // Pattern recognition for optimization
640
- mcp__moflo__neural_patterns({
641
- "data": workflowMetrics,
642
- "patterns": ["bottleneck", "optimization-opportunity", "efficiency-gain"]
643
- })
644
- ```
645
-
646
- ### Spell Automation
647
-
648
- ```javascript
649
- // Create reusable spell
650
- mcp__moflo__spell_create({
651
- "name": "full-stack-development",
652
- "steps": [
653
- { "phase": "design", "agents": ["architect"] },
654
- { "phase": "implement", "agents": ["backend-dev", "frontend-dev"], "parallel": true },
655
- { "phase": "test", "agents": ["tester", "security-tester"], "parallel": true },
656
- { "phase": "review", "agents": ["reviewer"] },
657
- { "phase": "deploy", "agents": ["devops"] }
658
- ],
659
- "triggers": ["on-commit", "scheduled-daily"]
660
- })
661
-
662
- // Setup automation rules
663
- // Event-driven triggers
664
- ```
665
-
666
- ### Performance Optimization
667
-
668
- ```javascript
669
- // Topology optimization
670
- // Load balancing
671
- // Agent coordination sync
672
- mcp__moflo__coordination_sync({
673
- "swarmId": "development-swarm"
674
- })
675
-
676
- // Auto-scaling
677
- ```
678
-
679
- ### Monitoring and Metrics
680
-
681
- ```javascript
682
- // Real-time swarm monitoring
683
- mcp__moflo__swarm_status({
684
- "swarmId": "active-swarm",
685
- "interval": 3000
686
- })
687
-
688
- // Collect comprehensive metrics
689
- // Health monitoring
690
- mcp__moflo__system_health({
691
- "components": ["swarm", "agents", "neural", "memory"]
692
- })
693
-
694
- // Usage statistics
695
- // Trend analysis
696
- ```
697
-
698
- ## Best Practices
699
-
700
- ### 1. Choosing the Right Topology
701
-
702
- - **Mesh**: Research, brainstorming, collaborative analysis
703
- - **Hierarchical**: Structured development, sequential workflows
704
- - **Star**: Testing, validation, centralized coordination
705
- - **Ring**: Pipeline processing, staged workflows
706
-
707
- ### 2. Agent Specialization
708
-
709
- - Assign specific capabilities to each agent
710
- - Avoid overlapping responsibilities
711
- - Use coordination agents for complex workflows
712
- - Leverage memory for agent communication
713
-
714
- ### 3. Parallel Execution
715
-
716
- - Identify independent tasks for parallelization
717
- - Use sequential execution for dependent tasks
718
- - Monitor resource usage during parallel execution
719
- - Implement proper error handling
720
-
721
- ### 4. Memory Management
722
-
723
- - Use namespaces to organize memory
724
- - Set appropriate TTL values
725
- - Create regular backups
726
- - Implement state snapshots for checkpoints
727
-
728
- ### 5. Monitoring and Optimization
729
-
730
- - Monitor swarm health regularly
731
- - Collect and analyze metrics
732
- - Optimize topology based on performance
733
- - Use neural patterns to learn from success
734
-
735
- ### 6. Error Recovery
736
-
737
- - Implement fault tolerance strategies
738
- - Use auto-recovery mechanisms
739
- - Analyze error patterns
740
- - Create fallback pipelines
741
-
742
- ## Real-World Examples
743
-
744
- ### Example 1: AI Research Project
745
- ```javascript
746
- // Research AI trends, analyze findings, generate report
747
- mcp__moflo__swarm_init({ topology: "mesh", maxAgents: 6 })
748
- // Spawn: 2 researchers, 2 analysts, 1 synthesizer, 1 documenter
749
- // Parallel gather → Analyze patterns → Synthesize → Report
750
- ```
751
-
752
- ### Example 2: Full-Stack Application
753
- ```javascript
754
- // Build complete web application with testing
755
- mcp__moflo__swarm_init({ topology: "hierarchical", maxAgents: 8 })
756
- // Spawn: 1 architect, 2 devs, 1 db engineer, 2 testers, 1 reviewer, 1 devops
757
- // Design → Parallel implement → Test → Review → Deploy
758
- ```
759
-
760
- ### Example 3: Security Audit
761
- ```javascript
762
- // Comprehensive security analysis
763
- mcp__moflo__swarm_init({ topology: "star", maxAgents: 5 })
764
- // Spawn: 1 coordinator, 1 code analyzer, 1 security scanner, 1 penetration tester, 1 reporter
765
- // Parallel scan → Vulnerability analysis → Penetration test → Report
766
- ```
767
-
768
- ### Example 4: Performance Optimization
769
- ```javascript
770
- // Identify and fix performance bottlenecks
771
- mcp__moflo__swarm_init({ topology: "mesh", maxAgents: 4 })
772
- // Spawn: 1 profiler, 1 bottleneck analyzer, 1 optimizer, 1 tester
773
- // Profile → Identify bottlenecks → Optimize → Validate
774
- ```
775
-
776
- ## Troubleshooting
777
-
778
- ### Common Issues
779
-
780
- **Issue**: Swarm agents not coordinating properly
781
- **Solution**: Check topology selection, verify memory usage, enable monitoring
782
-
783
- **Issue**: Parallel execution failing
784
- **Solution**: Verify task dependencies, check resource limits, implement error handling
785
-
786
- **Issue**: Memory persistence not working
787
- **Solution**: Verify namespaces, check TTL settings, ensure backup configuration
788
-
789
- **Issue**: Performance degradation
790
- **Solution**: Optimize topology, reduce agent count, analyze bottlenecks
791
-
792
- ## Related Skills
793
-
794
- - `sparc-methodology` - Systematic development workflow
795
- - `github-integration` - Repository management and automation
796
- - `neural-patterns` - AI-powered coordination optimization
797
- - `memory-management` - Cross-session state persistence
798
-
799
- ## References
800
-
801
- - [Claude Flow Documentation](https://github.com/eric-cielo/moflo)
802
- - [Swarm Orchestration Guide](https://github.com/eric-cielo/moflo/wiki/swarm)
803
- - [MCP Tools Reference](https://github.com/eric-cielo/moflo/wiki/mcp)
804
- - [Performance Optimization](https://github.com/eric-cielo/moflo/wiki/performance)
805
-
806
- ---
807
-
808
- **Version**: 2.0.0
809
- **Last Updated**: 2025-10-19
810
- **Skill Level**: Advanced
811
- **Estimated Learning Time**: 2-3 hours