claude-flow-novice 2.14.18 → 2.14.20
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_EXPERT_UPDATE.md +142 -0
- package/.claude/commands/CFN_LOOP_TASK_MODE.md +6 -6
- package/.claude/commands/cfn-docker/CFN_DOCKER_CLI.md +527 -0
- package/.claude/commands/cfn-docker/CFN_DOCKER_LOOP.md +377 -0
- package/.claude/commands/cfn-docker/CFN_DOCKER_TASK.md +490 -0
- package/.claude/commands/cfn-loop-cli.md +279 -69
- package/.claude/commands/deprecated/README.md +55 -0
- package/.claude/root-claude-distribute/CFN-CLAUDE.md +115 -42
- package/.claude/skills/cfn-loop-orchestration/orchestrate.sh +66 -11
- package/.claude/skills/cfn-loop-orchestration/orchestrate.sh.backup +884 -0
- package/claude-assets/agents/cfn-dev-team/developers/frontend/typescript-specialist.md +326 -0
- package/claude-assets/agents/cfn-seo-team/technical-seo-specialist.md +9 -6
- package/claude-assets/agents/docker-coordinators/cfn-docker-v3-coordinator.md +199 -0
- package/claude-assets/commands/CFN_EXPERT_UPDATE.md +142 -0
- package/claude-assets/commands/CFN_LOOP_TASK_MODE.md +6 -6
- package/claude-assets/commands/cfn-docker/CFN_DOCKER_CLI.md +527 -0
- package/claude-assets/commands/cfn-docker/CFN_DOCKER_LOOP.md +377 -0
- package/claude-assets/commands/cfn-docker/CFN_DOCKER_TASK.md +490 -0
- package/claude-assets/commands/cfn-loop-cli.md +279 -69
- package/claude-assets/commands/deprecated/README.md +55 -0
- package/claude-assets/root-claude-distribute/CFN-CLAUDE.md +115 -42
- package/claude-assets/skills/cfn-docker-agent-spawning/SKILL.md +394 -0
- package/claude-assets/skills/cfn-docker-agent-spawning/spawn-agent.sh +461 -0
- package/claude-assets/skills/cfn-docker-loop-orchestration/SKILL.md +449 -0
- package/claude-assets/skills/cfn-docker-loop-orchestration/orchestrate.sh +787 -0
- package/claude-assets/skills/cfn-docker-redis-coordination/SKILL.md +435 -0
- package/claude-assets/skills/cfn-docker-redis-coordination/coordinate.sh +635 -0
- package/claude-assets/skills/cfn-docker-skill-mcp-selection/SKILL.md +289 -0
- package/claude-assets/skills/cfn-docker-skill-mcp-selection/skill-mcp-selector.js +472 -0
- package/claude-assets/skills/cfn-expert-update/update-expert.sh +346 -0
- package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh +66 -11
- package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh.backup +884 -0
- package/dist/cli/config-manager.js +91 -109
- package/dist/cli/config-manager.js.map +1 -1
- package/package.json +1 -1
- package/scripts/build-agent-image.sh +53 -0
- package/.claude/commands/CFN_LOOP_TASK_MODE copy.md +0 -495
- package/claude-assets/commands/CFN_LOOP_TASK_MODE copy.md +0 -495
- /package/.claude/commands/{cfn-loop-epic.md → deprecated/cfn-loop-epic.md} +0 -0
- /package/.claude/commands/{cfn-loop-single.md → deprecated/cfn-loop-single.md} +0 -0
- /package/.claude/commands/{cfn-loop-sprints.md → deprecated/cfn-loop-sprints.md} +0 -0
- /package/.claude/commands/{cfn-loop.md → deprecated/cfn-loop.md} +0 -0
- /package/.claude/commands/{cfn/run-tests.md → run-tests.md} +0 -0
- /package/claude-assets/commands/{cfn-loop-epic.md → deprecated/cfn-loop-epic.md} +0 -0
- /package/claude-assets/commands/{cfn-loop-single.md → deprecated/cfn-loop-single.md} +0 -0
- /package/claude-assets/commands/{cfn-loop-sprints.md → deprecated/cfn-loop-sprints.md} +0 -0
- /package/claude-assets/commands/{cfn-loop.md → deprecated/cfn-loop.md} +0 -0
- /package/claude-assets/commands/{cfn/run-tests.md → run-tests.md} +0 -0
|
@@ -15,29 +15,13 @@ Execute CFN Loop using CLI spawning for maximum cost savings (95-98% vs Task too
|
|
|
15
15
|
## What is CLI Mode?
|
|
16
16
|
|
|
17
17
|
**CLI Mode Architecture v3.0 (Enhanced):**
|
|
18
|
-
- Main Chat
|
|
19
|
-
-
|
|
20
|
-
- CLI agents use **Z.ai custom routing** (when enabled)
|
|
18
|
+
- Main Chat processes **slash command** then spawns coordinator agent via CLI with background=true
|
|
19
|
+
- Coordinator spawns **all workers via CLI** with background=true for cost optimization
|
|
20
|
+
- All CLI agents use **Z.ai custom routing** (when enabled)
|
|
21
21
|
- **Real-time monitoring** with automatic recovery from stuck agents
|
|
22
22
|
- Background execution with **Redis monitoring** and progress visibility
|
|
23
|
-
- **95-98% cost savings** vs Task tool spawning
|
|
24
23
|
- **Enhanced features**: Process health checking, context validation, broadcast protocol
|
|
25
24
|
|
|
26
|
-
**Cost Breakdown:**
|
|
27
|
-
```
|
|
28
|
-
┌─────────────────────┬──────────────┬────────────┐
|
|
29
|
-
│ Component │ Provider │ Cost/Call │
|
|
30
|
-
├─────────────────────┼──────────────┼────────────┤
|
|
31
|
-
│ Main Chat │ Anthropic │ $0.015 │
|
|
32
|
-
│ Coordinator (Task) │ Anthropic │ $0.015 │
|
|
33
|
-
│ Loop 3 Agents (CLI) │ Z.ai │ $0.003 ea │
|
|
34
|
-
│ Loop 2 Agents (CLI) │ Z.ai │ $0.003 ea │
|
|
35
|
-
│ Product Owner (CLI) │ Z.ai │ $0.003 │
|
|
36
|
-
└─────────────────────┴──────────────┴────────────┘
|
|
37
|
-
|
|
38
|
-
Total per iteration: ~$0.054 (vs $0.150 Task mode)
|
|
39
|
-
Savings: 64% with custom routing, 95-98% vs all-Task
|
|
40
|
-
```
|
|
41
25
|
|
|
42
26
|
## Prerequisites
|
|
43
27
|
|
|
@@ -54,7 +38,8 @@ Savings: 64% with custom routing, 95-98% vs all-Task
|
|
|
54
38
|
|
|
55
39
|
## Command Options
|
|
56
40
|
|
|
57
|
-
|
|
41
|
+
**Usage Examples:**
|
|
42
|
+
```
|
|
58
43
|
# Standard mode (recommended)
|
|
59
44
|
/cfn-loop-cli "Implement JWT authentication"
|
|
60
45
|
|
|
@@ -79,21 +64,99 @@ Savings: 64% with custom routing, 95-98% vs all-Task
|
|
|
79
64
|
|
|
80
65
|
## How CLI Mode Works
|
|
81
66
|
|
|
82
|
-
1. **Main Chat**
|
|
83
|
-
2. **
|
|
84
|
-
3. **
|
|
85
|
-
4. **
|
|
86
|
-
5. **
|
|
87
|
-
6. **
|
|
67
|
+
1. **Main Chat** invokes `/cfn-loop-cli` slash command
|
|
68
|
+
2. **SlashCommand tool** processes command and returns execution instructions to Main Chat
|
|
69
|
+
3. **Main Chat** spawns `cfn-v3-coordinator` agent via bash with background=true
|
|
70
|
+
4. **Coordinator** orchestrates the entire CFN Loop workflow in the background
|
|
71
|
+
5. **Coordinator** spawns **Loop 3 workers via CLI** with background=true
|
|
72
|
+
6. **Loop 3** agents implement the solution and validate against quality gates
|
|
73
|
+
7. **Coordinator** spawns **Loop 2 workers via CLI** for validation
|
|
74
|
+
8. **Product Owner** makes the final decision on deliverables
|
|
75
|
+
9. **Background execution** with Redis coordination for scalability
|
|
76
|
+
|
|
77
|
+
**CLI Architecture Pattern:**
|
|
78
|
+
- Main Chat → SlashCommand (processing) → Main Chat spawns coordinator via bash
|
|
79
|
+
```bash
|
|
80
|
+
npx claude-flow-novice agent cfn-v3-coordinator \
|
|
81
|
+
--task-id "cfn-cli-$(date +%s%N | tail -c 7)-${RANDOM}" \
|
|
82
|
+
--context "TASK_DESCRIPTION='Fix core infrastructure
|
|
83
|
+
dependencies' MODE='standard' MAX_ITERATIONS=10" \
|
|
84
|
+
--timeout 300 \
|
|
85
|
+
--background=true
|
|
86
|
+
```
|
|
87
|
+
- All agents spawned via CLI by coordinator with Z.ai routing and background execution
|
|
88
|
+
- Background execution enables monitoring and recovery capabilities
|
|
89
|
+
|
|
90
|
+
## Main Chat Monitoring Instructions
|
|
91
|
+
|
|
92
|
+
**After spawning the coordinator, Main Chat should:**
|
|
93
|
+
|
|
94
|
+
### 1. Immediate Verification (First 30 seconds)
|
|
95
|
+
```bash
|
|
96
|
+
# Verify coordinator spawned successfully
|
|
97
|
+
TASK_ID="cfn-cli-$(date +%s%N | tail -c 7)-${RANDOM}"
|
|
98
|
+
pgrep -f "cfn-v3-coordinator" && echo "✅ Coordinator running" || echo "❌ Coordinator failed"
|
|
99
|
+
|
|
100
|
+
# Check Redis context was created
|
|
101
|
+
redis-cli EXISTS "cfn_loop:task:$TASK_ID:context" && echo "✅ Context stored" || echo "❌ No context"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### 2. Progress Monitoring (Every 2-5 minutes for long tasks)
|
|
105
|
+
```bash
|
|
106
|
+
# Check iteration progress and confidence scores
|
|
107
|
+
redis-cli HGETALL "cfn_loop:task:$TASK_ID:context" | grep -E "(iteration|confidence|status)"
|
|
108
|
+
|
|
109
|
+
# Monitor agent completion status
|
|
110
|
+
redis-cli LRANGE "swarm:${TASK_ID}:agent:status" 0 -1
|
|
111
|
+
|
|
112
|
+
# Quick health check
|
|
113
|
+
redis-cli HGET "cfn_loop:task:$TASK_ID:health" "coordinator"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 3. Web Portal Monitoring (Recommended for >10 minute tasks)
|
|
117
|
+
```bash
|
|
118
|
+
# Start monitoring dashboard
|
|
119
|
+
npm run portal:start
|
|
120
|
+
|
|
121
|
+
# Access real-time progress at http://localhost:3000
|
|
122
|
+
# - Live agent status dashboard
|
|
123
|
+
# - Iteration progress visualization
|
|
124
|
+
# - Confidence score trends
|
|
125
|
+
# - Error rate monitoring
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### 4. Background Execution Monitoring Pattern
|
|
129
|
+
```bash
|
|
130
|
+
# For long-running tasks, use this monitoring pattern:
|
|
131
|
+
sleep 300 # Wait 5 minutes
|
|
132
|
+
redis-cli HGETALL "cfn_loop:task:$TASK_ID:context" | grep status
|
|
133
|
+
|
|
134
|
+
# If still running, continue monitoring
|
|
135
|
+
if [ $? -eq 0 ]; then
|
|
136
|
+
echo "Task in progress, monitoring..."
|
|
137
|
+
sleep 300 # Wait another 5 minutes
|
|
138
|
+
redis-cli HGETALL "cfn_loop:task:$TASK_ID:context" | grep status
|
|
139
|
+
fi
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### 5. Troubleshooting If Coordinator Fails
|
|
143
|
+
```bash
|
|
144
|
+
# Investigate missing coordinator
|
|
145
|
+
./.claude/skills/cfn-loop-orchestration/investigate-missing-coordinator.sh "$TASK_ID"
|
|
88
146
|
|
|
89
|
-
|
|
147
|
+
# Check for process issues
|
|
148
|
+
ps aux | grep "claude-flow-novice agent" | grep -v grep
|
|
149
|
+
|
|
150
|
+
# Verify Redis connectivity
|
|
151
|
+
redis-cli PING
|
|
152
|
+
```
|
|
90
153
|
|
|
91
154
|
## CLI Mode Benefits
|
|
92
155
|
|
|
93
|
-
**
|
|
94
|
-
- 64% savings with Z.ai routing vs all-Anthropic
|
|
95
|
-
- 95-98% savings vs Task tool spawning
|
|
156
|
+
**Performance:**
|
|
96
157
|
- Scales linearly with iterations (Task mode scales exponentially)
|
|
158
|
+
- Background execution without timeout limitations
|
|
159
|
+
- Parallel agent spawning for improved throughput
|
|
97
160
|
|
|
98
161
|
**Production Features v3.0:**
|
|
99
162
|
- Background execution (no timeout issues)
|
|
@@ -110,21 +173,6 @@ The coordinator handles all agent spawning internally using optimized CLI proces
|
|
|
110
173
|
- Instant wake-up (<100ms latency)
|
|
111
174
|
- Scalable (10+ agents, indefinite cycles)
|
|
112
175
|
|
|
113
|
-
## When to Use CLI Mode
|
|
114
|
-
|
|
115
|
-
**Use CLI Mode for:**
|
|
116
|
-
- ✅ Production features
|
|
117
|
-
- ✅ Long-running tasks (>10 min)
|
|
118
|
-
- ✅ Multi-iteration workflows
|
|
119
|
-
- ✅ Cost-sensitive projects
|
|
120
|
-
- ✅ Background execution
|
|
121
|
-
|
|
122
|
-
**Use Task Mode for:**
|
|
123
|
-
- Debugging (full visibility needed)
|
|
124
|
-
- Learning CFN Loop workflow
|
|
125
|
-
- Short prototypes (<5 min)
|
|
126
|
-
- Single-iteration tasks
|
|
127
|
-
|
|
128
176
|
## Troubleshooting
|
|
129
177
|
|
|
130
178
|
**Custom routing not working:**
|
|
@@ -148,25 +196,131 @@ The coordinator handles all agent spawning internally using optimized CLI proces
|
|
|
148
196
|
- View detailed execution logs and health status
|
|
149
197
|
- Track iteration progress and confidence scores
|
|
150
198
|
|
|
199
|
+
## Enhanced Monitoring v3.0
|
|
200
|
+
|
|
201
|
+
CLI mode includes comprehensive monitoring capabilities for production workflows:
|
|
202
|
+
|
|
203
|
+
### Real-Time Progress Tracking
|
|
204
|
+
- **Agent Status**: Monitor individual agent health and progress
|
|
205
|
+
- **Iteration Progress**: Track confidence scores and gate validation
|
|
206
|
+
- **Resource Usage**: CPU, memory, and Redis connection monitoring
|
|
207
|
+
- **Error Detection**: Automatic identification of stuck or failed agents
|
|
208
|
+
|
|
209
|
+
### Monitoring Commands
|
|
210
|
+
|
|
211
|
+
**Check Task Status:**
|
|
212
|
+
```bash
|
|
213
|
+
# View complete task context and progress
|
|
214
|
+
redis-cli HGETALL "cfn_loop:task:$TASK_ID:context"
|
|
215
|
+
|
|
216
|
+
# Monitor agent completion status
|
|
217
|
+
redis-cli LRANGE "swarm:${TASK_ID}:agent:status" 0 -1
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
**Agent Health Monitoring:**
|
|
221
|
+
```bash
|
|
222
|
+
# Check if coordinator is running
|
|
223
|
+
pgrep -f "cfn-v3-coordinator" && echo "Coordinator alive" || echo "Coordinator missing"
|
|
224
|
+
|
|
225
|
+
# Monitor active agent processes
|
|
226
|
+
ps aux | grep "claude-flow-novice agent" | grep -v grep
|
|
227
|
+
|
|
228
|
+
# Check Redis connectivity
|
|
229
|
+
redis-cli PING
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**Progress Monitoring:**
|
|
233
|
+
```bash
|
|
234
|
+
# Real-time agent completion monitoring
|
|
235
|
+
watch -n 5 'redis-cli HGETALL "cfn_loop:task:$TASK_ID:context" | grep -E "(iteration|confidence|status)"'
|
|
236
|
+
|
|
237
|
+
# Monitor agent signals
|
|
238
|
+
redis-cli PUBLISH "swarm:${TASK_ID}:monitor" "status_check"
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Automatic Recovery Features
|
|
242
|
+
|
|
243
|
+
**Dead Process Detection:**
|
|
244
|
+
- Automatically detects and reports stuck agents
|
|
245
|
+
- Process health checking with configurable timeouts
|
|
246
|
+
- Automatic cleanup of orphaned Redis connections
|
|
247
|
+
|
|
248
|
+
**Agent Restart Capability:**
|
|
249
|
+
- Coordinator can restart failed agents automatically
|
|
250
|
+
- Context preservation across agent restarts
|
|
251
|
+
- Iteration state recovery from Redis persistence
|
|
252
|
+
|
|
253
|
+
**Error Recovery Patterns:**
|
|
254
|
+
- Timeout detection and agent termination
|
|
255
|
+
- Context validation before spawning replacements
|
|
256
|
+
- Graceful degradation with partial agent sets
|
|
257
|
+
|
|
258
|
+
### Monitoring Dashboard Features
|
|
259
|
+
|
|
260
|
+
**Web Portal (http://localhost:3000):**
|
|
261
|
+
- Live agent status dashboard
|
|
262
|
+
- Iteration progress visualization
|
|
263
|
+
- Confidence score trends
|
|
264
|
+
- Error rate monitoring
|
|
265
|
+
- Resource usage graphs
|
|
266
|
+
|
|
267
|
+
**CLI Monitoring Tools:**
|
|
268
|
+
- `cfn-portal` - Start/stop monitoring dashboard
|
|
269
|
+
- `cfn-context` - Query task context and status
|
|
270
|
+
- `cfn-metrics` - View performance analytics
|
|
271
|
+
- `cfn-redis` - Direct Redis inspection tools
|
|
272
|
+
|
|
273
|
+
### Troubleshooting Monitoring Issues
|
|
274
|
+
|
|
275
|
+
**Missing Coordinator:**
|
|
276
|
+
```bash
|
|
277
|
+
# Investigate coordinator failure
|
|
278
|
+
./.claude/skills/cfn-loop-orchestration/investigate-missing-coordinator.sh "$TASK_ID"
|
|
279
|
+
|
|
280
|
+
# Check for namespace mismatches
|
|
281
|
+
redis-cli KEYS "cfn_loop:*" | head -10
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
**Stuck Agents:**
|
|
285
|
+
```bash
|
|
286
|
+
# Force cleanup of stuck agents
|
|
287
|
+
./.claude/skills/cfn-loop-orchestration/cleanup-stuck-agents.sh "$TASK_ID"
|
|
288
|
+
|
|
289
|
+
# Monitor agent timeouts
|
|
290
|
+
redis-cli HGET "cfn_loop:task:$TASK_ID:timeouts" "agent_timeouts"
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
**Redis Connection Issues:**
|
|
294
|
+
```bash
|
|
295
|
+
# Test Redis connectivity
|
|
296
|
+
redis-cli -n 0 PING
|
|
297
|
+
|
|
298
|
+
# Check Redis memory usage
|
|
299
|
+
redis-cli INFO memory | grep used_memory_human
|
|
300
|
+
|
|
301
|
+
# Monitor Redis keyspace
|
|
302
|
+
redis-cli DBSIZE
|
|
303
|
+
```
|
|
304
|
+
|
|
151
305
|
## Usage Examples
|
|
152
306
|
|
|
153
307
|
**Simple API Development:**
|
|
154
|
-
```
|
|
308
|
+
```
|
|
155
309
|
/cfn-loop-cli "Build REST API with user authentication"
|
|
156
310
|
```
|
|
157
311
|
|
|
158
312
|
**Complex Feature with High Quality Requirements:**
|
|
159
|
-
```
|
|
313
|
+
```
|
|
160
314
|
/cfn-loop-cli "Implement payment processing with PCI compliance" --mode=enterprise --max-iterations=15
|
|
161
315
|
```
|
|
162
316
|
|
|
163
317
|
**Quick Prototype:**
|
|
164
|
-
```
|
|
318
|
+
```
|
|
165
319
|
/cfn-loop-cli "Build MVP landing page" --mode=mvp
|
|
166
320
|
```
|
|
167
321
|
|
|
168
322
|
**Infrastructure Deployment:**
|
|
169
|
-
```
|
|
323
|
+
```
|
|
170
324
|
/cfn-loop-cli "Set up CI/CD pipeline for microservices"
|
|
171
325
|
```
|
|
172
326
|
|
|
@@ -187,7 +341,11 @@ The coordinator handles all agent spawning internally using optimized CLI proces
|
|
|
187
341
|
|
|
188
342
|
## 🚨 EXECUTION INSTRUCTIONS (Internal Use)
|
|
189
343
|
|
|
190
|
-
**Main Chat:
|
|
344
|
+
**Main Chat: Slash command processing followed by CLI coordinator spawning:**
|
|
345
|
+
|
|
346
|
+
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.
|
|
347
|
+
|
|
348
|
+
**Coordinator Spawning Pattern:**
|
|
191
349
|
|
|
192
350
|
```bash
|
|
193
351
|
# Generate unique task ID
|
|
@@ -198,6 +356,36 @@ TASK_DESCRIPTION="$ARGUMENTS"
|
|
|
198
356
|
MODE="${mode:-standard}"
|
|
199
357
|
MAX_ITERATIONS="${maxIterations:-10}"
|
|
200
358
|
|
|
359
|
+
# Spawn coordinator via CLI (background execution)
|
|
360
|
+
npx claude-flow-novice agent cfn-v3-coordinator \
|
|
361
|
+
--task-id "$TASK_ID" \
|
|
362
|
+
--context "TASK_DESCRIPTION='$TASK_DESCRIPTION' MODE='$MODE' MAX_ITERATIONS=$MAX_ITERATIONS" \
|
|
363
|
+
--timeout 300 \
|
|
364
|
+
--background=true
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
**Main Chat Execution Command:**
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
# Main Chat should execute this command after processing slash command
|
|
371
|
+
npx claude-flow-novice agent cfn-v3-coordinator \
|
|
372
|
+
--task-id "cfn-cli-$(date +%s%N | tail -c 7)-${RANDOM}" \
|
|
373
|
+
--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" \
|
|
374
|
+
--timeout 300 \
|
|
375
|
+
--background=true
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
**Internal Coordinator Pattern (what the coordinator does):**
|
|
379
|
+
|
|
380
|
+
```bash
|
|
381
|
+
# Generate unique task ID
|
|
382
|
+
TASK_ID="cfn-cli-$(date +%s%N | tail -c 7)-${RANDOM}"
|
|
383
|
+
|
|
384
|
+
# Extract task description and mode from slash command arguments
|
|
385
|
+
TASK_DESCRIPTION="parsed from $ARGUMENTS"
|
|
386
|
+
MODE="${mode:-standard}"
|
|
387
|
+
MAX_ITERATIONS="${maxIterations:-10}"
|
|
388
|
+
|
|
201
389
|
# Determine appropriate agents based on task complexity
|
|
202
390
|
TASK_COMPLEXITY="standard" # auto-detect or pass from command
|
|
203
391
|
case "$TASK_COMPLEXITY" in
|
|
@@ -215,33 +403,55 @@ case "$TASK_COMPLEXITY" in
|
|
|
215
403
|
;;
|
|
216
404
|
esac
|
|
217
405
|
|
|
218
|
-
#
|
|
219
|
-
npx claude-flow-novice agent
|
|
406
|
+
# Coordinator spawns CLI workers (background execution)
|
|
407
|
+
npx claude-flow-novice agent "$LOOP3_AGENT" \
|
|
220
408
|
--task-id "$TASK_ID" \
|
|
221
|
-
--
|
|
222
|
-
--
|
|
409
|
+
--agent-id "$AGENT_ID" \
|
|
410
|
+
--context "Complete deliverables and acceptance criteria" \
|
|
411
|
+
--timeout 300 \
|
|
412
|
+
--background=true
|
|
223
413
|
|
|
224
|
-
# Monitor progress (
|
|
414
|
+
# Monitor progress (required for background tasks)
|
|
225
415
|
# redis-cli HGETALL "cfn_loop:task:$TASK_ID:context"
|
|
226
416
|
```
|
|
227
417
|
|
|
228
|
-
**
|
|
418
|
+
**Critical Background Execution Instructions:**
|
|
229
419
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
420
|
+
1. **Always use `--background=true`** for CLI mode to enable:
|
|
421
|
+
- Non-blocking coordinator execution
|
|
422
|
+
- Real-time monitoring capabilities
|
|
423
|
+
- Redis state persistence
|
|
424
|
+
- Automatic recovery features
|
|
425
|
+
|
|
426
|
+
2. **Background execution means:**
|
|
427
|
+
- Coordinator runs independently of Main Chat
|
|
428
|
+
- Main Chat can monitor progress via Redis queries
|
|
429
|
+
- Long-running tasks won't timeout due to Bash tool limitations
|
|
430
|
+
- Web portal can track agent progress in real-time
|
|
431
|
+
|
|
432
|
+
3. **Without `--background=true`:**
|
|
433
|
+
- Coordinator blocks Main Chat execution
|
|
434
|
+
- No monitoring capabilities
|
|
435
|
+
- Timeouts after 10 minutes (Bash tool limit)
|
|
436
|
+
- No recovery or persistence features
|
|
237
437
|
|
|
238
438
|
**Why This Pattern:**
|
|
239
|
-
- ✅
|
|
240
|
-
- ✅
|
|
241
|
-
- ✅
|
|
439
|
+
- ✅ Coordinator via CLI with background=true for monitoring capabilities
|
|
440
|
+
- ✅ All agents via CLI for maximum cost optimization (95-98% savings)
|
|
441
|
+
- ✅ Background execution with enhanced monitoring
|
|
442
|
+
- ✅ Z.ai routing automatically applied to all CLI agents
|
|
242
443
|
- ✅ Redis coordination for agent communication
|
|
243
|
-
- ✅ 95-98% cost savings vs Task tool
|
|
244
444
|
- ✅ Enhanced monitoring and recovery capabilities
|
|
245
|
-
- ✅ Clean separation: Main Chat →
|
|
445
|
+
- ✅ Clean separation: Main Chat → SlashCommand (processing) → Main Chat spawns CLI(coordinator) → CLI Workers
|
|
446
|
+
- ✅ Production-ready with real-time progress tracking
|
|
447
|
+
- ✅ No timeout limitations with `--background=true`
|
|
448
|
+
|
|
449
|
+
**Enhanced Monitoring Benefits:**
|
|
450
|
+
- Real-time agent progress tracking via Redis
|
|
451
|
+
- Automatic recovery from stuck agents
|
|
452
|
+
- Web portal visibility (http://localhost:3000)
|
|
453
|
+
- Process health checking and cleanup
|
|
454
|
+
- Context validation and preservation
|
|
455
|
+
- Performance metrics and analytics
|
|
246
456
|
|
|
247
|
-
**Version:** 3.0
|
|
457
|
+
**Version:** 3.1.0 (2025-11-05) - Removed cost information, added Main Chat monitoring instructions, clarified background execution requirements
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Deprecated CFN Loop Commands
|
|
2
|
+
|
|
3
|
+
**⚠️ DEPRECATED (Removed 2025-10-31)**
|
|
4
|
+
|
|
5
|
+
These commands are no longer maintained and have been replaced by the simplified CFN Loop v3.0 command structure.
|
|
6
|
+
|
|
7
|
+
## Migration Path
|
|
8
|
+
|
|
9
|
+
### Old Commands → New Commands
|
|
10
|
+
|
|
11
|
+
| Deprecated Command | Replacement | Use Case |
|
|
12
|
+
|-------------------|-------------|----------|
|
|
13
|
+
| `/cfn-loop` | `/cfn-loop-cli` or `/cfn-loop-task` | General CFN Loop execution |
|
|
14
|
+
| `/cfn-loop-single` | `/cfn-loop-cli --mode=mvp` | Single focused task |
|
|
15
|
+
| `/cfn-loop-epic` | Multiple `/cfn-loop-cli` calls | Multi-phase epic development |
|
|
16
|
+
| `/cfn-loop-sprints` | Multiple `/cfn-loop-cli` calls | Sprint-based development |
|
|
17
|
+
|
|
18
|
+
## Current Commands (v3.0)
|
|
19
|
+
|
|
20
|
+
- `/cfn-loop-cli` - Production CLI mode with background execution
|
|
21
|
+
- `/cfn-loop-task` - Task mode for debugging with full visibility
|
|
22
|
+
- `/cfn-loop-frontend` - Frontend development with visual validation
|
|
23
|
+
- `/cfn-loop-document` - Automated documentation generation
|
|
24
|
+
|
|
25
|
+
## Key Changes
|
|
26
|
+
|
|
27
|
+
1. **Simplified Architecture**: 4 current commands instead of 8
|
|
28
|
+
2. **Dual Execution Modes**: CLI (production) vs Task (debugging)
|
|
29
|
+
3. **Background Execution**: CLI mode supports `--background=true`
|
|
30
|
+
4. **Enhanced Monitoring**: Real-time progress tracking via Redis
|
|
31
|
+
5. **Cleaner Separation**: Clear distinction between production and debugging workflows
|
|
32
|
+
|
|
33
|
+
## Why Deprecated?
|
|
34
|
+
|
|
35
|
+
- **Command Overload**: Too many similar commands caused confusion
|
|
36
|
+
- **Inconsistent Patterns**: Different parameter structures across commands
|
|
37
|
+
- **Maintenance Complexity**: Supporting multiple execution patterns
|
|
38
|
+
- **User Experience**: Simplified command structure improves adoption
|
|
39
|
+
|
|
40
|
+
## Documentation
|
|
41
|
+
|
|
42
|
+
See current command documentation:
|
|
43
|
+
- [`../cfn-loop-cli.md`](../cfn-loop-cli.md)
|
|
44
|
+
- [`../cfn-loop-task.md`](../cfn-loop-task.md)
|
|
45
|
+
- [`../cfn-loop-frontend.md`](../cfn-loop-frontend.md)
|
|
46
|
+
- [`../cfn-loop-document.md`](../cfn-loop-document.md)
|
|
47
|
+
|
|
48
|
+
## Historical Reference
|
|
49
|
+
|
|
50
|
+
These files are preserved for:
|
|
51
|
+
- Migration guidance for existing users
|
|
52
|
+
- Historical reference for development decisions
|
|
53
|
+
- Understanding the evolution of CFN Loop architecture
|
|
54
|
+
|
|
55
|
+
**Note**: These commands will be removed completely in a future major version.
|