claude-flow-novice 2.18.39 → 2.18.40
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-loop-task.md +227 -291
- package/package.json +1 -1
|
@@ -1,359 +1,295 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Execute CFN Loop in Task Mode with direct agent spawning (visible in main chat)"
|
|
3
|
-
argument-hint: "<task description> [--mode=mvp|standard|enterprise] [--max-iterations=n]
|
|
4
|
-
allowed-tools: ["Task", "TodoWrite", "Read", "Bash", "
|
|
3
|
+
argument-hint: "<task description> [--mode=mvp|standard|enterprise] [--max-iterations=n]"
|
|
4
|
+
allowed-tools: ["Task", "TodoWrite", "Read", "Bash", "Grep", "Glob"]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# CFN Loop Task Mode
|
|
7
|
+
# CFN Loop Task Mode
|
|
8
8
|
|
|
9
|
-
**
|
|
9
|
+
**You are the coordinator. You MUST execute this loop until PROCEED or max iterations.**
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
---
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## MANDATORY: Initialize State Tracking
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
**IMMEDIATELY create this todo list using TodoWrite:**
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
```
|
|
18
|
+
1. [pending] Parse arguments and initialize task
|
|
19
|
+
2. [pending] LOOP 3: Spawn implementation agents
|
|
20
|
+
3. [pending] GATE CHECK: Run tests and validate pass rate
|
|
21
|
+
4. [pending] LOOP 2: Spawn validator agents (ONLY if gate passed)
|
|
22
|
+
5. [pending] PRODUCT OWNER: Review validator feedback, filter out-of-scope, decide
|
|
23
|
+
```
|
|
18
24
|
|
|
19
|
-
|
|
20
|
-
- **NO WAITING:** Do not wait for user confirmation between iterations or steps
|
|
21
|
-
- **KEEP SPAWNING:** Gate fail → spawn Loop 3 again. Gate pass → spawn validators. Validators pass → spawn next task.
|
|
25
|
+
**You MUST update todo status as you complete each phase. Do NOT skip phases.**
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
1. **Corruption/rollback needed** - Commits broke the codebase beyond repair, need git rollback
|
|
25
|
-
2. **Architectural mismatch** - RCA identifies fundamental design conflicts that require rewrite
|
|
26
|
-
3. **Critical security issue** - Credentials exposed, injection vulnerabilities found
|
|
27
|
-
4. **External system failure** - CI/CD down, package registry unavailable, API deprecated
|
|
27
|
+
---
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
- Test regressions (loop fixes them - keep iterating)
|
|
31
|
-
- Test pass rate drops (keep iterating, RCA will analyze)
|
|
32
|
-
- Coverage gaps (keep iterating)
|
|
33
|
-
- Single file conflicts (RCA handles it)
|
|
34
|
-
- Validator rejections (incorporate feedback and continue)
|
|
35
|
-
- Max iterations reached (report results but don't block)
|
|
29
|
+
## THE LOOP (Execute Until Done)
|
|
36
30
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
```
|
|
32
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
33
|
+
│ ITERATION = 1 │
|
|
34
|
+
│ │
|
|
35
|
+
│ WHILE iteration <= MAX_ITERATIONS: │
|
|
36
|
+
│ ├── LOOP 3: Spawn implementation agents │
|
|
37
|
+
│ ├── GATE CHECK: Run npm test, calculate pass rate │
|
|
38
|
+
│ │ ├── IF pass_rate < threshold: iteration++, CONTINUE│
|
|
39
|
+
│ │ └── IF pass_rate >= threshold: PROCEED to Loop 2 │
|
|
40
|
+
│ ├── LOOP 2: Spawn validator agents │
|
|
41
|
+
│ ├── PRODUCT OWNER: Review validator feedback │
|
|
42
|
+
│ │ ├── Filter out-of-scope validator requirements │
|
|
43
|
+
│ │ ├── PROCEED: In-scope work complete, EXIT │
|
|
44
|
+
│ │ ├── ITERATE: In-scope issues remain, CONTINUE │
|
|
45
|
+
│ │ └── ABORT: Corruption/security only, EXIT │
|
|
46
|
+
│ └── END WHILE │
|
|
47
|
+
│ │
|
|
48
|
+
│ MAX_ITERATIONS reached: Report and EXIT │
|
|
49
|
+
└─────────────────────────────────────────────────────────────┘
|
|
50
|
+
```
|
|
41
51
|
|
|
42
52
|
---
|
|
43
53
|
|
|
44
|
-
##
|
|
54
|
+
## PHASE 1: Parse Arguments
|
|
45
55
|
|
|
46
|
-
**
|
|
56
|
+
**Mark todo #1 as in_progress, then execute:**
|
|
47
57
|
|
|
48
|
-
After Loop 3 agents complete, run gate validation:
|
|
49
58
|
```bash
|
|
50
|
-
#
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
# Calculate pass rate
|
|
56
|
-
if [ "$TOTAL_COUNT" -gt 0 ]; then
|
|
57
|
-
PASS_RATE=$(echo "scale=4; $PASS_COUNT / $TOTAL_COUNT" | bc)
|
|
58
|
-
else
|
|
59
|
-
PASS_RATE="0"
|
|
60
|
-
fi
|
|
61
|
-
|
|
62
|
-
# Validate gate
|
|
63
|
-
npx ts-node .claude/skills/cfn-loop-orchestration-v2/lib/orchestrator/src/helpers/gate-check.ts \
|
|
64
|
-
--pass-rate "$PASS_RATE" \
|
|
65
|
-
--mode "$MODE"
|
|
59
|
+
# Parse from $ARGUMENTS
|
|
60
|
+
MODE="standard" # or mvp, enterprise
|
|
61
|
+
MAX_ITERATIONS=10
|
|
62
|
+
TASK_ID="cfn-task-$(date +%s)-${RANDOM}"
|
|
63
|
+
ITERATION=1
|
|
66
64
|
```
|
|
67
65
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
| Enterprise | 98% |
|
|
66
|
+
| Mode | Gate Threshold | Consensus Threshold |
|
|
67
|
+
|------|----------------|---------------------|
|
|
68
|
+
| mvp | 70% | 80% |
|
|
69
|
+
| standard | 95% | 90% |
|
|
70
|
+
| enterprise | 98% | 95% |
|
|
74
71
|
|
|
75
|
-
**
|
|
72
|
+
**Mark todo #1 as completed. Proceed to Phase 2.**
|
|
76
73
|
|
|
77
74
|
---
|
|
78
75
|
|
|
79
|
-
##
|
|
76
|
+
## PHASE 2: LOOP 3 - Implementation Agents
|
|
77
|
+
|
|
78
|
+
**Mark todo #2 as in_progress.**
|
|
79
|
+
|
|
80
|
+
**Spawn using Task tool with subagent_type="backend-developer":**
|
|
80
81
|
|
|
81
|
-
After ANY file modification, run:
|
|
82
|
-
```bash
|
|
83
|
-
./.claude/hooks/cfn-invoke-post-edit.sh "$FILE_PATH" --agent-id "$AGENT_ID"
|
|
84
82
|
```
|
|
83
|
+
TASK: Implement for iteration ${ITERATION}: ${TASK_DESCRIPTION}
|
|
85
84
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
REQUIREMENTS:
|
|
86
|
+
1. Write tests FIRST (TDD)
|
|
87
|
+
2. Implement to make tests pass
|
|
88
|
+
3. Run: npm test
|
|
89
|
+
4. Report: { "tests_passed": N, "tests_total": M, "files_modified": [...] }
|
|
90
|
+
|
|
91
|
+
AGENT_ID: loop3-impl-${TASK_ID}-iter${ITERATION}
|
|
89
92
|
```
|
|
90
93
|
|
|
94
|
+
**WAIT for agent to complete and return results.**
|
|
95
|
+
|
|
96
|
+
**Mark todo #2 as completed. Proceed to Phase 3.**
|
|
97
|
+
|
|
91
98
|
---
|
|
92
99
|
|
|
93
|
-
##
|
|
100
|
+
## PHASE 3: GATE CHECK (Mandatory Before Loop 2)
|
|
101
|
+
|
|
102
|
+
**Mark todo #3 as in_progress.**
|
|
103
|
+
|
|
104
|
+
**YOU MUST RUN THIS - DO NOT SKIP:**
|
|
94
105
|
|
|
95
|
-
**Step 1: Parse Arguments**
|
|
96
106
|
```bash
|
|
97
|
-
|
|
98
|
-
|
|
107
|
+
# Run tests
|
|
108
|
+
npm test 2>&1 | tee /tmp/test-output-${TASK_ID}.txt
|
|
99
109
|
|
|
100
|
-
|
|
101
|
-
|
|
110
|
+
# Parse results (adjust grep pattern for your test runner)
|
|
111
|
+
PASS_COUNT=$(grep -oP '\d+(?= pass)' /tmp/test-output-${TASK_ID}.txt | head -1 || echo 0)
|
|
112
|
+
TOTAL_COUNT=$(grep -oP '\d+(?= (test|spec))' /tmp/test-output-${TASK_ID}.txt | head -1 || echo 1)
|
|
113
|
+
PASS_RATE=$(echo "scale=2; $PASS_COUNT / $TOTAL_COUNT" | bc)
|
|
102
114
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
--mode=*) MODE="${arg#*=}" ;;
|
|
106
|
-
--max-iterations=*) MAX_ITERATIONS="${arg#*=}" ;;
|
|
107
|
-
esac
|
|
108
|
-
done
|
|
115
|
+
echo "Gate Check: ${PASS_COUNT}/${TOTAL_COUNT} = ${PASS_RATE}"
|
|
116
|
+
```
|
|
109
117
|
|
|
110
|
-
|
|
111
|
-
echo "ERROR: Invalid mode '$MODE'. Must be: mvp, standard, enterprise"
|
|
112
|
-
exit 1
|
|
113
|
-
fi
|
|
118
|
+
**DECISION POINT:**
|
|
114
119
|
|
|
115
|
-
|
|
116
|
-
|
|
120
|
+
```
|
|
121
|
+
IF pass_rate >= threshold:
|
|
122
|
+
→ Mark todo #3 completed
|
|
123
|
+
→ PROCEED to Phase 4 (Loop 2)
|
|
124
|
+
|
|
125
|
+
IF pass_rate < threshold:
|
|
126
|
+
→ Log: "Gate FAILED (${PASS_RATE} < ${THRESHOLD}). Iterating..."
|
|
127
|
+
→ ITERATION = ITERATION + 1
|
|
128
|
+
→ IF iteration > MAX_ITERATIONS: Report failure and EXIT
|
|
129
|
+
→ Reset todo #2 to pending, mark #3 as pending
|
|
130
|
+
→ GO BACK TO PHASE 2 (spawn Loop 3 again with failure context)
|
|
117
131
|
```
|
|
118
132
|
|
|
119
|
-
**
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
4. Run: npm test -- --reporter=json after implementation
|
|
133
|
-
5. Report actual pass/fail counts, NOT confidence scores
|
|
134
|
-
|
|
135
|
-
POST-EDIT (MANDATORY):
|
|
136
|
-
After each file edit, run:
|
|
137
|
-
./.claude/hooks/cfn-invoke-post-edit.sh "$FILE_PATH" --agent-id "$AGENT_ID"
|
|
138
|
-
|
|
139
|
-
RETURN FORMAT:
|
|
140
|
-
{
|
|
141
|
-
"tests_passed": <number>,
|
|
142
|
-
"tests_total": <number>,
|
|
143
|
-
"pass_rate": <0.0-1.0>,
|
|
144
|
-
"files_created": [...],
|
|
145
|
-
"files_modified": [...]
|
|
146
|
-
}
|
|
147
|
-
`)
|
|
148
|
-
;;
|
|
149
|
-
|
|
150
|
-
"standard"|"enterprise")
|
|
151
|
-
Task("backend-developer", `
|
|
152
|
-
AGENT_ID="backend-dev-${TASK_ID}"
|
|
153
|
-
|
|
154
|
-
TASK: Implement production solution for: ${TASK_DESCRIPTION}
|
|
155
|
-
|
|
156
|
-
TDD REQUIREMENTS (MANDATORY - London School):
|
|
157
|
-
1. Write unit tests with mocks FIRST
|
|
158
|
-
2. Write integration tests for component interactions
|
|
159
|
-
3. Implement to make all tests pass
|
|
160
|
-
4. Achieve ${MODE === 'standard' ? '80' : '95'}% coverage minimum
|
|
161
|
-
5. Run: npm test -- --reporter=json after implementation
|
|
162
|
-
6. Report actual pass/fail counts, NOT confidence scores
|
|
163
|
-
|
|
164
|
-
POST-EDIT (MANDATORY):
|
|
165
|
-
After each file edit, run:
|
|
166
|
-
./.claude/hooks/cfn-invoke-post-edit.sh "$FILE_PATH" --agent-id "$AGENT_ID"
|
|
167
|
-
|
|
168
|
-
RETURN FORMAT:
|
|
169
|
-
{
|
|
170
|
-
"tests_passed": <number>,
|
|
171
|
-
"tests_total": <number>,
|
|
172
|
-
"pass_rate": <0.0-1.0>,
|
|
173
|
-
"coverage_percent": <number>,
|
|
174
|
-
"files_created": [...],
|
|
175
|
-
"files_modified": [...]
|
|
176
|
-
}
|
|
177
|
-
`)
|
|
178
|
-
;;
|
|
179
|
-
esac
|
|
133
|
+
**DO NOT proceed to Loop 2 if gate failed. ITERATE.**
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## PHASE 4: LOOP 2 - Validator Agents
|
|
138
|
+
|
|
139
|
+
**Mark todo #4 as in_progress.**
|
|
140
|
+
|
|
141
|
+
**ONLY execute this phase if Gate Check passed.**
|
|
142
|
+
|
|
143
|
+
**Spawn validators in parallel using Task tool:**
|
|
144
|
+
|
|
145
|
+
**Validator 1: code-reviewer**
|
|
180
146
|
```
|
|
147
|
+
TASK: Review implementation for: ${TASK_DESCRIPTION}
|
|
181
148
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
149
|
+
CHECKLIST:
|
|
150
|
+
- [ ] Tests exist and pass
|
|
151
|
+
- [ ] No hardcoded secrets
|
|
152
|
+
- [ ] Code follows project patterns
|
|
185
153
|
|
|
186
|
-
|
|
187
|
-
|
|
154
|
+
Return: PASS or FAIL with findings
|
|
155
|
+
AGENT_ID: loop2-reviewer-${TASK_ID}
|
|
156
|
+
```
|
|
188
157
|
|
|
189
|
-
|
|
190
|
-
TESTS_PASSED=${LOOP3_RESULT.tests_passed:-0}
|
|
191
|
-
TESTS_TOTAL=${LOOP3_RESULT.tests_total:-1}
|
|
192
|
-
PASS_RATE=$(echo "scale=4; $TESTS_PASSED / $TESTS_TOTAL" | bc)
|
|
193
|
-
|
|
194
|
-
# Run gate validation
|
|
195
|
-
GATE_RESULT=$(npx ts-node .claude/skills/cfn-loop-orchestration-v2/lib/orchestrator/src/helpers/gate-check.ts \
|
|
196
|
-
--pass-rate "$PASS_RATE" \
|
|
197
|
-
--mode "$MODE" 2>&1)
|
|
198
|
-
|
|
199
|
-
if echo "$GATE_RESULT" | grep -q '"passed": false'; then
|
|
200
|
-
echo "GATE FAILED - Iterating Loop 3"
|
|
201
|
-
ITERATION=$((ITERATION + 1))
|
|
202
|
-
|
|
203
|
-
# Test regressions are NOT a stop condition - the loop fixes them
|
|
204
|
-
# Only stop for: corruption needing rollback, architectural mismatch, security issues
|
|
205
|
-
echo "Pass rate: ${PASS_RATE} - Loop will continue iterating to fix"
|
|
206
|
-
|
|
207
|
-
# After 3 failed iterations, invoke root cause analysis
|
|
208
|
-
if [ $ITERATION -eq 3 ]; then
|
|
209
|
-
echo "3 iterations failed - Spawning root cause analyst..."
|
|
210
|
-
|
|
211
|
-
Task("root-cause-analyst", `
|
|
212
|
-
AGENT_ID="rca-${TASK_ID}"
|
|
213
|
-
|
|
214
|
-
TASK: Analyze why Loop 3 implementation keeps failing for: ${TASK_DESCRIPTION}
|
|
215
|
-
|
|
216
|
-
INVESTIGATION SCOPE:
|
|
217
|
-
1. Review test failures from previous iterations
|
|
218
|
-
2. Identify blocking patterns (missing dependencies, architectural issues, incorrect assumptions)
|
|
219
|
-
3. Check for circular dependencies or integration conflicts
|
|
220
|
-
4. Analyze error logs and stack traces
|
|
221
|
-
|
|
222
|
-
REQUIRED OUTPUT:
|
|
223
|
-
{
|
|
224
|
-
"root_causes": [
|
|
225
|
-
{"issue": "<description>", "severity": "critical|high|medium", "fix": "<specific solution>"}
|
|
226
|
-
],
|
|
227
|
-
"recommended_approach": "<concrete implementation strategy>",
|
|
228
|
-
"files_to_modify": [...],
|
|
229
|
-
"tests_to_add": [...],
|
|
230
|
-
"blockers_to_remove": [...]
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
This analysis will be passed to the next Loop 3 iteration to prevent repeated failures.
|
|
234
|
-
`)
|
|
235
|
-
|
|
236
|
-
# Store RCA findings for next iteration
|
|
237
|
-
RCA_FINDINGS=${RCA_RESULT}
|
|
238
|
-
echo "Root cause analysis complete. Findings will guide next iteration."
|
|
239
|
-
fi
|
|
240
|
-
|
|
241
|
-
if [ $ITERATION -lt $MAX_ITERATIONS ]; then
|
|
242
|
-
# Spawn Loop 3 again with failure context (and RCA findings if available)
|
|
243
|
-
if [ -n "$RCA_FINDINGS" ]; then
|
|
244
|
-
echo "Re-running Loop 3 with root cause analysis guidance..."
|
|
245
|
-
# RCA_FINDINGS passed to Loop 3 agents in next iteration
|
|
246
|
-
fi
|
|
247
|
-
continue
|
|
248
|
-
else
|
|
249
|
-
echo "Max iterations (10) reached. Gate still failing."
|
|
250
|
-
exit 1
|
|
251
|
-
fi
|
|
252
|
-
fi
|
|
253
|
-
|
|
254
|
-
echo "GATE PASSED - Proceeding to validators"
|
|
158
|
+
**Validator 2: tester**
|
|
255
159
|
```
|
|
160
|
+
TASK: Validate test coverage for: ${TASK_DESCRIPTION}
|
|
256
161
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
162
|
+
Execute: npm test -- --coverage
|
|
163
|
+
Return: { "pass": true/false, "coverage": N%, "findings": [...] }
|
|
164
|
+
AGENT_ID: loop2-tester-${TASK_ID}
|
|
165
|
+
```
|
|
261
166
|
|
|
262
|
-
|
|
167
|
+
**Collect results from both validators.**
|
|
263
168
|
|
|
264
|
-
|
|
265
|
-
- [ ] Tests exist for all new code
|
|
266
|
-
- [ ] Tests follow TDD pattern (written before implementation)
|
|
267
|
-
- [ ] Coverage meets threshold for ${MODE} mode
|
|
268
|
-
- [ ] No hardcoded secrets or credentials
|
|
269
|
-
- [ ] Post-edit hooks were invoked
|
|
169
|
+
**Mark todo #4 as completed. Proceed to Phase 5.**
|
|
270
170
|
|
|
271
|
-
|
|
272
|
-
`)
|
|
171
|
+
---
|
|
273
172
|
|
|
274
|
-
|
|
275
|
-
AGENT_ID="tester-${TASK_ID}"
|
|
173
|
+
## PHASE 5: Product Owner Decision
|
|
276
174
|
|
|
277
|
-
|
|
175
|
+
**Mark todo #5 as in_progress.**
|
|
278
176
|
|
|
279
|
-
|
|
280
|
-
1. npm test -- --coverage
|
|
281
|
-
2. Report pass/fail counts
|
|
282
|
-
3. Report coverage percentages
|
|
177
|
+
**Spawn Product Owner agent using Task tool with subagent_type="product-owner":**
|
|
283
178
|
|
|
284
|
-
|
|
285
|
-
|
|
179
|
+
```
|
|
180
|
+
TASK: Review validator feedback and make scope-aware decision
|
|
181
|
+
|
|
182
|
+
CONTEXT:
|
|
183
|
+
- Task: ${TASK_DESCRIPTION}
|
|
184
|
+
- Mode: ${MODE}
|
|
185
|
+
- Iteration: ${ITERATION}
|
|
186
|
+
- Gate pass rate: ${PASS_RATE}
|
|
187
|
+
|
|
188
|
+
VALIDATOR FEEDBACK:
|
|
189
|
+
${VALIDATOR_1_FEEDBACK}
|
|
190
|
+
${VALIDATOR_2_FEEDBACK}
|
|
191
|
+
|
|
192
|
+
YOUR RESPONSIBILITIES:
|
|
193
|
+
1. Review each validator finding
|
|
194
|
+
2. Classify each finding as IN-SCOPE or OUT-OF-SCOPE
|
|
195
|
+
3. OUT-OF-SCOPE items: Log for backlog, do NOT require iteration
|
|
196
|
+
4. IN-SCOPE items: Determine if they block PROCEED
|
|
197
|
+
|
|
198
|
+
DECISION CRITERIA:
|
|
199
|
+
- PROCEED: All in-scope requirements met, tests pass, no blocking issues
|
|
200
|
+
- ITERATE: In-scope issues remain that need fixing
|
|
201
|
+
- ABORT: Only for corruption, security vulnerabilities, or architectural dead-ends
|
|
202
|
+
|
|
203
|
+
RETURN FORMAT:
|
|
204
|
+
{
|
|
205
|
+
"decision": "PROCEED" | "ITERATE" | "ABORT",
|
|
206
|
+
"in_scope_findings": [...],
|
|
207
|
+
"out_of_scope_findings": [...],
|
|
208
|
+
"reasoning": "...",
|
|
209
|
+
"iteration_guidance": "..." (if ITERATE)
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
AGENT_ID: product-owner-${TASK_ID}-iter${ITERATION}
|
|
286
213
|
```
|
|
287
214
|
|
|
288
|
-
**
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
#
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
215
|
+
**WAIT for Product Owner agent to return decision.**
|
|
216
|
+
|
|
217
|
+
**Handle Decision:**
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
IF decision == "PROCEED":
|
|
221
|
+
→ Mark todo #5 completed
|
|
222
|
+
→ Report success: "Task complete. Out-of-scope items logged to backlog."
|
|
223
|
+
→ EXIT
|
|
224
|
+
|
|
225
|
+
IF decision == "ITERATE":
|
|
226
|
+
→ Log: "PO requested iteration. In-scope issues: ${IN_SCOPE_FINDINGS}"
|
|
227
|
+
→ ITERATION = ITERATION + 1
|
|
228
|
+
→ IF iteration > MAX_ITERATIONS: Report and EXIT
|
|
229
|
+
→ Reset todos #2-#5 to pending
|
|
230
|
+
→ Include PO's iteration_guidance in next Loop 3 context
|
|
231
|
+
→ GO BACK TO PHASE 2
|
|
232
|
+
|
|
233
|
+
IF decision == "ABORT":
|
|
234
|
+
→ Log: "PO aborted: ${REASONING}"
|
|
235
|
+
→ Report failure with reasoning
|
|
236
|
+
→ EXIT
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**The Product Owner is the ONLY agent that can approve PROCEED or request ABORT.**
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Iteration Context Injection
|
|
244
|
+
|
|
245
|
+
**When iterating, include this context for Loop 3 agents:**
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
PREVIOUS ITERATION FAILED:
|
|
249
|
+
- Iteration: ${ITERATION - 1}
|
|
250
|
+
- Gate pass rate: ${PASS_RATE}
|
|
251
|
+
- Validator feedback: ${FEEDBACK}
|
|
252
|
+
- Files with issues: ${PROBLEM_FILES}
|
|
253
|
+
|
|
254
|
+
FIX THESE SPECIFIC ISSUES before re-running tests.
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
**After 3 failed iterations, spawn root-cause-analyst before next Loop 3:**
|
|
258
|
+
```
|
|
259
|
+
Task(subagent_type="root-cause-analyst", prompt="Analyze repeated failures...")
|
|
329
260
|
```
|
|
330
261
|
|
|
331
262
|
---
|
|
332
263
|
|
|
333
|
-
##
|
|
264
|
+
## Quick Reference
|
|
334
265
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
266
|
+
| Phase | What Happens | Next If Success | Next If Fail |
|
|
267
|
+
|-------|--------------|-----------------|--------------|
|
|
268
|
+
| 1. Parse | Initialize vars | → Phase 2 | N/A |
|
|
269
|
+
| 2. Loop 3 | Implementation agents | → Phase 3 | Retry |
|
|
270
|
+
| 3. Gate | Test pass rate check | → Phase 4 | → Phase 2 (iterate) |
|
|
271
|
+
| 4. Loop 2 | Validator agents | → Phase 5 | Retry |
|
|
272
|
+
| 5. PO | Scope filter + decision | EXIT (PROCEED) | → Phase 2 (iterate) |
|
|
342
273
|
|
|
343
|
-
**
|
|
274
|
+
**Product Owner Role:**
|
|
275
|
+
- Filters validator feedback into IN-SCOPE vs OUT-OF-SCOPE
|
|
276
|
+
- OUT-OF-SCOPE items go to backlog, don't block PROCEED
|
|
277
|
+
- Only IN-SCOPE issues can trigger ITERATE
|
|
278
|
+
- ABORT is rare (corruption, security, dead-end architecture)
|
|
344
279
|
|
|
345
280
|
---
|
|
346
281
|
|
|
347
|
-
##
|
|
282
|
+
## Reminders
|
|
348
283
|
|
|
349
|
-
- **
|
|
350
|
-
- **
|
|
351
|
-
- **
|
|
284
|
+
- **DO NOT skip Gate Check** - Phase 3 is mandatory after every Loop 3
|
|
285
|
+
- **DO NOT spawn Loop 2 if gate failed** - Iterate Loop 3 instead
|
|
286
|
+
- **DO NOT skip Product Owner** - Only PO can approve PROCEED
|
|
287
|
+
- **DO NOT iterate on out-of-scope items** - PO filters these to backlog
|
|
288
|
+
- **DO NOT stop on test failures** - That's what iteration fixes
|
|
289
|
+
- **DO update todos** - This tracks your state as coordinator
|
|
290
|
+
- **DO pass validator feedback to PO** - PO needs full context to decide
|
|
291
|
+
- **DO inject PO guidance into next iteration** - Use iteration_guidance from PO
|
|
352
292
|
|
|
353
293
|
---
|
|
354
294
|
|
|
355
|
-
**Version
|
|
356
|
-
- v1.4.0 (2025-12-25) - Hard cap 10 iterations for all modes; root cause analyst after 3 failures
|
|
357
|
-
- v1.3.0 (2025-12-14) - Fixed to use test-based gate checks, not confidence scores
|
|
358
|
-
- v1.2.0 (2025-12-08) - Added TDD enforcement
|
|
359
|
-
- v1.1.0 (2025-12-01) - Added RuVector integration
|
|
295
|
+
**Version:** 2.0.0 | **Date:** 2026-01-09 | Restructured with enforced state tracking + Product Owner scope filtering
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-flow-novice",
|
|
3
|
-
"version": "2.18.
|
|
3
|
+
"version": "2.18.40",
|
|
4
4
|
"description": "Claude Flow Novice - Advanced orchestration platform for multi-agent AI workflows with CFN Loop architecture\n\nIncludes Local RuVector Accelerator and all CFN skills for complete functionality.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|