claude-flow-novice 2.12.0 → 2.14.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 (42) 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 +279 -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 +460 -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/agents/agent-loader.js +165 -146
  16. package/dist/agents/agent-loader.js.map +1 -1
  17. package/dist/cli/config-manager.js.map +1 -1
  18. package/package.json +1 -1
  19. package/claude-assets/commands/cfn/auto-compact.md +0 -80
  20. package/claude-assets/commands/cfn/cfn-loop-epic.md +0 -478
  21. package/claude-assets/commands/cfn/cfn-loop-single.md +0 -256
  22. package/claude-assets/commands/cfn/cfn-loop-sprints.md +0 -396
  23. package/claude-assets/commands/cfn/cfn-loop.md +0 -518
  24. package/claude-assets/commands/cfn/claude-md.md +0 -64
  25. package/claude-assets/commands/cfn/claude-soul.md +0 -22
  26. package/claude-assets/commands/cfn/cost-savings-off.md +0 -35
  27. package/claude-assets/commands/cfn/cost-savings-on.md +0 -35
  28. package/claude-assets/commands/cfn/cost-savings-status.md +0 -34
  29. package/claude-assets/commands/cfn/custom-routing-activate.md +0 -55
  30. package/claude-assets/commands/cfn/custom-routing-deactivate.md +0 -46
  31. package/claude-assets/commands/cfn/dependency-recommendations.md +0 -171
  32. package/claude-assets/commands/cfn/fullstack.md +0 -179
  33. package/claude-assets/commands/cfn/github.md +0 -221
  34. package/claude-assets/commands/cfn/hooks.md +0 -38
  35. package/claude-assets/commands/cfn/metrics-summary.md +0 -58
  36. package/claude-assets/commands/cfn/neural.md +0 -39
  37. package/claude-assets/commands/cfn/parse-epic.md +0 -357
  38. package/claude-assets/commands/cfn/performance.md +0 -41
  39. package/claude-assets/commands/cfn/sparc.md +0 -46
  40. package/claude-assets/commands/cfn/suggest-improvements.md +0 -95
  41. package/claude-assets/commands/cfn/suggest-templates.md +0 -147
  42. package/claude-assets/commands/cfn/swarm.md +0 -24
@@ -0,0 +1,279 @@
1
+ ---
2
+ description: "Execute CFN Loop in CLI mode (production, cost-optimized, 95-98% savings)"
3
+ argument-hint: "<task description> [--mode=mvp|standard|enterprise] [--max-iterations=n]"
4
+ allowed-tools: ["Task", "TodoWrite", "Read", "Bash"]
5
+ ---
6
+
7
+ # CFN Loop CLI Mode - Production Execution
8
+
9
+ Execute CFN Loop using CLI spawning for maximum cost savings (95-98% vs Task tool).
10
+
11
+ 🚨 **CLI MODE: Production, Cost-Optimized, Background Execution**
12
+
13
+ **Task**: $ARGUMENTS
14
+
15
+ ## What is CLI Mode?
16
+
17
+ **CLI Mode Architecture:**
18
+ - Main Chat spawns **single coordinator agent** via Task()
19
+ - Coordinator spawns **all workers via CLI** (`npx claude-flow-novice`)
20
+ - CLI agents use **Z.ai custom routing** (when enabled)
21
+ - Background execution with **Redis monitoring**
22
+ - **95-98% cost savings** vs Task tool spawning
23
+
24
+ **Cost Breakdown:**
25
+ ```
26
+ ┌─────────────────────┬──────────────┬────────────┐
27
+ │ Component │ Provider │ Cost/Call │
28
+ ├─────────────────────┼──────────────┼────────────┤
29
+ │ Main Chat │ Anthropic │ $0.015 │
30
+ │ Coordinator (Task) │ Anthropic │ $0.015 │
31
+ │ Loop 3 Agents (CLI) │ Z.ai │ $0.003 ea │
32
+ │ Loop 2 Agents (CLI) │ Z.ai │ $0.003 ea │
33
+ │ Product Owner (CLI) │ Z.ai │ $0.003 │
34
+ └─────────────────────┴──────────────┴────────────┘
35
+
36
+ Total per iteration: ~$0.054 (vs $0.150 Task mode)
37
+ Savings: 64% with custom routing, 95-98% vs all-Task
38
+ ```
39
+
40
+ ## Prerequisites
41
+
42
+ **Enable Z.ai Custom Routing (One-Time Setup):**
43
+ ```bash
44
+ /switch-api zai
45
+ ```
46
+
47
+ **Verify Status:**
48
+ ```bash
49
+ /switch-api status
50
+ # Expected: Main Chat=Anthropic, Task=Anthropic, CLI=Z.ai
51
+ ```
52
+
53
+ ## Command Options
54
+
55
+ ```bash
56
+ # Standard mode (recommended)
57
+ /cfn-loop-cli "Implement JWT authentication"
58
+
59
+ # MVP mode (fast, lower quality gates)
60
+ /cfn-loop-cli "Build prototype feature" --mode=mvp
61
+
62
+ # Enterprise mode (high quality, more validators)
63
+ /cfn-loop-cli "Production security feature" --mode=enterprise --max-iterations=15
64
+ ```
65
+
66
+ **Options:**
67
+ - `--mode=<mvp|standard|enterprise>`: Quality mode (default: standard)
68
+ - `--max-iterations=<n>`: Max iterations per loop (default: 10)
69
+
70
+ ## Mode Comparison
71
+
72
+ | Mode | Gate | Consensus | Iterations | Validators | Use Case |
73
+ |------|------|-----------|------------|------------|----------|
74
+ | MVP | ≥0.70 | ≥0.80 | 5 | 2 | Prototypes, proof-of-concept |
75
+ | Standard | ≥0.75 | ≥0.90 | 10 | 3-4 | Production features |
76
+ | Enterprise | ≥0.85 | ≥0.95 | 15 | 5 | Security, compliance, critical systems |
77
+
78
+ ## 🚨 CRITICAL EXECUTION INSTRUCTIONS
79
+
80
+ **YOU ARE MAIN CHAT. YOU SPAWN ONLY ONE AGENT: cfn-v3-coordinator**
81
+
82
+ **DO NOT spawn Loop 3 agents (backend-dev, researcher, etc.)**
83
+ **DO NOT spawn Loop 2 agents (reviewer, tester, etc.)**
84
+ **DO NOT spawn product-owner**
85
+ **DO NOT ask user which agents to use**
86
+
87
+ The coordinator handles ALL agent spawning internally via CLI.
88
+
89
+ ---
90
+
91
+ ### Execute This Task() Call:
92
+
93
+ ```javascript
94
+ Task("cfn-v3-coordinator", `
95
+ CFN LOOP CLI MODE - PRODUCTION EXECUTION
96
+
97
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
98
+ TASK SPECIFICATION
99
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
100
+
101
+ Task Description: $ARGUMENTS
102
+ Task ID: cfn-cli-$(date +%s)
103
+ Mode: ${mode.toUpperCase()}
104
+
105
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
106
+ SUCCESS CRITERIA
107
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
108
+
109
+ Acceptance Criteria:
110
+ - [ ] Core functionality implemented
111
+ - [ ] All tests pass with >80% coverage
112
+ - [ ] Security review completed
113
+ - [ ] Documentation updated
114
+ - [ ] No regression in existing features
115
+
116
+ Quality Gates (${mode.toUpperCase()} MODE):
117
+ - Loop 3 Gate Threshold: ${mode === 'enterprise' ? 0.85 : mode === 'standard' ? 0.75 : 0.70}
118
+ - Loop 2 Consensus Threshold: ${mode === 'enterprise' ? 0.95 : mode === 'standard' ? 0.90 : 0.80}
119
+ - Max Iterations: ${maxIterations}
120
+
121
+ Definition of Done:
122
+ - Consensus ≥ threshold achieved
123
+ - All acceptance criteria met
124
+ - Product Owner approval received
125
+
126
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
127
+ ORCHESTRATION CONFIGURATION
128
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
129
+
130
+ Mode: ${mode.toUpperCase()}
131
+
132
+ Loop 3 Agents (Implementation) - SELECT BASED ON TASK:
133
+ Examples:
134
+ - Backend API: backend-dev, researcher, devops
135
+ - Full-Stack: backend-dev, react-frontend-engineer, devops
136
+ - Infrastructure: devops, rust-developer, researcher
137
+ - Security: security-specialist, backend-dev, researcher
138
+
139
+ Loop 2 Agents (Validation) - SCALE BY COMPLEXITY:
140
+ Simple (1-2 files): reviewer, tester
141
+ Standard (3-5 files): reviewer, tester, architect, security-specialist
142
+ Complex (>5 files): +code-analyzer, +performance-benchmarker
143
+
144
+ Product Owner: product-owner
145
+
146
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
147
+ EXECUTION INSTRUCTIONS
148
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
149
+
150
+ 1. INVOKE ORCHESTRATOR (CLI spawning):
151
+
152
+ TASK_ID="cfn-cli-$(date +%s)"
153
+ MODE="${mode}"
154
+ LOOP3_AGENTS="backend-dev,researcher,devops" # Customize for task
155
+ LOOP2_AGENTS="reviewer,tester,architect,security-specialist" # Scale by complexity
156
+
157
+ ./.claude/skills/cfn-loop-orchestration/orchestrate.sh \\
158
+ --task-id "$TASK_ID" \\
159
+ --mode "$MODE" \\
160
+ --loop3-agents "$LOOP3_AGENTS" \\
161
+ --loop2-agents "$LOOP2_AGENTS" \\
162
+ --product-owner "product-owner" \\
163
+ --max-iterations ${maxIterations}
164
+
165
+ 2. ORCHESTRATOR HANDLES:
166
+ - Spawns all agents via CLI (background)
167
+ - Loop 3: Gate check (≥threshold) → PASS/ITERATE
168
+ - Loop 2: Consensus check (≥threshold) → COMPLETE/ITERATE
169
+ - Product Owner: PROCEED/ITERATE/ABORT decision
170
+ - Git commit/push on PROCEED
171
+ - Returns structured result to Main Chat
172
+
173
+ 3. RETURN STRUCTURED RESULT:
174
+ {
175
+ "taskId": "cfn-cli-XXXXX",
176
+ "status": "complete|failed",
177
+ "iterations": {"loop3": N, "loop2": M},
178
+ "finalConsensus": 0.XX,
179
+ "acceptanceCriteria": {
180
+ "met": [...],
181
+ "pending": [...]
182
+ },
183
+ "deliverables": [...],
184
+ "recommendations": [...]
185
+ }
186
+
187
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
188
+ CRITICAL RULES
189
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
190
+
191
+ - DO NOT spawn agents with Task() - orchestrator uses CLI
192
+ - ALL agents run in background via npx claude-flow-novice
193
+ - USE Redis BLPOP for loop dependencies
194
+ - AGENTS use Z.ai routing automatically (when enabled)
195
+ - RETURN structured result when complete
196
+ `, "cfn-v3-coordinator")
197
+ ```
198
+
199
+ ## Autonomous Execution Rules
200
+
201
+ **YOU ARE FORBIDDEN FROM:**
202
+ - ❌ Asking "Should I retry?" (coordinator handles automatically)
203
+ - ❌ Asking "Proceed to consensus?" (orchestrator decides)
204
+ - ❌ Waiting for approval during CFN Loop cycles
205
+ - ❌ Spawning workers with Task() (use coordinator only)
206
+
207
+ **YOU MUST:**
208
+ - ✅ ALWAYS spawn single coordinator agent
209
+ - ✅ LET coordinator invoke orchestrator internally
210
+ - ✅ COORDINATOR handles all loop execution autonomously
211
+ - ✅ ONLY return to chat when complete or blocked
212
+
213
+ ## CLI Mode Benefits
214
+
215
+ **Cost Savings:**
216
+ - 64% savings with Z.ai routing vs all-Anthropic
217
+ - 95-98% savings vs Task tool spawning
218
+ - Scales linearly with iterations (Task mode scales exponentially)
219
+
220
+ **Production Features:**
221
+ - Background execution (no timeout issues)
222
+ - Redis state persistence (crash recovery)
223
+ - Zero-token waiting (BLPOP blocks without API calls)
224
+ - Web portal visibility (http://localhost:3000)
225
+
226
+ **Performance:**
227
+ - Parallel agent spawning (no sequential bottleneck)
228
+ - Instant wake-up (<100ms latency)
229
+ - Scalable (10+ agents, indefinite cycles)
230
+
231
+ ## When to Use CLI Mode
232
+
233
+ **Use CLI Mode for:**
234
+ - ✅ Production features
235
+ - ✅ Long-running tasks (>10 min)
236
+ - ✅ Multi-iteration workflows
237
+ - ✅ Cost-sensitive projects
238
+ - ✅ Background execution
239
+
240
+ **Use Task Mode for:**
241
+ - Debugging (full visibility needed)
242
+ - Learning CFN Loop workflow
243
+ - Short prototypes (<5 min)
244
+ - Single-iteration tasks
245
+
246
+ ## Troubleshooting
247
+
248
+ **Custom routing not working:**
249
+ ```bash
250
+ /switch-api status # Check current provider
251
+ /switch-api zai # Enable Z.ai routing
252
+ ```
253
+
254
+ **Coordinator timeout:**
255
+ - Expected for long tasks (>10 min)
256
+ - Check web portal for progress: http://localhost:3000
257
+ - Query Redis: `redis-cli HGETALL "cfn_loop:task:$TASK_ID:context"`
258
+
259
+ **No deliverables created:**
260
+ - Orchestrator validates deliverables before PROCEED
261
+ - Will force ITERATE if git diff shows zero changes
262
+ - Check coordinator output for validation failures
263
+
264
+ ## Related Commands
265
+
266
+ - **Task Mode**: `/cfn-loop-task` (debugging, full visibility)
267
+ - **Frontend**: `/cfn-loop-frontend` (visual iteration workflow)
268
+ - **Documentation**: `/cfn-loop-document` (generate docs)
269
+
270
+ ## Related Documentation
271
+
272
+ - Task Mode Guide: `.claude/commands/cfn/CFN_LOOP_TASK_MODE.md`
273
+ - Coordinator Parameters: `.claude/commands/cfn/CFN_COORDINATOR_PARAMETERS.md`
274
+ - Redis Coordination: `.claude/skills/cfn-redis-coordination/SKILL.md`
275
+ - Orchestration: `.claude/skills/cfn-loop-orchestration/SKILL.md`
276
+
277
+ ---
278
+
279
+ **Version:** 1.0.0 (2025-10-31) - CLI mode: production execution, cost-optimized, background processing
@@ -398,13 +398,32 @@ Validating documentation...
398
398
  Documentation update complete.
399
399
  ```
400
400
 
401
+ ## CFN Loop Command Structure (v3.0)
402
+
403
+ **Current Commands (as of 2025-10-31):**
404
+ 1. `/cfn-loop-task` - Task mode (debugging, full visibility)
405
+ 2. `/cfn-loop-cli` - CLI mode (production, cost-optimized)
406
+ 3. `/cfn-loop-frontend` - Visual iteration (screenshot + video validation)
407
+ 4. `/cfn-loop-document` - Documentation generation (this command)
408
+
409
+ **Removed Commands (deprecated 2025-10-31):**
410
+ - ❌ `/cfn-loop` (replaced by `/cfn-loop-cli` or `/cfn-loop-task`)
411
+ - ❌ `/cfn-loop-single` (replaced by `/cfn-loop-cli`)
412
+ - ❌ `/cfn-loop-epic` (use multiple `/cfn-loop-cli` executions)
413
+ - ❌ `/cfn-loop-sprints` (use `/cfn-loop-cli` per sprint)
414
+
415
+ **When documenting CFN Loop features:**
416
+ - Reference correct command names (task/cli/frontend/document)
417
+ - Update examples to use new commands
418
+ - Mark deprecated commands clearly in changelog
419
+ - Maintain backward compatibility notes
420
+
401
421
  ## Integration with CFN Loop
402
422
 
403
423
  ### Auto-Trigger Conditions
404
424
  ```javascript
405
425
  // Automatically trigger documentation after:
406
426
  if (
407
- epicComplete || // Epic completion
408
427
  sprintComplete || // Sprint completion
409
428
  majorPhaseComplete || // Major phase completion
410
429
  newSlashCommandAdded || // New slash command
@@ -94,7 +94,7 @@ npm install -D @playwright/test
94
94
 
95
95
  ## Execution Pattern
96
96
 
97
- ### Step 1: Parse Command Arguments
97
+ ### Step 1: Parse Command Arguments & Determine Mode
98
98
 
99
99
  ```javascript
100
100
  const params = {
@@ -107,9 +107,24 @@ const params = {
107
107
  };
108
108
 
109
109
  console.log(`Frontend CFN Loop: ${params.mode} mode, ${params.spawnMode} spawning`);
110
+
111
+ // MODE DETECTION: Inject mode-specific instructions
112
+ if (params.spawnMode === 'cli') {
113
+ console.log('━━━ CLI MODE INSTRUCTIONS ━━━');
114
+ console.log('Main Chat spawns ONLY cfn-frontend-coordinator');
115
+ console.log('Coordinator handles all visual iteration internally');
116
+ console.log('CLI agents use Z.ai routing (when enabled)');
117
+ console.log('Background execution with Redis monitoring');
118
+ } else {
119
+ console.log('━━━ TASK MODE INSTRUCTIONS ━━━');
120
+ console.log('Main Chat coordinates entire visual iteration workflow');
121
+ console.log('NO coordinator agent spawned');
122
+ console.log('Main Chat spawns all agents via Task()');
123
+ console.log('Full visibility in Main Chat');
124
+ }
110
125
  ```
111
126
 
112
- ### Step 2: Mode Selection
127
+ ### Step 2: Execute Based on Mode
113
128
 
114
129
  #### CLI Mode (Default) - Spawn Frontend Coordinator
115
130