claude-flow-novice 2.13.0 → 2.14.1
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/README.md +177 -129
- package/.claude/commands/cfn/cfn-loop-cli.md +279 -0
- package/.claude/commands/cfn/cfn-loop-document.md +20 -1
- package/.claude/commands/cfn/cfn-loop-frontend.md +17 -2
- package/.claude/commands/cfn/cfn-loop-task.md +460 -0
- package/.claude/commands/cfn/context-curate.md +27 -38
- package/.claude/commands/cfn/context-inject.md +14 -25
- package/.claude/commands/cfn/context-query.md +40 -45
- package/.claude/commands/cfn/context-reflect.md +40 -38
- package/.claude/commands/cfn/context-stats.md +13 -38
- package/.claude/commands/cfn/launch-web-dashboard.md +0 -295
- package/.claude/commands/cfn/list-agents-rebuild.md +18 -18
- package/.claude/commands/cfn/write-plan.md +246 -75
- package/.claude/root-claude-distribute/CFN-CLAUDE.md +126 -233
- package/.claude/skills/cfn-backlog-management/add-backlog-item.sh +25 -27
- package/.claude/skills/cfn-changelog-management/add-changelog-entry.sh +21 -19
- package/.claude/skills/cfn-changelog-management/bulk-import.sh +268 -0
- package/.claude/skills/cfn-changelog-management/lib/README.md +212 -0
- package/.claude/skills/cfn-changelog-management/lib/validation.sh +72 -0
- package/.claude/skills/cfn-product-owner-decision/execute-decision.sh +36 -11
- package/claude-assets/agents/cfn-dev-team/analysts/root-cause-analyst.md +259 -0
- package/claude-assets/agents/cfn-dev-team/reviewers/reviewer.md +45 -6
- package/claude-assets/agents/cfn-dev-team/testers/tester.md +59 -0
- package/claude-assets/agents/cfn-dev-team/utility/agent-builder.md +4 -4
- package/claude-assets/commands/cfn/auto-compact.md +80 -0
- package/claude-assets/commands/cfn/cfn-loop-cli.md +13 -2
- package/claude-assets/commands/cfn/cfn-loop-epic.md +478 -0
- package/claude-assets/commands/cfn/cfn-loop-single.md +256 -0
- package/claude-assets/commands/cfn/cfn-loop-sprints.md +396 -0
- package/claude-assets/commands/cfn/cfn-loop-task.md +27 -9
- package/claude-assets/commands/cfn/cfn-loop.md +518 -0
- package/claude-assets/commands/cfn/claude-md.md +64 -0
- package/claude-assets/commands/cfn/claude-soul.md +22 -0
- package/claude-assets/commands/cfn/cost-savings-off.md +35 -0
- package/claude-assets/commands/cfn/cost-savings-on.md +35 -0
- package/claude-assets/commands/cfn/cost-savings-status.md +34 -0
- package/claude-assets/commands/cfn/custom-routing-activate.md +55 -0
- package/claude-assets/commands/cfn/custom-routing-deactivate.md +46 -0
- package/claude-assets/commands/cfn/dependency-recommendations.md +171 -0
- package/claude-assets/commands/cfn/fullstack.md +179 -0
- package/claude-assets/commands/cfn/github.md +221 -0
- package/claude-assets/commands/cfn/hooks.md +38 -0
- package/claude-assets/commands/cfn/metrics-summary.md +58 -0
- package/claude-assets/commands/cfn/neural.md +39 -0
- package/claude-assets/commands/cfn/parse-epic.md +357 -0
- package/claude-assets/commands/cfn/performance.md +41 -0
- package/claude-assets/commands/cfn/sparc.md +46 -0
- package/claude-assets/commands/cfn/suggest-improvements.md +95 -0
- package/claude-assets/commands/cfn/suggest-templates.md +147 -0
- package/claude-assets/commands/cfn/swarm.md +24 -0
- package/claude-assets/root-claude-distribute/CFN-CLAUDE.md +126 -233
- package/claude-assets/skills/cfn-backlog-management/add-backlog-item.sh +25 -27
- package/claude-assets/skills/cfn-changelog-management/add-changelog-entry.sh +21 -19
- package/claude-assets/skills/cfn-changelog-management/bulk-import.sh +268 -0
- package/claude-assets/skills/cfn-changelog-management/lib/README.md +212 -0
- package/claude-assets/skills/cfn-changelog-management/lib/validation.sh +72 -0
- package/claude-assets/skills/cfn-product-owner-decision/execute-decision.sh +36 -11
- package/claude-assets/skills/cfn-task-config-init/SKILL.md +204 -0
- package/claude-assets/skills/cfn-task-config-init/initialize-config.sh +264 -0
- package/dist/agents/agent-loader.js +165 -146
- package/dist/agents/agent-loader.js.map +1 -1
- package/package.json +2 -2
- package/.claude/commands/README.md +0 -205
- package/.claude/skills/cfn-loop-orchestration/orchestrate.sh.backup +0 -840
- package/.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh.backup-p7 +0 -423
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup +0 -38
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-1761167675 +0 -1672
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-p5 +0 -1604
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-phase1 +0 -1550
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-phase2 +0 -1621
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-phase3 +0 -1621
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.broken +0 -1627
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.corrupted +0 -80
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.deprecated +0 -1864
- package/.claude/skills/cfn-redis-coordination/tests/test_coordination_primitives.sh.deprecated +0 -20
- package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh.backup +0 -840
- package/claude-assets/skills/cfn-loop2-output-processing/execute-and-extract.sh.backup +0 -36
- package/claude-assets/skills/cfn-redis-coordination/invoke-waiting-mode.sh.backup-p7 +0 -423
- package/claude-assets/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup +0 -38
- package/claude-assets/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-1761167675 +0 -1672
- package/claude-assets/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-p5 +0 -1604
- package/claude-assets/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-phase1 +0 -1550
- package/claude-assets/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-phase2 +0 -1621
- package/claude-assets/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-phase3 +0 -1621
- package/claude-assets/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.broken +0 -1627
- package/claude-assets/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.corrupted +0 -80
- package/claude-assets/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.deprecated +0 -1864
- package/claude-assets/skills/cfn-redis-coordination/tests/test_coordination_primitives.sh.deprecated +0 -20
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Execute single task through autonomous CFN Loop (natural language, file path, or partial reference)"
|
|
3
|
+
argument-hint: "<task description or file reference>"
|
|
4
|
+
allowed-tools: ["Task", "TodoWrite", "Read", "Write", "Edit", "Bash", "Glob", "Grep"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# CFN Loop Single - Single Task Autonomous Execution
|
|
8
|
+
|
|
9
|
+
Execute a single task through the CFN Loop without sprint/phase structure. Supports natural language, file paths, or partial file references.
|
|
10
|
+
|
|
11
|
+
🚨 **AUTONOMOUS SELF-LOOPING PROCESS**
|
|
12
|
+
|
|
13
|
+
**Task**: $ARGUMENTS
|
|
14
|
+
|
|
15
|
+
## CFN Loop Structure (4 Loops)
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
LOOP 0: Epic/Sprint Orchestration (use /cfn-loop-epic or /cfn-loop-sprints)
|
|
19
|
+
↓
|
|
20
|
+
LOOP 1: Phase Execution (this command - single phase)
|
|
21
|
+
↓
|
|
22
|
+
LOOP 2: Consensus Validation (≥90% Byzantine consensus)
|
|
23
|
+
↓
|
|
24
|
+
LOOP 3: Primary Swarm Execution (implementation with confidence scores)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Execution Pattern
|
|
28
|
+
|
|
29
|
+
**MANDATORY: Spawn single coordinator agent that manages all orchestration internally.**
|
|
30
|
+
|
|
31
|
+
The coordinator uses CLI spawning (95-98% cost savings) and provides full visibility via web portal.
|
|
32
|
+
|
|
33
|
+
### Step 1: Spawn Coordinator Agent (SINGLE AGENT PATTERN)
|
|
34
|
+
|
|
35
|
+
```javascript
|
|
36
|
+
Task("cfn-v3-coordinator", `
|
|
37
|
+
CFN LOOP SINGLE TASK EXECUTION
|
|
38
|
+
|
|
39
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
40
|
+
COST OPTIMIZATION - CUSTOM ROUTING (CRITICAL)
|
|
41
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
42
|
+
|
|
43
|
+
⚠️ IMPORTANT: Enable custom routing for maximum cost savings!
|
|
44
|
+
|
|
45
|
+
1. Enable routing (one-time setup):
|
|
46
|
+
/custom-routing-activate
|
|
47
|
+
|
|
48
|
+
2. Verify status:
|
|
49
|
+
/switch-api status
|
|
50
|
+
|
|
51
|
+
Cost Breakdown (per iteration):
|
|
52
|
+
┌─────────────────────┬──────────────┬────────────┐
|
|
53
|
+
│ Component │ Provider │ Cost/Call │
|
|
54
|
+
├─────────────────────┼──────────────┼────────────┤
|
|
55
|
+
│ Main Chat │ Anthropic │ $0.015 │
|
|
56
|
+
│ Coordinator (Task) │ Anthropic │ $0.015 │
|
|
57
|
+
│ Loop 3 Agents (CLI) │ Z.ai │ $0.003 ea │
|
|
58
|
+
│ Loop 2 Agents (CLI) │ Z.ai │ $0.003 ea │
|
|
59
|
+
│ Product Owner (CLI) │ Z.ai │ $0.003 │
|
|
60
|
+
└─────────────────────┴──────────────┴────────────┘
|
|
61
|
+
|
|
62
|
+
Expected Savings:
|
|
63
|
+
• WITH custom routing: ~64% cost reduction
|
|
64
|
+
• WITHOUT custom routing: Full Anthropic pricing
|
|
65
|
+
• Combined with CLI: 95-98% vs all-Task-tool
|
|
66
|
+
|
|
67
|
+
Key Concept:
|
|
68
|
+
- Task() agents use Main Chat provider (Anthropic)
|
|
69
|
+
- CLI-spawned agents use custom routing (Z.ai when enabled)
|
|
70
|
+
|
|
71
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
72
|
+
TASK SPECIFICATION
|
|
73
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
74
|
+
|
|
75
|
+
Task Description: $ARGUMENTS
|
|
76
|
+
Task ID: cfn-single-$(date +%s)
|
|
77
|
+
Mode: STANDARD (gate: 0.75, consensus: 0.90)
|
|
78
|
+
|
|
79
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
80
|
+
SUCCESS CRITERIA (REQUIRED - CUSTOMIZE FOR TASK)
|
|
81
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
82
|
+
|
|
83
|
+
Acceptance Criteria:
|
|
84
|
+
- [ ] Core functionality implemented
|
|
85
|
+
- [ ] Tests pass with >80% coverage
|
|
86
|
+
- [ ] Code reviewed for security
|
|
87
|
+
- [ ] Documentation complete
|
|
88
|
+
- [ ] No breaking changes
|
|
89
|
+
|
|
90
|
+
Quality Gates:
|
|
91
|
+
- Loop 3 Gate Threshold: 0.75 (standard mode)
|
|
92
|
+
- Loop 2 Consensus Threshold: 0.90 (standard mode)
|
|
93
|
+
- Max Loop 3 Iterations: 10
|
|
94
|
+
- Max Loop 2 Iterations: 10
|
|
95
|
+
|
|
96
|
+
Definition of Done:
|
|
97
|
+
- All acceptance criteria checked
|
|
98
|
+
- Consensus ≥0.90 achieved
|
|
99
|
+
- Product Owner approval
|
|
100
|
+
|
|
101
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
102
|
+
AGENT CONFIGURATION
|
|
103
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
104
|
+
|
|
105
|
+
Loop 3 Agents (Implementation):
|
|
106
|
+
- researcher (requirement analysis)
|
|
107
|
+
- backend-dev (implementation)
|
|
108
|
+
- devops (deployment/infrastructure)
|
|
109
|
+
|
|
110
|
+
Loop 2 Agents (Validation):
|
|
111
|
+
- reviewer (code review)
|
|
112
|
+
- architect (design validation)
|
|
113
|
+
- tester (quality assurance)
|
|
114
|
+
- security-specialist (security audit)
|
|
115
|
+
|
|
116
|
+
Product Owner: product-owner (GOAP decision-making)
|
|
117
|
+
|
|
118
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
119
|
+
EXECUTION INSTRUCTIONS
|
|
120
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
121
|
+
|
|
122
|
+
1. INVOKE ORCHESTRATOR:
|
|
123
|
+
./.claude/skills/cfn-cfn-orchestration/orchestrate.sh \\
|
|
124
|
+
--task-id "cfn-single-$(date +%s)" \\
|
|
125
|
+
--mode standard \\
|
|
126
|
+
--loop3-agents "researcher,backend-dev,devops" \\
|
|
127
|
+
--loop2-agents "reviewer,architect,tester,security-specialist" \\
|
|
128
|
+
--product-owner "product-owner" \\
|
|
129
|
+
--max-iterations 10
|
|
130
|
+
|
|
131
|
+
2. MONITOR PROGRESS:
|
|
132
|
+
- Web portal: http://localhost:3000
|
|
133
|
+
- CLI metrics: ./.claude/skills/cfn-web-portal/invoke-portal-agents.sh
|
|
134
|
+
- Event stream: ./.claude/skills/cfn-web-portal/invoke-portal-events.sh
|
|
135
|
+
|
|
136
|
+
3. REPORT STRUCTURED RESULT:
|
|
137
|
+
{
|
|
138
|
+
"taskId": "cfn-single-XXXXX",
|
|
139
|
+
"status": "complete|failed",
|
|
140
|
+
"iterations": {"loop3": N, "loop2": M},
|
|
141
|
+
"finalConsensus": 0.XX,
|
|
142
|
+
"acceptanceCriteria": {
|
|
143
|
+
"met": ["Core functionality", "Tests passing", ...],
|
|
144
|
+
"pending": ["Documentation"]
|
|
145
|
+
},
|
|
146
|
+
"recommendations": [...]
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
150
|
+
CRITICAL RULES
|
|
151
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
152
|
+
|
|
153
|
+
- DO NOT spawn agents with Task()
|
|
154
|
+
- LET orchestrator handle CLI spawning
|
|
155
|
+
- USE Redis BLPOP for dependencies
|
|
156
|
+
- PUBLISH events to web-portal channel
|
|
157
|
+
- RETURN structured result to Main Chat
|
|
158
|
+
`, "cfn-v3-coordinator")
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Step 2: Coordinator Autonomous Execution
|
|
162
|
+
|
|
163
|
+
The coordinator runs orchestrator script internally:
|
|
164
|
+
|
|
165
|
+
**Loop 3: Implementation**
|
|
166
|
+
- Spawns agents via CLI: `npx cfn-spawn agent <type>`
|
|
167
|
+
- Collects confidence scores
|
|
168
|
+
- Gate check (≥0.75): PASS → Wake Loop 2 | FAIL → Iterate
|
|
169
|
+
|
|
170
|
+
**Loop 2: Validation**
|
|
171
|
+
- **WAITS** for Loop 3 gate pass (Redis BLPOP)
|
|
172
|
+
- Spawns validators via CLI
|
|
173
|
+
- Collects consensus scores
|
|
174
|
+
- Consensus check (≥0.90): PASS → Complete | FAIL → Iterate
|
|
175
|
+
|
|
176
|
+
**Loop 1: Product Owner**
|
|
177
|
+
- GOAP decision-making
|
|
178
|
+
- Returns structured result to Main Chat
|
|
179
|
+
|
|
180
|
+
### Step 3: Visibility via Web Portal
|
|
181
|
+
|
|
182
|
+
**Monitor execution:**
|
|
183
|
+
```bash
|
|
184
|
+
# Start web portal (if not running)
|
|
185
|
+
./.claude/skills/cfn-web-portal/invoke-portal-start.sh
|
|
186
|
+
|
|
187
|
+
# View agents
|
|
188
|
+
./.claude/skills/cfn-web-portal/invoke-portal-agents.sh --status active
|
|
189
|
+
|
|
190
|
+
# Track events
|
|
191
|
+
./.claude/skills/cfn-web-portal/invoke-portal-events.sh --limit 50
|
|
192
|
+
|
|
193
|
+
# Get metrics
|
|
194
|
+
./.claude/skills/cfn-web-portal/invoke-portal-metrics.sh
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
**Web UI:** http://localhost:3000 (real-time updates)
|
|
198
|
+
|
|
199
|
+
## Autonomous Execution Rules
|
|
200
|
+
|
|
201
|
+
**YOU ARE FORBIDDEN FROM:**
|
|
202
|
+
- ❌ Asking "Should I retry?" (ALWAYS retry if iterations < 10)
|
|
203
|
+
- ❌ Asking "Proceed to next step?" (AUTO-PROCEED)
|
|
204
|
+
- ❌ Waiting for approval during CFN Loop cycles
|
|
205
|
+
|
|
206
|
+
**YOU MUST:**
|
|
207
|
+
- ✅ IMMEDIATELY relaunch Loop 3 on low confidence (iteration < 10)
|
|
208
|
+
- ✅ IMMEDIATELY relaunch Loop 3 on consensus failure (iteration < 10)
|
|
209
|
+
- ✅ AUTOMATICALLY select better agents based on failure analysis
|
|
210
|
+
- ✅ ONLY escalate when truly blocked (critical error or max iterations)
|
|
211
|
+
|
|
212
|
+
## Iteration Limits
|
|
213
|
+
- **Loop 2** (Consensus): 10 iterations max
|
|
214
|
+
- **Loop 3** (Primary Swarm): 10 iterations max
|
|
215
|
+
|
|
216
|
+
## Example Execution
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
[Turn 1] Loop 3 Iteration 1/10
|
|
220
|
+
→ Primary swarm (coder, tester, backend-dev)
|
|
221
|
+
→ Confidence: 68%, 72%, 85%
|
|
222
|
+
→ Gate FAILS (2 agents <75%)
|
|
223
|
+
→ IMMEDIATELY retry Loop 3 (autonomous)
|
|
224
|
+
|
|
225
|
+
[Turn 2] Loop 3 Iteration 2/10
|
|
226
|
+
→ Primary swarm with feedback
|
|
227
|
+
→ Confidence: 82%, 79%, 88%
|
|
228
|
+
→ Gate PASSES (all ≥75%)
|
|
229
|
+
→ Proceed to Loop 2
|
|
230
|
+
|
|
231
|
+
[Turn 3] Loop 2 Iteration 1/10
|
|
232
|
+
→ Consensus validators spawned
|
|
233
|
+
→ Consensus: 85% (below 90%)
|
|
234
|
+
→ IMMEDIATELY retry (autonomous)
|
|
235
|
+
|
|
236
|
+
[Turn 4] Loop 2 Iteration 2/10
|
|
237
|
+
→ Product Owner: PROCEED (GOAP cost=50)
|
|
238
|
+
→ Loop 3 relaunched with targeted agents
|
|
239
|
+
→ Consensus achieved: 94% ✅
|
|
240
|
+
→ PHASE COMPLETE
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## Output Format
|
|
244
|
+
|
|
245
|
+
Concise, action-oriented:
|
|
246
|
+
```
|
|
247
|
+
Loop 3 Iteration 2/10 - Confidence: 82% avg ✅
|
|
248
|
+
Proceeding to Loop 2 (Consensus)...
|
|
249
|
+
|
|
250
|
+
Loop 2 Iteration 1/10 - Consensus: 87% ❌
|
|
251
|
+
Product Owner: PROCEED (5 in-scope blockers)
|
|
252
|
+
IMMEDIATELY relaunching Loop 3 with:
|
|
253
|
+
- backend-dev (fix SQL injection)
|
|
254
|
+
- security-specialist (validate fix)
|
|
255
|
+
[Executing autonomously - no permission needed]
|
|
256
|
+
```
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Execute single phase with multiple sprints using CFN Loop autonomous coordination"
|
|
3
|
+
argument-hint: "<phase description>"
|
|
4
|
+
allowed-tools: ["Task", "TodoWrite", "Read", "Write", "Edit", "Bash", "Glob", "Grep"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# CFN Loop Sprints - Single Phase, Multiple Sprints
|
|
8
|
+
|
|
9
|
+
Execute a single phase broken into multiple sprints using CFN Loop autonomous coordination.
|
|
10
|
+
|
|
11
|
+
🚨 **AUTONOMOUS SPRINT-BASED SELF-LOOPING PROCESS**
|
|
12
|
+
|
|
13
|
+
**Phase Goal**: $ARGUMENTS
|
|
14
|
+
|
|
15
|
+
## CFN Loop Structure (4 Loops)
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
LOOP 0: Epic/Sprint Orchestration (THIS COMMAND - sprint level)
|
|
19
|
+
├─ Sprint 1 → Sprint 2 → Sprint 3 → ... → Sprint N
|
|
20
|
+
↓
|
|
21
|
+
LOOP 1: Phase Execution (single phase with multiple sprints)
|
|
22
|
+
↓
|
|
23
|
+
LOOP 2: Consensus Validation (≥90% Byzantine consensus per sprint)
|
|
24
|
+
↓
|
|
25
|
+
LOOP 3: Primary Swarm Execution (implementation with confidence scores)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Sprint Planning (Loop 0)
|
|
29
|
+
|
|
30
|
+
### Step 1: Parse Phase into Sprints
|
|
31
|
+
```javascript
|
|
32
|
+
const sprintPlan = {
|
|
33
|
+
phase_name: "User Authentication",
|
|
34
|
+
sprints: [
|
|
35
|
+
{
|
|
36
|
+
sprint_id: "1.1",
|
|
37
|
+
name: "Core Login API",
|
|
38
|
+
deliverables: [
|
|
39
|
+
"POST /auth/login endpoint",
|
|
40
|
+
"JWT token generation",
|
|
41
|
+
"Password validation"
|
|
42
|
+
],
|
|
43
|
+
estimated_agents: 3,
|
|
44
|
+
dependencies: []
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
sprint_id: "1.2",
|
|
48
|
+
name: "Password Security",
|
|
49
|
+
deliverables: [
|
|
50
|
+
"bcrypt password hashing",
|
|
51
|
+
"Salt generation",
|
|
52
|
+
"Hash verification"
|
|
53
|
+
],
|
|
54
|
+
estimated_agents: 2,
|
|
55
|
+
dependencies: ["1.1"]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
sprint_id: "1.3",
|
|
59
|
+
name: "Token Management",
|
|
60
|
+
deliverables: [
|
|
61
|
+
"Token refresh endpoint",
|
|
62
|
+
"Token expiration handling",
|
|
63
|
+
"Token blacklisting"
|
|
64
|
+
],
|
|
65
|
+
estimated_agents: 4,
|
|
66
|
+
dependencies: ["1.1", "1.2"]
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Step 2: Store Scope Boundaries (Per Sprint)
|
|
73
|
+
```javascript
|
|
74
|
+
mcp__claude-flow-novice__memory_usage({
|
|
75
|
+
action: "store",
|
|
76
|
+
namespace: "scope-control",
|
|
77
|
+
key: "sprint-boundaries",
|
|
78
|
+
value: JSON.stringify({
|
|
79
|
+
primary_goal: "User Authentication Phase",
|
|
80
|
+
sprint_scope: {
|
|
81
|
+
"1.1": {
|
|
82
|
+
in_scope: ["Login API", "JWT generation", "Basic validation"],
|
|
83
|
+
out_of_scope: ["OAuth", "MFA", "Password reset"]
|
|
84
|
+
},
|
|
85
|
+
"1.2": {
|
|
86
|
+
in_scope: ["bcrypt hashing", "Salt generation"],
|
|
87
|
+
out_of_scope: ["Argon2", "Key derivation functions"]
|
|
88
|
+
},
|
|
89
|
+
"1.3": {
|
|
90
|
+
in_scope: ["Refresh tokens", "Expiration", "Blacklist"],
|
|
91
|
+
out_of_scope: ["Sliding sessions", "Device tracking"]
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
risk_profile: "public-facing-medium-risk"
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Sprint Execution (Loop 1)
|
|
100
|
+
|
|
101
|
+
For EACH sprint in phase:
|
|
102
|
+
|
|
103
|
+
### Sprint Initialization (MANDATORY Coordinator Pattern)
|
|
104
|
+
|
|
105
|
+
**CRITICAL:** Use CFN Loop Coordinator agent with automatic orchestration.
|
|
106
|
+
|
|
107
|
+
```javascript
|
|
108
|
+
// SPRINT 1.1: Core Login API - Spawn coordinator (DO NOT spawn implementers directly)
|
|
109
|
+
Task("CFN Loop Coordinator", `
|
|
110
|
+
Execute CFN Loop for Sprint ${sprintId}: ${sprintName}
|
|
111
|
+
|
|
112
|
+
MANDATORY: Use orchestrator script for dependency enforcement.
|
|
113
|
+
|
|
114
|
+
./.claude/skills/cfn-cfn-orchestration/orchestrate.sh \
|
|
115
|
+
--task-id "sprint-${sprintId}-$(date +%s)" \
|
|
116
|
+
--mode standard \
|
|
117
|
+
--loop3-agents "backend-dev,tester,security-specialist" \
|
|
118
|
+
--loop2-agents "reviewer,architect" \
|
|
119
|
+
--product-owner "product-owner" \
|
|
120
|
+
--max-iterations 10
|
|
121
|
+
|
|
122
|
+
The orchestrator will:
|
|
123
|
+
- Spawn all agents automatically
|
|
124
|
+
- Enforce BLPOP dependency blocking
|
|
125
|
+
- Collect consensus after validators finish
|
|
126
|
+
- Wake agents for next iteration if needed
|
|
127
|
+
- Report final result
|
|
128
|
+
|
|
129
|
+
DO NOT spawn agents manually with Task().
|
|
130
|
+
`, "cfn-loop-coordinator")
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Alternative: Manual Spawning (NOT RECOMMENDED)
|
|
134
|
+
|
|
135
|
+
If you must spawn agents manually (NOT recommended due to lack of dependency enforcement), follow this pattern:
|
|
136
|
+
|
|
137
|
+
```javascript
|
|
138
|
+
// Initialize swarm for sprint
|
|
139
|
+
mcp__claude-flow-novice__swarm_init({
|
|
140
|
+
topology: "mesh",
|
|
141
|
+
maxAgents: 3,
|
|
142
|
+
strategy: "balanced"
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
// Execute Loop 3 (Primary Swarm)
|
|
146
|
+
Task("Backend Dev 1", `
|
|
147
|
+
Implement POST /auth/login endpoint
|
|
148
|
+
|
|
149
|
+
MANDATORY: After EVERY file edit:
|
|
150
|
+
node config/hooks/post-edit-pipeline.js "[FILE_PATH]" --memory-key "swarm/sprint-1.1/backend-1"
|
|
151
|
+
|
|
152
|
+
Report confidence score when complete.
|
|
153
|
+
`, "backend-dev")
|
|
154
|
+
|
|
155
|
+
// ... more agents
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Sprint Self-Assessment Gate
|
|
159
|
+
```javascript
|
|
160
|
+
// Collect confidence scores
|
|
161
|
+
const sprintConfidence = {
|
|
162
|
+
"backend-1": 0.88,
|
|
163
|
+
"tester-1": 0.82,
|
|
164
|
+
"security-1": 0.79
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Gate logic
|
|
168
|
+
if (allAgents >= 0.75) {
|
|
169
|
+
// PROCEED to Loop 2 (Consensus)
|
|
170
|
+
console.log("Sprint ${sprintId} gate PASSED. Proceeding to consensus...");
|
|
171
|
+
} else {
|
|
172
|
+
// RELAUNCH Loop 3 (autonomous retry)
|
|
173
|
+
console.log("Sprint ${sprintId} gate FAILED. Relaunching Loop 3 with feedback...");
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Sprint Consensus Validation
|
|
178
|
+
```javascript
|
|
179
|
+
// MESSAGE 2: Validators (AFTER sprint implementation complete)
|
|
180
|
+
mcp__claude-flow-novice__swarm_init({
|
|
181
|
+
topology: "mesh",
|
|
182
|
+
maxAgents: 2,
|
|
183
|
+
strategy: "balanced"
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
Task("Reviewer 1", `
|
|
187
|
+
Review completed Sprint ${sprintId} work:
|
|
188
|
+
- Files: [list specific files]
|
|
189
|
+
- Deliverables: ${JSON.stringify(deliverables)}
|
|
190
|
+
|
|
191
|
+
Validate code quality, test coverage, security.
|
|
192
|
+
Report consensus score.
|
|
193
|
+
`, "reviewer")
|
|
194
|
+
|
|
195
|
+
Task("Architect 1", `
|
|
196
|
+
Validate Sprint ${sprintId} architecture:
|
|
197
|
+
- API design consistency
|
|
198
|
+
- Integration patterns
|
|
199
|
+
- Scalability considerations
|
|
200
|
+
|
|
201
|
+
Report consensus score.
|
|
202
|
+
`, "architect")
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Sprint Product Owner Decision
|
|
206
|
+
```javascript
|
|
207
|
+
Task("Product Owner", `
|
|
208
|
+
GOAP DECISION - Sprint ${sprintId} Complete
|
|
209
|
+
|
|
210
|
+
CURRENT STATE:
|
|
211
|
+
- Sprint ${sprintId} consensus: ${consensusScore}
|
|
212
|
+
- Remaining sprints: ${remainingSprints}
|
|
213
|
+
- Validator concerns: ${concerns}
|
|
214
|
+
|
|
215
|
+
RETRIEVE SPRINT SCOPE:
|
|
216
|
+
mcp__claude-flow-novice__memory_usage({
|
|
217
|
+
action: "retrieve",
|
|
218
|
+
namespace: "scope-control",
|
|
219
|
+
key: "sprint-boundaries"
|
|
220
|
+
})
|
|
221
|
+
|
|
222
|
+
EXECUTE GOAP A* SEARCH:
|
|
223
|
+
1. Classify concerns by sprint scope
|
|
224
|
+
2. Calculate cost: in-scope fix vs defer to backlog
|
|
225
|
+
3. A* pathfinding for optimal decision
|
|
226
|
+
4. Make autonomous decision
|
|
227
|
+
|
|
228
|
+
DECISION OPTIONS:
|
|
229
|
+
- PROCEED_NEXT_SPRINT (dependencies satisfied, scope intact)
|
|
230
|
+
- RELAUNCH_SPRINT (in-scope blockers remain)
|
|
231
|
+
- DEFER_CONCERNS (out-of-scope, save to backlog)
|
|
232
|
+
|
|
233
|
+
OUTPUT: {decision: "...", next_action: "..."}
|
|
234
|
+
`, "product-owner")
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Sprint Transition Logic
|
|
238
|
+
```javascript
|
|
239
|
+
// Product Owner decision outcomes
|
|
240
|
+
switch (decision) {
|
|
241
|
+
case "PROCEED_NEXT_SPRINT":
|
|
242
|
+
// Store sprint results
|
|
243
|
+
mcp__claude-flow-novice__memory_usage({
|
|
244
|
+
action: "store",
|
|
245
|
+
namespace: "sprint-progress",
|
|
246
|
+
key: `sprint-${sprintId}-results`,
|
|
247
|
+
value: JSON.stringify({
|
|
248
|
+
consensus: consensusScore,
|
|
249
|
+
deliverables: completedDeliverables,
|
|
250
|
+
timestamp: Date.now()
|
|
251
|
+
})
|
|
252
|
+
})
|
|
253
|
+
|
|
254
|
+
// Check next sprint dependencies
|
|
255
|
+
const nextSprint = sprintPlan.sprints[currentSprintIndex + 1];
|
|
256
|
+
if (dependenciesSatisfied(nextSprint)) {
|
|
257
|
+
// IMMEDIATELY transition (NO approval needed)
|
|
258
|
+
console.log(`IMMEDIATELY transitioning to Sprint ${nextSprint.sprint_id}...`);
|
|
259
|
+
executeSprint(nextSprint);
|
|
260
|
+
}
|
|
261
|
+
break;
|
|
262
|
+
|
|
263
|
+
case "RELAUNCH_SPRINT":
|
|
264
|
+
// IMMEDIATELY relaunch Loop 3 with targeted agents (NO approval)
|
|
265
|
+
console.log(`Relaunching Sprint ${sprintId} Loop 3 with targeted agents...`);
|
|
266
|
+
break;
|
|
267
|
+
|
|
268
|
+
case "DEFER_CONCERNS":
|
|
269
|
+
// Save to backlog, proceed to next sprint
|
|
270
|
+
console.log(`Deferred out-of-scope items. Proceeding to next sprint...`);
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## Autonomous Sprint Execution
|
|
276
|
+
|
|
277
|
+
**FORBIDDEN PATTERNS:**
|
|
278
|
+
- ❌ "Sprint 1.1 complete. Proceed to Sprint 1.2?" (AUTO-PROCEED)
|
|
279
|
+
- ❌ "Should I continue with sprints?" (ALWAYS continue until all sprints done)
|
|
280
|
+
- ❌ Waiting for approval between sprints (AUTONOMOUS TRANSITION)
|
|
281
|
+
|
|
282
|
+
**REQUIRED PATTERNS:**
|
|
283
|
+
```
|
|
284
|
+
Sprint 1.1 consensus: 93% ✅
|
|
285
|
+
Dependencies for Sprint 1.2 satisfied.
|
|
286
|
+
IMMEDIATELY transitioning to Sprint 1.2...
|
|
287
|
+
|
|
288
|
+
Sprint 1.2: Password Security
|
|
289
|
+
[Spawning agents autonomously - no permission needed]
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
## Iteration Limits (Per Sprint)
|
|
293
|
+
- **Loop 2** (Consensus): 10 iterations max per sprint
|
|
294
|
+
- **Loop 3** (Primary Swarm): 10 iterations max per sprint
|
|
295
|
+
- **Loop 1** (Sprints): Unlimited (continues until all sprints complete)
|
|
296
|
+
|
|
297
|
+
## Sprint Progress Tracking
|
|
298
|
+
|
|
299
|
+
```javascript
|
|
300
|
+
// Query sprint progress
|
|
301
|
+
mcp__claude-flow-novice__memory_usage({
|
|
302
|
+
action: "list",
|
|
303
|
+
namespace: "sprint-progress"
|
|
304
|
+
})
|
|
305
|
+
|
|
306
|
+
// Output:
|
|
307
|
+
{
|
|
308
|
+
"sprint-1.1-results": {consensus: 0.93, deliverables: [...]},
|
|
309
|
+
"sprint-1.2-results": {consensus: 0.88, deliverables: [...]},
|
|
310
|
+
"sprint-1.3-results": null // Current sprint in progress
|
|
311
|
+
}
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
## Example Sprint Execution
|
|
315
|
+
|
|
316
|
+
```
|
|
317
|
+
[Turn 1] Phase: User Authentication (3 sprints)
|
|
318
|
+
→ Sprint scope boundaries stored
|
|
319
|
+
→ Sprint 1.1: Core Login API
|
|
320
|
+
|
|
321
|
+
[Turn 2-3] Sprint 1.1 Execution
|
|
322
|
+
→ Loop 3 (backend-dev, tester, security)
|
|
323
|
+
→ Gate PASSES (all ≥75%)
|
|
324
|
+
→ Loop 2 consensus: 93% ✅
|
|
325
|
+
→ Product Owner: PROCEED_NEXT_SPRINT
|
|
326
|
+
|
|
327
|
+
[Turn 4] AUTONOMOUS TRANSITION
|
|
328
|
+
→ Dependencies for Sprint 1.2 satisfied
|
|
329
|
+
→ IMMEDIATELY starting Sprint 1.2: Password Security
|
|
330
|
+
|
|
331
|
+
[Turn 5-6] Sprint 1.2 Execution
|
|
332
|
+
→ Loop 3 (2 agents - smaller scope)
|
|
333
|
+
→ Consensus: 88% ✅
|
|
334
|
+
→ Product Owner: DEFER (Argon2 out-of-scope)
|
|
335
|
+
|
|
336
|
+
[Turn 7] AUTONOMOUS TRANSITION
|
|
337
|
+
→ Sprint 1.3: Token Management
|
|
338
|
+
|
|
339
|
+
[Turn 8-10] Sprint 1.3 Execution
|
|
340
|
+
→ Final sprint completion
|
|
341
|
+
→ Phase COMPLETE ✅
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
## Output Format
|
|
345
|
+
|
|
346
|
+
```
|
|
347
|
+
Phase: User Authentication (3 sprints)
|
|
348
|
+
Sprint 1.1/1.3: Core Login API
|
|
349
|
+
|
|
350
|
+
Loop 3 Iteration 1/10 - Confidence: 87% avg ✅
|
|
351
|
+
Loop 2 Iteration 1/10 - Consensus: 93% ✅
|
|
352
|
+
|
|
353
|
+
Sprint 1.1 COMPLETE
|
|
354
|
+
Dependencies satisfied for Sprint 1.2.
|
|
355
|
+
IMMEDIATELY transitioning to Sprint 1.2...
|
|
356
|
+
|
|
357
|
+
─────────────────────────────────
|
|
358
|
+
Sprint 1.2/1.3: Password Security
|
|
359
|
+
[Executing autonomously - no permission needed]
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
## Phase Completion
|
|
363
|
+
|
|
364
|
+
When final sprint achieves ≥90% consensus:
|
|
365
|
+
```
|
|
366
|
+
Sprint 1.3 COMPLETE - Consensus: 91% ✅
|
|
367
|
+
|
|
368
|
+
Phase: User Authentication - ALL SPRINTS COMPLETE ✅
|
|
369
|
+
- Sprint 1.1: Core Login API (93%)
|
|
370
|
+
- Sprint 1.2: Password Security (88%)
|
|
371
|
+
- Sprint 1.3: Token Management (91%)
|
|
372
|
+
|
|
373
|
+
Deferred items saved to backlog:
|
|
374
|
+
- OAuth integration (out-of-scope)
|
|
375
|
+
- Argon2 hashing (out-of-scope)
|
|
376
|
+
- Sliding session windows (out-of-scope)
|
|
377
|
+
|
|
378
|
+
Phase execution complete. Self-looping terminated.
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
## Integration with Epic
|
|
382
|
+
|
|
383
|
+
If this phase is part of a larger epic, results are stored for epic-level tracking:
|
|
384
|
+
```javascript
|
|
385
|
+
mcp__claude-flow-novice__memory_usage({
|
|
386
|
+
action: "store",
|
|
387
|
+
namespace: "epic-progress",
|
|
388
|
+
key: "phase-1-results",
|
|
389
|
+
value: JSON.stringify({
|
|
390
|
+
phase_name: "User Authentication",
|
|
391
|
+
sprints_completed: ["1.1", "1.2", "1.3"],
|
|
392
|
+
overall_consensus: 0.91,
|
|
393
|
+
ready_for_next_phase: true
|
|
394
|
+
})
|
|
395
|
+
})
|
|
396
|
+
```
|
|
@@ -4,13 +4,21 @@ argument-hint: "<task description> [--mode=mvp|standard|enterprise] [--max-itera
|
|
|
4
4
|
allowed-tools: ["Task", "TodoWrite", "Read", "Write", "Edit", "Bash", "Glob", "Grep"]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# 🚨 TASK MODE INSTRUCTIONS FOR MAIN CHAT
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**YOU are executing this CFN Loop. These are YOUR instructions.**
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
**Task to execute**: $ARGUMENTS
|
|
12
12
|
|
|
13
|
-
|
|
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
|
|
14
22
|
|
|
15
23
|
## What is Task Mode?
|
|
16
24
|
|
|
@@ -81,17 +89,27 @@ Cost: 3x CLI mode, but full visibility for debugging
|
|
|
81
89
|
| Standard | ≥0.75 | ≥0.90 | 10 | 3-4 | Production features |
|
|
82
90
|
| Enterprise | ≥0.85 | ≥0.95 | 15 | 5 | Security, compliance, critical systems |
|
|
83
91
|
|
|
84
|
-
##
|
|
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.
|
|
85
101
|
|
|
86
|
-
|
|
102
|
+
---
|
|
87
103
|
|
|
88
104
|
### Step 1: Read Task Mode Guide
|
|
89
105
|
|
|
90
|
-
|
|
91
|
-
const guide = Read('.claude/commands/cfn/CFN_LOOP_TASK_MODE.md');
|
|
106
|
+
Read the complete Task Mode guide for detailed workflow:
|
|
92
107
|
|
|
93
|
-
console.log('Task Mode: Main Chat coordinating CFN Loop directly');
|
|
94
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
|
|
95
113
|
|
|
96
114
|
### Step 2: Analyze Task Complexity
|
|
97
115
|
|