claude-flow-novice 2.14.30 → 2.14.32

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 (81) hide show
  1. package/.claude/cfn-data/cfn-loop.db +0 -0
  2. package/.claude/commands/CFN_LOOP_TASK_MODE.md +1 -1
  3. package/.claude/skills/cfn-agent-discovery/agents-registry.json +10 -9
  4. package/.claude/skills/cfn-docker-agent-spawning/SKILL.md +394 -0
  5. package/.claude/skills/cfn-docker-agent-spawning/spawn-agent.sh +521 -0
  6. package/.claude/skills/cfn-docker-loop-orchestration/SKILL.md +449 -0
  7. package/.claude/skills/cfn-docker-loop-orchestration/orchestrate.sh +787 -0
  8. package/.claude/skills/cfn-docker-redis-coordination/SKILL.md +435 -0
  9. package/.claude/skills/cfn-docker-redis-coordination/coordinate.sh +635 -0
  10. package/.claude/skills/cfn-docker-skill-mcp-selection/SKILL.md +289 -0
  11. package/.claude/skills/cfn-docker-skill-mcp-selection/skill-mcp-selector.js +472 -0
  12. package/.claude/skills/cfn-loop-validation/config.json +2 -2
  13. package/README.md +95 -0
  14. package/claude-assets/agents/README-AGENT_LIFECYCLE.md +10 -37
  15. package/claude-assets/agents/README-VALIDATION.md +8 -0
  16. package/claude-assets/agents/cfn-dev-team/CLAUDE.md +10 -9
  17. package/claude-assets/agents/cfn-dev-team/README.md +8 -0
  18. package/claude-assets/agents/cfn-dev-team/architecture/base-template-generator.md +2 -9
  19. package/claude-assets/agents/cfn-dev-team/coordinators/README.md +9 -1
  20. package/claude-assets/agents/cfn-dev-team/dev-ops/devops-engineer.md +7 -12
  21. package/claude-assets/agents/cfn-dev-team/dev-ops/docker-specialist.md +10 -5
  22. package/claude-assets/agents/cfn-dev-team/dev-ops/github-commit-agent.md +11 -10
  23. package/claude-assets/agents/cfn-dev-team/dev-ops/monitoring-specialist.md +10 -5
  24. package/claude-assets/agents/cfn-dev-team/developers/README.md +9 -1
  25. package/claude-assets/agents/cfn-dev-team/developers/api-gateway-specialist.md +2 -5
  26. package/claude-assets/agents/cfn-dev-team/developers/backend-developer.md +11 -6
  27. package/claude-assets/agents/cfn-dev-team/developers/database/database-architect.md +2 -5
  28. package/claude-assets/agents/cfn-dev-team/developers/frontend/mobile-dev.md +2 -19
  29. package/claude-assets/agents/cfn-dev-team/developers/frontend/react-frontend-engineer.md +11 -6
  30. package/claude-assets/agents/cfn-dev-team/developers/frontend/ui-designer.md +9 -23
  31. package/claude-assets/agents/cfn-dev-team/developers/graphql-specialist.md +10 -5
  32. package/claude-assets/agents/cfn-dev-team/developers/rust-developer.md +2 -9
  33. package/claude-assets/agents/cfn-dev-team/documentation/README-VALIDATION.md +8 -0
  34. package/claude-assets/agents/cfn-dev-team/documentation/agent-type-guidelines.md +10 -0
  35. package/claude-assets/agents/cfn-dev-team/documentation/pseudocode.md +2 -9
  36. package/claude-assets/agents/cfn-dev-team/product-owners/accessibility-advocate-persona.md +11 -6
  37. package/claude-assets/agents/cfn-dev-team/product-owners/cto-agent.md +0 -5
  38. package/claude-assets/agents/cfn-dev-team/product-owners/power-user-persona.md +0 -3
  39. package/claude-assets/agents/cfn-dev-team/product-owners/product-owner.md +2 -8
  40. package/claude-assets/agents/cfn-dev-team/reviewers/README.md +9 -1
  41. package/claude-assets/agents/cfn-dev-team/reviewers/quality/quality-metrics.md +10 -0
  42. package/claude-assets/agents/cfn-dev-team/test-agent.md +10 -0
  43. package/claude-assets/agents/cfn-dev-team/testers/README.md +9 -1
  44. package/claude-assets/agents/cfn-dev-team/utility/analyst.md +0 -7
  45. package/claude-assets/agents/cfn-dev-team/utility/code-booster.md +1 -38
  46. package/claude-assets/agents/cfn-dev-team/utility/memory-leak-specialist.md +10 -5
  47. package/claude-assets/agents/cfn-dev-team/utility/researcher.md +8 -34
  48. package/claude-assets/agents/cfn-dev-team/utility/z-ai-specialist.md +10 -5
  49. package/claude-assets/agents/csuite/cto-agent.md +10 -0
  50. package/claude-assets/agents/custom/cfn-system-expert.md +128 -1
  51. package/claude-assets/agents/docker-coordinators/cfn-docker-v3-coordinator.md +5 -1
  52. package/claude-assets/agents/docker-team/csuite/c-suite-template.md +5 -1
  53. package/claude-assets/agents/docker-team/infrastructure/team-coordinator-template.md +5 -1
  54. package/claude-assets/agents/marketing_hybrid/cost_tracker.md +10 -0
  55. package/claude-assets/agents/marketing_hybrid/docker_deployer.md +10 -0
  56. package/claude-assets/agents/marketing_hybrid/zai_worker_spawner.md +10 -0
  57. package/claude-assets/agents/project-only-agents/npm-package-specialist.md +9 -26
  58. package/claude-assets/commands/CFN_LOOP_TASK_MODE.md +1 -1
  59. package/claude-assets/hooks/cfn-post-execution/memory-cleanup.sh +20 -0
  60. package/claude-assets/hooks/cfn-pre-execution/memory-check.sh +20 -0
  61. package/claude-assets/skills/agent-lifecycle/SKILL.md +60 -0
  62. package/claude-assets/skills/agent-lifecycle/execute-lifecycle-hook.sh +573 -0
  63. package/claude-assets/skills/agent-lifecycle/simple-audit.sh +31 -0
  64. package/claude-assets/skills/cfn-agent-discovery/agents-registry.json +10 -9
  65. package/claude-assets/skills/cfn-docker-agent-spawning/spawn-agent.sh +70 -10
  66. package/claude-assets/skills/cfn-loop-validation/config.json +2 -2
  67. package/claude-assets/skills/cfn-memory-management/SKILL.md +271 -0
  68. package/claude-assets/skills/cfn-memory-management/check-memory.sh +160 -0
  69. package/claude-assets/skills/cfn-memory-management/cleanup-memory.sh +197 -0
  70. package/claude-assets/skills/cfn-task-config-init/initialize-config.sh +2 -2
  71. package/dist/agents/agent-loader.js +165 -146
  72. package/dist/agents/agent-loader.js.map +1 -1
  73. package/dist/cli/agent-command.js +44 -2
  74. package/dist/cli/agent-command.js.map +1 -1
  75. package/dist/cli/config-manager.js +91 -109
  76. package/dist/cli/config-manager.js.map +1 -1
  77. package/dist/cli/index.js +29 -2
  78. package/dist/cli/index.js.map +1 -1
  79. package/package.json +10 -2
  80. package/readme/README.md +71 -14
  81. package/scripts/memory-leak-prevention.sh +306 -0
Binary file
@@ -467,7 +467,7 @@ Complex/Enterprise (>5 files, >500 LOC): +code-analyzer
467
467
  ### Complexity Analysis CLI
468
468
  ```bash
469
469
  ./.claude/skills/task-complexity/analyze.sh --task "$DESC" --files "$LIST"
470
- # Output: {"score": 85, "category": "standard", "validators": ["reviewer","tester","architect","security-specialist"], "threshold": 0.90}
470
+ # Output: {"score": 85, "category": "standard", "validators": ["reviewer","tester","system-architect","security-specialist"], "threshold": 0.90}
471
471
  ```
472
472
 
473
473
  ---
@@ -374,19 +374,20 @@
374
374
  "file": "/mnt/c/Users/masha/Documents/claude-flow-novice/.claude/agents/planners/analyst.md"
375
375
  },
376
376
  {
377
- "name": "architect",
378
- "description": "MUST BE USED for system architecture design, technical planning, and infrastructure strategy. Use PROACTIVELY for scalable, maintainable system design.",
379
- "type": "coordinator",
380
- "loop": "coordinator",
377
+ "name": "system-architect",
378
+ "description": "MUST BE USED when designing enterprise-grade system architecture, providing technical leadership for distributed systems, microservices, cloud-native solutions. Use PROACTIVELY for architectural design, technical strategy, infrastructure planning.",
379
+ "type": "specialist",
380
+ "loop": "loop3",
381
381
  "keywords": [
382
+ "enterprise-architecture",
382
383
  "system-design",
383
- "architecture-planning",
384
- "infrastructure-strategy",
385
- "scalability",
386
384
  "technical-leadership",
387
- "component-integration"
385
+ "architectural-patterns",
386
+ "distributed-systems",
387
+ "microservices",
388
+ "cloud-native"
388
389
  ],
389
- "file": "/mnt/c/Users/masha/Documents/claude-flow-novice/.claude/agents/planners/architect.md"
390
+ "file": "/mnt/c/Users/masha/Documents/claude-flow-novice/.claude/agents/cfn-dev-team/architecture/system-architect.md"
390
391
  },
391
392
  {
392
393
  "name": "planner",
@@ -0,0 +1,394 @@
1
+ # CFN Docker Agent Spawning Skill
2
+
3
+ **Purpose:** Spawn agents in isolated Docker containers with skill-based MCP selection, resource management, and authentication.
4
+
5
+ ## Overview
6
+
7
+ This skill manages the lifecycle of container-based agents, providing isolated execution environments with controlled resource usage, secure MCP access, and comprehensive monitoring capabilities.
8
+
9
+ ## Architecture
10
+
11
+ ```bash
12
+ Agent Spawning Request
13
+
14
+ Container Configuration (memory, CPU, volumes)
15
+
16
+ Docker Container Creation
17
+
18
+ MCP Token Generation & Injection
19
+
20
+ Agent Initialization (claude-flow-novice agent-spawn)
21
+
22
+ Resource Monitoring & Management
23
+ ```
24
+
25
+ ## Core Functions
26
+
27
+ ### 1. Container Configuration
28
+ Generate Docker container specifications based on agent type and requirements:
29
+
30
+ ```bash
31
+ # Configure container for frontend engineer
32
+ cfn-docker-agent-spawn configure \
33
+ --agent-type react-frontend-engineer \
34
+ --memory-limit 1g \
35
+ --cpu-limit 1.0 \
36
+ --network mcp-network
37
+ ```
38
+
39
+ ### 2. Container Creation
40
+ Create and start Docker containers with proper isolation:
41
+
42
+ ```bash
43
+ # Spawn agent container
44
+ cfn-docker-agent-spawn create \
45
+ --agent-id agent-frontend-001 \
46
+ --agent-type react-frontend-engineer \
47
+ --task-id task-authentication \
48
+ --context "${TASK_CONTEXT}"
49
+ ```
50
+
51
+ ### 3. MCP Integration
52
+ Configure secure MCP server access with authentication tokens:
53
+
54
+ ```bash
55
+ # Setup MCP access for container
56
+ cfn-docker-agent-spawn setup-mcp \
57
+ --container-id agent-frontend-001 \
58
+ --mcp-servers playwright \
59
+ --token-file /tmp/mcp-tokens.json
60
+ ```
61
+
62
+ ### 4. Resource Management
63
+ Monitor and manage container resources:
64
+
65
+ ```bash
66
+ # Monitor container resources
67
+ cfn-docker-agent-spawn monitor \
68
+ --container-id agent-frontend-001 \
69
+ --alert-threshold 90%
70
+ ```
71
+
72
+ ## Container Specification
73
+
74
+ ### Standard Configuration
75
+ ```yaml
76
+ # Docker container specification
77
+ agent-container:
78
+ image: claude-flow-novice:agent
79
+ hostname: agent-{{AGENT_ID}}
80
+ networks:
81
+ - mcp-network
82
+ volumes:
83
+ - ./.claude:/app/.claude:ro
84
+ - ./src:/app/src:ro
85
+ - agent-workspace-{{AGENT_ID}}:/app/workspace
86
+ environment:
87
+ - AGENT_ID={{AGENT_ID}}
88
+ - AGENT_TYPE={{AGENT_TYPE}}
89
+ - TASK_ID={{TASK_ID}}
90
+ - REDIS_URL=redis://redis:6379
91
+ - MCP_TOKENS_FILE=/tmp/mcp-tokens.json
92
+ resources:
93
+ memory: {{MEMORY_LIMIT}}
94
+ cpu: {{CPU_LIMIT}}
95
+ restart_policy: unless-stopped
96
+ ```
97
+
98
+ ### Volume Mounts
99
+ - **Codebase**: Read-only mount for source code and skills
100
+ - **Agent Configuration**: Read-only mount for .claude directory
101
+ - **Workspace**: Writable mount for agent work output
102
+ - **Token Store**: Temporary file for MCP authentication tokens
103
+
104
+ ### Environment Variables
105
+ - `AGENT_ID`: Unique container identifier
106
+ - `AGENT_TYPE`: Agent type for skill-based selection
107
+ - `TASK_ID`: CFN Loop task identifier
108
+ - `REDIS_URL`: Redis connection string
109
+ - `MCP_TOKENS_FILE`: Path to MCP authentication tokens
110
+
111
+ ## Usage Patterns
112
+
113
+ ### Basic Agent Spawning
114
+ ```bash
115
+ # Spawn single agent
116
+ cfn-docker-agent-spawn \
117
+ --agent-type react-frontend-engineer \
118
+ --task-id "implement-ui" \
119
+ --memory-limit 1g
120
+ ```
121
+
122
+ ### Batch Agent Spawning
123
+ ```bash
124
+ # Spawn team of agents
125
+ cfn-docker-agent-spawn batch \
126
+ --team frontend \
127
+ --agents 3 \
128
+ --task-id "ui-development" \
129
+ --memory-limit 1g \
130
+ --network mcp-network
131
+ ```
132
+
133
+ ### Custom Configuration
134
+ ```bash
135
+ # Spawn with custom configuration
136
+ cfn-docker-agent-spawn \
137
+ --agent-type security-specialist \
138
+ --custom-config config/security-agent.json \
139
+ --environment "DEBUG=true,LOG_LEVEL=verbose" \
140
+ --volume /data/secrets:/app/secrets:ro
141
+ ```
142
+
143
+ ## Resource Management
144
+
145
+ ### Memory Limits
146
+ | Agent Type | Default Limit | Maximum Recommended |
147
+ |------------|---------------|---------------------|
148
+ | **Frontend Engineer** | 1GB | 2GB |
149
+ | **Backend Developer** | 768MB | 1.5GB |
150
+ | **Security Specialist** | 1.5GB | 3GB |
151
+ | **DevOps Engineer** | 1GB | 2GB |
152
+
153
+ ### CPU Limits
154
+ - **Standard Agents**: 0.5-1.0 CPU units
155
+ - **Resource-Intensive Agents**: 1.0-2.0 CPU units
156
+ - **Batch Operations**: 0.3-0.5 CPU units per agent
157
+
158
+ ### Network Configuration
159
+ ```bash
160
+ # Create isolated network for MCP communication
161
+ docker network create mcp-network --driver bridge
162
+
163
+ # Connect containers to MCP network
164
+ docker network connect mcp-network agent-frontend-001
165
+ docker network connect mcp-network playwright-mcp
166
+ ```
167
+
168
+ ## Integration with CFN Docker Skills
169
+
170
+ ### Skill-Based MCP Selection
171
+ ```bash
172
+ # Get MCP configuration for agent
173
+ MCP_CONFIG=$(cfn-docker-skill-mcp-selector select --agent-type ${AGENT_TYPE})
174
+
175
+ # Spawn with MCP configuration
176
+ cfn-docker-agent-spawn \
177
+ --agent-type ${AGENT_TYPE} \
178
+ --mcp-config "${MCP_CONFIG}" \
179
+ --auto-tokens
180
+ ```
181
+
182
+ ### Redis Coordination
183
+ ```bash
184
+ # Register agent in Redis
185
+ cfn-docker-redis-coordination register \
186
+ --agent-id ${AGENT_ID} \
187
+ --container-id ${CONTAINER_ID} \
188
+ --status "spawning"
189
+
190
+ # Update agent status
191
+ cfn-docker-redis-coordination update-status \
192
+ --agent-id ${AGENT_ID} \
193
+ --status "running"
194
+ ```
195
+
196
+ ### Loop Orchestration
197
+ ```bash
198
+ # Spawn agents for Loop 3 implementation
199
+ cfn-docker-loop-orchestration spawn-loop3 \
200
+ --task-context "${TASK_CONTEXT}" \
201
+ --agent-count 3 \
202
+ --parallel
203
+ ```
204
+
205
+ ## Monitoring and Observability
206
+
207
+ ### Resource Monitoring
208
+ ```bash
209
+ # Real-time resource usage
210
+ cfn-docker-agent-spawn stats \
211
+ --agent-id agent-frontend-001 \
212
+ --format json
213
+
214
+ # Historical resource data
215
+ cfn-docker-agent-spawn history \
216
+ --agent-id agent-frontend-001 \
217
+ --duration 1h
218
+ ```
219
+
220
+ ### Health Checks
221
+ ```bash
222
+ # Container health status
223
+ cfn-docker-agent-spawn health \
224
+ --agent-id agent-frontend-001
225
+
226
+ # MCP server connectivity
227
+ cfn-docker-agent-spawn check-mcp \
228
+ --agent-id agent-frontend-001 \
229
+ --servers playwright,redis
230
+ ```
231
+
232
+ ### Logging
233
+ ```bash
234
+ # Container logs
235
+ cfn-docker-agent-spawn logs \
236
+ --agent-id agent-frontend-001 \
237
+ --tail 100
238
+
239
+ # Structured logs for monitoring
240
+ cfn-docker-agent-spawn logs \
241
+ --agent-id agent-frontend-001 \
242
+ --format json \
243
+ --output /var/log/agents/${AGENT_ID}.log
244
+ ```
245
+
246
+ ## Error Handling
247
+
248
+ ### Container Failure Recovery
249
+ ```bash
250
+ # Automatic restart on failure
251
+ cfn-docker-agent-spawn \
252
+ --agent-type ${AGENT_TYPE} \
253
+ --restart-policy on-failure \
254
+ --restart-count 3
255
+
256
+ # Manual recovery
257
+ cfn-docker-agent-spawn recover \
258
+ --agent-id agent-frontend-001 \
259
+ --backup-state
260
+ ```
261
+
262
+ ### Resource Exhaustion Handling
263
+ ```bash
264
+ # Memory pressure handling
265
+ cfn-docker-agent-spawn \
266
+ --memory-limit 1g \
267
+ --memory-swap 1.5g \
268
+ --oom-kill-disable
269
+
270
+ # CPU throttling
271
+ cfn-docker-agent-spawn \
272
+ --cpu-limit 1.0 \
273
+ --cpu-shares 1024
274
+ ```
275
+
276
+ ### Network Isolation Issues
277
+ ```bash
278
+ # Network connectivity validation
279
+ cfn-docker-agent-spawn validate-network \
280
+ --agent-id agent-frontend-001 \
281
+ --targets redis:6379,playwright-mcp:3000
282
+
283
+ # Network repair
284
+ cfn-docker-agent-spawn repair-network \
285
+ --agent-id agent-frontend-001 \
286
+ --recreate-network
287
+ ```
288
+
289
+ ## Performance Optimization
290
+
291
+ ### Startup Optimization
292
+ - **Pre-warmed Images**: Use Docker image layer caching
293
+ - **Parallel Startup**: Spawn multiple containers concurrently
294
+ - **Lazy Loading**: Load MCP servers on-demand
295
+ - **Resource Pre-allocation**: Reserve resources in advance
296
+
297
+ ### Memory Optimization
298
+ - **Selective MCP Loading**: Only load required MCP servers
299
+ - **Workspace Cleanup**: Clean temporary files automatically
300
+ - **Garbage Collection**: Optimize Node.js memory management
301
+ - **Shared Libraries**: Use shared mounts for common dependencies
302
+
303
+ ### Network Optimization
304
+ - **Local Network**: Use Docker bridge networks for MCP communication
305
+ - **Connection Pooling**: Reuse MCP server connections
306
+ - **DNS Caching**: Cache MCP server DNS resolution
307
+ - **Compression**: Compress large data transfers
308
+
309
+ ## Security Considerations
310
+
311
+ ### Container Isolation
312
+ - **Read-only Codebase**: Prevent code modification
313
+ - **Limited Privileges**: Run as non-root user
314
+ - **Resource Limits**: Prevent DoS attacks
315
+ - **Network Segmentation**: Isolate agent networks
316
+
317
+ ### Token Security
318
+ - **Secure Token Storage**: Use tmpfs for token files
319
+ - **Token Expiration**: Automatic token rotation
320
+ - **Access Logging**: Log all token usage
321
+ - **Revocation**: Immediate token invalidation
322
+
323
+ ### File System Security
324
+ - **Restricted Access**: Limit file system access
325
+ - **Workspace Isolation**: Isolate agent workspaces
326
+ - **Temporary Files**: Secure cleanup of temporary files
327
+ - **Audit Logging**: Log all file system operations
328
+
329
+ ## Testing and Validation
330
+
331
+ ### Unit Tests
332
+ - Container creation and configuration
333
+ - Resource limit enforcement
334
+ - Network connectivity validation
335
+ - Token injection and validation
336
+
337
+ ### Integration Tests
338
+ - End-to-end agent spawning workflow
339
+ - MCP server connectivity and authentication
340
+ - Resource monitoring and alerting
341
+ - Error handling and recovery
342
+
343
+ ### Performance Tests
344
+ - Container startup time measurement
345
+ - Resource usage benchmarking
346
+ - Concurrent spawning scalability
347
+ - Network performance validation
348
+
349
+ ## Troubleshooting
350
+
351
+ ### Common Issues
352
+ 1. **Container Won't Start**: Check image availability and resource limits
353
+ 2. **MCP Connection Failed**: Verify network configuration and token validity
354
+ 3. **Memory Issues**: Monitor usage and adjust limits
355
+ 4. **Permission Errors**: Check volume mounts and user permissions
356
+
357
+ ### Debug Commands
358
+ ```bash
359
+ # Debug container creation
360
+ cfn-docker-agent-spawn debug \
361
+ --agent-type ${AGENT_TYPE} \
362
+ --verbose \
363
+ --dry-run
364
+
365
+ # Inspect container configuration
366
+ cfn-docker-agent-spawn inspect \
367
+ --container-id ${CONTAINER_ID} \
368
+ --format json
369
+
370
+ # Validate MCP connectivity
371
+ cfn-docker-agent-spawn test-mcp \
372
+ --container-id ${CONTAINER_ID} \
373
+ --all-servers
374
+ ```
375
+
376
+ ## Best Practices
377
+
378
+ ### Resource Planning
379
+ - **Conservative Limits**: Start with lower memory limits and increase as needed
380
+ - **Monitoring**: Implement comprehensive resource monitoring
381
+ - **Capacity Planning**: Plan for peak usage scenarios
382
+ - **Resource Cleanup**: Clean up unused containers and volumes
383
+
384
+ ### Security Hardening
385
+ - **Minimal Images**: Use minimal Docker images
386
+ - **Regular Updates**: Keep base images updated
387
+ - **Scanning**: Regularly scan images for vulnerabilities
388
+ - **Access Control**: Implement proper access controls
389
+
390
+ ### Operational Excellence
391
+ - **Automation**: Automate container lifecycle management
392
+ - **Observability**: Implement comprehensive monitoring
393
+ - **Documentation**: Maintain detailed configuration documentation
394
+ - **Backup**: Backup critical container configurations