claude-flow-novice 2.12.0 → 2.13.0

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 (40) hide show
  1. package/.claude/commands/README.md +177 -129
  2. package/claude-assets/commands/cfn/README.md +177 -129
  3. package/claude-assets/commands/cfn/cfn-loop-cli.md +268 -0
  4. package/claude-assets/commands/cfn/cfn-loop-document.md +20 -1
  5. package/claude-assets/commands/cfn/cfn-loop-frontend.md +17 -2
  6. package/claude-assets/commands/cfn/cfn-loop-task.md +442 -0
  7. package/claude-assets/commands/cfn/context-curate.md +27 -38
  8. package/claude-assets/commands/cfn/context-inject.md +14 -25
  9. package/claude-assets/commands/cfn/context-query.md +40 -45
  10. package/claude-assets/commands/cfn/context-reflect.md +40 -38
  11. package/claude-assets/commands/cfn/context-stats.md +13 -38
  12. package/claude-assets/commands/cfn/launch-web-dashboard.md +0 -295
  13. package/claude-assets/commands/cfn/list-agents-rebuild.md +18 -18
  14. package/claude-assets/commands/cfn/write-plan.md +246 -75
  15. package/dist/cli/config-manager.js +109 -91
  16. package/package.json +1 -1
  17. package/claude-assets/commands/cfn/auto-compact.md +0 -80
  18. package/claude-assets/commands/cfn/cfn-loop-epic.md +0 -478
  19. package/claude-assets/commands/cfn/cfn-loop-single.md +0 -256
  20. package/claude-assets/commands/cfn/cfn-loop-sprints.md +0 -396
  21. package/claude-assets/commands/cfn/cfn-loop.md +0 -518
  22. package/claude-assets/commands/cfn/claude-md.md +0 -64
  23. package/claude-assets/commands/cfn/claude-soul.md +0 -22
  24. package/claude-assets/commands/cfn/cost-savings-off.md +0 -35
  25. package/claude-assets/commands/cfn/cost-savings-on.md +0 -35
  26. package/claude-assets/commands/cfn/cost-savings-status.md +0 -34
  27. package/claude-assets/commands/cfn/custom-routing-activate.md +0 -55
  28. package/claude-assets/commands/cfn/custom-routing-deactivate.md +0 -46
  29. package/claude-assets/commands/cfn/dependency-recommendations.md +0 -171
  30. package/claude-assets/commands/cfn/fullstack.md +0 -179
  31. package/claude-assets/commands/cfn/github.md +0 -221
  32. package/claude-assets/commands/cfn/hooks.md +0 -38
  33. package/claude-assets/commands/cfn/metrics-summary.md +0 -58
  34. package/claude-assets/commands/cfn/neural.md +0 -39
  35. package/claude-assets/commands/cfn/parse-epic.md +0 -357
  36. package/claude-assets/commands/cfn/performance.md +0 -41
  37. package/claude-assets/commands/cfn/sparc.md +0 -46
  38. package/claude-assets/commands/cfn/suggest-improvements.md +0 -95
  39. package/claude-assets/commands/cfn/suggest-templates.md +0 -147
  40. package/claude-assets/commands/cfn/swarm.md +0 -24
@@ -1,478 +0,0 @@
1
- ---
2
- description: "Execute multi-phase epic with CFN Loop orchestration and autonomous phase transitions"
3
- argument-hint: "<epic description>"
4
- allowed-tools: ["Task", "TodoWrite", "Read", "Write", "Edit", "Bash", "Glob", "Grep"]
5
- ---
6
-
7
- # CFN Loop Epic - Multi-Phase Autonomous Development
8
-
9
- Execute a large multi-phase epic using the full 4-loop CFN structure with autonomous phase orchestration.
10
-
11
- 🚨 **AUTONOMOUS MULTI-PHASE SELF-LOOPING PROCESS**
12
-
13
- **Epic Goal**: $ARGUMENTS
14
-
15
- ## CFN Loop Structure (4 Loops)
16
-
17
- ```
18
- LOOP 0: Epic/Sprint Orchestration (THIS COMMAND)
19
- ├─ Phase 1 → Phase 2 → Phase 3 → ... → Phase N
20
-
21
- LOOP 1: Phase Execution (current phase)
22
-
23
- LOOP 2: Consensus Validation (≥90% Byzantine consensus)
24
-
25
- LOOP 3: Primary Swarm Execution (implementation with confidence scores)
26
- ```
27
-
28
- ## Epic Planning (Loop 0)
29
-
30
- ### Step 1: Parse Epic into Phases
31
- ```javascript
32
- // Use parse-epic utility to break down epic
33
- const epicPlan = {
34
- epic_name: "auth-system",
35
- phases: [
36
- {
37
- phase_id: "1",
38
- name: "User Authentication",
39
- deliverables: ["Login API", "JWT generation", "Password hashing"],
40
- dependencies: [],
41
- estimated_agents: 5
42
- },
43
- {
44
- phase_id: "2",
45
- name: "Authorization & RBAC",
46
- deliverables: ["Role system", "Permission checks", "Middleware"],
47
- dependencies: ["1"],
48
- estimated_agents: 6
49
- },
50
- {
51
- phase_id: "3",
52
- name: "Session Management",
53
- deliverables: ["Refresh tokens", "Logout", "Session tracking"],
54
- dependencies: ["1", "2"],
55
- estimated_agents: 4
56
- }
57
- ]
58
- }
59
- ```
60
-
61
- ### Step 2: Store Scope Boundaries (CRITICAL)
62
- ```javascript
63
- mcp__claude-flow-novice__memory_usage({
64
- action: "store",
65
- namespace: "scope-control",
66
- key: "project-boundaries",
67
- value: JSON.stringify({
68
- primary_goal: "Build complete authentication system",
69
- in_scope: [
70
- "JWT authentication",
71
- "Role-based access control",
72
- "Session management",
73
- "Password security (bcrypt)"
74
- ],
75
- out_of_scope: [
76
- "OAuth/social login",
77
- "Multi-factor authentication",
78
- "Biometric authentication",
79
- "Advanced rate limiting beyond basic"
80
- ],
81
- risk_profile: "public-facing-medium-risk",
82
- decision_authority_config: {
83
- auto_approve_threshold: 0.90,
84
- auto_relaunch_max_iteration: 10,
85
- escalation_criteria: ["security vulnerability", "data loss risk"]
86
- }
87
- })
88
- })
89
- ```
90
-
91
- ## Phase Execution (Loop 1)
92
-
93
- **MANDATORY: Spawn single coordinator agent that manages ALL phases autonomously.**
94
-
95
- The coordinator uses CLI spawning per phase and provides full visibility via web portal.
96
-
97
- ### Epic Pattern (SINGLE COORDINATOR FOR ALL PHASES)
98
-
99
- ```javascript
100
- Task("cfn-v3-coordinator", `
101
- CFN LOOP EPIC EXECUTION - MULTI-PHASE
102
-
103
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
104
- COST OPTIMIZATION - CUSTOM ROUTING (CRITICAL)
105
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
106
-
107
- ⚠️ IMPORTANT: Enable custom routing for maximum cost savings!
108
-
109
- 1. Enable routing (one-time setup):
110
- /custom-routing-activate
111
-
112
- 2. Verify status:
113
- /switch-api status
114
-
115
- Cost Breakdown (PER PHASE, per iteration):
116
- ┌─────────────────────┬──────────────┬────────────┐
117
- │ Component │ Provider │ Cost/Call │
118
- ├─────────────────────┼──────────────┼────────────┤
119
- │ Main Chat │ Anthropic │ $0.015 │
120
- │ Coordinator (Task) │ Anthropic │ $0.015 │
121
- │ Loop 3 Agents (CLI) │ Z.ai │ $0.003 ea │
122
- │ Loop 2 Agents (CLI) │ Z.ai │ $0.003 ea │
123
- │ Product Owner (CLI) │ Z.ai │ $0.003 │
124
- └─────────────────────┴──────────────┴────────────┘
125
-
126
- Epic Cost Example (3 phases, 2 iterations each):
127
- • WITH custom routing: ~$0.30 total
128
- • WITHOUT custom routing: ~$0.90 total
129
- • SAVINGS: ~67% cost reduction
130
-
131
- Key Concept:
132
- - Task() agents use Main Chat provider (Anthropic)
133
- - CLI-spawned agents use custom routing (Z.ai when enabled)
134
- - Cost multiplies by number of phases and iterations
135
-
136
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
137
- EPIC SPECIFICATION
138
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
139
-
140
- Epic Goal: $ARGUMENTS
141
- Epic ID: epic-$(date +%s)
142
- Mode: STANDARD (gate: 0.75, consensus: 0.90)
143
-
144
- Phases (ANALYZE EPIC AND DEFINE):
145
- # Parse epic description and break into phases
146
- # Example structure:
147
- Phase 0: Assessment
148
- - Deliverables: Requirements analysis, Architecture design
149
- - Dependencies: None
150
- - Estimated agents: 2 (analyst, architect)
151
-
152
- Phase 1: Core Implementation
153
- - Deliverables: Main features, API endpoints
154
- - Dependencies: Phase 0
155
- - Estimated agents: 3 (backend-dev, researcher, devops)
156
-
157
- Phase 2: Validation
158
- - Deliverables: Tests, Security audit, Documentation
159
- - Dependencies: Phase 0, Phase 1
160
- - Estimated agents: 3 (tester, reviewer, security-specialist)
161
-
162
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
163
- EPIC-LEVEL SUCCESS CRITERIA
164
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
165
-
166
- Scope Boundaries (CRITICAL - ENFORCE STRICTLY):
167
-
168
- In Scope (EXAMPLE - CUSTOMIZE FOR YOUR EPIC):
169
- - Feature implementation as described
170
- - Basic testing and validation
171
- - Essential documentation
172
- - Security fundamentals
173
-
174
- Out of Scope (DEFER TO BACKLOG - EXAMPLE):
175
- - Advanced features not in core spec
176
- - Performance optimization beyond basics
177
- - Additional integrations
178
- - Nice-to-have features
179
-
180
- Epic-Level Acceptance Criteria:
181
- - [ ] All phases complete with consensus ≥0.90
182
- - [ ] All deliverables implemented
183
- - [ ] Integration tests pass
184
- - [ ] Security audit complete
185
- - [ ] Documentation updated
186
- - [ ] No scope creep (out-of-scope items deferred)
187
-
188
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
189
- PHASE-BY-PHASE EXECUTION
190
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
191
-
192
- For EACH phase:
193
-
194
- 1. CHECK DEPENDENCIES:
195
- - Verify all dependency phases complete
196
- - Load previous phase results from memory
197
-
198
- 2. STORE SCOPE BOUNDARIES:
199
- mcp__claude-flow-novice__memory_usage({
200
- action: "store",
201
- namespace: "scope-control",
202
- key: "epic-${EPIC_ID}-scope",
203
- value: JSON.stringify({
204
- inScope: [...],
205
- outOfScope: [...],
206
- decisionAuthority: {...}
207
- })
208
- })
209
-
210
- 3. INVOKE ORCHESTRATOR FOR PHASE:
211
- # Generate task ID and construct bash command with actual values
212
- # DO NOT use template literals - construct real bash variables
213
-
214
- TASK_ID="phase-0-$(date +%s)"
215
- MODE="standard"
216
- LOOP3_AGENTS="analyst,architect"
217
- LOOP2_AGENTS="reviewer,architect"
218
-
219
- ./.claude/skills/cfn-cfn-cfn-orchestration/orchestrate.sh \
220
- --task-id "$TASK_ID" \
221
- --mode "$MODE" \
222
- --loop3-agents "$LOOP3_AGENTS" \
223
- --loop2-agents "$LOOP2_AGENTS" \
224
- --product-owner "product-owner" \
225
- --max-iterations 10
226
-
227
- 4. STORE PHASE RESULTS:
228
- mcp__claude-flow-novice__memory_usage({
229
- action: "store",
230
- namespace: "epic-progress",
231
- key: "phase-${PHASE_ID}-results",
232
- value: JSON.stringify({
233
- consensus: 0.XX,
234
- deliverables: [...],
235
- timestamp: Date.now()
236
- })
237
- })
238
-
239
- 5. AUTO-TRANSITION:
240
- IF phase consensus ≥0.90 AND dependencies satisfied:
241
- IMMEDIATELY start next phase (NO approval needed)
242
-
243
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
244
- MONITORING & VISIBILITY
245
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
246
-
247
- Web Portal: http://localhost:3000
248
-
249
- Per-Phase Monitoring:
250
- - Agents: ./.claude/skills/cfn-cfn-web-portal/invoke-portal-agents.sh --swarm phase-${PHASE_ID}
251
- - Events: ./.claude/skills/cfn-cfn-web-portal/invoke-portal-events.sh --phase phase-${PHASE_ID}
252
- - Metrics: ./.claude/skills/cfn-cfn-web-portal/invoke-portal-metrics.sh
253
-
254
- Epic Progress:
255
- - Query memory for phase results
256
- - Track consensus trends
257
- - Monitor scope adherence
258
-
259
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
260
- FINAL EPIC REPORT
261
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
262
-
263
- Return structured result to Main Chat:
264
- {
265
- "epicId": "epic-XXXXX",
266
- "status": "complete|partial|failed",
267
- "phases": [
268
- {
269
- "phaseId": "phase-1",
270
- "name": "User Authentication",
271
- "status": "complete",
272
- "consensus": 0.94,
273
- "iterations": {"loop3": 2, "loop2": 1},
274
- "deliverables": ["Login API", "JWT generation", ...]
275
- },
276
- ...
277
- ],
278
- "deferredItems": [
279
- "OAuth integration (out-of-scope)",
280
- "Biometric auth (out-of-scope)"
281
- ],
282
- "recommendations": [...]
283
- }
284
-
285
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
286
- CRITICAL RULES
287
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
288
-
289
- - DO NOT spawn agents with Task()
290
- - LET orchestrator handle CLI spawning per phase
291
- - USE memory for scope enforcement
292
- - AUTO-TRANSITION between phases (no approval)
293
- - DEFER out-of-scope items to backlog
294
- - PUBLISH events per phase
295
- - RETURN epic summary when complete
296
- `, "cfn-v3-coordinator")
297
- ```
298
-
299
- ### Coordinator Autonomous Multi-Phase Execution
300
-
301
- **Phase Iteration:**
302
- For each phase, coordinator:
303
- 1. Checks dependencies satisfied
304
- 2. Loads scope boundaries
305
- 3. Invokes orchestrator for phase
306
- 4. Monitors via web portal
307
- 5. Stores phase results
308
- 6. Auto-transitions to next phase
309
-
310
- **Visibility per Phase:**
311
- - Web UI shows all phases, current phase highlighted
312
- - Event stream filtered by phase ID
313
- - Metrics track per-phase consensus trends
314
-
315
- ### Phase Transition Logic
316
- ```javascript
317
- // After each phase completes
318
- if (consensusScore >= 0.90 && allDeliverablesComplete) {
319
- // Store phase results
320
- mcp__claude-flow-novice__memory_usage({
321
- action: "store",
322
- namespace: "epic-progress",
323
- key: `phase-${phaseId}-results`,
324
- value: JSON.stringify({
325
- consensus: consensusScore,
326
- deliverables: completedDeliverables,
327
- timestamp: Date.now()
328
- })
329
- })
330
-
331
- // Check next phase dependencies
332
- const nextPhase = epicPlan.phases[currentPhaseIndex + 1];
333
- if (dependenciesSatisfied(nextPhase)) {
334
- // IMMEDIATELY transition (NO approval needed)
335
- executePhase(nextPhase);
336
- }
337
- }
338
- ```
339
-
340
- ## Product Owner Integration (GOAP)
341
-
342
- Product Owner operates at EACH phase completion:
343
-
344
- ```javascript
345
- Task("Product Owner", `
346
- GOAP DECISION - Phase ${phaseId} Complete
347
-
348
- CURRENT STATE:
349
- - Phase ${phaseId} consensus: ${consensusScore}
350
- - Remaining phases: ${remainingPhases}
351
- - Validator concerns: ${concerns}
352
-
353
- RETRIEVE EPIC SCOPE:
354
- mcp__claude-flow-novice__memory_usage({
355
- action: "retrieve",
356
- namespace: "scope-control",
357
- key: "project-boundaries"
358
- })
359
-
360
- EXECUTE GOAP A* SEARCH:
361
- 1. Classify phase completion quality
362
- 2. Evaluate scope adherence
363
- 3. Calculate cost of scope expansion vs backlog defer
364
- 4. Make autonomous decision
365
-
366
- DECISION OPTIONS:
367
- - PROCEED_NEXT_PHASE (dependencies satisfied, scope intact)
368
- - DEFER_CONCERNS (save to backlog, continue epic)
369
- - ESCALATE (critical scope violation or blocker)
370
-
371
- OUTPUT: {decision: "...", next_action: "..."}
372
- `, "product-owner")
373
- ```
374
-
375
- ## Autonomous Multi-Phase Execution
376
-
377
- **FORBIDDEN PATTERNS:**
378
- - ❌ "Phase 1 complete. Proceed to Phase 2?" (AUTO-PROCEED)
379
- - ❌ "Should I continue the epic?" (ALWAYS continue until all phases done)
380
- - ❌ Waiting for approval between phases (AUTONOMOUS TRANSITION)
381
-
382
- **REQUIRED PATTERNS:**
383
- ```
384
- Phase 1 consensus: 94% ✅
385
- Dependencies for Phase 2 satisfied.
386
- IMMEDIATELY transitioning to Phase 2...
387
-
388
- Phase 2: Authorization & RBAC
389
- [Spawning agents autonomously - no permission needed]
390
- ```
391
-
392
- ## Iteration Limits (Per Phase)
393
- - **Loop 2** (Consensus): 10 iterations max per phase
394
- - **Loop 3** (Primary Swarm): 10 iterations max per phase
395
- - **Loop 1** (Phases): Unlimited (continues until all phases complete)
396
-
397
- ## Epic Progress Tracking
398
-
399
- ```javascript
400
- // Query epic progress
401
- mcp__claude-flow-novice__memory_usage({
402
- action: "list",
403
- namespace: "epic-progress"
404
- })
405
-
406
- // Output:
407
- {
408
- "phase-1-results": {consensus: 0.94, deliverables: [...]},
409
- "phase-2-results": {consensus: 0.91, deliverables: [...]},
410
- "phase-3-results": null // Current phase in progress
411
- }
412
- ```
413
-
414
- ## Example Multi-Phase Execution
415
-
416
- ```
417
- [Turn 1] Epic: Auth System (3 phases)
418
- → Scope boundaries stored in memory
419
- → Phase 1: User Authentication
420
-
421
- [Turn 2-5] Phase 1 Execution (Loop 3 + Loop 2)
422
- → Loop 3 iterations (confidence checks)
423
- → Loop 2 consensus validation
424
- → Product Owner: PROCEED_NEXT_PHASE
425
- → Phase 1 COMPLETE (consensus: 94%)
426
-
427
- [Turn 6] AUTONOMOUS TRANSITION
428
- → Dependencies for Phase 2 satisfied
429
- → IMMEDIATELY starting Phase 2: Authorization & RBAC
430
-
431
- [Turn 7-10] Phase 2 Execution
432
- → Loop 3 + Loop 2 cycles
433
- → Product Owner: DEFER (OAuth out-of-scope)
434
- → Phase 2 COMPLETE (consensus: 91%)
435
-
436
- [Turn 11] AUTONOMOUS TRANSITION
437
- → Phase 3: Session Management
438
-
439
- [Turn 12-14] Phase 3 Execution
440
- → Final phase completion
441
- → Epic COMPLETE ✅
442
- ```
443
-
444
- ## Output Format
445
-
446
- ```
447
- Epic: auth-system (3 phases)
448
- Phase 1/3: User Authentication
449
-
450
- Loop 3 Iteration 2/10 - Confidence: 85% avg ✅
451
- Loop 2 Iteration 1/10 - Consensus: 94% ✅
452
-
453
- Phase 1 COMPLETE
454
- Dependencies satisfied for Phase 2.
455
- IMMEDIATELY transitioning to Phase 2...
456
-
457
- ─────────────────────────────────
458
- Phase 2/3: Authorization & RBAC
459
- [Executing autonomously - no permission needed]
460
- ```
461
-
462
- ## Epic Completion
463
-
464
- When final phase achieves ≥90% consensus:
465
- ```
466
- Phase 3 COMPLETE - Consensus: 92% ✅
467
-
468
- Epic: auth-system - ALL PHASES COMPLETE ✅
469
- - Phase 1: User Authentication (94%)
470
- - Phase 2: Authorization & RBAC (91%)
471
- - Phase 3: Session Management (92%)
472
-
473
- Deferred items saved to backlog:
474
- - OAuth/social login integration
475
- - Multi-factor authentication
476
-
477
- Epic execution complete. Self-looping terminated.
478
- ```