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,904 +0,0 @@
1
- ---
2
- name: sparc-methodology
3
- description: SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) comprehensive development methodology with multi-agent orchestration
4
- version: 2.7.0
5
- category: development
6
- tags:
7
- - sparc
8
- - tdd
9
- - architecture
10
- - orchestration
11
- - methodology
12
- - multi-agent
13
- author: Claude Flow
14
- ---
15
-
16
- # SPARC Methodology - Comprehensive Development Framework
17
-
18
- ## Overview
19
-
20
- SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) is a systematic development methodology integrated with Claude Flow's multi-agent orchestration capabilities. It provides 17 specialized modes for comprehensive software development, from initial research through deployment and monitoring.
21
-
22
- ## Table of Contents
23
-
24
- 1. [Core Philosophy](#core-philosophy)
25
- 2. [Development Phases](#development-phases)
26
- 3. [Available Modes](#available-modes)
27
- 4. [Activation Methods](#activation-methods)
28
- 5. [Orchestration Patterns](#orchestration-patterns)
29
- 6. [TDD Workflows](#tdd-workflows)
30
- 7. [Best Practices](#best-practices)
31
- 8. [Integration Examples](#integration-examples)
32
- 9. [Common Workflows](#common-workflows)
33
-
34
- ---
35
-
36
- ## Core Philosophy
37
-
38
- SPARC methodology emphasizes:
39
-
40
- - **Systematic Approach**: Structured phases from specification to completion
41
- - **Test-Driven Development**: Tests written before implementation
42
- - **Parallel Execution**: Concurrent agent coordination for 2.8-4.4x speed improvements
43
- - **Memory Integration**: Persistent knowledge sharing across agents and sessions
44
- - **Quality First**: Comprehensive reviews, testing, and validation
45
- - **Modular Design**: Clean separation of concerns with clear interfaces
46
-
47
- ### Key Principles
48
-
49
- 1. **Specification Before Code**: Define requirements and constraints clearly
50
- 2. **Design Before Implementation**: Plan architecture and components
51
- 3. **Tests Before Features**: Write failing tests, then make them pass
52
- 4. **Review Everything**: Code quality, security, and performance checks
53
- 5. **Document Continuously**: Maintain current documentation throughout
54
-
55
- ---
56
-
57
- ## Development Phases
58
-
59
- ### Phase 1: Specification
60
- **Goal**: Define requirements, constraints, and success criteria
61
-
62
- - Requirements analysis
63
- - User story mapping
64
- - Constraint identification
65
- - Success metrics definition
66
- - Pseudocode planning
67
-
68
- **Key Modes**: `researcher`, `analyzer`, `memory-manager`
69
-
70
- ### Phase 2: Architecture
71
- **Goal**: Design system structure and component interfaces
72
-
73
- - System architecture design
74
- - Component interface definition
75
- - Database schema planning
76
- - API contract specification
77
- - Infrastructure planning
78
-
79
- **Key Modes**: `architect`, `designer`, `orchestrator`
80
-
81
- ### Phase 3: Refinement (TDD Implementation)
82
- **Goal**: Implement features with test-first approach
83
-
84
- - Write failing tests
85
- - Implement minimum viable code
86
- - Make tests pass
87
- - Refactor for quality
88
- - Iterate until complete
89
-
90
- **Key Modes**: `tdd`, `coder`, `tester`
91
-
92
- ### Phase 4: Review
93
- **Goal**: Ensure code quality, security, and performance
94
-
95
- - Code quality assessment
96
- - Security vulnerability scanning
97
- - Performance profiling
98
- - Best practices validation
99
- - Documentation review
100
-
101
- **Key Modes**: `reviewer`, `optimizer`, `debugger`
102
-
103
- ### Phase 5: Completion
104
- **Goal**: Integration, deployment, and monitoring
105
-
106
- - System integration
107
- - Deployment automation
108
- - Monitoring setup
109
- - Documentation finalization
110
- - Knowledge capture
111
-
112
- **Key Modes**: `spell-manager`, `documenter`, `memory-manager`
113
-
114
- ---
115
-
116
- ## Available Modes
117
-
118
- ### Core Orchestration Modes
119
-
120
- #### `orchestrator`
121
- Multi-agent task orchestration with TodoWrite/Task/Memory coordination.
122
-
123
- **Capabilities**:
124
- - Task decomposition into manageable units
125
- - Agent coordination and resource allocation
126
- - Progress tracking and result synthesis
127
- - Adaptive strategy selection
128
- - Cross-agent communication
129
-
130
- **Usage**:
131
-
132
- #### `swarm-coordinator`
133
- Specialized swarm management for complex multi-agent coordination.
134
-
135
- **Capabilities**:
136
- - Topology optimization (mesh, hierarchical, ring, star)
137
- - Agent lifecycle management
138
- - Dynamic scaling based on workload
139
- - Fault tolerance and recovery
140
- - Performance monitoring
141
-
142
- #### `spell-manager`
143
- Process automation and spell orchestration.
144
-
145
- **Capabilities**:
146
- - Spell definition and execution
147
- - Event-driven triggers
148
- - Sequential and parallel pipelines
149
- - State management
150
- - Error handling and retry logic
151
-
152
- #### `batch-executor`
153
- Parallel task execution for high-throughput operations.
154
-
155
- **Capabilities**:
156
- - Concurrent file operations
157
- - Batch processing optimization
158
- - Resource pooling
159
- - Load balancing
160
- - Progress aggregation
161
-
162
- ---
163
-
164
- ### Development Modes
165
-
166
- #### `coder`
167
- Autonomous code generation with batch file operations.
168
-
169
- **Capabilities**:
170
- - Feature implementation
171
- - Code refactoring
172
- - Bug fixes and patches
173
- - API development
174
- - Algorithm implementation
175
-
176
- **Quality Standards**:
177
- - ES2022+ standards
178
- - TypeScript type safety
179
- - Comprehensive error handling
180
- - Performance optimization
181
- - Security best practices
182
-
183
- **Usage**:
184
-
185
- #### `architect`
186
- System design with Memory-based coordination.
187
-
188
- **Capabilities**:
189
- - Microservices architecture
190
- - Event-driven design
191
- - Domain-driven design (DDD)
192
- - Hexagonal architecture
193
- - CQRS and Event Sourcing
194
-
195
- **Memory Integration**:
196
- - Store architectural decisions
197
- - Share component specifications
198
- - Maintain design consistency
199
- - Track architectural evolution
200
-
201
- **Design Patterns**:
202
- - Layered architecture
203
- - Microservices patterns
204
- - Event-driven patterns
205
- - Domain modeling
206
- - Infrastructure as Code
207
-
208
- **Usage**:
209
-
210
- #### `tdd`
211
- Test-driven development with comprehensive testing.
212
-
213
- **Capabilities**:
214
- - Test-first development
215
- - Red-green-refactor cycle
216
- - Test suite design
217
- - Coverage optimization (target: 90%+)
218
- - Continuous testing
219
-
220
- **TDD Workflow**:
221
- 1. Write failing test (RED)
222
- 2. Implement minimum code
223
- 3. Make test pass (GREEN)
224
- 4. Refactor for quality (REFACTOR)
225
- 5. Repeat cycle
226
-
227
- **Testing Strategies**:
228
- - Unit testing (Jest, Mocha, Vitest)
229
- - Integration testing
230
- - End-to-end testing (Playwright, Cypress)
231
- - Performance testing
232
- - Security testing
233
-
234
- **Usage**:
235
-
236
- #### `reviewer`
237
- Code review using batch file analysis.
238
-
239
- **Capabilities**:
240
- - Code quality assessment
241
- - Security vulnerability detection
242
- - Performance analysis
243
- - Best practices validation
244
- - Documentation review
245
-
246
- **Review Criteria**:
247
- - Code correctness and logic
248
- - Design pattern adherence
249
- - Comprehensive error handling
250
- - Test coverage adequacy
251
- - Maintainability and readability
252
- - Security vulnerabilities
253
- - Performance bottlenecks
254
-
255
- **Batch Analysis**:
256
- - Parallel file review
257
- - Pattern detection
258
- - Dependency checking
259
- - Consistency validation
260
- - Automated reporting
261
-
262
- **Usage**:
263
-
264
- ---
265
-
266
- ### Analysis and Research Modes
267
-
268
- #### `researcher`
269
- Deep research with parallel WebSearch/WebFetch and Memory coordination.
270
-
271
- **Capabilities**:
272
- - Comprehensive information gathering
273
- - Source credibility evaluation
274
- - Trend analysis and forecasting
275
- - Competitive research
276
- - Technology assessment
277
-
278
- **Research Methods**:
279
- - Parallel web searches
280
- - Academic paper analysis
281
- - Industry report synthesis
282
- - Expert opinion gathering
283
- - Statistical data compilation
284
-
285
- **Memory Integration**:
286
- - Store research findings with citations
287
- - Build knowledge graphs
288
- - Track information sources
289
- - Cross-reference insights
290
- - Maintain research history
291
-
292
- **Usage**:
293
-
294
- #### `analyzer`
295
- Code and data analysis with pattern recognition.
296
-
297
- **Capabilities**:
298
- - Static code analysis
299
- - Dependency analysis
300
- - Performance profiling
301
- - Security scanning
302
- - Data pattern recognition
303
-
304
- #### `optimizer`
305
- Performance optimization and bottleneck resolution.
306
-
307
- **Capabilities**:
308
- - Algorithm optimization
309
- - Database query tuning
310
- - Caching strategy design
311
- - Bundle size reduction
312
- - Memory leak detection
313
-
314
- ---
315
-
316
- ### Creative and Support Modes
317
-
318
- #### `designer`
319
- UI/UX design with accessibility focus.
320
-
321
- **Capabilities**:
322
- - Interface design
323
- - User experience optimization
324
- - Accessibility compliance (WCAG 2.1)
325
- - Design system creation
326
- - Responsive layout design
327
-
328
- #### `innovator`
329
- Creative problem-solving and novel solutions.
330
-
331
- **Capabilities**:
332
- - Brainstorming and ideation
333
- - Alternative approach generation
334
- - Technology evaluation
335
- - Proof of concept development
336
- - Innovation feasibility analysis
337
-
338
- #### `documenter`
339
- Comprehensive documentation generation.
340
-
341
- **Capabilities**:
342
- - API documentation (OpenAPI/Swagger)
343
- - Architecture diagrams
344
- - User guides and tutorials
345
- - Code comments and JSDoc
346
- - README and changelog maintenance
347
-
348
- #### `debugger`
349
- Systematic debugging and issue resolution.
350
-
351
- **Capabilities**:
352
- - Bug reproduction
353
- - Root cause analysis
354
- - Fix implementation
355
- - Regression prevention
356
- - Debug logging optimization
357
-
358
- #### `tester`
359
- Comprehensive testing beyond TDD.
360
-
361
- **Capabilities**:
362
- - Test suite expansion
363
- - Edge case identification
364
- - Performance testing
365
- - Load testing
366
- - Chaos engineering
367
-
368
- #### `memory-manager`
369
- Knowledge management and context preservation.
370
-
371
- **Capabilities**:
372
- - Cross-session memory persistence
373
- - Knowledge graph construction
374
- - Context restoration
375
- - Learning pattern extraction
376
- - Decision tracking
377
-
378
- ---
379
-
380
- ## Activation Methods
381
-
382
- ### Method 1: MCP Tools (Preferred in Claude Code)
383
-
384
- **Best for**: Integrated Claude Code workflows with full orchestration capabilities
385
-
386
- ```javascript
387
- // Basic mode execution
388
-
389
- // Initialize swarm for complex tasks
390
- mcp__moflo__swarm_init {
391
- topology: "hierarchical", // or "mesh", "ring", "star"
392
- strategy: "auto", // or "balanced", "specialized", "adaptive"
393
- maxAgents: 8
394
- }
395
-
396
- // Spawn specialized agents
397
- mcp__moflo__agent_spawn {
398
- type: "<agent-type>",
399
- capabilities: ["<capability1>", "<capability2>"]
400
- }
401
-
402
- // Monitor execution
403
- mcp__moflo__swarm_status {
404
- swarmId: "current",
405
- interval: 5000
406
- }
407
- ```
408
-
409
- ### Method 2: NPX CLI (Fallback)
410
-
411
- **Best for**: Terminal usage or when MCP tools unavailable
412
-
413
- ```bash
414
- # Execute specific mode
415
- npx claude-flow sparc run <mode> "task description"
416
-
417
- # Use alpha features
418
- npx claude-flow@alpha sparc run <mode> "task description"
419
-
420
- # List all available modes
421
- npx claude-flow sparc modes
422
-
423
- # Get help for specific mode
424
- npx claude-flow sparc help <mode>
425
-
426
- # Run with options
427
- npx claude-flow sparc run <mode> "task" --parallel --monitor
428
-
429
- # Execute TDD workflow
430
- npx claude-flow sparc tdd "feature description"
431
-
432
- # Batch execution
433
- npx claude-flow sparc batch <mode1,mode2,mode3> "task"
434
-
435
- # Pipeline execution
436
- npx claude-flow sparc pipeline "task description"
437
- ```
438
-
439
- ### Method 3: Local Installation
440
-
441
- **Best for**: Projects with local claude-flow installation
442
-
443
- ```bash
444
- # If claude-flow is installed locally
445
- ./claude-flow sparc run <mode> "task description"
446
- ```
447
-
448
- ---
449
-
450
- ## Orchestration Patterns
451
-
452
- ### Pattern 1: Hierarchical Coordination
453
-
454
- **Best for**: Complex projects with clear delegation hierarchy
455
-
456
- ```javascript
457
- // Initialize hierarchical swarm
458
- mcp__moflo__swarm_init {
459
- topology: "hierarchical",
460
- maxAgents: 12
461
- }
462
-
463
- // Spawn coordinator
464
- mcp__moflo__agent_spawn {
465
- type: "coordinator",
466
- capabilities: ["planning", "delegation", "monitoring"]
467
- }
468
-
469
- // Spawn specialized workers
470
- mcp__moflo__agent_spawn { type: "architect" }
471
- mcp__moflo__agent_spawn { type: "coder" }
472
- mcp__moflo__agent_spawn { type: "tester" }
473
- mcp__moflo__agent_spawn { type: "reviewer" }
474
- ```
475
-
476
- ### Pattern 2: Mesh Coordination
477
-
478
- **Best for**: Collaborative tasks requiring peer-to-peer communication
479
-
480
- ```javascript
481
- mcp__moflo__swarm_init {
482
- topology: "mesh",
483
- strategy: "balanced",
484
- maxAgents: 6
485
- }
486
- ```
487
-
488
- ### Pattern 3: Sequential Pipeline
489
-
490
- **Best for**: Ordered workflow execution (spec → design → code → test → review)
491
-
492
- ```javascript
493
- mcp__moflo__spell_create {
494
- name: "sparc-methodology",
495
- steps: [
496
- { mode: "researcher", task: "gather requirements" },
497
- { mode: "architect", task: "design system" },
498
- { mode: "coder", task: "implement features" },
499
- { mode: "tdd", task: "create tests" },
500
- { mode: "reviewer", task: "review code" }
501
- ],
502
- triggers: ["on_step_complete"]
503
- }
504
- ```
505
-
506
- ### Pattern 4: Parallel Execution
507
-
508
- **Best for**: Independent tasks that can run concurrently
509
-
510
- ### Pattern 5: Adaptive Strategy
511
-
512
- **Best for**: Dynamic workloads with changing requirements
513
-
514
- ```javascript
515
- mcp__moflo__swarm_init {
516
- topology: "hierarchical",
517
- strategy: "adaptive", // Auto-adjusts based on workload
518
- maxAgents: 20
519
- }
520
- ```
521
-
522
- ---
523
-
524
- ## TDD Workflows
525
-
526
- ### Complete TDD Workflow
527
-
528
- ```javascript
529
- // Step 1: Initialize TDD swarm
530
- mcp__moflo__swarm_init {
531
- topology: "hierarchical",
532
- maxAgents: 8
533
- }
534
-
535
- // Step 2: Research and planning
536
-
537
- // Step 3: Architecture design
538
-
539
- // Step 4: TDD implementation
540
-
541
- // Step 5: Code review
542
-
543
- // Step 6: Optimization
544
- ```
545
-
546
- ### Red-Green-Refactor Cycle
547
-
548
- ```javascript
549
- // RED: Write failing test
550
-
551
- // GREEN: Minimal implementation
552
-
553
- // REFACTOR: Improve code quality
554
- ```
555
-
556
- ---
557
-
558
- ## Best Practices
559
-
560
- ### 1. Memory Integration
561
-
562
- **Always use Memory for cross-agent coordination**:
563
-
564
- ```javascript
565
- // Store architectural decisions
566
- mcp__moflo__memory_store {
567
- namespace: "architecture",
568
- key: "api-design-v1",
569
- value: JSON.stringify(apiDesign),
570
- ttl: 86400000 // 24 hours
571
- }
572
-
573
- // Retrieve in subsequent agents
574
- mcp__moflo__memory_retrieve {
575
- namespace: "architecture",
576
- key: "api-design-v1"
577
- }
578
- ```
579
-
580
- ### 2. Parallel Operations
581
-
582
- **Batch all related operations in single message**:
583
-
584
- ```javascript
585
- // ✅ CORRECT: All operations together
586
- [Single Message]:
587
- mcp__moflo__agent_spawn { type: "researcher" }
588
- mcp__moflo__agent_spawn { type: "coder" }
589
- mcp__moflo__agent_spawn { type: "tester" }
590
- TodoWrite { todos: [8-10 todos] }
591
-
592
- // ❌ WRONG: Multiple messages
593
- Message 1: mcp__moflo__agent_spawn { type: "researcher" }
594
- Message 2: mcp__moflo__agent_spawn { type: "coder" }
595
- Message 3: TodoWrite { todos: [...] }
596
- ```
597
-
598
- ### 3. Hook Integration
599
-
600
- **Every SPARC mode should use hooks**:
601
-
602
- ```bash
603
- # Before work
604
- npx claude-flow@alpha hooks pre-task --description "implement auth"
605
-
606
- # During work
607
- npx claude-flow@alpha hooks post-edit --file "auth.js"
608
-
609
- # After work
610
- npx claude-flow@alpha hooks post-task --task-id "task-123"
611
- ```
612
-
613
- ### 4. Test Coverage
614
-
615
- **Maintain minimum 90% coverage**:
616
-
617
- - Unit tests for all functions
618
- - Integration tests for APIs
619
- - E2E tests for critical flows
620
- - Edge case coverage
621
- - Error path testing
622
-
623
- ### 5. Documentation
624
-
625
- **Document as you build**:
626
-
627
- - API documentation (OpenAPI)
628
- - Architecture decision records (ADR)
629
- - Code comments for complex logic
630
- - README with setup instructions
631
- - Changelog for version tracking
632
-
633
- ### 6. File Organization
634
-
635
- **Never save to root folder**:
636
-
637
- ```
638
- project/
639
- ├── src/ # Source code
640
- ├── tests/ # Test files
641
- ├── docs/ # Documentation
642
- ├── config/ # Configuration
643
- ├── scripts/ # Utility scripts
644
- └── examples/ # Example code
645
- ```
646
-
647
- ---
648
-
649
- ## Integration Examples
650
-
651
- ### Example 1: Full-Stack Development
652
-
653
- ```javascript
654
- [Single Message - Parallel Agent Execution]:
655
-
656
- // Initialize swarm
657
- mcp__moflo__swarm_init {
658
- topology: "hierarchical",
659
- maxAgents: 10
660
- }
661
-
662
- // Architecture phase
663
-
664
- // Research phase
665
-
666
- // Implementation phase
667
-
668
- // Testing phase
669
-
670
- // Review phase
671
-
672
- // Batch todos
673
- TodoWrite {
674
- todos: [
675
- {content: "Design API schema", status: "completed"},
676
- {content: "Research JWT implementation", status: "completed"},
677
- {content: "Implement authentication", status: "in_progress"},
678
- {content: "Write API tests", status: "pending"},
679
- {content: "Security review", status: "pending"},
680
- {content: "Performance optimization", status: "pending"},
681
- {content: "API documentation", status: "pending"},
682
- {content: "Deployment setup", status: "pending"}
683
- ]
684
- }
685
- ```
686
-
687
- ### Example 2: Research-Driven Innovation
688
-
689
- ```javascript
690
- // Research phase
691
-
692
- // Innovation phase
693
-
694
- // Architecture phase
695
-
696
- // Implementation phase
697
-
698
- // Documentation phase
699
- ```
700
-
701
- ### Example 3: Legacy Code Refactoring
702
-
703
- ```javascript
704
- // Analysis phase
705
-
706
- // Planning phase
707
-
708
- // Testing phase (create safety net)
709
-
710
- // Refactoring phase
711
-
712
- // Review phase
713
- ```
714
-
715
- ---
716
-
717
- ## Common Workflows
718
-
719
- ### Workflow 1: Feature Development
720
-
721
- ```bash
722
- # Step 1: Research and planning
723
- npx claude-flow sparc run researcher "authentication patterns"
724
-
725
- # Step 2: Architecture design
726
- npx claude-flow sparc run architect "design auth system"
727
-
728
- # Step 3: TDD implementation
729
- npx claude-flow sparc tdd "user authentication feature"
730
-
731
- # Step 4: Code review
732
- npx claude-flow sparc run reviewer "review auth implementation"
733
-
734
- # Step 5: Documentation
735
- npx claude-flow sparc run documenter "document auth API"
736
- ```
737
-
738
- ### Workflow 2: Bug Investigation
739
-
740
- ```bash
741
- # Step 1: Analyze issue
742
- npx claude-flow sparc run analyzer "investigate bug #456"
743
-
744
- # Step 2: Debug systematically
745
- npx claude-flow sparc run debugger "fix memory leak in service X"
746
-
747
- # Step 3: Create tests
748
- npx claude-flow sparc run tester "regression tests for bug #456"
749
-
750
- # Step 4: Review fix
751
- npx claude-flow sparc run reviewer "validate bug fix"
752
- ```
753
-
754
- ### Workflow 3: Performance Optimization
755
-
756
- ```bash
757
- # Step 1: Profile performance
758
- npx claude-flow sparc run analyzer "profile API response times"
759
-
760
- # Step 2: Identify bottlenecks
761
- npx claude-flow sparc run optimizer "optimize database queries"
762
-
763
- # Step 3: Implement improvements
764
- npx claude-flow sparc run coder "implement caching layer"
765
-
766
- # Step 4: Benchmark results
767
- npx claude-flow sparc run tester "performance benchmarks"
768
- ```
769
-
770
- ### Workflow 4: Complete Workflow
771
-
772
- ```bash
773
- # Execute full development pipeline
774
- npx claude-flow sparc pipeline "e-commerce checkout feature"
775
-
776
- # This automatically runs:
777
- # 1. researcher - Gather requirements
778
- # 2. architect - Design system
779
- # 3. coder - Implement features
780
- # 4. tdd - Create comprehensive tests
781
- # 5. reviewer - Code quality review
782
- # 6. optimizer - Performance tuning
783
- # 7. documenter - Documentation
784
- ```
785
-
786
- ---
787
-
788
- ## Advanced Features
789
-
790
- ### Neural Pattern Training
791
-
792
- ```javascript
793
- // Train patterns from successful workflows
794
- mcp__moflo__neural_train {
795
- pattern_type: "coordination",
796
- training_data: "successful_tdd_workflow.json",
797
- epochs: 50
798
- }
799
- ```
800
-
801
- ### Cross-Session Memory
802
-
803
- ```javascript
804
- // Save session state
805
-
806
- // Restore in new session
807
- ```
808
-
809
- ### GitHub Integration
810
-
811
- ```javascript
812
- // Analyze repository
813
- mcp__moflo__github_repo_analyze {
814
- repo: "owner/repo",
815
- analysis_type: "code_quality"
816
- }
817
-
818
- // Manage pull requests
819
- mcp__moflo__github_pr_manage {
820
- repo: "owner/repo",
821
- pr_number: 123,
822
- action: "review"
823
- }
824
- ```
825
-
826
- ### Performance Monitoring
827
-
828
- ```javascript
829
- // Real-time swarm monitoring
830
- mcp__moflo__swarm_status {
831
- swarmId: "current",
832
- interval: 5000
833
- }
834
-
835
- // Bottleneck analysis
836
- mcp__moflo__performance_report {
837
- component: "api-layer",
838
- metrics: ["latency", "throughput", "errors"]
839
- }
840
-
841
- // Token usage tracking
842
- ```
843
-
844
- ---
845
-
846
- ## Performance Benefits
847
-
848
- **Proven Results**:
849
- - **84.8%** SWE-Bench solve rate
850
- - **32.3%** token reduction through optimizations
851
- - **2.8-4.4x** speed improvement with parallel execution
852
- - **27+** neural models for pattern learning
853
- - **90%+** test coverage standard
854
-
855
- ---
856
-
857
- ## Support and Resources
858
-
859
- - **Documentation**: https://github.com/eric-cielo/moflo
860
- - **Issues**: https://github.com/eric-cielo/moflo/issues
861
- - **NPM Package**: https://www.npmjs.com/package/claude-flow
862
- - **Community**: Discord server (link in repository)
863
-
864
- ---
865
-
866
- ## Quick Reference
867
-
868
- ### Most Common Commands
869
-
870
- ```bash
871
- # List modes
872
- npx claude-flow sparc modes
873
-
874
- # Run specific mode
875
- npx claude-flow sparc run <mode> "task"
876
-
877
- # TDD workflow
878
- npx claude-flow sparc tdd "feature"
879
-
880
- # Full pipeline
881
- npx claude-flow sparc pipeline "task"
882
-
883
- # Batch execution
884
- npx claude-flow sparc batch <modes> "task"
885
- ```
886
-
887
- ### Most Common MCP Calls
888
-
889
- ```javascript
890
- // Initialize swarm
891
- mcp__moflo__swarm_init { topology: "hierarchical" }
892
-
893
- // Execute mode
894
-
895
- // Monitor progress
896
- mcp__moflo__swarm_status { interval: 5000 }
897
-
898
- // Store in memory
899
- mcp__moflo__memory_store { action: "store", key: "...", value: "..." }
900
- ```
901
-
902
- ---
903
-
904
- Remember: **SPARC = Systematic, Parallel, Agile, Refined, Complete**