claude-flow-novice 2.10.6 → 2.10.8
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/CFN_LOOP_TASK_MODE.md +94 -0
- package/.claude/commands/cfn/cfn-loop.md +4 -3
- package/.claude/hooks/cfn-invoke-security-validation.sh +70 -0
- package/.claude/skills/cfn-hybrid-routing/spawn-worker.sh +43 -43
- package/claude-assets/agents/cfn-dev-team/dev-ops/docker-specialist.md +692 -0
- package/claude-assets/agents/cfn-dev-team/dev-ops/monitoring-specialist.md +739 -0
- package/claude-assets/agents/cfn-dev-team/developers/api-gateway-specialist.md +905 -0
- package/claude-assets/agents/cfn-dev-team/testers/api-testing-specialist.md +707 -0
- package/claude-assets/agents/cfn-dev-team/testers/chaos-engineering-specialist.md +901 -0
- package/claude-assets/agents/cfn-dev-team/utility/memory-leak-specialist.md +757 -0
- package/claude-assets/agents/cfn-dev-team/utility/z-ai-specialist.md +630 -0
- package/claude-assets/agents/docker-team/csuite/c-suite-template.md +529 -0
- package/claude-assets/agents/docker-team/infrastructure/team-coordinator-template.md +467 -0
- package/claude-assets/commands/cfn/CFN_LOOP_TASK_MODE.md +94 -0
- package/claude-assets/commands/cfn/cfn-loop.md +4 -3
- package/claude-assets/hooks/cfn-invoke-security-validation.sh +70 -0
- package/claude-assets/skills/cfn-hybrid-routing/spawn-worker.sh +43 -43
- package/claude-assets/skills/team-provider-routing/execute-agent.sh +76 -0
- package/claude-assets/skills/team-provider-routing/spawn-worker.sh +91 -0
- package/dist/agents/agent-loader.js +0 -315
- package/dist/agents/agent-loader.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Generate team-specific coordinator configurations for Docker organizational architecture
|
|
3
|
+
tools: [Read, Write, Edit, Bash, Grep, Glob]
|
|
4
|
+
priority: high
|
|
5
|
+
tags: [docker, infrastructure, templating, coordinator, team-config]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Team Coordinator Template Agent
|
|
9
|
+
|
|
10
|
+
Generate complete coordinator configurations for organizational teams in Docker-based architecture.
|
|
11
|
+
|
|
12
|
+
## Specialization
|
|
13
|
+
|
|
14
|
+
**Primary Focus:**
|
|
15
|
+
- Team-specific Docker compose service definitions
|
|
16
|
+
- Coordinator environment variable templates
|
|
17
|
+
- Team provider routing configurations
|
|
18
|
+
- MCP isolation configs per team
|
|
19
|
+
- Network and volume definitions
|
|
20
|
+
|
|
21
|
+
**Key Capabilities:**
|
|
22
|
+
- Extract team requirements from epic config
|
|
23
|
+
- Generate docker-compose service entries
|
|
24
|
+
- Create .env variable templates
|
|
25
|
+
- Populate team-providers.json entries
|
|
26
|
+
- Configure team-isolated networks
|
|
27
|
+
- Set up team playbook volumes
|
|
28
|
+
|
|
29
|
+
## Core Responsibilities
|
|
30
|
+
|
|
31
|
+
### 1. Docker Compose Service Generation
|
|
32
|
+
|
|
33
|
+
Generate coordinator service definition for team:
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
team-coordinator:
|
|
37
|
+
image: claude-flow-novice:latest
|
|
38
|
+
container_name: {team}-coordinator
|
|
39
|
+
environment:
|
|
40
|
+
- TEAM_ID={team}
|
|
41
|
+
- AGENT_ROLE=coordinator
|
|
42
|
+
- {TEAM}_COORDINATOR_API_KEY=${...}
|
|
43
|
+
- ZAI_API_KEY=${ZAI_API_KEY}
|
|
44
|
+
- REDIS_URL=${REDIS_URL}
|
|
45
|
+
- POSTGRES_URL=${POSTGRES_URL}
|
|
46
|
+
volumes:
|
|
47
|
+
- ./.claude:/app/.claude:ro
|
|
48
|
+
- {team}-playbooks:/app/playbooks
|
|
49
|
+
networks:
|
|
50
|
+
- {team}-network
|
|
51
|
+
- coordinator-mesh
|
|
52
|
+
depends_on:
|
|
53
|
+
- redis
|
|
54
|
+
- postgres
|
|
55
|
+
restart: unless-stopped
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 2. Environment Variable Templates
|
|
59
|
+
|
|
60
|
+
Generate .env entries for team:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# {Team} Team Coordinator API Key (Claude Max subscription)
|
|
64
|
+
{TEAM}_COORDINATOR_API_KEY=sk-ant-api03-your-{team}-key
|
|
65
|
+
|
|
66
|
+
# {Team} Team Configuration
|
|
67
|
+
{TEAM}_AGENT_COUNT={count}
|
|
68
|
+
{TEAM}_CONCURRENT_WORKERS={concurrent}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 3. Team Provider Configuration
|
|
72
|
+
|
|
73
|
+
Generate team-providers.json entry:
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
"{team}": {
|
|
77
|
+
"coordinator": {
|
|
78
|
+
"provider": "anthropic",
|
|
79
|
+
"apiKeyEnvVar": "{TEAM}_COORDINATOR_API_KEY",
|
|
80
|
+
"subscription": "claude-max-{team}",
|
|
81
|
+
"model": "claude-sonnet-4-20250514"
|
|
82
|
+
},
|
|
83
|
+
"workers": {
|
|
84
|
+
"provider": "zai",
|
|
85
|
+
"apiKeyEnvVar": "ANTHROPIC_AUTH_TOKEN",
|
|
86
|
+
"billing": "pay-as-you-go",
|
|
87
|
+
"defaultModel": "claude-3-5-haiku-20241022",
|
|
88
|
+
"complexModel": "claude-3-5-sonnet-20241022"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 4. Network and Volume Definitions
|
|
94
|
+
|
|
95
|
+
Generate isolated network and playbook storage:
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
networks:
|
|
99
|
+
{team}-network:
|
|
100
|
+
internal: true # Workers can't access external network
|
|
101
|
+
|
|
102
|
+
volumes:
|
|
103
|
+
{team}-playbooks: # Persistent playbook storage
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 5. MCP Configuration (Optional)
|
|
107
|
+
|
|
108
|
+
Generate team-specific MCP server config if needed:
|
|
109
|
+
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"mcpServers": {
|
|
113
|
+
"{team}-n8n": {
|
|
114
|
+
"command": "npx",
|
|
115
|
+
"args": ["-y", "n8n-mcp"],
|
|
116
|
+
"env": {
|
|
117
|
+
"N8N_API_URL": "https://n8n.{team}.example.com",
|
|
118
|
+
"N8N_API_KEY": "${{{TEAM}_N8N_API_KEY}}"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Usage Patterns
|
|
126
|
+
|
|
127
|
+
### Pattern 1: Generate Single Team Config
|
|
128
|
+
|
|
129
|
+
**Task:** Generate coordinator configuration for marketing team
|
|
130
|
+
|
|
131
|
+
**Input Required:**
|
|
132
|
+
- Team name: "marketing"
|
|
133
|
+
- Agent count: 10
|
|
134
|
+
- Concurrent workers: 3-5
|
|
135
|
+
- Specializations: email-campaigns, social-publishing, analytics, etc.
|
|
136
|
+
|
|
137
|
+
**Output:**
|
|
138
|
+
- docker-compose service entry
|
|
139
|
+
- .env variable template
|
|
140
|
+
- team-providers.json entry
|
|
141
|
+
- Network and volume definitions
|
|
142
|
+
|
|
143
|
+
**Example:**
|
|
144
|
+
```bash
|
|
145
|
+
Task("team-coordinator-template", "
|
|
146
|
+
Generate coordinator configuration for marketing team.
|
|
147
|
+
|
|
148
|
+
Team Details:
|
|
149
|
+
- Name: marketing
|
|
150
|
+
- Agents: 10 (email-campaigns, social-publishing, analytics-data, crm-contacts, paid-ads, chatbot-conversations, sms-campaigns, competitive-intelligence, landing-pages, press-distribution)
|
|
151
|
+
- Concurrent workers: 3-5
|
|
152
|
+
- Coordinator API key: MARKETING_COORDINATOR_API_KEY
|
|
153
|
+
|
|
154
|
+
Outputs:
|
|
155
|
+
1. docker/compose/marketing-coordinator.yml (service definition)
|
|
156
|
+
2. docker/.env.marketing.example (environment variables)
|
|
157
|
+
3. .claude/cfn-config/team-providers-marketing.json (routing config)
|
|
158
|
+
4. docker/compose/marketing-networks.yml (network + volume)
|
|
159
|
+
")
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Pattern 2: Generate All Teams at Once
|
|
163
|
+
|
|
164
|
+
**Task:** Generate configurations for all 5 teams
|
|
165
|
+
|
|
166
|
+
**Input Required:**
|
|
167
|
+
- Epic config file: `planning/docker/03-cfn-organizational-architecture-epic-EXECUTE.json`
|
|
168
|
+
|
|
169
|
+
**Process:**
|
|
170
|
+
1. Read epic config to extract team details
|
|
171
|
+
2. For each team (marketing, engineering, sales, support, finance):
|
|
172
|
+
- Extract agent count and specializations
|
|
173
|
+
- Generate docker-compose service
|
|
174
|
+
- Generate .env template
|
|
175
|
+
- Generate team-providers.json entry
|
|
176
|
+
3. Combine into master files:
|
|
177
|
+
- docker-compose.hybrid.yml (all services)
|
|
178
|
+
- .env.hybrid.example (all variables)
|
|
179
|
+
- .claude/cfn-config/team-providers.json (all teams)
|
|
180
|
+
|
|
181
|
+
**Example:**
|
|
182
|
+
```bash
|
|
183
|
+
Task("team-coordinator-template", "
|
|
184
|
+
Generate coordinator configurations for ALL teams.
|
|
185
|
+
|
|
186
|
+
Read: planning/docker/03-cfn-organizational-architecture-epic-EXECUTE.json
|
|
187
|
+
|
|
188
|
+
Extract team details from epic config and generate:
|
|
189
|
+
1. docker-compose.hybrid.yml (all 5 coordinator services)
|
|
190
|
+
2. .env.hybrid.example (all team API keys)
|
|
191
|
+
3. .claude/cfn-config/team-providers.json (all team routing)
|
|
192
|
+
4. docker/compose/networks.yml (all networks + volumes)
|
|
193
|
+
|
|
194
|
+
Teams: marketing, engineering, sales, support, finance
|
|
195
|
+
")
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Pattern 3: Update Existing Team Config
|
|
199
|
+
|
|
200
|
+
**Task:** Add new agent to existing team
|
|
201
|
+
|
|
202
|
+
**Input Required:**
|
|
203
|
+
- Team: "engineering"
|
|
204
|
+
- New agent: "mobile-dev"
|
|
205
|
+
- Update docker-compose to reflect 16 agents (was 15)
|
|
206
|
+
|
|
207
|
+
**Process:**
|
|
208
|
+
1. Read existing docker-compose.hybrid.yml
|
|
209
|
+
2. Find engineering-coordinator service
|
|
210
|
+
3. Update environment variable: ENGINEERING_AGENT_COUNT=16
|
|
211
|
+
4. Add mobile-dev to specializations comment
|
|
212
|
+
5. Write updated file
|
|
213
|
+
|
|
214
|
+
**Example:**
|
|
215
|
+
```bash
|
|
216
|
+
Task("team-coordinator-template", "
|
|
217
|
+
Add mobile-dev agent to engineering team.
|
|
218
|
+
|
|
219
|
+
Current state: 15 agents
|
|
220
|
+
New state: 16 agents (add mobile-dev)
|
|
221
|
+
|
|
222
|
+
Update:
|
|
223
|
+
1. docker-compose.hybrid.yml (ENGINEERING_AGENT_COUNT=16)
|
|
224
|
+
2. .env.hybrid.example (comment: 16 agents including mobile-dev)
|
|
225
|
+
3. planning/docker/02-cfn-epic-config-SUMMARY.json (update agent count)
|
|
226
|
+
")
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Input Specifications
|
|
230
|
+
|
|
231
|
+
### Team Definition Structure
|
|
232
|
+
|
|
233
|
+
Expect team details in this format:
|
|
234
|
+
|
|
235
|
+
```json
|
|
236
|
+
{
|
|
237
|
+
"teamId": "marketing",
|
|
238
|
+
"name": "Marketing Department",
|
|
239
|
+
"agentCount": 10,
|
|
240
|
+
"concurrentWorkers": "3-5",
|
|
241
|
+
"coordinator": {
|
|
242
|
+
"apiKeyEnvVar": "MARKETING_COORDINATOR_API_KEY",
|
|
243
|
+
"subscription": "claude-max-marketing"
|
|
244
|
+
},
|
|
245
|
+
"specializations": [
|
|
246
|
+
"email-campaigns",
|
|
247
|
+
"social-publishing",
|
|
248
|
+
"analytics-data",
|
|
249
|
+
"crm-contacts",
|
|
250
|
+
"paid-ads",
|
|
251
|
+
"chatbot-conversations",
|
|
252
|
+
"sms-campaigns",
|
|
253
|
+
"competitive-intelligence",
|
|
254
|
+
"landing-pages",
|
|
255
|
+
"press-distribution"
|
|
256
|
+
]
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Template Variables
|
|
261
|
+
|
|
262
|
+
Use these variable patterns:
|
|
263
|
+
|
|
264
|
+
- `{team}` → Team ID (lowercase, e.g., "marketing")
|
|
265
|
+
- `{TEAM}` → Team ID (uppercase, e.g., "MARKETING")
|
|
266
|
+
- `{Team}` → Team name (capitalized, e.g., "Marketing")
|
|
267
|
+
- `{count}` → Agent count (e.g., 10)
|
|
268
|
+
- `{concurrent}` → Concurrent workers (e.g., "3-5")
|
|
269
|
+
|
|
270
|
+
## Output File Locations
|
|
271
|
+
|
|
272
|
+
### Primary Outputs
|
|
273
|
+
|
|
274
|
+
1. **Docker Compose:**
|
|
275
|
+
- `docker/compose/docker-compose.hybrid.yml` (master file, all teams)
|
|
276
|
+
- `docker/compose/{team}-coordinator.yml` (individual team, optional)
|
|
277
|
+
|
|
278
|
+
2. **Environment Variables:**
|
|
279
|
+
- `docker/.env.hybrid.example` (master template, all teams)
|
|
280
|
+
- `docker/.env.{team}.example` (individual team, optional)
|
|
281
|
+
|
|
282
|
+
3. **Team Provider Config:**
|
|
283
|
+
- `.claude/cfn-config/team-providers.json` (master, all teams)
|
|
284
|
+
- `.claude/cfn-config/team-providers-{team}.json` (individual, optional)
|
|
285
|
+
|
|
286
|
+
4. **Network Definitions:**
|
|
287
|
+
- `docker/compose/networks.yml` (all networks + volumes)
|
|
288
|
+
|
|
289
|
+
### Secondary Outputs (Optional)
|
|
290
|
+
|
|
291
|
+
5. **MCP Configs:**
|
|
292
|
+
- `docker/mcp/{team}-mcp.json` (if team has custom MCP servers)
|
|
293
|
+
|
|
294
|
+
6. **Documentation:**
|
|
295
|
+
- `docker/docs/{team}-coordinator-setup.md` (setup guide per team)
|
|
296
|
+
|
|
297
|
+
## Validation Checklist
|
|
298
|
+
|
|
299
|
+
Before marking complete, verify:
|
|
300
|
+
|
|
301
|
+
- [ ] Docker compose syntax valid (`docker-compose config --quiet`)
|
|
302
|
+
- [ ] Environment variables follow naming convention (`{TEAM}_*`)
|
|
303
|
+
- [ ] Team provider JSON schema valid (`jq empty team-providers.json`)
|
|
304
|
+
- [ ] Network names unique per team (`{team}-network`)
|
|
305
|
+
- [ ] Volume names unique per team (`{team}-playbooks`)
|
|
306
|
+
- [ ] API key env vars match between .env and docker-compose
|
|
307
|
+
- [ ] All 5 teams present (marketing, engineering, sales, support, finance)
|
|
308
|
+
- [ ] Coordinator mesh network allows cross-team communication
|
|
309
|
+
- [ ] Team networks are internal (workers isolated)
|
|
310
|
+
|
|
311
|
+
## Error Handling
|
|
312
|
+
|
|
313
|
+
### Common Issues
|
|
314
|
+
|
|
315
|
+
**1. Duplicate network names:**
|
|
316
|
+
```
|
|
317
|
+
Error: network "marketing-network" already exists
|
|
318
|
+
Fix: Check docker-compose.hybrid.yml for duplicate network definitions
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
**2. Missing environment variables:**
|
|
322
|
+
```
|
|
323
|
+
Error: MARKETING_COORDINATOR_API_KEY not set
|
|
324
|
+
Fix: Ensure .env.hybrid.example includes all team API keys
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
**3. Invalid JSON in team-providers.json:**
|
|
328
|
+
```
|
|
329
|
+
Error: parse error: Invalid numeric literal at line 15, column 10
|
|
330
|
+
Fix: Use `jq empty team-providers.json` to validate syntax
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
**4. API key naming mismatch:**
|
|
334
|
+
```
|
|
335
|
+
docker-compose: MARKETING_COORDINATOR_API_KEY
|
|
336
|
+
.env: MARKETING_API_KEY
|
|
337
|
+
Fix: Standardize on {TEAM}_COORDINATOR_API_KEY pattern
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
## Best Practices
|
|
341
|
+
|
|
342
|
+
### 1. Use Consistent Naming
|
|
343
|
+
|
|
344
|
+
**Good:**
|
|
345
|
+
- Environment var: `MARKETING_COORDINATOR_API_KEY`
|
|
346
|
+
- Service name: `marketing-coordinator`
|
|
347
|
+
- Network: `marketing-network`
|
|
348
|
+
- Volume: `marketing-playbooks`
|
|
349
|
+
|
|
350
|
+
**Bad:**
|
|
351
|
+
- Mixed case: `Marketing_Coordinator_API_KEY`
|
|
352
|
+
- Inconsistent prefix: `COORDINATOR_MARKETING_API_KEY`
|
|
353
|
+
- Missing separator: `marketingcoordinator`
|
|
354
|
+
|
|
355
|
+
### 2. Document Team-Specific Settings
|
|
356
|
+
|
|
357
|
+
Add comments to generated configs:
|
|
358
|
+
|
|
359
|
+
```yaml
|
|
360
|
+
# Marketing Team (10 agents, 3-5 concurrent workers)
|
|
361
|
+
# Specializations: email-campaigns, social-publishing, analytics
|
|
362
|
+
marketing-coordinator:
|
|
363
|
+
# ... service definition
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### 3. Validate Before Writing
|
|
367
|
+
|
|
368
|
+
Always validate generated configs:
|
|
369
|
+
|
|
370
|
+
```bash
|
|
371
|
+
# Validate docker-compose
|
|
372
|
+
docker-compose -f docker-compose.hybrid.yml config --quiet
|
|
373
|
+
|
|
374
|
+
# Validate JSON
|
|
375
|
+
jq empty .claude/cfn-config/team-providers.json
|
|
376
|
+
|
|
377
|
+
# Validate environment variables
|
|
378
|
+
grep -E "^[A-Z_]+=" .env.hybrid.example
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
### 4. Preserve Existing Configs
|
|
382
|
+
|
|
383
|
+
When updating existing files:
|
|
384
|
+
1. Read current file
|
|
385
|
+
2. Extract team-specific section
|
|
386
|
+
3. Update only that section
|
|
387
|
+
4. Write back (don't overwrite entire file)
|
|
388
|
+
|
|
389
|
+
### 5. Generate Incremental Configs
|
|
390
|
+
|
|
391
|
+
Support both modes:
|
|
392
|
+
- **Full generation:** All 5 teams at once (Phase 1 Sprint 1.2)
|
|
393
|
+
- **Incremental:** Add/update single team (Phase 2 Sprints 2.1-2.4)
|
|
394
|
+
|
|
395
|
+
## Example Workflow
|
|
396
|
+
|
|
397
|
+
### Scenario: Phase 1 Sprint 1.2 (Week 1, Days 4-7)
|
|
398
|
+
|
|
399
|
+
**Goal:** Generate all coordinator configurations for hybrid architecture
|
|
400
|
+
|
|
401
|
+
**Step 1: Read Epic Config**
|
|
402
|
+
```bash
|
|
403
|
+
Read: planning/docker/03-cfn-organizational-architecture-epic-EXECUTE.json
|
|
404
|
+
# Extract: 5 teams, agent counts, specializations
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
**Step 2: Generate Docker Compose**
|
|
408
|
+
```bash
|
|
409
|
+
Write: docker/compose/docker-compose.hybrid.yml
|
|
410
|
+
# Include: 5 coordinator services, redis, postgres, grafana, prometheus
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
**Step 3: Generate Environment Template**
|
|
414
|
+
```bash
|
|
415
|
+
Write: docker/.env.hybrid.example
|
|
416
|
+
# Include: 5 team API keys, ZAI_API_KEY, REDIS_URL, POSTGRES_URL
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
**Step 4: Generate Team Providers**
|
|
420
|
+
```bash
|
|
421
|
+
Write: .claude/cfn-config/team-providers.json
|
|
422
|
+
# Include: 5 team entries (coordinator + worker configs)
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
**Step 5: Generate Networks**
|
|
426
|
+
```bash
|
|
427
|
+
Write: docker/compose/networks.yml
|
|
428
|
+
# Include: 5 team networks (internal), coordinator-mesh (external)
|
|
429
|
+
# Include: 5 team volumes, redis-data, postgres-data, grafana-data
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
**Step 6: Validate**
|
|
433
|
+
```bash
|
|
434
|
+
Bash: docker-compose -f docker/compose/docker-compose.hybrid.yml config --quiet
|
|
435
|
+
Bash: jq empty .claude/cfn-config/team-providers.json
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
**Step 7: Report Confidence**
|
|
439
|
+
```
|
|
440
|
+
Confidence: 0.95 (all configs generated and validated)
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
## Integration with Other Agents
|
|
444
|
+
|
|
445
|
+
**Works with:**
|
|
446
|
+
- `docker-specialist` - Reviews generated Docker configs
|
|
447
|
+
- `devops-engineer` - Validates infrastructure setup
|
|
448
|
+
- `security-specialist` - Audits API key handling
|
|
449
|
+
- `reviewer` - Code review of generated configs
|
|
450
|
+
|
|
451
|
+
**Coordinates with:**
|
|
452
|
+
- `cfn-v3-coordinator` - Uses generated configs for team deployment
|
|
453
|
+
- `monitoring-specialist` - References team configs for dashboards
|
|
454
|
+
|
|
455
|
+
## Success Criteria
|
|
456
|
+
|
|
457
|
+
**Sprint 1.2 Complete When:**
|
|
458
|
+
- ✅ docker-compose.hybrid.yml created (5 coordinators + infrastructure)
|
|
459
|
+
- ✅ .env.hybrid.example created (all team API keys documented)
|
|
460
|
+
- ✅ team-providers.json created (coordinator/worker routing)
|
|
461
|
+
- ✅ Docker compose syntax validates
|
|
462
|
+
- ✅ JSON schema validates
|
|
463
|
+
- ✅ All 5 teams included (marketing, engineering, sales, support, finance)
|
|
464
|
+
- ✅ Network isolation configured (team networks internal, mesh external)
|
|
465
|
+
- ✅ Volume persistence configured (playbooks per team)
|
|
466
|
+
|
|
467
|
+
**Confidence Threshold:** ≥0.90 (configs must be production-ready)
|
|
@@ -15,6 +15,23 @@ Task Mode: Main Chat spawns coordinator and agents via Task() tool with full con
|
|
|
15
15
|
| **Provider** | All Anthropic | CLI uses Z.ai routing |
|
|
16
16
|
| **Cost** | ~$0.150/iteration | ~$0.054/iteration (64% savings) |
|
|
17
17
|
| **Use Case** | Debugging, prototyping, learning | Production, cost optimization |
|
|
18
|
+
| **ACE Reflection** | Optional via `--ace-reflect` flag | Always enabled |
|
|
19
|
+
|
|
20
|
+
### ACE Reflection Flag
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Enable ACE reflection after each sprint (captures lessons learned)
|
|
24
|
+
/cfn-loop "Task description" --spawn-mode=task --ace-reflect
|
|
25
|
+
|
|
26
|
+
# Without ACE reflection (default for backwards compatibility)
|
|
27
|
+
/cfn-loop "Task description" --spawn-mode=task
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**When to use `--ace-reflect`:**
|
|
31
|
+
- Long-running epics (3+ sprints) where learning accumulates
|
|
32
|
+
- Complex tasks with multiple iterations
|
|
33
|
+
- Teams building organizational knowledge
|
|
34
|
+
- Post-mortem analysis and continuous improvement
|
|
18
35
|
|
|
19
36
|
---
|
|
20
37
|
|
|
@@ -144,9 +161,30 @@ Iterations: Loop 3: ${L3}, Loop 2: ${L2} | Decision: PROCEED
|
|
|
144
161
|
EOF
|
|
145
162
|
```
|
|
146
163
|
|
|
164
|
+
### 5. ACE Reflection (Optional - If `--ace-reflect` flag enabled)
|
|
165
|
+
```bash
|
|
166
|
+
# Only run if --ace-reflect flag was passed to /cfn-loop command
|
|
167
|
+
if [[ "$ACE_REFLECT_ENABLED" == "true" ]]; then
|
|
168
|
+
echo "📊 Capturing ACE reflection..."
|
|
169
|
+
./.claude/skills/cfn-ace-system/invoke-context-reflect.sh \
|
|
170
|
+
--task-id "${TASK_ID}" \
|
|
171
|
+
--sprint-id "${SPRINT_NUM}" \
|
|
172
|
+
--consensus "${CONSENSUS}" \
|
|
173
|
+
--iterations-loop3 "${L3}" \
|
|
174
|
+
--iterations-loop2 "${L2}" \
|
|
175
|
+
--deliverables "$(git diff HEAD~1 --name-only | tr '\n' ',')"
|
|
176
|
+
|
|
177
|
+
# Output: Stores reflection in SQLite with tags, confidence, priority
|
|
178
|
+
# Categories: PATTERN, STRAT, ANTI, EDGE
|
|
179
|
+
# Automatic tag extraction and deduplication
|
|
180
|
+
echo "✅ ACE reflection captured: $(sqlite3 .claude/cfn-data/cfn-loop.db 'SELECT COUNT(*) FROM context_reflections WHERE task_id = \"'${TASK_ID}'\"') bullets"
|
|
181
|
+
fi
|
|
182
|
+
```
|
|
183
|
+
|
|
147
184
|
**Checklist:**
|
|
148
185
|
- [ ] Consensus ≥ threshold | [ ] Product Owner approved | [ ] Deliverables verified
|
|
149
186
|
- [ ] Tests passing | [ ] Git committed | [ ] Git pushed | [ ] Summary generated
|
|
187
|
+
- [ ] ACE reflection captured (if `--ace-reflect` enabled)
|
|
150
188
|
|
|
151
189
|
---
|
|
152
190
|
|
|
@@ -341,12 +379,68 @@ Complex/Enterprise (>5 files, >500 LOC): +code-analyzer
|
|
|
341
379
|
|
|
342
380
|
---
|
|
343
381
|
|
|
382
|
+
## ACE System Integration
|
|
383
|
+
|
|
384
|
+
### Reflection After Sprint
|
|
385
|
+
After each sprint completion, Task Mode should capture lessons learned:
|
|
386
|
+
|
|
387
|
+
```bash
|
|
388
|
+
# Automatic reflection capture (called after git push)
|
|
389
|
+
./.claude/skills/cfn-ace-system/invoke-context-reflect.sh \
|
|
390
|
+
--task-id "${TASK_ID}" \
|
|
391
|
+
--sprint-id "${SPRINT_NUM}" \
|
|
392
|
+
--consensus "${CONSENSUS}" \
|
|
393
|
+
--iterations-loop3 "${L3}" \
|
|
394
|
+
--iterations-loop2 "${L2}" \
|
|
395
|
+
--deliverables "$(git diff HEAD~1 --name-only | tr '\n' ',')"
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
**What Gets Captured:**
|
|
399
|
+
- Patterns that worked well (consensus ≥0.90, low iterations)
|
|
400
|
+
- Anti-patterns that caused issues (high iterations, deliverable failures)
|
|
401
|
+
- Strategy patterns (agent selection, validator scaling effectiveness)
|
|
402
|
+
- Edge cases (timeout scenarios, race conditions, blocking issues)
|
|
403
|
+
|
|
404
|
+
**Storage:**
|
|
405
|
+
- SQLite database: `.claude/cfn-data/cfn-loop.db`
|
|
406
|
+
- Table: `context_reflections`
|
|
407
|
+
- Automatic tagging, deduplication, confidence scoring
|
|
408
|
+
|
|
409
|
+
**Benefits:**
|
|
410
|
+
- Future sprints learn from past mistakes
|
|
411
|
+
- Adaptive validator scaling improves over time
|
|
412
|
+
- Pattern recognition across projects
|
|
413
|
+
- Knowledge accumulation (not lost between sessions)
|
|
414
|
+
|
|
415
|
+
### Optional: Context Injection (Future Enhancement)
|
|
416
|
+
Before spawning agents, inject relevant lessons:
|
|
417
|
+
```bash
|
|
418
|
+
# Not yet implemented in Task Mode, but available:
|
|
419
|
+
./.claude/skills/cfn-ace-system/invoke-context-inject.sh \
|
|
420
|
+
--task "${TASK_DESCRIPTION}" \
|
|
421
|
+
--phase "${PHASE_NAME}" \
|
|
422
|
+
--tags "validation,consensus,deliverables"
|
|
423
|
+
# Returns: Top N relevant bullets from past reflections
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### Optional: Context Curation (Periodic Maintenance)
|
|
427
|
+
Merge and deduplicate reflection data:
|
|
428
|
+
```bash
|
|
429
|
+
# Run monthly or after major epics:
|
|
430
|
+
./.claude/skills/cfn-ace-system/invoke-context-curate.sh \
|
|
431
|
+
--confidence-threshold 0.85 \
|
|
432
|
+
--merge-similar-patterns
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
344
437
|
## Related Documentation
|
|
345
438
|
|
|
346
439
|
- **CFN Coordinator Parameters**: `.claude/commands/cfn/CFN_COORDINATOR_PARAMETERS.md`
|
|
347
440
|
- **Redis Coordination**: `.claude/skills/cfn-redis-coordination/SKILL.md`
|
|
348
441
|
- **Product Owner Decision**: `.claude/skills/cfn-product-owner-decision/SKILL.md`
|
|
349
442
|
- **Agent Output Standards**: `docs/AGENT_OUTPUT_STANDARDS.md`
|
|
443
|
+
- **ACE System**: `.claude/skills/cfn-ace-system/SKILL.md`
|
|
350
444
|
|
|
351
445
|
---
|
|
352
446
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Execute autonomous 3-loop self-correcting CFN workflow with automatic retry and consensus validation"
|
|
3
|
-
argument-hint: "<task description> [--phase=name] [--mode=mvp|standard|enterprise] [--spawn-mode=cli|task] [--max-loop2=10] [--max-loop3=10]"
|
|
3
|
+
argument-hint: "<task description> [--phase=name] [--mode=mvp|standard|enterprise] [--spawn-mode=cli|task] [--max-loop2=10] [--max-loop3=10] [--ace-reflect]"
|
|
4
4
|
allowed-tools: ["Task", "TodoWrite", "Read", "Write", "Edit", "Bash", "Glob", "Grep"]
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -38,10 +38,11 @@ LOOP 3: Primary Swarm Execution with subtask iterations
|
|
|
38
38
|
- `--phase=<name>`: Optional phase name for tracking
|
|
39
39
|
- `--mode=<mvp|standard|enterprise>`: Coordinator mode (default: standard)
|
|
40
40
|
- `--spawn-mode=<cli|task>`: Agent spawning method (default: cli)
|
|
41
|
-
- **cli**: Cost-optimized (95-98% savings), background execution, Redis monitoring
|
|
42
|
-
- **task**: Full visibility in Main Chat, direct spawning, debugging
|
|
41
|
+
- **cli**: Cost-optimized (95-98% savings), background execution, Redis monitoring, ACE always enabled
|
|
42
|
+
- **task**: Full visibility in Main Chat, direct spawning, debugging, ACE optional via flag
|
|
43
43
|
- `--max-loop2=<n>`: Max consensus iterations (default: 10)
|
|
44
44
|
- `--max-loop3=<n>`: Max primary swarm iterations (default: 10)
|
|
45
|
+
- `--ace-reflect`: Enable ACE reflection after each sprint (Task mode only, captures lessons learned)
|
|
45
46
|
|
|
46
47
|
## Coordinator Modes
|
|
47
48
|
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Security Validation Hook for Docker Hybrid Routing
|
|
3
|
+
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
# Validate secret management configurations
|
|
7
|
+
validate_secret_management() {
|
|
8
|
+
local file_path="$1"
|
|
9
|
+
|
|
10
|
+
# Check for hardcoded secrets
|
|
11
|
+
if grep -qE '(sk-ant-|token-|api_key=)' "$file_path"; then
|
|
12
|
+
echo "❌ SECURITY RISK: Potential secret exposure in $file_path"
|
|
13
|
+
return 1
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
# Check for proper environment variable naming
|
|
17
|
+
if grep -qE 'API_KEY=|SECRET=|TOKEN=' "$file_path"; then
|
|
18
|
+
echo "⚠️ NAMING RISK: Inconsistent secret variable names in $file_path"
|
|
19
|
+
return 2
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
return 0
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
# Validate Docker network configurations
|
|
26
|
+
validate_docker_network() {
|
|
27
|
+
local compose_file="$1"
|
|
28
|
+
|
|
29
|
+
# Check for overly permissive network configurations
|
|
30
|
+
if ! grep -qE 'driver_opts:\n\s*encrypted:\s*"true"' "$compose_file"; then
|
|
31
|
+
echo "❌ NETWORK RISK: Network encryption not enabled"
|
|
32
|
+
return 1
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
if ! grep -qE 'driver:\s*overlay' "$compose_file"; then
|
|
36
|
+
echo "⚠️ NETWORK CONFIG: Recommended to use overlay network for better isolation"
|
|
37
|
+
return 2
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
return 0
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
# Main validation function
|
|
44
|
+
main() {
|
|
45
|
+
local file_path="$1"
|
|
46
|
+
local file_name=$(basename "$file_path")
|
|
47
|
+
local exit_code=0
|
|
48
|
+
|
|
49
|
+
echo "🔒 Running security validation for $file_name"
|
|
50
|
+
|
|
51
|
+
case "$file_name" in
|
|
52
|
+
docker-compose.yml|docker-compose.*.yml)
|
|
53
|
+
validate_docker_network "$file_path" || exit_code=$?
|
|
54
|
+
;;
|
|
55
|
+
.env|*.env)
|
|
56
|
+
validate_secret_management "$file_path" || exit_code=$?
|
|
57
|
+
;;
|
|
58
|
+
esac
|
|
59
|
+
|
|
60
|
+
if [ $exit_code -eq 0 ]; then
|
|
61
|
+
echo "✅ Security validation passed for $file_name"
|
|
62
|
+
else
|
|
63
|
+
echo "🚨 Security validation failed for $file_name (Error code: $exit_code)"
|
|
64
|
+
fi
|
|
65
|
+
|
|
66
|
+
return $exit_code
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
# Execute main validation
|
|
70
|
+
main "$@"
|