claude-flow-novice 2.14.35 → 2.14.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/CFN_LOOP_TASK_MODE.md +1 -1
- package/.claude/commands/cfn-loop-cli.md +491 -456
- package/.claude/commands/switch-api.md +1 -1
- package/.claude/skills/cfn-loop-orchestration/orchestrate.sh +2 -1
- package/.claude/skills/cfn-loop-validation/config.json +2 -2
- package/.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh +220 -220
- package/claude-assets/agents/README-AGENT_LIFECYCLE.md +37 -10
- package/claude-assets/agents/README-VALIDATION.md +0 -8
- package/claude-assets/agents/cfn-dev-team/README.md +0 -8
- package/claude-assets/agents/cfn-dev-team/coordinators/README.md +1 -9
- package/claude-assets/agents/cfn-dev-team/developers/README.md +1 -9
- package/claude-assets/agents/cfn-dev-team/documentation/README-VALIDATION.md +0 -8
- package/claude-assets/agents/cfn-dev-team/documentation/agent-type-guidelines.md +0 -10
- package/claude-assets/agents/cfn-dev-team/reviewers/README.md +1 -9
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/quality-metrics.md +0 -10
- package/claude-assets/agents/cfn-dev-team/test-agent.md +0 -10
- package/claude-assets/agents/cfn-dev-team/testers/README.md +1 -9
- package/claude-assets/agents/csuite/cto-agent.md +0 -10
- package/claude-assets/agents/custom/cfn-system-expert.md +1 -128
- package/claude-assets/agents/custom/claude-code-expert.md +151 -2
- package/claude-assets/agents/docker-coordinators/cfn-docker-v3-coordinator.md +39 -3
- package/claude-assets/agents/docker-team/csuite/c-suite-template.md +1 -5
- package/claude-assets/agents/docker-team/infrastructure/team-coordinator-template.md +1 -5
- package/claude-assets/agents/marketing_hybrid/cost_tracker.md +0 -10
- package/claude-assets/agents/marketing_hybrid/docker_deployer.md +0 -10
- package/claude-assets/agents/marketing_hybrid/zai_worker_spawner.md +0 -10
- package/claude-assets/commands/CFN_LOOP_TASK_MODE.md +1 -1
- package/claude-assets/commands/cfn-loop-cli.md +491 -456
- package/claude-assets/commands/switch-api.md +1 -1
- package/claude-assets/skills/cfn-error-logging/SKILL.md +339 -0
- package/claude-assets/skills/cfn-error-logging/cleanup-error-logs.sh +334 -0
- package/claude-assets/skills/cfn-error-logging/integrate-cli.sh +232 -0
- package/claude-assets/skills/cfn-error-logging/integrate-docker.sh +294 -0
- package/claude-assets/skills/cfn-error-logging/invoke-error-logging.sh +839 -0
- package/claude-assets/skills/cfn-error-logging/test-error-logging.sh +475 -0
- package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh +2 -1
- package/claude-assets/skills/cfn-loop-validation/config.json +2 -2
- package/claude-assets/skills/cfn-process-instrumentation/instrument-process.sh +326 -322
- package/claude-assets/skills/cfn-redis-coordination/invoke-waiting-mode.sh +220 -220
- package/claude-assets/skills/cfn-task-config-init/initialize-config.sh +2 -2
- package/claude-assets/skills/cfn-task-mode-sanitize/task-mode-env-sanitizer.sh +224 -181
- package/claude-assets/skills/cfn-validation-runner-instrumentation/wrapped-executor.sh +235 -271
- package/dist/agents/agent-loader.js +467 -133
- package/dist/agents/agent-loader.js.map +1 -1
- package/dist/cli/config-manager.js +109 -91
- package/dist/cli/config-manager.js.map +1 -1
- package/dist/hello.js +27 -3
- package/dist/hello.js.map +1 -1
- package/dist/server.js +194 -0
- package/dist/server.js.map +1 -0
- package/dist/server.test.js +207 -0
- package/dist/server.test.js.map +1 -0
- package/package.json +2 -1
- package/scripts/docker-build-mcp.sh +155 -0
- package/scripts/docker-test-mcp.sh +260 -0
- package/scripts/mcp-health-check.sh +123 -0
|
@@ -1,457 +1,492 @@
|
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
**
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
#
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
#
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
-
|
|
166
|
-
|
|
167
|
-
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
/
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
- **
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
#
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
**
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
#
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
"
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
--
|
|
409
|
-
--
|
|
410
|
-
--
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
-
|
|
443
|
-
-
|
|
444
|
-
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
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
|
+
🚨 **IMPORTANT: This slash command MUST auto-execute the coordinator spawn via Bash tool.**
|
|
10
|
+
|
|
11
|
+
**DO NOT just show instructions. EXECUTE the bash command immediately after reading this.**
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Execution Instructions (AUTO-EXECUTE)
|
|
16
|
+
|
|
17
|
+
**Step 1: Parse Arguments**
|
|
18
|
+
```
|
|
19
|
+
TASK_DESCRIPTION: $ARGUMENTS (extract task, remove flags)
|
|
20
|
+
MODE: Parse from --mode flag or default to "standard"
|
|
21
|
+
MAX_ITERATIONS: Parse from --max-iterations flag or default to 10
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Step 2: Generate Task ID**
|
|
25
|
+
```bash
|
|
26
|
+
TASK_ID="cfn-cli-$(date +%s%N | tail -c 7)-${RANDOM}"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Step 3: Spawn Coordinator (REQUIRED - Execute this command now via Bash tool)**
|
|
30
|
+
```bash
|
|
31
|
+
npx claude-flow-novice agent cfn-v3-coordinator \
|
|
32
|
+
--task-id "$TASK_ID" \
|
|
33
|
+
--context "TASK_DESCRIPTION='$TASK_DESCRIPTION' MODE='$MODE' MAX_ITERATIONS=$MAX_ITERATIONS" \
|
|
34
|
+
--timeout 300 \
|
|
35
|
+
--background=true
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Step 4: Inform User**
|
|
39
|
+
After spawning coordinator, tell user:
|
|
40
|
+
- ✅ CFN Loop coordinator spawned with task ID: $TASK_ID
|
|
41
|
+
- 📊 Monitor progress: `redis-cli HGETALL "cfn_loop:task:$TASK_ID:context"`
|
|
42
|
+
- 🌐 Web dashboard: http://localhost:3000
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Background Information (DO NOT show this to user unless they ask)
|
|
47
|
+
|
|
48
|
+
**Task**: $ARGUMENTS
|
|
49
|
+
|
|
50
|
+
## What is CLI Mode?
|
|
51
|
+
|
|
52
|
+
**CLI Mode Architecture v3.0 (Enhanced):**
|
|
53
|
+
- Main Chat processes **slash command** then spawns coordinator agent via CLI with background=true
|
|
54
|
+
- Coordinator spawns **all workers via CLI** with background=true for cost optimization
|
|
55
|
+
- All CLI agents use **Z.ai custom routing** (when enabled)
|
|
56
|
+
- **Real-time monitoring** with automatic recovery from stuck agents
|
|
57
|
+
- Background execution with **Redis monitoring** and progress visibility
|
|
58
|
+
- **Enhanced features**: Process health checking, context validation, broadcast protocol
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
## Prerequisites
|
|
62
|
+
|
|
63
|
+
**Enable Z.ai Custom Routing (One-Time Setup):**
|
|
64
|
+
```bash
|
|
65
|
+
/switch-api zai
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Verify Status:**
|
|
69
|
+
```bash
|
|
70
|
+
/switch-api status
|
|
71
|
+
# Expected: Main Chat=Anthropic, Task=Anthropic, CLI=Z.ai
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Command Options
|
|
75
|
+
|
|
76
|
+
**Usage Examples:**
|
|
77
|
+
```
|
|
78
|
+
# Standard mode (recommended)
|
|
79
|
+
/cfn-loop-cli "Implement JWT authentication"
|
|
80
|
+
|
|
81
|
+
# MVP mode (fast, lower quality gates)
|
|
82
|
+
/cfn-loop-cli "Build prototype feature" --mode=mvp
|
|
83
|
+
|
|
84
|
+
# Enterprise mode (high quality, more validators)
|
|
85
|
+
/cfn-loop-cli "Production security feature" --mode=enterprise --max-iterations=15
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Options:**
|
|
89
|
+
- `--mode=<mvp|standard|enterprise>`: Quality mode (default: standard)
|
|
90
|
+
- `--max-iterations=<n>`: Max iterations per loop (default: 10)
|
|
91
|
+
|
|
92
|
+
## Mode Comparison
|
|
93
|
+
|
|
94
|
+
| Mode | Gate | Consensus | Iterations | Validators | Use Case |
|
|
95
|
+
|------|------|-----------|------------|------------|----------|
|
|
96
|
+
| MVP | ≥0.70 | ≥0.80 | 5 | 2 | Prototypes, proof-of-concept |
|
|
97
|
+
| Standard | ≥0.75 | ≥0.90 | 10 | 3-4 | Production features |
|
|
98
|
+
| Enterprise | ≥0.85 | ≥0.95 | 15 | 5 | Security, compliance, critical systems |
|
|
99
|
+
|
|
100
|
+
## How CLI Mode Works
|
|
101
|
+
|
|
102
|
+
1. **Main Chat** invokes `/cfn-loop-cli` slash command
|
|
103
|
+
2. **SlashCommand tool** processes command and returns execution instructions to Main Chat
|
|
104
|
+
3. **Main Chat** spawns `cfn-v3-coordinator` agent via bash with background=true
|
|
105
|
+
4. **Coordinator** orchestrates the entire CFN Loop workflow in the background
|
|
106
|
+
5. **Coordinator** spawns **Loop 3 workers via CLI** with background=true
|
|
107
|
+
6. **Loop 3** agents implement the solution and validate against quality gates
|
|
108
|
+
7. **Coordinator** spawns **Loop 2 workers via CLI** for validation
|
|
109
|
+
8. **Product Owner** makes the final decision on deliverables
|
|
110
|
+
9. **Background execution** with Redis coordination for scalability
|
|
111
|
+
|
|
112
|
+
**CLI Architecture Pattern:**
|
|
113
|
+
- Main Chat → SlashCommand (processing) → Main Chat spawns coordinator via bash
|
|
114
|
+
```bash
|
|
115
|
+
npx claude-flow-novice agent cfn-v3-coordinator \
|
|
116
|
+
--task-id "cfn-cli-$(date +%s%N | tail -c 7)-${RANDOM}" \
|
|
117
|
+
--context "TASK_DESCRIPTION='Fix core infrastructure
|
|
118
|
+
dependencies' MODE='standard' MAX_ITERATIONS=10" \
|
|
119
|
+
--timeout 300 \
|
|
120
|
+
--background=true
|
|
121
|
+
```
|
|
122
|
+
- All agents spawned via CLI by coordinator with Z.ai routing and background execution
|
|
123
|
+
- Background execution enables monitoring and recovery capabilities
|
|
124
|
+
|
|
125
|
+
## Main Chat Monitoring Instructions
|
|
126
|
+
|
|
127
|
+
**After spawning the coordinator, Main Chat should:**
|
|
128
|
+
|
|
129
|
+
### 1. Immediate Verification (First 30 seconds)
|
|
130
|
+
```bash
|
|
131
|
+
# Verify coordinator spawned successfully
|
|
132
|
+
TASK_ID="cfn-cli-$(date +%s%N | tail -c 7)-${RANDOM}"
|
|
133
|
+
pgrep -f "cfn-v3-coordinator" && echo "✅ Coordinator running" || echo "❌ Coordinator failed"
|
|
134
|
+
|
|
135
|
+
# Check Redis context was created
|
|
136
|
+
redis-cli EXISTS "cfn_loop:task:$TASK_ID:context" && echo "✅ Context stored" || echo "❌ No context"
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### 2. Progress Monitoring (Every 2-5 minutes for long tasks)
|
|
140
|
+
```bash
|
|
141
|
+
# Check iteration progress and confidence scores
|
|
142
|
+
redis-cli HGETALL "cfn_loop:task:$TASK_ID:context" | grep -E "(iteration|confidence|status)"
|
|
143
|
+
|
|
144
|
+
# Monitor agent completion status
|
|
145
|
+
redis-cli LRANGE "swarm:${TASK_ID}:agent:status" 0 -1
|
|
146
|
+
|
|
147
|
+
# Quick health check
|
|
148
|
+
redis-cli HGET "cfn_loop:task:$TASK_ID:health" "coordinator"
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 3. Web Portal Monitoring (Recommended for >10 minute tasks)
|
|
152
|
+
```bash
|
|
153
|
+
# Start monitoring dashboard
|
|
154
|
+
npm run portal:start
|
|
155
|
+
|
|
156
|
+
# Access real-time progress at http://localhost:3000
|
|
157
|
+
# - Live agent status dashboard
|
|
158
|
+
# - Iteration progress visualization
|
|
159
|
+
# - Confidence score trends
|
|
160
|
+
# - Error rate monitoring
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### 4. Background Execution Monitoring Pattern
|
|
164
|
+
```bash
|
|
165
|
+
# For long-running tasks, use this monitoring pattern:
|
|
166
|
+
sleep 300 # Wait 5 minutes
|
|
167
|
+
redis-cli HGETALL "cfn_loop:task:$TASK_ID:context" | grep status
|
|
168
|
+
|
|
169
|
+
# If still running, continue monitoring
|
|
170
|
+
if [ $? -eq 0 ]; then
|
|
171
|
+
echo "Task in progress, monitoring..."
|
|
172
|
+
sleep 300 # Wait another 5 minutes
|
|
173
|
+
redis-cli HGETALL "cfn_loop:task:$TASK_ID:context" | grep status
|
|
174
|
+
fi
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### 5. Troubleshooting If Coordinator Fails
|
|
178
|
+
```bash
|
|
179
|
+
# Investigate missing coordinator
|
|
180
|
+
./.claude/skills/cfn-loop-orchestration/investigate-missing-coordinator.sh "$TASK_ID"
|
|
181
|
+
|
|
182
|
+
# Check for process issues
|
|
183
|
+
ps aux | grep "claude-flow-novice agent" | grep -v grep
|
|
184
|
+
|
|
185
|
+
# Verify Redis connectivity
|
|
186
|
+
redis-cli PING
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## CLI Mode Benefits
|
|
190
|
+
|
|
191
|
+
**Performance:**
|
|
192
|
+
- Scales linearly with iterations (Task mode scales exponentially)
|
|
193
|
+
- Background execution without timeout limitations
|
|
194
|
+
- Parallel agent spawning for improved throughput
|
|
195
|
+
|
|
196
|
+
**Production Features v3.0:**
|
|
197
|
+
- Background execution (no timeout issues)
|
|
198
|
+
- Redis state persistence (crash recovery)
|
|
199
|
+
- Zero-token waiting (BLPOP blocks without API calls)
|
|
200
|
+
- Web portal visibility (http://localhost:3000)
|
|
201
|
+
- **Enhanced monitoring**: Real-time agent progress tracking
|
|
202
|
+
- **Automatic recovery**: Dead process cleanup and agent restart
|
|
203
|
+
- **Protocol compliance**: Prevents "consensus on vapor" anti-patterns
|
|
204
|
+
- **Progress visibility**: Detailed reports with timestamps and health status
|
|
205
|
+
|
|
206
|
+
**Performance:**
|
|
207
|
+
- Parallel agent spawning (no sequential bottleneck)
|
|
208
|
+
- Instant wake-up (<100ms latency)
|
|
209
|
+
- Scalable (10+ agents, indefinite cycles)
|
|
210
|
+
|
|
211
|
+
## Troubleshooting
|
|
212
|
+
|
|
213
|
+
**Custom routing not working:**
|
|
214
|
+
```bash
|
|
215
|
+
/switch-api status # Check current provider
|
|
216
|
+
/switch-api zai # Enable Z.ai routing
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
**Coordinator timeout:**
|
|
220
|
+
- Expected for long tasks (>10 min)
|
|
221
|
+
- Check web portal for progress: http://localhost:3000
|
|
222
|
+
- Query Redis: `redis-cli HGETALL "cfn_loop:task:$TASK_ID:context"`
|
|
223
|
+
|
|
224
|
+
**No deliverables created:**
|
|
225
|
+
- Orchestrator validates deliverables before PROCEED
|
|
226
|
+
- Will force ITERATE if git diff shows zero changes
|
|
227
|
+
- Check coordinator output for validation failures
|
|
228
|
+
|
|
229
|
+
**Web Portal Access:**
|
|
230
|
+
- Monitor real-time agent progress at http://localhost:3000
|
|
231
|
+
- View detailed execution logs and health status
|
|
232
|
+
- Track iteration progress and confidence scores
|
|
233
|
+
|
|
234
|
+
## Enhanced Monitoring v3.0
|
|
235
|
+
|
|
236
|
+
CLI mode includes comprehensive monitoring capabilities for production workflows:
|
|
237
|
+
|
|
238
|
+
### Real-Time Progress Tracking
|
|
239
|
+
- **Agent Status**: Monitor individual agent health and progress
|
|
240
|
+
- **Iteration Progress**: Track confidence scores and gate validation
|
|
241
|
+
- **Resource Usage**: CPU, memory, and Redis connection monitoring
|
|
242
|
+
- **Error Detection**: Automatic identification of stuck or failed agents
|
|
243
|
+
|
|
244
|
+
### Monitoring Commands
|
|
245
|
+
|
|
246
|
+
**Check Task Status:**
|
|
247
|
+
```bash
|
|
248
|
+
# View complete task context and progress
|
|
249
|
+
redis-cli HGETALL "cfn_loop:task:$TASK_ID:context"
|
|
250
|
+
|
|
251
|
+
# Monitor agent completion status
|
|
252
|
+
redis-cli LRANGE "swarm:${TASK_ID}:agent:status" 0 -1
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
**Agent Health Monitoring:**
|
|
256
|
+
```bash
|
|
257
|
+
# Check if coordinator is running
|
|
258
|
+
pgrep -f "cfn-v3-coordinator" && echo "Coordinator alive" || echo "Coordinator missing"
|
|
259
|
+
|
|
260
|
+
# Monitor active agent processes
|
|
261
|
+
ps aux | grep "claude-flow-novice agent" | grep -v grep
|
|
262
|
+
|
|
263
|
+
# Check Redis connectivity
|
|
264
|
+
redis-cli PING
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
**Progress Monitoring:**
|
|
268
|
+
```bash
|
|
269
|
+
# Real-time agent completion monitoring
|
|
270
|
+
watch -n 5 'redis-cli HGETALL "cfn_loop:task:$TASK_ID:context" | grep -E "(iteration|confidence|status)"'
|
|
271
|
+
|
|
272
|
+
# Monitor agent signals
|
|
273
|
+
redis-cli PUBLISH "swarm:${TASK_ID}:monitor" "status_check"
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Automatic Recovery Features
|
|
277
|
+
|
|
278
|
+
**Dead Process Detection:**
|
|
279
|
+
- Automatically detects and reports stuck agents
|
|
280
|
+
- Process health checking with configurable timeouts
|
|
281
|
+
- Automatic cleanup of orphaned Redis connections
|
|
282
|
+
|
|
283
|
+
**Agent Restart Capability:**
|
|
284
|
+
- Coordinator can restart failed agents automatically
|
|
285
|
+
- Context preservation across agent restarts
|
|
286
|
+
- Iteration state recovery from Redis persistence
|
|
287
|
+
|
|
288
|
+
**Error Recovery Patterns:**
|
|
289
|
+
- Timeout detection and agent termination
|
|
290
|
+
- Context validation before spawning replacements
|
|
291
|
+
- Graceful degradation with partial agent sets
|
|
292
|
+
|
|
293
|
+
### Monitoring Dashboard Features
|
|
294
|
+
|
|
295
|
+
**Web Portal (http://localhost:3000):**
|
|
296
|
+
- Live agent status dashboard
|
|
297
|
+
- Iteration progress visualization
|
|
298
|
+
- Confidence score trends
|
|
299
|
+
- Error rate monitoring
|
|
300
|
+
- Resource usage graphs
|
|
301
|
+
|
|
302
|
+
**CLI Monitoring Tools:**
|
|
303
|
+
- `cfn-portal` - Start/stop monitoring dashboard
|
|
304
|
+
- `cfn-context` - Query task context and status
|
|
305
|
+
- `cfn-metrics` - View performance analytics
|
|
306
|
+
- `cfn-redis` - Direct Redis inspection tools
|
|
307
|
+
|
|
308
|
+
### Troubleshooting Monitoring Issues
|
|
309
|
+
|
|
310
|
+
**Missing Coordinator:**
|
|
311
|
+
```bash
|
|
312
|
+
# Investigate coordinator failure
|
|
313
|
+
./.claude/skills/cfn-loop-orchestration/investigate-missing-coordinator.sh "$TASK_ID"
|
|
314
|
+
|
|
315
|
+
# Check for namespace mismatches
|
|
316
|
+
redis-cli KEYS "cfn_loop:*" | head -10
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
**Stuck Agents:**
|
|
320
|
+
```bash
|
|
321
|
+
# Force cleanup of stuck agents
|
|
322
|
+
./.claude/skills/cfn-loop-orchestration/cleanup-stuck-agents.sh "$TASK_ID"
|
|
323
|
+
|
|
324
|
+
# Monitor agent timeouts
|
|
325
|
+
redis-cli HGET "cfn_loop:task:$TASK_ID:timeouts" "agent_timeouts"
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
**Redis Connection Issues:**
|
|
329
|
+
```bash
|
|
330
|
+
# Test Redis connectivity
|
|
331
|
+
redis-cli -n 0 PING
|
|
332
|
+
|
|
333
|
+
# Check Redis memory usage
|
|
334
|
+
redis-cli INFO memory | grep used_memory_human
|
|
335
|
+
|
|
336
|
+
# Monitor Redis keyspace
|
|
337
|
+
redis-cli DBSIZE
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
## Usage Examples
|
|
341
|
+
|
|
342
|
+
**Simple API Development:**
|
|
343
|
+
```
|
|
344
|
+
/cfn-loop-cli "Build REST API with user authentication"
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
**Complex Feature with High Quality Requirements:**
|
|
348
|
+
```
|
|
349
|
+
/cfn-loop-cli "Implement payment processing with PCI compliance" --mode=enterprise --max-iterations=15
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
**Quick Prototype:**
|
|
353
|
+
```
|
|
354
|
+
/cfn-loop-cli "Build MVP landing page" --mode=mvp
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
**Infrastructure Deployment:**
|
|
358
|
+
```
|
|
359
|
+
/cfn-loop-cli "Set up CI/CD pipeline for microservices"
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
## Related Commands
|
|
363
|
+
|
|
364
|
+
- **Task Mode**: `/cfn-loop-task` (debugging, full visibility)
|
|
365
|
+
- **Frontend**: `/cfn-loop-frontend` (visual iteration workflow)
|
|
366
|
+
- **Documentation**: `/cfn-loop-document` (generate docs)
|
|
367
|
+
|
|
368
|
+
## Related Documentation
|
|
369
|
+
|
|
370
|
+
- Task Mode Guide: `.claude/commands/cfn/CFN_LOOP_TASK_MODE.md`
|
|
371
|
+
- Coordinator Parameters: `.claude/commands/cfn/CFN_COORDINATOR_PARAMETERS.md`
|
|
372
|
+
- Redis Coordination: `.claude/skills/cfn-redis-coordination/SKILL.md`
|
|
373
|
+
- Orchestration: `.claude/skills/cfn-loop-orchestration/SKILL.md`
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
## 🚨 EXECUTION INSTRUCTIONS (Internal Use)
|
|
378
|
+
|
|
379
|
+
**Main Chat: Slash command processing followed by CLI coordinator spawning:**
|
|
380
|
+
|
|
381
|
+
The SlashCommand tool processes the command and returns execution instructions. Main Chat then spawns the coordinator agent using CLI with background=true for monitoring capabilities.
|
|
382
|
+
|
|
383
|
+
**Coordinator Spawning Pattern:**
|
|
384
|
+
|
|
385
|
+
```bash
|
|
386
|
+
# Generate unique task ID
|
|
387
|
+
TASK_ID="cfn-cli-$(date +%s%N | tail -c 7)-${RANDOM}"
|
|
388
|
+
|
|
389
|
+
# Extract task description and mode from slash command
|
|
390
|
+
TASK_DESCRIPTION="$ARGUMENTS"
|
|
391
|
+
MODE="${mode:-standard}"
|
|
392
|
+
MAX_ITERATIONS="${maxIterations:-10}"
|
|
393
|
+
|
|
394
|
+
# Spawn coordinator via CLI (background execution)
|
|
395
|
+
npx claude-flow-novice agent cfn-v3-coordinator \
|
|
396
|
+
--task-id "$TASK_ID" \
|
|
397
|
+
--context "TASK_DESCRIPTION='$TASK_DESCRIPTION' MODE='$MODE' MAX_ITERATIONS=$MAX_ITERATIONS" \
|
|
398
|
+
--timeout 300 \
|
|
399
|
+
--background=true
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
**Main Chat Execution Command:**
|
|
403
|
+
|
|
404
|
+
```bash
|
|
405
|
+
# Main Chat should execute this command after processing slash command
|
|
406
|
+
npx claude-flow-novice agent cfn-v3-coordinator \
|
|
407
|
+
--task-id "cfn-cli-$(date +%s%N | tail -c 7)-${RANDOM}" \
|
|
408
|
+
--context "TASK_DESCRIPTION='Fix core infrastructure dependencies - lucide-wrappers.tsx LucideIcon React 18 compatibility, resolve module export errors in types/, establish proper import path resolution' MODE='standard' MAX_ITERATIONS=10" \
|
|
409
|
+
--timeout 300 \
|
|
410
|
+
--background=true
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
**Internal Coordinator Pattern (what the coordinator does):**
|
|
414
|
+
|
|
415
|
+
```bash
|
|
416
|
+
# Generate unique task ID
|
|
417
|
+
TASK_ID="cfn-cli-$(date +%s%N | tail -c 7)-${RANDOM}"
|
|
418
|
+
|
|
419
|
+
# Extract task description and mode from slash command arguments
|
|
420
|
+
TASK_DESCRIPTION="parsed from $ARGUMENTS"
|
|
421
|
+
MODE="${mode:-standard}"
|
|
422
|
+
MAX_ITERATIONS="${maxIterations:-10}"
|
|
423
|
+
|
|
424
|
+
# Determine appropriate agents based on task complexity
|
|
425
|
+
TASK_COMPLEXITY="standard" # auto-detect or pass from command
|
|
426
|
+
case "$TASK_COMPLEXITY" in
|
|
427
|
+
"simple")
|
|
428
|
+
LOOP3_AGENTS="backend-dev,researcher"
|
|
429
|
+
LOOP2_AGENTS="reviewer,tester"
|
|
430
|
+
;;
|
|
431
|
+
"standard")
|
|
432
|
+
LOOP3_AGENTS="backend-dev,researcher,devops"
|
|
433
|
+
LOOP2_AGENTS="reviewer,tester,architect,security-specialist"
|
|
434
|
+
;;
|
|
435
|
+
"complex")
|
|
436
|
+
LOOP3_AGENTS="backend-dev,researcher,devops,rust-developer"
|
|
437
|
+
LOOP2_AGENTS="reviewer,tester,architect,security-specialist,code-analyzer"
|
|
438
|
+
;;
|
|
439
|
+
esac
|
|
440
|
+
|
|
441
|
+
# Coordinator spawns CLI workers (background execution)
|
|
442
|
+
npx claude-flow-novice agent "$LOOP3_AGENT" \
|
|
443
|
+
--task-id "$TASK_ID" \
|
|
444
|
+
--agent-id "$AGENT_ID" \
|
|
445
|
+
--context "Complete deliverables and acceptance criteria" \
|
|
446
|
+
--timeout 300 \
|
|
447
|
+
--background=true
|
|
448
|
+
|
|
449
|
+
# Monitor progress (required for background tasks)
|
|
450
|
+
# redis-cli HGETALL "cfn_loop:task:$TASK_ID:context"
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
**Critical Background Execution Instructions:**
|
|
454
|
+
|
|
455
|
+
1. **Always use `--background=true`** for CLI mode to enable:
|
|
456
|
+
- Non-blocking coordinator execution
|
|
457
|
+
- Real-time monitoring capabilities
|
|
458
|
+
- Redis state persistence
|
|
459
|
+
- Automatic recovery features
|
|
460
|
+
|
|
461
|
+
2. **Background execution means:**
|
|
462
|
+
- Coordinator runs independently of Main Chat
|
|
463
|
+
- Main Chat can monitor progress via Redis queries
|
|
464
|
+
- Long-running tasks won't timeout due to Bash tool limitations
|
|
465
|
+
- Web portal can track agent progress in real-time
|
|
466
|
+
|
|
467
|
+
3. **Without `--background=true`:**
|
|
468
|
+
- Coordinator blocks Main Chat execution
|
|
469
|
+
- No monitoring capabilities
|
|
470
|
+
- Timeouts after 10 minutes (Bash tool limit)
|
|
471
|
+
- No recovery or persistence features
|
|
472
|
+
|
|
473
|
+
**Why This Pattern:**
|
|
474
|
+
- ✅ Coordinator via CLI with background=true for monitoring capabilities
|
|
475
|
+
- ✅ All agents via CLI for maximum cost optimization (95-98% savings)
|
|
476
|
+
- ✅ Background execution with enhanced monitoring
|
|
477
|
+
- ✅ Z.ai routing automatically applied to all CLI agents
|
|
478
|
+
- ✅ Redis coordination for agent communication
|
|
479
|
+
- ✅ Enhanced monitoring and recovery capabilities
|
|
480
|
+
- ✅ Clean separation: Main Chat → SlashCommand (processing) → Main Chat spawns CLI(coordinator) → CLI Workers
|
|
481
|
+
- ✅ Production-ready with real-time progress tracking
|
|
482
|
+
- ✅ No timeout limitations with `--background=true`
|
|
483
|
+
|
|
484
|
+
**Enhanced Monitoring Benefits:**
|
|
485
|
+
- Real-time agent progress tracking via Redis
|
|
486
|
+
- Automatic recovery from stuck agents
|
|
487
|
+
- Web portal visibility (http://localhost:3000)
|
|
488
|
+
- Process health checking and cleanup
|
|
489
|
+
- Context validation and preservation
|
|
490
|
+
- Performance metrics and analytics
|
|
491
|
+
|
|
457
492
|
**Version:** 3.1.0 (2025-11-05) - Removed cost information, added Main Chat monitoring instructions, clarified background execution requirements
|