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
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cfn-expert-update
|
|
3
|
+
description: "Update CFN system expert agent with relevant git commits since last scan"
|
|
4
|
+
argument-hint: "[--dry-run] [--since=commit_hash] [--force]"
|
|
5
|
+
allowed-tools: ["Bash", "Read", "Write", "Grep", "Glob"]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# CFN Expert Update
|
|
9
|
+
|
|
10
|
+
Scan git commits since last run and update the CFN system expert agent with relevant process changes.
|
|
11
|
+
|
|
12
|
+
## Purpose
|
|
13
|
+
|
|
14
|
+
Updates the `.claude/agents/custom/cfn-system-expert.md` agent with:
|
|
15
|
+
- New CLI commands and patterns
|
|
16
|
+
- Updated CFN Loop processes
|
|
17
|
+
- New skills and coordination patterns
|
|
18
|
+
- Cost optimization strategies
|
|
19
|
+
- Adaptive context lessons
|
|
20
|
+
|
|
21
|
+
## Execution
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Standard update (scans since last tracked commit)
|
|
25
|
+
/cfn-expert-update
|
|
26
|
+
|
|
27
|
+
# Dry run (show what would be updated without making changes)
|
|
28
|
+
/cfn-expert-update --dry-run
|
|
29
|
+
|
|
30
|
+
# Force scan from specific commit
|
|
31
|
+
/cfn-expert-update --since=abc123
|
|
32
|
+
|
|
33
|
+
# Force full re-scan (ignore last commit tracking)
|
|
34
|
+
/cfn-expert-update --force
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Process
|
|
38
|
+
|
|
39
|
+
### 1. Commit Tracking
|
|
40
|
+
- Reads last scanned commit from `.claude/state/cfn-expert-last-commit`
|
|
41
|
+
- Scans git log from that point to HEAD
|
|
42
|
+
- Updates tracking file after successful scan
|
|
43
|
+
|
|
44
|
+
### 2. Relevance Detection
|
|
45
|
+
Scans commits for CFN-related patterns:
|
|
46
|
+
- `CLAUDE.md` changes (system rules)
|
|
47
|
+
- `.claude/commands/cfn/` additions/modifications
|
|
48
|
+
- `.claude/skills/cfn-*` updates
|
|
49
|
+
- Agent coordination patterns
|
|
50
|
+
- Cost optimization updates
|
|
51
|
+
- CFN Loop methodology changes
|
|
52
|
+
|
|
53
|
+
### 3. Knowledge Extraction
|
|
54
|
+
For relevant commits, extracts:
|
|
55
|
+
- New commands and usage patterns
|
|
56
|
+
- Updated processes and workflows
|
|
57
|
+
- Performance insights
|
|
58
|
+
- Bug fixes and solutions
|
|
59
|
+
- Cost optimization strategies
|
|
60
|
+
|
|
61
|
+
### 4. Agent Update
|
|
62
|
+
Updates the expert agent with:
|
|
63
|
+
- Enhanced command knowledge
|
|
64
|
+
- New troubleshooting patterns
|
|
65
|
+
- Updated best practices
|
|
66
|
+
- Current cost comparison data
|
|
67
|
+
- Latest adaptive context lessons
|
|
68
|
+
|
|
69
|
+
## State Management
|
|
70
|
+
|
|
71
|
+
**Last Commit Tracking**: `.claude/state/cfn-expert-last-commit`
|
|
72
|
+
```
|
|
73
|
+
abc123def456789 # Commit hash of last scan
|
|
74
|
+
2025-01-15T10:30:00Z # Timestamp of last update
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Backup Strategy**: Creates backup before updates:
|
|
78
|
+
```
|
|
79
|
+
.claude/backups/cfn-expert/20250115_103000_cfn-system-expert.md
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Relevance Patterns
|
|
83
|
+
|
|
84
|
+
**High Priority** (always updates):
|
|
85
|
+
- `CLAUDE.md` modifications
|
|
86
|
+
- `/cfn-loop-*` command changes
|
|
87
|
+
- CFN Loop methodology updates
|
|
88
|
+
|
|
89
|
+
**Medium Priority** (contextual updates):
|
|
90
|
+
- `.claude/skills/cfn-*` changes
|
|
91
|
+
- Agent coordination improvements
|
|
92
|
+
- Cost optimization strategies
|
|
93
|
+
|
|
94
|
+
**Low Priority** (informational):
|
|
95
|
+
- Documentation updates
|
|
96
|
+
- Test additions
|
|
97
|
+
- Performance improvements
|
|
98
|
+
|
|
99
|
+
## Output Examples
|
|
100
|
+
|
|
101
|
+
### Dry Run Mode
|
|
102
|
+
```
|
|
103
|
+
🔍 Scanning commits since abc123def (5 commits found)
|
|
104
|
+
📋 Relevant commits: 3/5
|
|
105
|
+
🎯 Updates available:
|
|
106
|
+
• New command: /cfn-loop-frontend (P1: 0.95)
|
|
107
|
+
• Updated cost table (P2: 0.87)
|
|
108
|
+
• New coordination pattern (P3: 0.92)
|
|
109
|
+
|
|
110
|
+
💡 Run without --dry-run to apply updates
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Update Mode
|
|
114
|
+
```
|
|
115
|
+
🔍 Scanning commits since abc123def (5 commits found)
|
|
116
|
+
📋 Relevant commits: 3/5
|
|
117
|
+
🎯 Applying 3 updates to cfn-system-expert agent:
|
|
118
|
+
✅ Added /cfn-loop-frontend command knowledge
|
|
119
|
+
✅ Updated cost optimization strategies
|
|
120
|
+
✅ Enhanced coordination patterns
|
|
121
|
+
|
|
122
|
+
📁 Backup created: .claude/backups/cfn-expert/20250115_103000_*
|
|
123
|
+
📝 Last commit updated: def456abc789
|
|
124
|
+
🔄 Expert agent updated successfully
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Error Handling
|
|
128
|
+
|
|
129
|
+
- **No new commits**: "No new commits to scan"
|
|
130
|
+
- **No relevant changes**: "No CFN-relevant changes found"
|
|
131
|
+
- **Git errors**: Check repository status and permissions
|
|
132
|
+
- **File errors**: Verify agent file exists and is writable
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Implementation Notes
|
|
137
|
+
|
|
138
|
+
- Uses git log with commit hash filtering
|
|
139
|
+
- Pattern matching for relevance detection
|
|
140
|
+
- Safe updates with backup/restore capability
|
|
141
|
+
- Idempotent operations (safe to re-run)
|
|
142
|
+
- Timestamp tracking for audit trail
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
## Overview
|
|
8
8
|
|
|
9
|
-
Task Mode: Main Chat
|
|
9
|
+
Task Mode: Main Chat coordinates directly and spawns agents via Task() tool with full context injection and visibility. NO coordinator agent is used.
|
|
10
10
|
|
|
11
11
|
| Aspect | Task Mode | CLI Mode |
|
|
12
12
|
|--------|-----------|----------|
|
|
13
|
-
| **Spawning** | Main Chat via Task() | Coordinator via npx CLI |
|
|
13
|
+
| **Spawning** | Main Chat directly via Task() | Coordinator via npx CLI |
|
|
14
14
|
| **Visibility** | Full transparency in Main Chat | Background, Redis logs |
|
|
15
15
|
| **Provider** | All Anthropic | CLI uses Z.ai routing |
|
|
16
16
|
| **Cost** | ~$0.150/iteration | ~$0.054/iteration (64% savings) |
|
|
@@ -88,15 +88,15 @@ return validators.slice(0, 6); // Max 6
|
|
|
88
88
|
## Sprint Completion Workflow
|
|
89
89
|
|
|
90
90
|
**Key Difference in Task Mode:**
|
|
91
|
-
- Product Owner spawned via `Task()` by
|
|
91
|
+
- Product Owner spawned via `Task()` by Main Chat directly (NOT via `execute-decision.sh`)
|
|
92
92
|
- Use helper scripts for parsing/validation: `parse-decision.sh`, `validate-deliverables.sh`
|
|
93
93
|
- CLI Mode uses `execute-decision.sh` which handles spawning + all logic
|
|
94
94
|
|
|
95
95
|
### 1. Consensus Validation
|
|
96
96
|
|
|
97
|
-
**Task Mode** -
|
|
97
|
+
**Task Mode** - Main Chat spawns Product Owner via Task():
|
|
98
98
|
```javascript
|
|
99
|
-
//
|
|
99
|
+
// Main Chat builds context and spawns PO
|
|
100
100
|
const poContext = `
|
|
101
101
|
CFN Loop iteration ${iteration} complete.
|
|
102
102
|
Loop 2 Consensus: ${consensus} (threshold: ${threshold})
|
|
@@ -164,7 +164,7 @@ EOF
|
|
|
164
164
|
### 5. Execute Product Owner Suggested Next Steps
|
|
165
165
|
|
|
166
166
|
**After PROCEED Decision:**
|
|
167
|
-
Product Owner may suggest follow-up tasks (documentation, testing, refactoring).
|
|
167
|
+
Product Owner may suggest follow-up tasks (documentation, testing, refactoring). Main Chat must proceed by spawning specialized agents to execute these tasks:
|
|
168
168
|
|
|
169
169
|
```javascript
|
|
170
170
|
// Parse PO feedback for suggested next steps
|
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Deploy production-ready container-based CFN Loop with CLI agent spawning and cost optimization"
|
|
3
|
+
argument-hint: "[task-description] --mode=standard --timeout=1800 --memory-limit=1g"
|
|
4
|
+
allowed-tools: ["Bash", "Read", "TodoWrite", "Task"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# CFN Docker CLI - Production Container Deployment
|
|
8
|
+
|
|
9
|
+
Deploy production-ready container-based CFN Loop with CLI agent spawning, achieving 95%+ cost savings while maintaining enterprise-grade security and resource management.
|
|
10
|
+
|
|
11
|
+
**Task Description:** $ARGUMENTS
|
|
12
|
+
|
|
13
|
+
## Architecture Overview
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
Main Chat
|
|
17
|
+
↓ (Task tool)
|
|
18
|
+
cfn-docker-v3-coordinator
|
|
19
|
+
↓ (CLI spawning - 95% cost savings)
|
|
20
|
+
CLI Agent Containers (via npx claude-flow-novice)
|
|
21
|
+
↓ (Authenticated MCP access)
|
|
22
|
+
Skill-Selected MCP Servers
|
|
23
|
+
↓ (Specialized tool access)
|
|
24
|
+
Playwright, Redis, Security Scanner, etc.
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Key Benefits
|
|
28
|
+
|
|
29
|
+
### 💰 Massive Cost Savings
|
|
30
|
+
- **95% cost reduction** vs Task-based spawning
|
|
31
|
+
- **Z.ai routing** for CLI agents (when enabled)
|
|
32
|
+
- **Resource efficiency** through container isolation
|
|
33
|
+
- **Pay only for what you use** pricing model
|
|
34
|
+
|
|
35
|
+
### 🔒 Enterprise Security
|
|
36
|
+
- **Container isolation** for all agents
|
|
37
|
+
- **Token-based MCP authentication**
|
|
38
|
+
- **Skill-based access control**
|
|
39
|
+
- **Comprehensive audit logging**
|
|
40
|
+
|
|
41
|
+
### ⚡ Performance Optimization
|
|
42
|
+
- **50%+ memory savings** via skill-based MCP selection
|
|
43
|
+
- **Parallel container execution**
|
|
44
|
+
- **Local MCP networking** for minimal latency
|
|
45
|
+
- **Resource monitoring** and automatic scaling
|
|
46
|
+
|
|
47
|
+
### 🔄 Production Reliability
|
|
48
|
+
- **Swarm recovery** via Redis persistence
|
|
49
|
+
- **Automatic error handling** and retry logic
|
|
50
|
+
- **Health monitoring** and alerting
|
|
51
|
+
- **Graceful degradation** on failures
|
|
52
|
+
|
|
53
|
+
## Usage Examples
|
|
54
|
+
|
|
55
|
+
### Standard Production Execution
|
|
56
|
+
```bash
|
|
57
|
+
# Standard CFN Loop with CLI agents
|
|
58
|
+
/cfn-docker-loop-cli "Implement user authentication system" --mode=standard
|
|
59
|
+
|
|
60
|
+
# With resource constraints
|
|
61
|
+
/cfn-docker-loop-cli "Analyze security vulnerabilities" --mode=enterprise --memory-limit=2g
|
|
62
|
+
|
|
63
|
+
# With custom timeout for long-running tasks
|
|
64
|
+
/cfn-docker-loop-cli "Migrate production database" --mode=enterprise --timeout=3600
|
|
65
|
+
|
|
66
|
+
# With specific network configuration
|
|
67
|
+
/cfn-docker-loop-cli "Deploy microservices" --network=production-network
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Cost-Optimized Execution
|
|
71
|
+
```bash
|
|
72
|
+
# MVP mode for rapid prototyping
|
|
73
|
+
/cfn-docker-loop-cli "Proof of concept API" --mode=mvp --timeout=900
|
|
74
|
+
|
|
75
|
+
# Batch processing for multiple tasks
|
|
76
|
+
/cfn-docker-loop-cli "Process user data batch" --mode=standard --batch-size=100
|
|
77
|
+
|
|
78
|
+
# Resource-constrained execution
|
|
79
|
+
/cfn-docker-loop-cli "Optimize queries" --memory-limit=512m --cpu-limit=0.5
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Integration-Focused Execution
|
|
83
|
+
```bash
|
|
84
|
+
# CI/CD pipeline integration
|
|
85
|
+
/cfn-docker-loop-cli "Deploy to staging" --mode=standard --integration=github-actions
|
|
86
|
+
|
|
87
|
+
# Database migration with rollback
|
|
88
|
+
/cfn-docker-loop-cli "Schema migration" --mode=enterprise --rollback-enabled
|
|
89
|
+
|
|
90
|
+
# External API integration
|
|
91
|
+
/cfn-docker-loop-cli "Connect payment gateway" --context-file payment-config.json
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Command Options
|
|
95
|
+
|
|
96
|
+
### Core Options
|
|
97
|
+
```bash
|
|
98
|
+
# Task specification
|
|
99
|
+
/cfn-docker-loop-cli "Task description" \
|
|
100
|
+
--mode=standard|mvp|enterprise \ # Execution mode
|
|
101
|
+
--timeout=1800 \ # Timeout in seconds
|
|
102
|
+
--memory-limit=1g \ # Per-agent memory limit
|
|
103
|
+
--cpu-limit=1.0 \ # Per-agent CPU limit
|
|
104
|
+
--network=mcp-network # Docker network
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Advanced Options
|
|
108
|
+
```bash
|
|
109
|
+
# Agent and skill configuration
|
|
110
|
+
/cfn-docker-loop-cli "Task description" \
|
|
111
|
+
--agents=backend-developer,security-specialist \ # Specific agents
|
|
112
|
+
--skills=api-development,security-auditing \ # Required skills
|
|
113
|
+
--mcp-servers=redis,security-scanner \ # Specific MCP servers
|
|
114
|
+
--context-file=task-context.json # Task context file
|
|
115
|
+
|
|
116
|
+
# Monitoring and debugging
|
|
117
|
+
/cfn-docker-loop-cli "Task description" \
|
|
118
|
+
--verbose \ # Detailed logging
|
|
119
|
+
--monitor \ # Real-time monitoring
|
|
120
|
+
--debug \ # Debug mode
|
|
121
|
+
--dry-run # Show configuration without execution
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Recovery and Maintenance
|
|
125
|
+
```bash
|
|
126
|
+
# Swarm recovery
|
|
127
|
+
/cfn-docker-loop-cli "Task description" \
|
|
128
|
+
--recover \ # Recover interrupted task
|
|
129
|
+
--task-id=previous-task-id \ # Specific task to recover
|
|
130
|
+
--resume-iteration=3 # Resume from specific iteration
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Execution Modes Comparison
|
|
134
|
+
|
|
135
|
+
| Feature | MVP Mode | Standard Mode | Enterprise Mode |
|
|
136
|
+
|---------|----------|---------------|-----------------|
|
|
137
|
+
| **Iterations** | 3 | 10 | 15 |
|
|
138
|
+
| **Gate Threshold** | 0.70 | 0.75 | 0.85 |
|
|
139
|
+
| **Consensus Threshold** | 0.80 | 0.90 | 0.95 |
|
|
140
|
+
| **Validators** | 2 | 3 | 5 |
|
|
141
|
+
| **Timeout** | 15 min | 30 min | 60 min |
|
|
142
|
+
| **Memory per Agent** | 512MB | 1GB | 2GB |
|
|
143
|
+
| **Cost (per hour)** | $0.05 | $0.08 | $0.15 |
|
|
144
|
+
| **Use Case** | Prototyping | Production | Critical Systems |
|
|
145
|
+
|
|
146
|
+
## Production Deployment Workflow
|
|
147
|
+
|
|
148
|
+
### 1. Environment Setup
|
|
149
|
+
```bash
|
|
150
|
+
# Start Redis server
|
|
151
|
+
redis-server --daemonize yes
|
|
152
|
+
|
|
153
|
+
# Verify Redis connectivity
|
|
154
|
+
redis-cli ping
|
|
155
|
+
|
|
156
|
+
# Create Docker network for MCP communication
|
|
157
|
+
docker network create mcp-network --driver bridge
|
|
158
|
+
|
|
159
|
+
# Verify MCP server status
|
|
160
|
+
docker ps | grep -E "(playwright|redis|security)"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### 2. Agent Token Management
|
|
164
|
+
```bash
|
|
165
|
+
# Register agent tokens for authentication
|
|
166
|
+
node src/cli/agent-token-manager.js register backend-developer
|
|
167
|
+
node src/cli/agent-token-manager.js register security-specialist
|
|
168
|
+
node src/cli/agent-token-manager.js register frontend-engineer
|
|
169
|
+
|
|
170
|
+
# List registered tokens
|
|
171
|
+
node src/cli/agent-token-manager.js list
|
|
172
|
+
|
|
173
|
+
# Validate tokens
|
|
174
|
+
node src/cli/agent-token-manager.js validate <token>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### 3. Task Execution
|
|
178
|
+
```bash
|
|
179
|
+
# Execute standard CFN Loop
|
|
180
|
+
/cfn-docker-loop-cli "Implement secure authentication" \
|
|
181
|
+
--mode=standard \
|
|
182
|
+
--timeout=1800 \
|
|
183
|
+
--memory-limit=1g
|
|
184
|
+
|
|
185
|
+
# Monitor progress in real-time
|
|
186
|
+
/cfn-docker-monitor --task-id <generated-task-id>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### 4. Results Collection
|
|
190
|
+
```bash
|
|
191
|
+
# Get task results
|
|
192
|
+
cfn-docker-results --task-id <generated-task-id> --output results/
|
|
193
|
+
|
|
194
|
+
# Performance metrics
|
|
195
|
+
cfn-docker-metrics --task-id <generated-task-id> --detailed
|
|
196
|
+
|
|
197
|
+
# Cost analysis
|
|
198
|
+
cfn-docker-cost-report --task-id <generated-task-id> --breakdown
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Resource Management
|
|
202
|
+
|
|
203
|
+
### Memory Optimization
|
|
204
|
+
```bash
|
|
205
|
+
# Memory-efficient execution
|
|
206
|
+
/cfn-docker-loop-cli "Lightweight task" \
|
|
207
|
+
--mode=mvp \
|
|
208
|
+
--memory-limit=512m \
|
|
209
|
+
--mcp-servers=minimal
|
|
210
|
+
|
|
211
|
+
# High-memory task
|
|
212
|
+
/cfn-docker-loop-cli "Heavy data processing" \
|
|
213
|
+
--mode=enterprise \
|
|
214
|
+
--memory-limit=4g \
|
|
215
|
+
--mcp-servers=redis,postgres,data-processor
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### CPU Management
|
|
219
|
+
```bash
|
|
220
|
+
# CPU-constrained execution
|
|
221
|
+
/cfn-docker-loop-cli "Background processing" \
|
|
222
|
+
--cpu-limit=0.5 \
|
|
223
|
+
--priority=low
|
|
224
|
+
|
|
225
|
+
# CPU-intensive task
|
|
226
|
+
/cfn-docker-loop-cli "Complex computation" \
|
|
227
|
+
--cpu-limit=2.0 \
|
|
228
|
+
--priority=high
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Network Configuration
|
|
232
|
+
```bash
|
|
233
|
+
# Isolated network for security
|
|
234
|
+
/cfn-docker-loop-cli "Process sensitive data" \
|
|
235
|
+
--network=secure-network \
|
|
236
|
+
--isolate-network
|
|
237
|
+
|
|
238
|
+
# Multi-network setup
|
|
239
|
+
/cfn-docker-loop-cli "Integration with external APIs" \
|
|
240
|
+
--networks=mcp-network,external-network \
|
|
241
|
+
--network-policies=restrictive
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Monitoring and Observability
|
|
245
|
+
|
|
246
|
+
### Real-time Monitoring
|
|
247
|
+
```bash
|
|
248
|
+
# Monitor active task
|
|
249
|
+
/cfn-docker-monitor --task-id <task-id>
|
|
250
|
+
|
|
251
|
+
# System-wide monitoring
|
|
252
|
+
/cfn-docker-monitor --all-tasks --refresh=5
|
|
253
|
+
|
|
254
|
+
# Resource usage monitoring
|
|
255
|
+
/cfn-docker-monitor --resource-usage --threshold=80
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Performance Analytics
|
|
259
|
+
```bash
|
|
260
|
+
# Task performance report
|
|
261
|
+
cfn-docker-performance-report \
|
|
262
|
+
--task-id <task-id> \
|
|
263
|
+
--include-timing \
|
|
264
|
+
--include-resources \
|
|
265
|
+
--include-costs
|
|
266
|
+
|
|
267
|
+
# Agent efficiency analysis
|
|
268
|
+
cfn-docker-agent-efficiency \
|
|
269
|
+
--agent-type backend-developer \
|
|
270
|
+
--duration 24h \
|
|
271
|
+
--compare-mode
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Health Checks
|
|
275
|
+
```bash
|
|
276
|
+
# System health check
|
|
277
|
+
cfn-docker-health-check --comprehensive
|
|
278
|
+
|
|
279
|
+
# MCP server health
|
|
280
|
+
cfn-docker-mcp-health --all-servers
|
|
281
|
+
|
|
282
|
+
# Network connectivity test
|
|
283
|
+
cfn-docker-network-test --all-networks
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
## Error Handling and Recovery
|
|
287
|
+
|
|
288
|
+
### Automatic Recovery
|
|
289
|
+
```bash
|
|
290
|
+
# Recover from interruption
|
|
291
|
+
/cfn-docker-recover --task-id <interrupted-task-id>
|
|
292
|
+
|
|
293
|
+
# Resume from specific iteration
|
|
294
|
+
/cfn-docker-resume \
|
|
295
|
+
--task-id <task-id> \
|
|
296
|
+
--iteration 3 \
|
|
297
|
+
--preserve-state
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### Manual Intervention
|
|
301
|
+
```bash
|
|
302
|
+
# Debug failed task
|
|
303
|
+
cfn-docker-debug --task-id <task-id> --component orchestration
|
|
304
|
+
|
|
305
|
+
# Inspect agent state
|
|
306
|
+
cfn-docker-agent-inspect --agent-id <agent-id> --detailed
|
|
307
|
+
|
|
308
|
+
# Manual task recovery
|
|
309
|
+
cfn-docker-manual-recovery \
|
|
310
|
+
--task-id <task-id> \
|
|
311
|
+
--backup-state \
|
|
312
|
+
--new-configuration
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
## Security Configuration
|
|
316
|
+
|
|
317
|
+
### Authentication Setup
|
|
318
|
+
```bash
|
|
319
|
+
# Configure Redis authentication
|
|
320
|
+
redis-cli CONFIG SET requirepass <strong-password>
|
|
321
|
+
|
|
322
|
+
# Enable MCP authentication
|
|
323
|
+
export CFN_DOCKER_MCP_AUTH_REQUIRED=true
|
|
324
|
+
export CFN_DOCKER_MCP_TOKEN_EXPIRY=24h
|
|
325
|
+
|
|
326
|
+
# Configure network security
|
|
327
|
+
docker network create --driver bridge --opt encrypted mcp-network
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### Access Control
|
|
331
|
+
```bash
|
|
332
|
+
# Agent whitelist configuration
|
|
333
|
+
cfn-docker-config agent-whitelist --config-file config/production-agents.json
|
|
334
|
+
|
|
335
|
+
# Skill-based access control
|
|
336
|
+
cfn-docker-config skill-requirements --strict-mode --audit-mode
|
|
337
|
+
|
|
338
|
+
# Rate limiting configuration
|
|
339
|
+
cfn-docker-config rate-limits --default 100 --agents 500
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### Audit and Compliance
|
|
343
|
+
```bash
|
|
344
|
+
# Enable audit logging
|
|
345
|
+
cfn-docker-config audit-logging --level info --retain-days=90
|
|
346
|
+
|
|
347
|
+
# Compliance reporting
|
|
348
|
+
cfn-docker-compliance-report \
|
|
349
|
+
--period 30d \
|
|
350
|
+
--include-access-logs \
|
|
351
|
+
--include-resource-usage
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
## Integration Examples
|
|
355
|
+
|
|
356
|
+
### CI/CD Pipeline Integration
|
|
357
|
+
```bash
|
|
358
|
+
# GitHub Actions integration
|
|
359
|
+
name: Deploy with CFN Docker
|
|
360
|
+
on:
|
|
361
|
+
push:
|
|
362
|
+
branches: [main]
|
|
363
|
+
jobs:
|
|
364
|
+
deploy:
|
|
365
|
+
runs-on: ubuntu-latest
|
|
366
|
+
steps:
|
|
367
|
+
- uses: actions/checkout@v3
|
|
368
|
+
- name: Deploy with CFN Docker
|
|
369
|
+
run: |
|
|
370
|
+
/cfn-docker-loop-cli "Deploy to production" \
|
|
371
|
+
--mode=enterprise \
|
|
372
|
+
--context-file deploy-config.json \
|
|
373
|
+
--integration=github-actions
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
### Database Migration
|
|
377
|
+
```bash
|
|
378
|
+
# Safe database migration
|
|
379
|
+
/cfn-docker-loop-cli "Migrate user database to v2.0" \
|
|
380
|
+
--mode=enterprise \
|
|
381
|
+
--context-file migration-plan.json \
|
|
382
|
+
--rollback-enabled \
|
|
383
|
+
--validation-required \
|
|
384
|
+
--backup-automated
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
### External API Integration
|
|
388
|
+
```bash
|
|
389
|
+
# Third-party service integration
|
|
390
|
+
/cfn-docker-loop-cli "Integrate Stripe payment processing" \
|
|
391
|
+
--mode=standard \
|
|
392
|
+
--mcp-servers=payment-api,webhook-processor \
|
|
393
|
+
--context-file stripe-config.json \
|
|
394
|
+
--security-scan
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
## Best Practices
|
|
398
|
+
|
|
399
|
+
### Production Deployment
|
|
400
|
+
1. **Use Standard or Enterprise mode** for production workloads
|
|
401
|
+
2. **Set appropriate timeouts** based on task complexity
|
|
402
|
+
3. **Monitor resource usage** to prevent resource exhaustion
|
|
403
|
+
4. **Enable comprehensive logging** for debugging and compliance
|
|
404
|
+
5. **Test in staging** before production deployment
|
|
405
|
+
|
|
406
|
+
### Cost Optimization
|
|
407
|
+
1. **Choose MVP mode** for prototyping and simple tasks
|
|
408
|
+
2. **Set realistic timeouts** to prevent runaway costs
|
|
409
|
+
3. **Monitor agent efficiency** and optimize resource usage
|
|
410
|
+
4. **Use batch processing** for similar tasks
|
|
411
|
+
5. **Leverage Z.ai routing** when available
|
|
412
|
+
|
|
413
|
+
### Security Best Practices
|
|
414
|
+
1. **Enable MCP authentication** for all production deployments
|
|
415
|
+
2. **Use isolated networks** for sensitive tasks
|
|
416
|
+
3. **Implement rate limiting** to prevent resource abuse
|
|
417
|
+
4. **Regular security audits** of agent and MCP configurations
|
|
418
|
+
5. **Encrypt sensitive data** in transit and at rest
|
|
419
|
+
|
|
420
|
+
### Performance Optimization
|
|
421
|
+
1. **Select appropriate agents** based on task requirements
|
|
422
|
+
2. **Optimize memory limits** for agent types
|
|
423
|
+
3. **Use local MCP networking** for minimal latency
|
|
424
|
+
4. **Monitor container performance** and adjust resources
|
|
425
|
+
5. **Implement caching** for repeated operations
|
|
426
|
+
|
|
427
|
+
## Troubleshooting Guide
|
|
428
|
+
|
|
429
|
+
### Common Issues
|
|
430
|
+
1. **Container Startup Failures**
|
|
431
|
+
```bash
|
|
432
|
+
# Check Docker daemon
|
|
433
|
+
docker info
|
|
434
|
+
|
|
435
|
+
# Verify image availability
|
|
436
|
+
docker images | grep claude-flow-novice
|
|
437
|
+
|
|
438
|
+
# Check resource limits
|
|
439
|
+
cfn-docker-resource-check --task-id <task-id>
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
2. **MCP Server Connection Issues**
|
|
443
|
+
```bash
|
|
444
|
+
# Test MCP connectivity
|
|
445
|
+
cfn-docker-mcp-test --server playwright --token <test-token>
|
|
446
|
+
|
|
447
|
+
# Check network configuration
|
|
448
|
+
docker network inspect mcp-network
|
|
449
|
+
|
|
450
|
+
# Verify token validity
|
|
451
|
+
node src/cli/agent-token-manager.js validate <token>
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
3. **Redis Coordination Issues**
|
|
455
|
+
```bash
|
|
456
|
+
# Test Redis connectivity
|
|
457
|
+
redis-cli ping
|
|
458
|
+
|
|
459
|
+
# Check Redis memory usage
|
|
460
|
+
redis-cli info memory
|
|
461
|
+
|
|
462
|
+
# Verify coordination data
|
|
463
|
+
redis-cli keys "cfn_docker:*"
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
### Performance Issues
|
|
467
|
+
1. **High Memory Usage**
|
|
468
|
+
```bash
|
|
469
|
+
# Monitor memory usage
|
|
470
|
+
cfn-docker-memory-monitor --task-id <task-id>
|
|
471
|
+
|
|
472
|
+
# Optimize agent selection
|
|
473
|
+
cfn-docker-optimize-agents --task-id <task-id> --memory-efficient
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
2. **Slow Execution**
|
|
477
|
+
```bash
|
|
478
|
+
# Performance analysis
|
|
479
|
+
cfn-docker-performance-analysis --task-id <task-id>
|
|
480
|
+
|
|
481
|
+
# Optimize MCP selection
|
|
482
|
+
cfn-docker-optimize-mcp --task-id <task-id>
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
## Configuration Reference
|
|
486
|
+
|
|
487
|
+
### Environment Variables
|
|
488
|
+
```bash
|
|
489
|
+
# Core Configuration
|
|
490
|
+
CFN_DOCKER_MODE=standard
|
|
491
|
+
CFN_DOCKER_TIMEOUT=1800
|
|
492
|
+
CFN_DOCKER_MEMORY_LIMIT=1g
|
|
493
|
+
CFN_DOCKER_CPU_LIMIT=1.0
|
|
494
|
+
|
|
495
|
+
# Redis Configuration
|
|
496
|
+
CFN_DOCKER_REDIS_HOST=localhost
|
|
497
|
+
CFN_DOCKER_REDIS_PORT=6379
|
|
498
|
+
CFN_DOCKER_REDIS_DB=0
|
|
499
|
+
CFN_DOCKER_REDIS_TTL=3600
|
|
500
|
+
|
|
501
|
+
# Docker Configuration
|
|
502
|
+
CFN_DOCKER_NETWORK=mcp-network
|
|
503
|
+
CFN_DOCKER_IMAGE=claude-flow-novice:agent
|
|
504
|
+
CFN_DOCKER_REGISTRY=local
|
|
505
|
+
|
|
506
|
+
# MCP Configuration
|
|
507
|
+
CFN_DOCKER_MCP_AUTH_REQUIRED=true
|
|
508
|
+
CFN_DOCKER_MCP_TOKEN_EXPIRY=24h
|
|
509
|
+
CFN_DOCKER_MCP_SERVER_TIMEOUT=30
|
|
510
|
+
|
|
511
|
+
# Security Configuration
|
|
512
|
+
CFN_DOCKER_ENABLE_AUDIT=true
|
|
513
|
+
CFN_DOCKER_RATE_LIMIT=100
|
|
514
|
+
CFN_DOCKER_MAX_CONCURRENT_AGENTS=10
|
|
515
|
+
|
|
516
|
+
# Monitoring Configuration
|
|
517
|
+
CFN_DOCKER_MONITORING_ENABLED=true
|
|
518
|
+
CFN_DOCKER_METRICS_RETENTION=7d
|
|
519
|
+
CFN_DOCKER_ALERT_THRESHOLDS=80
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
### Configuration Files
|
|
523
|
+
- **Agent Configuration**: `config/production-agents.json`
|
|
524
|
+
- **MCP Server Configuration**: `config/mcp-servers.json`
|
|
525
|
+
- **Network Configuration**: `config/networks.json`
|
|
526
|
+
- **Security Configuration**: `config/security.json`
|
|
527
|
+
- **Monitoring Configuration**: `config/monitoring.json`
|