claude-flow-novice 2.12.0 → 2.14.0
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/README.md +177 -129
- package/claude-assets/commands/cfn/README.md +177 -129
- package/claude-assets/commands/cfn/cfn-loop-cli.md +279 -0
- package/claude-assets/commands/cfn/cfn-loop-document.md +20 -1
- package/claude-assets/commands/cfn/cfn-loop-frontend.md +17 -2
- package/claude-assets/commands/cfn/cfn-loop-task.md +460 -0
- package/claude-assets/commands/cfn/context-curate.md +27 -38
- package/claude-assets/commands/cfn/context-inject.md +14 -25
- package/claude-assets/commands/cfn/context-query.md +40 -45
- package/claude-assets/commands/cfn/context-reflect.md +40 -38
- package/claude-assets/commands/cfn/context-stats.md +13 -38
- package/claude-assets/commands/cfn/launch-web-dashboard.md +0 -295
- package/claude-assets/commands/cfn/list-agents-rebuild.md +18 -18
- package/claude-assets/commands/cfn/write-plan.md +246 -75
- package/dist/agents/agent-loader.js +165 -146
- package/dist/agents/agent-loader.js.map +1 -1
- package/dist/cli/config-manager.js.map +1 -1
- package/package.json +1 -1
- package/claude-assets/commands/cfn/auto-compact.md +0 -80
- package/claude-assets/commands/cfn/cfn-loop-epic.md +0 -478
- package/claude-assets/commands/cfn/cfn-loop-single.md +0 -256
- package/claude-assets/commands/cfn/cfn-loop-sprints.md +0 -396
- package/claude-assets/commands/cfn/cfn-loop.md +0 -518
- package/claude-assets/commands/cfn/claude-md.md +0 -64
- package/claude-assets/commands/cfn/claude-soul.md +0 -22
- package/claude-assets/commands/cfn/cost-savings-off.md +0 -35
- package/claude-assets/commands/cfn/cost-savings-on.md +0 -35
- package/claude-assets/commands/cfn/cost-savings-status.md +0 -34
- package/claude-assets/commands/cfn/custom-routing-activate.md +0 -55
- package/claude-assets/commands/cfn/custom-routing-deactivate.md +0 -46
- package/claude-assets/commands/cfn/dependency-recommendations.md +0 -171
- package/claude-assets/commands/cfn/fullstack.md +0 -179
- package/claude-assets/commands/cfn/github.md +0 -221
- package/claude-assets/commands/cfn/hooks.md +0 -38
- package/claude-assets/commands/cfn/metrics-summary.md +0 -58
- package/claude-assets/commands/cfn/neural.md +0 -39
- package/claude-assets/commands/cfn/parse-epic.md +0 -357
- package/claude-assets/commands/cfn/performance.md +0 -41
- package/claude-assets/commands/cfn/sparc.md +0 -46
- package/claude-assets/commands/cfn/suggest-improvements.md +0 -95
- package/claude-assets/commands/cfn/suggest-templates.md +0 -147
- package/claude-assets/commands/cfn/swarm.md +0 -24
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Execute CFN Loop in Task mode (debugging, full visibility, Main Chat coordination)"
|
|
3
|
+
argument-hint: "<task description> [--mode=mvp|standard|enterprise] [--max-iterations=n] [--ace-reflect]"
|
|
4
|
+
allowed-tools: ["Task", "TodoWrite", "Read", "Write", "Edit", "Bash", "Glob", "Grep"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 🚨 TASK MODE INSTRUCTIONS FOR MAIN CHAT
|
|
8
|
+
|
|
9
|
+
**YOU are executing this CFN Loop. These are YOUR instructions.**
|
|
10
|
+
|
|
11
|
+
**Task to execute**: $ARGUMENTS
|
|
12
|
+
|
|
13
|
+
## MODE: Task Mode (Full Visibility, Direct Coordination)
|
|
14
|
+
|
|
15
|
+
**CRITICAL RULES:**
|
|
16
|
+
1. ❌ **DO NOT spawn cfn-v3-coordinator** - that's for CLI mode
|
|
17
|
+
2. ❌ **DO NOT ask user "which mode?"** - they already chose Task mode
|
|
18
|
+
3. ❌ **DO NOT offer options** - execute these instructions directly
|
|
19
|
+
4. ✅ **YOU spawn all agents** using Task() tool
|
|
20
|
+
5. ✅ **YOU coordinate the entire workflow** step by step
|
|
21
|
+
6. ✅ **Follow the 9-step workflow below** exactly
|
|
22
|
+
|
|
23
|
+
## What is Task Mode?
|
|
24
|
+
|
|
25
|
+
**Task Mode Architecture:**
|
|
26
|
+
- Main Chat coordinates **entire workflow directly**
|
|
27
|
+
- **NO coordinator agent** spawned
|
|
28
|
+
- Main Chat spawns **all agents via Task()**
|
|
29
|
+
- All agents use **Anthropic provider** (Main Chat provider)
|
|
30
|
+
- **Full visibility** in Main Chat (every agent output visible)
|
|
31
|
+
- **Simplified workflow** for debugging and learning
|
|
32
|
+
|
|
33
|
+
**Cost Breakdown:**
|
|
34
|
+
```
|
|
35
|
+
┌─────────────────────┬──────────────┬────────────┐
|
|
36
|
+
│ Component │ Provider │ Cost/Call │
|
|
37
|
+
├─────────────────────┼──────────────┼────────────┤
|
|
38
|
+
│ Main Chat │ Anthropic │ $0.015 │
|
|
39
|
+
│ Loop 3 Agents │ Anthropic │ $0.015 ea │
|
|
40
|
+
│ Loop 2 Agents │ Anthropic │ $0.015 ea │
|
|
41
|
+
│ Product Owner │ Anthropic │ $0.015 │
|
|
42
|
+
└─────────────────────┴──────────────┴────────────┘
|
|
43
|
+
|
|
44
|
+
Total per iteration: ~$0.150 (vs $0.054 CLI mode)
|
|
45
|
+
Cost: 3x CLI mode, but full visibility for debugging
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## When to Use Task Mode
|
|
49
|
+
|
|
50
|
+
**Use Task Mode for:**
|
|
51
|
+
- ✅ Debugging CFN Loop issues
|
|
52
|
+
- ✅ Learning CFN Loop workflow
|
|
53
|
+
- ✅ Understanding agent interactions
|
|
54
|
+
- ✅ Prototyping new agent configurations
|
|
55
|
+
- ✅ Short tasks (<5 min)
|
|
56
|
+
|
|
57
|
+
**Use CLI Mode for:**
|
|
58
|
+
- Production features
|
|
59
|
+
- Long-running tasks (>10 min)
|
|
60
|
+
- Multi-iteration workflows
|
|
61
|
+
- Cost-sensitive projects
|
|
62
|
+
|
|
63
|
+
## Command Options
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Standard mode (recommended)
|
|
67
|
+
/cfn-loop-task "Implement JWT authentication"
|
|
68
|
+
|
|
69
|
+
# MVP mode (fast, lower quality gates)
|
|
70
|
+
/cfn-loop-task "Build prototype feature" --mode=mvp
|
|
71
|
+
|
|
72
|
+
# Enterprise mode with ACE reflection
|
|
73
|
+
/cfn-loop-task "Production security feature" --mode=enterprise --ace-reflect
|
|
74
|
+
|
|
75
|
+
# Custom iteration limits
|
|
76
|
+
/cfn-loop-task "Refactor API" --mode=standard --max-iterations=15
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Options:**
|
|
80
|
+
- `--mode=<mvp|standard|enterprise>`: Quality mode (default: standard)
|
|
81
|
+
- `--max-iterations=<n>`: Max iterations per loop (default: 10)
|
|
82
|
+
- `--ace-reflect`: Enable ACE reflection after sprint (captures lessons learned)
|
|
83
|
+
|
|
84
|
+
## Mode Comparison
|
|
85
|
+
|
|
86
|
+
| Mode | Gate | Consensus | Iterations | Validators | Use Case |
|
|
87
|
+
|------|------|-----------|------------|------------|----------|
|
|
88
|
+
| MVP | ≥0.70 | ≥0.80 | 5 | 2 | Prototypes, proof-of-concept |
|
|
89
|
+
| Standard | ≥0.75 | ≥0.90 | 10 | 3-4 | Production features |
|
|
90
|
+
| Enterprise | ≥0.85 | ≥0.95 | 15 | 5 | Security, compliance, critical systems |
|
|
91
|
+
|
|
92
|
+
## 🚨 CRITICAL EXECUTION INSTRUCTIONS
|
|
93
|
+
|
|
94
|
+
**YOU ARE MAIN CHAT. YOU COORDINATE THIS ENTIRE WORKFLOW.**
|
|
95
|
+
|
|
96
|
+
**DO NOT spawn cfn-v3-coordinator or any coordinator agent.**
|
|
97
|
+
**DO NOT ask user which mode to use.**
|
|
98
|
+
**DO NOT offer options.**
|
|
99
|
+
|
|
100
|
+
You must execute this CFN Loop directly using the Task() tool to spawn agents.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
### Step 1: Read Task Mode Guide
|
|
105
|
+
|
|
106
|
+
Read the complete Task Mode guide for detailed workflow:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
Read('.claude/commands/cfn/CFN_LOOP_TASK_MODE.md')
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Expected output:** Complete guide with agent selection, workflow steps, helper scripts
|
|
113
|
+
|
|
114
|
+
### Step 2: Analyze Task Complexity
|
|
115
|
+
|
|
116
|
+
```javascript
|
|
117
|
+
// Estimate complexity to scale validators
|
|
118
|
+
const complexity = {
|
|
119
|
+
files: estimateFileCount(), // From task description
|
|
120
|
+
loc: estimateLOC(), // Estimated lines of code
|
|
121
|
+
keywords: extractKeywords() // Security, performance, frontend, etc.
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
// Complexity scoring (from guide)
|
|
125
|
+
let score = 0;
|
|
126
|
+
score += (complexity.files <= 2) ? 10 : (complexity.files <= 5) ? 30 : 60;
|
|
127
|
+
score += (complexity.loc <= 200) ? 10 : (complexity.loc <= 500) ? 30 : 60;
|
|
128
|
+
if (complexity.keywords.match(/auth|payment|token/i)) score += 40; // Security
|
|
129
|
+
if (complexity.keywords.match(/performance|cache/i)) score += 30; // Performance
|
|
130
|
+
if (complexity.keywords.match(/frontend|ui|react/i)) score += 20; // Accessibility
|
|
131
|
+
|
|
132
|
+
// Category: simple (≤50), standard (≤100), complex (>100)
|
|
133
|
+
const category = score <= 50 ? 'simple' : score <= 100 ? 'standard' : 'complex';
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Step 3: Select Agents (Adaptive Scaling)
|
|
137
|
+
|
|
138
|
+
```javascript
|
|
139
|
+
// Loop 3 Agents (Implementation) - Based on task type
|
|
140
|
+
const loop3Agents = selectImplementers({
|
|
141
|
+
taskType: extractTaskType(), // backend, fullstack, mobile, infra
|
|
142
|
+
keywords: complexity.keywords
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
// Examples:
|
|
146
|
+
// Backend API: ['backend-dev', 'researcher', 'devops']
|
|
147
|
+
// Full-Stack: ['backend-dev', 'react-frontend-engineer', 'devops']
|
|
148
|
+
// Mobile: ['mobile-dev', 'backend-dev', 'researcher']
|
|
149
|
+
// Infrastructure: ['devops', 'rust-developer', 'researcher']
|
|
150
|
+
|
|
151
|
+
// Loop 2 Agents (Validation) - Adaptive scaling by complexity
|
|
152
|
+
let loop2Agents = ['reviewer', 'tester']; // Base (simple)
|
|
153
|
+
|
|
154
|
+
if (category === 'standard') {
|
|
155
|
+
loop2Agents.push('architect', 'security-specialist');
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (category === 'complex') {
|
|
159
|
+
loop2Agents.push('code-analyzer');
|
|
160
|
+
if (complexity.keywords.match(/performance|cache/i)) {
|
|
161
|
+
loop2Agents.push('performance-benchmarker');
|
|
162
|
+
}
|
|
163
|
+
if (complexity.keywords.match(/frontend|ui|react/i)) {
|
|
164
|
+
loop2Agents.push('accessibility-advocate-persona');
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Max 6 validators
|
|
169
|
+
loop2Agents = loop2Agents.slice(0, 6);
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Step 4: Loop 3 - Implementation
|
|
173
|
+
|
|
174
|
+
```javascript
|
|
175
|
+
let iteration = 1;
|
|
176
|
+
let loop3Confidence = 0;
|
|
177
|
+
const maxIterations = extractFlag('--max-iterations') || 10;
|
|
178
|
+
const mode = extractFlag('--mode') || 'standard';
|
|
179
|
+
const gateThreshold = mode === 'enterprise' ? 0.85 : mode === 'standard' ? 0.75 : 0.70;
|
|
180
|
+
|
|
181
|
+
do {
|
|
182
|
+
console.log(`\n━━━ Loop 3 Iteration ${iteration}/${maxIterations} ━━━`);
|
|
183
|
+
|
|
184
|
+
// Spawn Loop 3 agents in parallel
|
|
185
|
+
const loop3Results = await Promise.all(
|
|
186
|
+
loop3Agents.map(agent =>
|
|
187
|
+
Task(agent, `
|
|
188
|
+
Implement: $ARGUMENTS (iteration ${iteration})
|
|
189
|
+
|
|
190
|
+
${iteration > 1 ? `Previous iteration feedback:\n${previousFeedback}` : ''}
|
|
191
|
+
|
|
192
|
+
Requirements:
|
|
193
|
+
- Core functionality implemented
|
|
194
|
+
- Tests written (>80% coverage)
|
|
195
|
+
- Security considerations addressed
|
|
196
|
+
- Documentation included
|
|
197
|
+
|
|
198
|
+
Report confidence score (0.0-1.0) when complete.
|
|
199
|
+
`)
|
|
200
|
+
)
|
|
201
|
+
);
|
|
202
|
+
|
|
203
|
+
// Calculate average confidence
|
|
204
|
+
loop3Confidence = average(loop3Results.map(r => parseConfidence(r.output)));
|
|
205
|
+
|
|
206
|
+
console.log(`Loop 3 confidence: ${loop3Confidence} (threshold: ${gateThreshold})`);
|
|
207
|
+
|
|
208
|
+
if (loop3Confidence >= gateThreshold) {
|
|
209
|
+
console.log('✅ Loop 3 gate PASSED, proceeding to Loop 2');
|
|
210
|
+
break;
|
|
211
|
+
} else {
|
|
212
|
+
console.log(`⚠️ Loop 3 gate FAILED, iteration ${iteration + 1}`);
|
|
213
|
+
previousFeedback = generateFeedback(loop3Results);
|
|
214
|
+
iteration++;
|
|
215
|
+
}
|
|
216
|
+
} while (iteration <= maxIterations);
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Step 5: Loop 2 - Validation
|
|
220
|
+
|
|
221
|
+
```javascript
|
|
222
|
+
console.log(`\n━━━ Loop 2 Validation ━━━`);
|
|
223
|
+
|
|
224
|
+
const consensusThreshold = mode === 'enterprise' ? 0.95 : mode === 'standard' ? 0.90 : 0.80;
|
|
225
|
+
|
|
226
|
+
// Spawn Loop 2 validators in parallel
|
|
227
|
+
const loop2Results = await Promise.all(
|
|
228
|
+
loop2Agents.map(validator =>
|
|
229
|
+
Task(validator, `
|
|
230
|
+
Review implementation from Loop 3.
|
|
231
|
+
|
|
232
|
+
Files modified: $(git diff --name-only HEAD)
|
|
233
|
+
|
|
234
|
+
Validation focus:
|
|
235
|
+
- Code quality and best practices
|
|
236
|
+
- Test coverage and quality
|
|
237
|
+
- Security vulnerabilities
|
|
238
|
+
- Architecture consistency
|
|
239
|
+
${validator === 'accessibility-advocate-persona' ? '- WCAG AA compliance' : ''}
|
|
240
|
+
${validator === 'performance-benchmarker' ? '- Performance optimization' : ''}
|
|
241
|
+
|
|
242
|
+
Report consensus score (0.0-1.0) when complete.
|
|
243
|
+
`)
|
|
244
|
+
)
|
|
245
|
+
);
|
|
246
|
+
|
|
247
|
+
const consensus = average(loop2Results.map(r => parseConfidence(r.output)));
|
|
248
|
+
|
|
249
|
+
console.log(`Loop 2 consensus: ${consensus} (threshold: ${consensusThreshold})`);
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Step 6: Product Owner Decision
|
|
253
|
+
|
|
254
|
+
```javascript
|
|
255
|
+
// Build context for Product Owner
|
|
256
|
+
const poContext = `
|
|
257
|
+
CFN Loop Task Mode - Iteration ${iteration} Complete
|
|
258
|
+
|
|
259
|
+
Task: $ARGUMENTS
|
|
260
|
+
Mode: ${mode.toUpperCase()}
|
|
261
|
+
|
|
262
|
+
Results:
|
|
263
|
+
- Loop 3 confidence: ${loop3Confidence} (gate: ${gateThreshold})
|
|
264
|
+
- Loop 2 consensus: ${consensus} (threshold: ${consensusThreshold})
|
|
265
|
+
- Iterations completed: ${iteration}/${maxIterations}
|
|
266
|
+
|
|
267
|
+
Deliverables:
|
|
268
|
+
$(git diff --name-status HEAD)
|
|
269
|
+
|
|
270
|
+
Decision Framework:
|
|
271
|
+
- PROCEED: Consensus >= ${consensusThreshold} AND deliverables verified
|
|
272
|
+
- ITERATE: Consensus < ${consensusThreshold} AND iteration < ${maxIterations}
|
|
273
|
+
- ABORT: Max iterations reached OR critical blocker
|
|
274
|
+
|
|
275
|
+
Output format (REQUIRED):
|
|
276
|
+
DECISION: PROCEED|ITERATE|ABORT
|
|
277
|
+
REASONING: [why]
|
|
278
|
+
`;
|
|
279
|
+
|
|
280
|
+
// Spawn Product Owner via Task()
|
|
281
|
+
const poOutput = await Task('product-owner', poContext);
|
|
282
|
+
|
|
283
|
+
// Parse decision using helper script
|
|
284
|
+
const decision = Bash(`./.claude/skills/cfn-product-owner-decision/parse-decision.sh --output "${poOutput}"`);
|
|
285
|
+
|
|
286
|
+
console.log(`Product Owner decision: ${decision}`);
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Step 7: Validate Deliverables
|
|
290
|
+
|
|
291
|
+
```javascript
|
|
292
|
+
// Prevent "consensus on vapor" (high consensus, zero deliverables)
|
|
293
|
+
const deliverableStatus = Bash(`./.claude/skills/cfn-product-owner-decision/validate-deliverables.sh --task-id "task-mode-${Date.now()}"`);
|
|
294
|
+
|
|
295
|
+
if (deliverableStatus === 'FAILED' && taskRequiresImplementation($ARGUMENTS)) {
|
|
296
|
+
console.log('⚠️ No deliverables created - overriding PROCEED to ITERATE');
|
|
297
|
+
decision = 'ITERATE';
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Step 8: Execute Decision
|
|
302
|
+
|
|
303
|
+
```javascript
|
|
304
|
+
if (decision === 'PROCEED') {
|
|
305
|
+
console.log('✅ Product Owner approved - committing changes');
|
|
306
|
+
|
|
307
|
+
// Git commit and push
|
|
308
|
+
Bash(`git add . && git commit -m "$(cat <<'EOF'
|
|
309
|
+
feat: $ARGUMENTS
|
|
310
|
+
|
|
311
|
+
Deliverables:
|
|
312
|
+
$(git diff --name-only HEAD | sed 's/^/- /')
|
|
313
|
+
|
|
314
|
+
Validation:
|
|
315
|
+
- Loop 3 confidence: ${loop3Confidence}
|
|
316
|
+
- Loop 2 consensus: ${consensus}
|
|
317
|
+
- Iterations: ${iteration}
|
|
318
|
+
|
|
319
|
+
🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
|
320
|
+
Co-Authored-By: Claude <noreply@anthropic.com>
|
|
321
|
+
EOF
|
|
322
|
+
)" && git push origin main`);
|
|
323
|
+
|
|
324
|
+
// Generate sprint summary
|
|
325
|
+
Write(`docs/SPRINT_${iteration}_COMPLETE.md`, `
|
|
326
|
+
# Sprint ${iteration} Complete
|
|
327
|
+
|
|
328
|
+
**Date:** $(date +%Y-%m-%d) | **Consensus:** ${consensus}
|
|
329
|
+
|
|
330
|
+
## Deliverables
|
|
331
|
+
$(git diff HEAD~1 --name-status | awk '{print "- "$2}')
|
|
332
|
+
|
|
333
|
+
## Validation
|
|
334
|
+
- Loop 3 iterations: ${iteration}
|
|
335
|
+
- Loop 2 consensus: ${consensus}
|
|
336
|
+
- Decision: PROCEED
|
|
337
|
+
`);
|
|
338
|
+
|
|
339
|
+
console.log('✅ Sprint complete - changes committed and pushed');
|
|
340
|
+
|
|
341
|
+
} else if (decision === 'ITERATE') {
|
|
342
|
+
console.log('🔄 Iterating with feedback...');
|
|
343
|
+
// Repeat from Step 4 with validator feedback
|
|
344
|
+
|
|
345
|
+
} else {
|
|
346
|
+
console.log('❌ Max iterations reached or critical blocker - aborting');
|
|
347
|
+
}
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### Step 9: ACE Reflection (Optional)
|
|
351
|
+
|
|
352
|
+
```javascript
|
|
353
|
+
// Only if --ace-reflect flag enabled
|
|
354
|
+
const aceReflectEnabled = extractFlag('--ace-reflect') === true;
|
|
355
|
+
|
|
356
|
+
if (aceReflectEnabled && decision === 'PROCEED') {
|
|
357
|
+
console.log('📊 Capturing ACE reflection...');
|
|
358
|
+
|
|
359
|
+
Bash(`./.claude/skills/cfn-ace-system/invoke-context-reflect.sh \\
|
|
360
|
+
--task-id "task-mode-${Date.now()}" \\
|
|
361
|
+
--sprint-id "${iteration}" \\
|
|
362
|
+
--consensus "${consensus}" \\
|
|
363
|
+
--iterations-loop3 "${iteration}" \\
|
|
364
|
+
--iterations-loop2 "1" \\
|
|
365
|
+
--deliverables "$(git diff HEAD~1 --name-only | tr '\n' ',')"`);
|
|
366
|
+
|
|
367
|
+
console.log('✅ ACE reflection captured');
|
|
368
|
+
}
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
## Task Mode Benefits
|
|
372
|
+
|
|
373
|
+
**Full Visibility:**
|
|
374
|
+
- Every agent output visible in Main Chat
|
|
375
|
+
- Easy to debug agent behavior
|
|
376
|
+
- Clear understanding of iteration flow
|
|
377
|
+
- Immediate feedback on issues
|
|
378
|
+
|
|
379
|
+
**Simplified Workflow:**
|
|
380
|
+
- No coordinator abstraction layer
|
|
381
|
+
- Direct Task() spawning
|
|
382
|
+
- Easier to modify and experiment
|
|
383
|
+
- Better for learning CFN Loop
|
|
384
|
+
|
|
385
|
+
**Debugging Features:**
|
|
386
|
+
- See exact confidence scores
|
|
387
|
+
- View validator feedback in real-time
|
|
388
|
+
- Understand Product Owner reasoning
|
|
389
|
+
- Trace decision-making logic
|
|
390
|
+
|
|
391
|
+
## Task Mode Limitations
|
|
392
|
+
|
|
393
|
+
**Cost:**
|
|
394
|
+
- 3x more expensive than CLI mode
|
|
395
|
+
- All agents use Anthropic provider
|
|
396
|
+
- No Z.ai cost savings
|
|
397
|
+
|
|
398
|
+
**Performance:**
|
|
399
|
+
- Sequential iteration cycles (no background processing)
|
|
400
|
+
- Main Chat must stay active (no crash recovery)
|
|
401
|
+
- No Redis state persistence
|
|
402
|
+
|
|
403
|
+
**Scalability:**
|
|
404
|
+
- Limited to 10-15 agents (visibility bottleneck)
|
|
405
|
+
- Long tasks may timeout (10-min Bash limit)
|
|
406
|
+
|
|
407
|
+
## Autonomous Execution Rules
|
|
408
|
+
|
|
409
|
+
**YOU ARE FORBIDDEN FROM:**
|
|
410
|
+
- ❌ Asking "Should I retry?" (ALWAYS retry if iterations < max)
|
|
411
|
+
- ❌ Asking "Proceed to next step?" (AUTO-PROCEED based on thresholds)
|
|
412
|
+
- ❌ Waiting for approval during CFN Loop cycles
|
|
413
|
+
- ❌ Spawning a coordinator agent (Main Chat coordinates directly)
|
|
414
|
+
|
|
415
|
+
**YOU MUST:**
|
|
416
|
+
- ✅ IMMEDIATELY retry Loop 3 on gate failure (iteration < max)
|
|
417
|
+
- ✅ IMMEDIATELY retry Loop 2 on consensus failure (iteration < max)
|
|
418
|
+
- ✅ AUTOMATICALLY execute Product Owner decision
|
|
419
|
+
- ✅ ONLY escalate when truly blocked (max iterations or critical error)
|
|
420
|
+
|
|
421
|
+
## Helper Scripts (Task Mode)
|
|
422
|
+
|
|
423
|
+
**DO NOT use execute-decision.sh (it spawns PO via CLI):**
|
|
424
|
+
```bash
|
|
425
|
+
# ❌ WRONG - spawns duplicate Product Owner
|
|
426
|
+
./.claude/skills/cfn-product-owner-decision/execute-decision.sh
|
|
427
|
+
|
|
428
|
+
# ✅ CORRECT - Main Chat spawns PO via Task(), then parses output
|
|
429
|
+
Task('product-owner', context)
|
|
430
|
+
parse-decision.sh --output "$PO_OUTPUT"
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
**DO use these helper scripts:**
|
|
434
|
+
```bash
|
|
435
|
+
# Parse Product Owner decision
|
|
436
|
+
./.claude/skills/cfn-product-owner-decision/parse-decision.sh --output "$OUTPUT"
|
|
437
|
+
|
|
438
|
+
# Validate deliverables exist
|
|
439
|
+
./.claude/skills/cfn-product-owner-decision/validate-deliverables.sh --task-id "$TASK_ID"
|
|
440
|
+
|
|
441
|
+
# Multi-pattern confidence parsing
|
|
442
|
+
./.claude/skills/cfn-loop3-output-processing/parse-confidence.sh --output "$AGENT_OUTPUT"
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
## Related Commands
|
|
446
|
+
|
|
447
|
+
- **CLI Mode**: `/cfn-loop-cli` (production, cost-optimized)
|
|
448
|
+
- **Frontend**: `/cfn-loop-frontend` (visual iteration workflow)
|
|
449
|
+
- **Documentation**: `/cfn-loop-document` (generate docs)
|
|
450
|
+
|
|
451
|
+
## Related Documentation
|
|
452
|
+
|
|
453
|
+
- **Task Mode Guide**: `.claude/commands/cfn/CFN_LOOP_TASK_MODE.md` (complete reference)
|
|
454
|
+
- Coordinator Parameters: `.claude/commands/cfn/CFN_COORDINATOR_PARAMETERS.md`
|
|
455
|
+
- Agent Output Standards: `docs/AGENT_OUTPUT_STANDARDS.md`
|
|
456
|
+
- ACE System: `.claude/skills/cfn-ace-system/SKILL.md`
|
|
457
|
+
|
|
458
|
+
---
|
|
459
|
+
|
|
460
|
+
**Version:** 1.0.0 (2025-10-31) - Task mode: debugging, full visibility, Main Chat coordination
|
|
@@ -98,16 +98,18 @@ if (similarity > threshold) {
|
|
|
98
98
|
}
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
**
|
|
101
|
+
**Curation Prompt Template:**
|
|
102
|
+
```
|
|
103
|
+
You are a Context Curator for the ACE (Adaptive Context Extension) system.
|
|
102
104
|
|
|
103
|
-
|
|
105
|
+
**Pending Reflection:**
|
|
106
|
+
{reflection_data}
|
|
104
107
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
You are a Context Curator for the ACE system.
|
|
108
|
+
**Existing Bullets (Semantic Neighbors):**
|
|
109
|
+
{similar_bullets}
|
|
108
110
|
|
|
109
111
|
**Your Mission:**
|
|
110
|
-
|
|
112
|
+
For each extracted lesson in the reflection:
|
|
111
113
|
|
|
112
114
|
1. **Check for semantic similarity**:
|
|
113
115
|
- Compare with existing bullets
|
|
@@ -129,38 +131,25 @@ Merge pending reflections into adaptive_context table. For each reflection:
|
|
|
129
131
|
- Medium (5-7): Optimization tips, domain insights
|
|
130
132
|
- Low (1-4): Edge cases, situational patterns
|
|
131
133
|
|
|
132
|
-
5. Update counters
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
- **New bullet**: Use add-bullet.sh
|
|
152
|
-
- **Increment helpful**: Update helpful_count
|
|
153
|
-
- **Merge similar**: Create new version, archive old
|
|
154
|
-
|
|
155
|
-
4. Update reflection status:
|
|
156
|
-
\`\`\`bash
|
|
157
|
-
./.claude/skills/cfn-ace-system/update-reflection.sh \\
|
|
158
|
-
--reflection-id \${REFL_ID} \\
|
|
159
|
-
--status merged
|
|
160
|
-
\`\`\`
|
|
161
|
-
|
|
162
|
-
5. Report actions taken
|
|
163
|
-
`, "context-curator");
|
|
134
|
+
5. **Update counters**:
|
|
135
|
+
- Identify helpful_existing_bullets → increment their helpful_count
|
|
136
|
+
- Identify harmful_existing_bullets → increment their harmful_count
|
|
137
|
+
|
|
138
|
+
**Output Format (JSON):**
|
|
139
|
+
{
|
|
140
|
+
"curation_actions": [
|
|
141
|
+
{
|
|
142
|
+
"action": "new_bullet|increment_helpful|increment_harmful|merge_similar|archive",
|
|
143
|
+
"bullet_id": "STRAT-042",
|
|
144
|
+
"target_bullet_id": "STRAT-001", // For increment/merge actions
|
|
145
|
+
"similarity_score": 0.92,
|
|
146
|
+
"reasoning": "Why this action is appropriate",
|
|
147
|
+
"merged_content": "New merged content (if merge action)"
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
"validation_required": ["STRAT-042"], // Bullets needing human review
|
|
151
|
+
"summary": "Curated 5 lessons: 2 new, 3 reinforced existing"
|
|
152
|
+
}
|
|
164
153
|
```
|
|
165
154
|
|
|
166
155
|
**Post-Curation:**
|
|
@@ -139,7 +139,7 @@ Inject bullets relevant to specific agent types:
|
|
|
139
139
|
|
|
140
140
|
```bash
|
|
141
141
|
# For security specialist agents
|
|
142
|
-
/context-inject --agent-type=security-specialist --target=./.claude/agents/
|
|
142
|
+
/context-inject --agent-type=security-specialist --target=./.claude/agents/security-specialist.md
|
|
143
143
|
|
|
144
144
|
# For coder agents
|
|
145
145
|
/context-inject --agent-type=coder --category=pattern --min-helpful=5
|
|
@@ -162,7 +162,7 @@ async function preAgentSpawnContext(agentType, taskContext) {
|
|
|
162
162
|
});
|
|
163
163
|
|
|
164
164
|
// Inject into agent's instruction file
|
|
165
|
-
const agentFile = `./.claude/agents
|
|
165
|
+
const agentFile = `./.claude/agents/${agentType}.md`;
|
|
166
166
|
await injectBullets(agentFile, bullets, { mode: 'merge' });
|
|
167
167
|
|
|
168
168
|
// Log usage
|
|
@@ -172,29 +172,18 @@ async function preAgentSpawnContext(agentType, taskContext) {
|
|
|
172
172
|
}
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
-
**Dynamic Injection:**
|
|
175
|
+
**Dynamic Injection During Execution:**
|
|
176
176
|
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
")
|
|
188
|
-
|
|
189
|
-
# Inject into agent prompt
|
|
190
|
-
Task("coder-1", "
|
|
191
|
-
Implement authentication system.
|
|
192
|
-
|
|
193
|
-
Before you start, review these proven patterns:
|
|
194
|
-
$BULLETS
|
|
195
|
-
|
|
196
|
-
Follow these patterns to avoid common pitfalls.
|
|
197
|
-
", "coder");
|
|
177
|
+
```javascript
|
|
178
|
+
// During CFN Loop 3, inject relevant optimization bullets
|
|
179
|
+
Task("coder-1", `
|
|
180
|
+
Implement authentication system.
|
|
181
|
+
|
|
182
|
+
Before you start, check these adaptive context bullets:
|
|
183
|
+
${await contextInject({ tags: 'auth,security', limit: 5, format: 'inline' })}
|
|
184
|
+
|
|
185
|
+
Follow these proven patterns to avoid common pitfalls.
|
|
186
|
+
`, "coder");
|
|
198
187
|
```
|
|
199
188
|
|
|
200
189
|
**Validation & Safety:**
|
|
@@ -221,7 +210,7 @@ rules:
|
|
|
221
210
|
action: context-inject
|
|
222
211
|
params:
|
|
223
212
|
agent-type: ${agent_type}
|
|
224
|
-
target: ./.claude/agents
|
|
213
|
+
target: ./.claude/agents/${agent_type}.md
|
|
225
214
|
limit: 10
|
|
226
215
|
|
|
227
216
|
- trigger: task-start
|