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.
Files changed (48) hide show
  1. package/.claude/commands/CFN_EXPERT_UPDATE.md +142 -0
  2. package/.claude/commands/CFN_LOOP_TASK_MODE.md +6 -6
  3. package/.claude/commands/cfn-docker/CFN_DOCKER_CLI.md +527 -0
  4. package/.claude/commands/cfn-docker/CFN_DOCKER_LOOP.md +377 -0
  5. package/.claude/commands/cfn-docker/CFN_DOCKER_TASK.md +490 -0
  6. package/.claude/commands/cfn-loop-cli.md +279 -69
  7. package/.claude/commands/deprecated/README.md +55 -0
  8. package/.claude/root-claude-distribute/CFN-CLAUDE.md +115 -42
  9. package/.claude/skills/cfn-loop-orchestration/orchestrate.sh +66 -11
  10. package/.claude/skills/cfn-loop-orchestration/orchestrate.sh.backup +884 -0
  11. package/claude-assets/agents/cfn-dev-team/developers/frontend/typescript-specialist.md +326 -0
  12. package/claude-assets/agents/cfn-seo-team/technical-seo-specialist.md +9 -6
  13. package/claude-assets/agents/docker-coordinators/cfn-docker-v3-coordinator.md +199 -0
  14. package/claude-assets/commands/CFN_EXPERT_UPDATE.md +142 -0
  15. package/claude-assets/commands/CFN_LOOP_TASK_MODE.md +6 -6
  16. package/claude-assets/commands/cfn-docker/CFN_DOCKER_CLI.md +527 -0
  17. package/claude-assets/commands/cfn-docker/CFN_DOCKER_LOOP.md +377 -0
  18. package/claude-assets/commands/cfn-docker/CFN_DOCKER_TASK.md +490 -0
  19. package/claude-assets/commands/cfn-loop-cli.md +279 -69
  20. package/claude-assets/commands/deprecated/README.md +55 -0
  21. package/claude-assets/root-claude-distribute/CFN-CLAUDE.md +115 -42
  22. package/claude-assets/skills/cfn-docker-agent-spawning/SKILL.md +394 -0
  23. package/claude-assets/skills/cfn-docker-agent-spawning/spawn-agent.sh +461 -0
  24. package/claude-assets/skills/cfn-docker-loop-orchestration/SKILL.md +449 -0
  25. package/claude-assets/skills/cfn-docker-loop-orchestration/orchestrate.sh +787 -0
  26. package/claude-assets/skills/cfn-docker-redis-coordination/SKILL.md +435 -0
  27. package/claude-assets/skills/cfn-docker-redis-coordination/coordinate.sh +635 -0
  28. package/claude-assets/skills/cfn-docker-skill-mcp-selection/SKILL.md +289 -0
  29. package/claude-assets/skills/cfn-docker-skill-mcp-selection/skill-mcp-selector.js +472 -0
  30. package/claude-assets/skills/cfn-expert-update/update-expert.sh +346 -0
  31. package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh +66 -11
  32. package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh.backup +884 -0
  33. package/dist/cli/config-manager.js +91 -109
  34. package/dist/cli/config-manager.js.map +1 -1
  35. package/package.json +1 -1
  36. package/scripts/build-agent-image.sh +53 -0
  37. package/.claude/commands/CFN_LOOP_TASK_MODE copy.md +0 -495
  38. package/claude-assets/commands/CFN_LOOP_TASK_MODE copy.md +0 -495
  39. /package/.claude/commands/{cfn-loop-epic.md → deprecated/cfn-loop-epic.md} +0 -0
  40. /package/.claude/commands/{cfn-loop-single.md → deprecated/cfn-loop-single.md} +0 -0
  41. /package/.claude/commands/{cfn-loop-sprints.md → deprecated/cfn-loop-sprints.md} +0 -0
  42. /package/.claude/commands/{cfn-loop.md → deprecated/cfn-loop.md} +0 -0
  43. /package/.claude/commands/{cfn/run-tests.md → run-tests.md} +0 -0
  44. /package/claude-assets/commands/{cfn-loop-epic.md → deprecated/cfn-loop-epic.md} +0 -0
  45. /package/claude-assets/commands/{cfn-loop-single.md → deprecated/cfn-loop-single.md} +0 -0
  46. /package/claude-assets/commands/{cfn-loop-sprints.md → deprecated/cfn-loop-sprints.md} +0 -0
  47. /package/claude-assets/commands/{cfn-loop.md → deprecated/cfn-loop.md} +0 -0
  48. /package/claude-assets/commands/{cfn/run-tests.md → run-tests.md} +0 -0
@@ -0,0 +1,377 @@
1
+ ---
2
+ description: "Execute container-based CFN Loop with skill-based MCP isolation and resource management"
3
+ argument-hint: "[task-description] --mode=mvp|standard|enterprise --memory-limit=1g --network=mcp-network"
4
+ allowed-tools: ["Bash", "Read", "TodoWrite", "Task"]
5
+ ---
6
+
7
+ # CFN Docker Loop - Container-Based Agent Orchestration
8
+
9
+ Execute container-based CFN Loop with skill-based MCP isolation, resource management, and cost optimization.
10
+
11
+ **Task Description:** $ARGUMENTS
12
+
13
+ ## Usage Modes
14
+
15
+ ### Task Mode (Debugging/Development)
16
+ ```bash
17
+ /cfn-docker-loop-task "Implement user authentication" --mode=standard
18
+ ```
19
+ - Main Chat spawns all agents via Task()
20
+ - Full visibility into agent execution
21
+ - Higher cost but complete debugging capability
22
+ - Use for development, testing, and learning
23
+
24
+ ### CLI Mode (Production)
25
+ ```bash
26
+ /cfn-docker-loop-cli "Implement user authentication" --mode=standard
27
+ ```
28
+ - Main Chat spawns only cfn-docker-v3-coordinator
29
+ - Coordinator spawns agents via CLI (95% cost savings)
30
+ - Use for production, long tasks, cost-sensitive workloads
31
+
32
+ ## Execution Modes
33
+
34
+ ### MVP Mode (Quick Execution)
35
+ - **Iterations:** 3
36
+ - **Gate Threshold:** 0.70
37
+ - **Consensus Threshold:** 0.80
38
+ - **Validators:** 2
39
+ - **Use Case:** Rapid prototyping, simple tasks
40
+
41
+ ### Standard Mode (Balanced)
42
+ - **Iterations:** 10
43
+ - **Gate Threshold:** 0.75
44
+ - **Consensus Threshold:** 0.90
45
+ - **Validators:** 3
46
+ - **Use Case:** Most production tasks, balanced quality/speed
47
+
48
+ ### Enterprise Mode (Thorough)
49
+ - **Iterations:** 15
50
+ - **Gate Threshold:** 0.85
51
+ - **Consensus Threshold:** 0.95
52
+ - **Validators:** 5
53
+ - **Use Case:** Critical systems, high-quality requirements
54
+
55
+ ## Command Options
56
+
57
+ ```bash
58
+ # Basic execution
59
+ /cfn-docker-loop "Implement user authentication"
60
+
61
+ # Mode selection
62
+ /cfn-docker-loop "Implement user authentication" --mode=standard
63
+
64
+ # Resource constraints
65
+ /cfn-docker-loop "Analyze security vulnerabilities" --mode=enterprise --memory-limit=2g
66
+
67
+ # Network configuration
68
+ /cfn-docker-loop "Build responsive UI" --network=frontend-network
69
+
70
+ # Custom agent selection
71
+ /cfn-docker-loop "Optimize database queries" --agents=backend-developer,database-specialist
72
+
73
+ # Context file
74
+ /cfn-docker-loop "Migrate user data" --context-file migration-context.json
75
+
76
+ # Task vs CLI mode selection
77
+ /cfn-docker-loop-task "Debug authentication issue" --mode=mvp --verbose
78
+ /cfn-docker-loop-cli "Process user payments" --mode=enterprise --timeout=1800
79
+ ```
80
+
81
+ ## Architecture Overview
82
+
83
+ ```
84
+ Main Chat
85
+ ↓ (Task tool)
86
+ cfn-docker-v3-coordinator
87
+ ↓ (orchestration)
88
+ CFN Docker Loop Orchestration
89
+ ↓ (Redis coordination)
90
+ CFN Docker Redis Coordination
91
+ ↓ (agent spawning)
92
+ CFN Docker Agent Spawning
93
+ ↓ (container execution)
94
+ Docker Containers (Agents)
95
+ ↓ (MCP selection)
96
+ CFN Docker Skill MCP Selection
97
+ ↓ (authenticated access)
98
+ MCP Servers (Playwright, Redis, Security)
99
+ ```
100
+
101
+ ## Key Features
102
+
103
+ ### 🐳 Container-Based Isolation
104
+ - All agents run in isolated Docker containers
105
+ - Memory limits prevent WSL2 crashes
106
+ - Resource controls ensure fair usage
107
+ - Complete agent lifecycle management
108
+
109
+ ### 🔐 Skill-Based MCP Security
110
+ - Dynamic MCP server selection based on agent skills
111
+ - Token-based authentication for MCP access
112
+ - 50%+ memory savings vs monolithic approach
113
+ - Enterprise-grade security controls
114
+
115
+ ### 💰 Cost Optimization
116
+ - **95% cost savings** vs Task-based spawning
117
+ - Custom routing with Z.ai when enabled
118
+ - Resource-efficient container utilization
119
+ - Pay only for required MCP servers
120
+
121
+ ### 🔄 Swarm Recovery
122
+ - Redis persistence for crash recovery
123
+ - State survives interruptions
124
+ - Automatic agent respawning on failure
125
+ - Complete task context preservation
126
+
127
+ ## Workflow Execution
128
+
129
+ ### 1. Task Analysis
130
+ - Parse task description for requirements
131
+ - Select appropriate agent types
132
+ - Determine required skills and MCP servers
133
+ - Create execution context
134
+
135
+ ### 2. Loop 3: Implementation
136
+ - Spawn 3 specialized implementer agents
137
+ - Parallel execution in isolated containers
138
+ - Agent-specific MCP server access
139
+ - Confidence scoring and reporting
140
+
141
+ ### 3. Gate Check
142
+ - Collect confidence scores from implementers
143
+ - Compare against gate threshold
144
+ - Decision: proceed to validation or iterate
145
+ - Adaptive agent selection for iterations
146
+
147
+ ### 4. Loop 2: Validation
148
+ - Spawn 2-5 validator agents (reviewers, testers, security)
149
+ - Sequential validation to prevent conflicts
150
+ - Comprehensive code review and testing
151
+ - Consensus collection and analysis
152
+
153
+ ### 5. Product Owner Decision
154
+ - Final decision based on consensus and deliverables
155
+ - PROCEED: Implementation complete
156
+ - ITERATE: More work needed with specific feedback
157
+ - ABORT: Task not feasible or requirements unclear
158
+
159
+ ## Resource Management
160
+
161
+ ### Memory Optimization
162
+ | Agent Type | Default Memory | MCP Servers | Savings |
163
+ |------------|---------------|-------------|---------|
164
+ | **Frontend Engineer** | 1GB | Playwright | 50% |
165
+ | **Backend Developer** | 768MB | Redis/Postgres | 62% |
166
+ | **Security Specialist** | 1.5GB | Security Scanner | 25% |
167
+
168
+ ### Network Configuration
169
+ - **Isolated Networks**: Separate Docker networks for security
170
+ - **MCP Communication**: Local networking for fast MCP access
171
+ - **Service Discovery**: Automatic MCP server discovery
172
+ - **Connection Reuse**: Persistent connections for performance
173
+
174
+ ### Resource Monitoring
175
+ - **Real-time Monitoring**: Memory, CPU, network usage tracking
176
+ - **Alert Management**: Automatic alerts for resource issues
177
+ - **Performance Metrics**: Detailed performance analytics
178
+ - **Cost Tracking**: Per-task cost analysis and optimization
179
+
180
+ ## Security Architecture
181
+
182
+ ### Multi-Layer Protection
183
+ 1. **Container Isolation**: Agents run in isolated Docker containers
184
+ 2. **Token Authentication**: MCP servers require valid agent tokens
185
+ 3. **Skill-Based Authorization**: Tools require specific agent skills
186
+ 4. **Rate Limiting**: Per-agent request limits for resource protection
187
+ 5. **Audit Logging**: Full request/response logging for compliance
188
+ 6. **Network Segmentation**: Isolated networks for different agent types
189
+
190
+ ### Access Control Flow
191
+ ```
192
+ Agent Request → Token Validation → Skill Check → Rate Limit → Tool Access
193
+ ```
194
+
195
+ ## Integration with Existing Systems
196
+
197
+ ### Hello World Test Compatibility
198
+ - **Enhanced Layer 0**: MCP tool validation with authentication
199
+ - **Enhanced Layer 5**: Container-based agent spawning
200
+ - **Enhanced Layer 6**: MCP-enabled agent coordination
201
+ - **Enhanced Layer 7**: Container-aware error handling
202
+
203
+ ### CFN Loop Consistency
204
+ - Same CFN Loop execution model as standard CFN
205
+ - Compatible consensus validation and decision flow
206
+ - Drop-in replacement with enhanced capabilities
207
+ - Backward compatible with existing workflows
208
+
209
+ ## Error Handling and Recovery
210
+
211
+ ### Container Failure Recovery
212
+ - **Automatic Restart**: Containers restart on failure
213
+ - **State Preservation**: Agent state stored in Redis
214
+ - **Graceful Degradation**: Fallback to direct tool access
215
+ - **Manual Intervention**: Manual override capabilities
216
+
217
+ ### Swarm Recovery
218
+ - **State Persistence**: Complete state stored in Redis
219
+ - **Crash Recovery**: Automatic recovery from interruptions
220
+ - **Agent Respawning**: Fresh agents spawned on recovery
221
+ - **Context Restoration**: Full task context preserved
222
+
223
+ ## Performance Metrics
224
+
225
+ ### Resource Efficiency
226
+ - **Memory Savings**: 50-75% reduction vs monolithic approach
227
+ - **Startup Time**: 30% faster with selective MCP loading
228
+ - **Network Traffic**: 60% reduction with local MCP communication
229
+ - **CPU Efficiency**: 40% improvement with targeted tool loading
230
+
231
+ ### Scalability Improvements
232
+ - **Concurrent Agents**: 10x increase in concurrent agent capacity
233
+ - **Resource Contention**: Eliminated through container isolation
234
+ - **WSL2 Stability**: 100% reduction in crash incidents
235
+ - **Cost Efficiency**: 95%+ cost reduction vs Task-based spawning
236
+
237
+ ## Monitoring and Observability
238
+
239
+ ### Real-time Monitoring
240
+ ```bash
241
+ # Monitor task progress
242
+ /cfn-docker-monitor --task-id task-authentication
243
+
244
+ # Resource usage dashboard
245
+ /cfn-docker-stats --agent-id agent-frontend-001
246
+
247
+ # MCP server status
248
+ /cfn-docker-mcp-status --servers playwright,redis
249
+ ```
250
+
251
+ ### Performance Analytics
252
+ ```bash
253
+ # Task performance report
254
+ /cfn-docker-performance --task-id task-authentication --report
255
+
256
+ # Agent efficiency metrics
257
+ /cfn-docker-agent-metrics --agent-id agent-backend-001 --duration 1h
258
+
259
+ # Cost analysis
260
+ /cfn-docker-cost-analysis --task-id task-authentication --breakdown
261
+ ```
262
+
263
+ ## Best Practices
264
+
265
+ ### Task Design
266
+ - **Clear Requirements**: Specific, measurable acceptance criteria
267
+ - **Appropriate Mode**: Choose MVP/Standard/Enterprise based on complexity
268
+ - **Resource Planning**: Estimate memory and CPU requirements
269
+ - **Success Criteria**: Define clear success metrics
270
+
271
+ ### Agent Selection
272
+ - **Skill Matching**: Select agents with relevant domain expertise
273
+ - **Diverse Perspectives**: Include different agent types for coverage
274
+ - **Performance History**: Consider past agent performance
275
+ - **Resource Optimization**: Balance capability with resource usage
276
+
277
+ ### Security Considerations
278
+ - **Principle of Least Privilege**: Agents only access required MCP servers
279
+ - **Token Management**: Use appropriate token expiration times
280
+ - **Audit Trail**: Enable comprehensive logging for compliance
281
+ - **Network Isolation**: Use isolated networks for sensitive tasks
282
+
283
+ ## Troubleshooting
284
+
285
+ ### Common Issues
286
+ 1. **Container Won't Start**: Check Docker daemon and resource limits
287
+ 2. **MCP Connection Failed**: Verify network configuration and token validity
288
+ 3. **Memory Issues**: Monitor usage and adjust memory limits
289
+ 4. **Agent Timeout**: Increase timeout or optimize task complexity
290
+
291
+ ### Debug Commands
292
+ ```bash
293
+ # Debug container creation
294
+ /cfn-docker-debug --task-id task-authentication --component containers
295
+
296
+ # Debug MCP connectivity
297
+ /cfn-docker-debug --task-id task-authentication --component mcp
298
+
299
+ # Debug agent communication
300
+ /cfn-docker-debug --task-id task-authentication --component coordination
301
+
302
+ # Full system health check
303
+ /cfn-docker-health-check --verbose
304
+ ```
305
+
306
+ ## Configuration
307
+
308
+ ### Environment Variables
309
+ ```bash
310
+ # Redis Configuration
311
+ CFN_DOCKER_REDIS_HOST=localhost
312
+ CFN_DOCKER_REDIS_PORT=6379
313
+ CFN_DOCKER_REDIS_TTL=3600
314
+
315
+ # Docker Configuration
316
+ CFN_DOCKER_NETWORK=mcp-network
317
+ CFN_DOCKER_MEMORY_LIMIT=1g
318
+ CFN_DOCKER_CPU_LIMIT=1.0
319
+
320
+ # MCP Configuration
321
+ CFN_DOCKER_MCP_AUTH_REQUIRED=true
322
+ CFN_DOCKER_MCP_TOKEN_EXPIRY=24h
323
+
324
+ # Performance Configuration
325
+ CFN_DOCKER_MAX_CONCURRENT_AGENTS=5
326
+ CFN_DOCKER_LOOP_TIMEOUT=600
327
+ ```
328
+
329
+ ### Configuration Files
330
+ - **Agent Configuration**: `config/agent-whitelist.json`
331
+ - **Skill Requirements**: `config/skill-requirements.json`
332
+ - **MCP Servers**: `config/mcp-servers.json`
333
+ - **Loop Configuration**: `config/loop-config.json`
334
+
335
+ ## Advanced Usage
336
+
337
+ ### Custom Agent Workflows
338
+ ```bash
339
+ # Custom agent selection with specific skills
340
+ /cfn-docker-loop "Implement ML pipeline" \
341
+ --agents=backend-developer,data-scientist,ml-engineer \
342
+ --skills=python,machine-learning,data-processing
343
+
344
+ # Custom MCP server configuration
345
+ /cfn-docker-loop "Process satellite imagery" \
346
+ --mcp-servers=ml-pipeline, image-processor, data-storage \
347
+ --memory-limit=4g
348
+ ```
349
+
350
+ ### Multi-Task Coordination
351
+ ```bash
352
+ # Execute multiple related tasks
353
+ /cfn-docker-batch \
354
+ --tasks "auth-service,user-profiles,notifications" \
355
+ --mode=standard \
356
+ --shared-context
357
+
358
+ # Epic-level execution
359
+ /cfn-docker-epic "Build e-commerce platform" \
360
+ --sprints "auth,catalog,checkout,admin" \
361
+ --mode=enterprise
362
+ ```
363
+
364
+ ### Integration with External Systems
365
+ ```bash
366
+ # CI/CD pipeline integration
367
+ /cfn-docker-loop "Deploy to production" \
368
+ --mode=enterprise \
369
+ --integration=github-actions \
370
+ --deployment-target=aws-eks
371
+
372
+ # Database migration
373
+ /cfn-docker-loop "Migrate to PostgreSQL" \
374
+ --context-file migration-plan.json \
375
+ --rollback-enabled \
376
+ --validation-required
377
+ ```