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
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "Compact conversation history to reduce token usage and maintain context efficiency"
|
|
3
|
-
argument-hint: "[--focus=<topic>] [--threshold=<percentage>]"
|
|
4
|
-
allowed-tools: ["Read", "Write", "Bash", "TodoWrite"]
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Auto-Compact - Programmatic Context Compression
|
|
8
|
-
|
|
9
|
-
Summarize and compress conversation history while preserving key facts, decisions, and context.
|
|
10
|
-
|
|
11
|
-
**Task**: $ARGUMENTS
|
|
12
|
-
|
|
13
|
-
## Command Options
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
/auto-compact
|
|
17
|
-
/auto-compact --focus="security decisions and API changes"
|
|
18
|
-
/auto-compact --threshold=70
|
|
19
|
-
/auto-compact --focus="CFN Loop implementation" --threshold=75
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
**Options:**
|
|
23
|
-
- `--focus=<topic>`: Focus summarization on specific topics (optional)
|
|
24
|
-
- `--threshold=<percentage>`: Token usage threshold to trigger compact (default: 70)
|
|
25
|
-
|
|
26
|
-
## Current Session Analysis
|
|
27
|
-
|
|
28
|
-
**Token Usage**: Check current context usage and determine if compaction is needed.
|
|
29
|
-
|
|
30
|
-
## Compaction Strategy
|
|
31
|
-
|
|
32
|
-
### What to Preserve
|
|
33
|
-
- Key architectural decisions
|
|
34
|
-
- Active task progress and todos
|
|
35
|
-
- Critical bug fixes and security changes
|
|
36
|
-
- Recent consensus validations
|
|
37
|
-
- Current phase/sprint context
|
|
38
|
-
|
|
39
|
-
### What to Compress
|
|
40
|
-
- Verbose implementation details
|
|
41
|
-
- Exploratory discussions
|
|
42
|
-
- Resolved issues and completed tasks
|
|
43
|
-
- Historical context from earlier phases
|
|
44
|
-
- Redundant explanations
|
|
45
|
-
|
|
46
|
-
## Execution Steps
|
|
47
|
-
|
|
48
|
-
1. **Analyze Current Context**: Review token usage and conversation flow
|
|
49
|
-
2. **Extract Key Facts**: Identify critical decisions, active work, and essential context
|
|
50
|
-
3. **Generate Summary**: Create concise summary preserving:
|
|
51
|
-
- Active tasks and blockers
|
|
52
|
-
- Recent decisions (last 10-20% of conversation)
|
|
53
|
-
- Phase/sprint progress
|
|
54
|
-
- Technical debt items
|
|
55
|
-
- Next steps
|
|
56
|
-
4. **Recommend Action**: Suggest when user should run `/compact` with optimal focus
|
|
57
|
-
|
|
58
|
-
## Output Format
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
📊 **Context Analysis**
|
|
62
|
-
- Current tokens: X/200k (Y%)
|
|
63
|
-
- Recommendation: [COMPACT NOW | DEFER | MONITOR]
|
|
64
|
-
|
|
65
|
-
🎯 **Suggested Compact Focus**
|
|
66
|
-
[Generated focus string based on conversation]
|
|
67
|
-
|
|
68
|
-
💡 **Summary Preview**
|
|
69
|
-
[Key facts to preserve in compact]
|
|
70
|
-
|
|
71
|
-
✅ **Action Required**
|
|
72
|
-
Run: /compact focus: "[generated focus]"
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Notes
|
|
76
|
-
|
|
77
|
-
- This command **analyzes** and **recommends** compaction
|
|
78
|
-
- User must manually run `/compact` (built-in command)
|
|
79
|
-
- Threshold default: 70% (140k/200k tokens)
|
|
80
|
-
- Auto-triggered at 95% by Claude Code built-in
|
|
@@ -1,478 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "Execute multi-phase epic with CFN Loop orchestration and autonomous phase transitions"
|
|
3
|
-
argument-hint: "<epic description>"
|
|
4
|
-
allowed-tools: ["Task", "TodoWrite", "Read", "Write", "Edit", "Bash", "Glob", "Grep"]
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# CFN Loop Epic - Multi-Phase Autonomous Development
|
|
8
|
-
|
|
9
|
-
Execute a large multi-phase epic using the full 4-loop CFN structure with autonomous phase orchestration.
|
|
10
|
-
|
|
11
|
-
🚨 **AUTONOMOUS MULTI-PHASE SELF-LOOPING PROCESS**
|
|
12
|
-
|
|
13
|
-
**Epic Goal**: $ARGUMENTS
|
|
14
|
-
|
|
15
|
-
## CFN Loop Structure (4 Loops)
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
LOOP 0: Epic/Sprint Orchestration (THIS COMMAND)
|
|
19
|
-
├─ Phase 1 → Phase 2 → Phase 3 → ... → Phase N
|
|
20
|
-
↓
|
|
21
|
-
LOOP 1: Phase Execution (current phase)
|
|
22
|
-
↓
|
|
23
|
-
LOOP 2: Consensus Validation (≥90% Byzantine consensus)
|
|
24
|
-
↓
|
|
25
|
-
LOOP 3: Primary Swarm Execution (implementation with confidence scores)
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Epic Planning (Loop 0)
|
|
29
|
-
|
|
30
|
-
### Step 1: Parse Epic into Phases
|
|
31
|
-
```javascript
|
|
32
|
-
// Use parse-epic utility to break down epic
|
|
33
|
-
const epicPlan = {
|
|
34
|
-
epic_name: "auth-system",
|
|
35
|
-
phases: [
|
|
36
|
-
{
|
|
37
|
-
phase_id: "1",
|
|
38
|
-
name: "User Authentication",
|
|
39
|
-
deliverables: ["Login API", "JWT generation", "Password hashing"],
|
|
40
|
-
dependencies: [],
|
|
41
|
-
estimated_agents: 5
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
phase_id: "2",
|
|
45
|
-
name: "Authorization & RBAC",
|
|
46
|
-
deliverables: ["Role system", "Permission checks", "Middleware"],
|
|
47
|
-
dependencies: ["1"],
|
|
48
|
-
estimated_agents: 6
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
phase_id: "3",
|
|
52
|
-
name: "Session Management",
|
|
53
|
-
deliverables: ["Refresh tokens", "Logout", "Session tracking"],
|
|
54
|
-
dependencies: ["1", "2"],
|
|
55
|
-
estimated_agents: 4
|
|
56
|
-
}
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### Step 2: Store Scope Boundaries (CRITICAL)
|
|
62
|
-
```javascript
|
|
63
|
-
mcp__claude-flow-novice__memory_usage({
|
|
64
|
-
action: "store",
|
|
65
|
-
namespace: "scope-control",
|
|
66
|
-
key: "project-boundaries",
|
|
67
|
-
value: JSON.stringify({
|
|
68
|
-
primary_goal: "Build complete authentication system",
|
|
69
|
-
in_scope: [
|
|
70
|
-
"JWT authentication",
|
|
71
|
-
"Role-based access control",
|
|
72
|
-
"Session management",
|
|
73
|
-
"Password security (bcrypt)"
|
|
74
|
-
],
|
|
75
|
-
out_of_scope: [
|
|
76
|
-
"OAuth/social login",
|
|
77
|
-
"Multi-factor authentication",
|
|
78
|
-
"Biometric authentication",
|
|
79
|
-
"Advanced rate limiting beyond basic"
|
|
80
|
-
],
|
|
81
|
-
risk_profile: "public-facing-medium-risk",
|
|
82
|
-
decision_authority_config: {
|
|
83
|
-
auto_approve_threshold: 0.90,
|
|
84
|
-
auto_relaunch_max_iteration: 10,
|
|
85
|
-
escalation_criteria: ["security vulnerability", "data loss risk"]
|
|
86
|
-
}
|
|
87
|
-
})
|
|
88
|
-
})
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## Phase Execution (Loop 1)
|
|
92
|
-
|
|
93
|
-
**MANDATORY: Spawn single coordinator agent that manages ALL phases autonomously.**
|
|
94
|
-
|
|
95
|
-
The coordinator uses CLI spawning per phase and provides full visibility via web portal.
|
|
96
|
-
|
|
97
|
-
### Epic Pattern (SINGLE COORDINATOR FOR ALL PHASES)
|
|
98
|
-
|
|
99
|
-
```javascript
|
|
100
|
-
Task("cfn-v3-coordinator", `
|
|
101
|
-
CFN LOOP EPIC EXECUTION - MULTI-PHASE
|
|
102
|
-
|
|
103
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
104
|
-
COST OPTIMIZATION - CUSTOM ROUTING (CRITICAL)
|
|
105
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
106
|
-
|
|
107
|
-
⚠️ IMPORTANT: Enable custom routing for maximum cost savings!
|
|
108
|
-
|
|
109
|
-
1. Enable routing (one-time setup):
|
|
110
|
-
/custom-routing-activate
|
|
111
|
-
|
|
112
|
-
2. Verify status:
|
|
113
|
-
/switch-api status
|
|
114
|
-
|
|
115
|
-
Cost Breakdown (PER PHASE, per iteration):
|
|
116
|
-
┌─────────────────────┬──────────────┬────────────┐
|
|
117
|
-
│ Component │ Provider │ Cost/Call │
|
|
118
|
-
├─────────────────────┼──────────────┼────────────┤
|
|
119
|
-
│ Main Chat │ Anthropic │ $0.015 │
|
|
120
|
-
│ Coordinator (Task) │ Anthropic │ $0.015 │
|
|
121
|
-
│ Loop 3 Agents (CLI) │ Z.ai │ $0.003 ea │
|
|
122
|
-
│ Loop 2 Agents (CLI) │ Z.ai │ $0.003 ea │
|
|
123
|
-
│ Product Owner (CLI) │ Z.ai │ $0.003 │
|
|
124
|
-
└─────────────────────┴──────────────┴────────────┘
|
|
125
|
-
|
|
126
|
-
Epic Cost Example (3 phases, 2 iterations each):
|
|
127
|
-
• WITH custom routing: ~$0.30 total
|
|
128
|
-
• WITHOUT custom routing: ~$0.90 total
|
|
129
|
-
• SAVINGS: ~67% cost reduction
|
|
130
|
-
|
|
131
|
-
Key Concept:
|
|
132
|
-
- Task() agents use Main Chat provider (Anthropic)
|
|
133
|
-
- CLI-spawned agents use custom routing (Z.ai when enabled)
|
|
134
|
-
- Cost multiplies by number of phases and iterations
|
|
135
|
-
|
|
136
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
137
|
-
EPIC SPECIFICATION
|
|
138
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
139
|
-
|
|
140
|
-
Epic Goal: $ARGUMENTS
|
|
141
|
-
Epic ID: epic-$(date +%s)
|
|
142
|
-
Mode: STANDARD (gate: 0.75, consensus: 0.90)
|
|
143
|
-
|
|
144
|
-
Phases (ANALYZE EPIC AND DEFINE):
|
|
145
|
-
# Parse epic description and break into phases
|
|
146
|
-
# Example structure:
|
|
147
|
-
Phase 0: Assessment
|
|
148
|
-
- Deliverables: Requirements analysis, Architecture design
|
|
149
|
-
- Dependencies: None
|
|
150
|
-
- Estimated agents: 2 (analyst, architect)
|
|
151
|
-
|
|
152
|
-
Phase 1: Core Implementation
|
|
153
|
-
- Deliverables: Main features, API endpoints
|
|
154
|
-
- Dependencies: Phase 0
|
|
155
|
-
- Estimated agents: 3 (backend-dev, researcher, devops)
|
|
156
|
-
|
|
157
|
-
Phase 2: Validation
|
|
158
|
-
- Deliverables: Tests, Security audit, Documentation
|
|
159
|
-
- Dependencies: Phase 0, Phase 1
|
|
160
|
-
- Estimated agents: 3 (tester, reviewer, security-specialist)
|
|
161
|
-
|
|
162
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
163
|
-
EPIC-LEVEL SUCCESS CRITERIA
|
|
164
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
165
|
-
|
|
166
|
-
Scope Boundaries (CRITICAL - ENFORCE STRICTLY):
|
|
167
|
-
|
|
168
|
-
In Scope (EXAMPLE - CUSTOMIZE FOR YOUR EPIC):
|
|
169
|
-
- Feature implementation as described
|
|
170
|
-
- Basic testing and validation
|
|
171
|
-
- Essential documentation
|
|
172
|
-
- Security fundamentals
|
|
173
|
-
|
|
174
|
-
Out of Scope (DEFER TO BACKLOG - EXAMPLE):
|
|
175
|
-
- Advanced features not in core spec
|
|
176
|
-
- Performance optimization beyond basics
|
|
177
|
-
- Additional integrations
|
|
178
|
-
- Nice-to-have features
|
|
179
|
-
|
|
180
|
-
Epic-Level Acceptance Criteria:
|
|
181
|
-
- [ ] All phases complete with consensus ≥0.90
|
|
182
|
-
- [ ] All deliverables implemented
|
|
183
|
-
- [ ] Integration tests pass
|
|
184
|
-
- [ ] Security audit complete
|
|
185
|
-
- [ ] Documentation updated
|
|
186
|
-
- [ ] No scope creep (out-of-scope items deferred)
|
|
187
|
-
|
|
188
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
189
|
-
PHASE-BY-PHASE EXECUTION
|
|
190
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
191
|
-
|
|
192
|
-
For EACH phase:
|
|
193
|
-
|
|
194
|
-
1. CHECK DEPENDENCIES:
|
|
195
|
-
- Verify all dependency phases complete
|
|
196
|
-
- Load previous phase results from memory
|
|
197
|
-
|
|
198
|
-
2. STORE SCOPE BOUNDARIES:
|
|
199
|
-
mcp__claude-flow-novice__memory_usage({
|
|
200
|
-
action: "store",
|
|
201
|
-
namespace: "scope-control",
|
|
202
|
-
key: "epic-${EPIC_ID}-scope",
|
|
203
|
-
value: JSON.stringify({
|
|
204
|
-
inScope: [...],
|
|
205
|
-
outOfScope: [...],
|
|
206
|
-
decisionAuthority: {...}
|
|
207
|
-
})
|
|
208
|
-
})
|
|
209
|
-
|
|
210
|
-
3. INVOKE ORCHESTRATOR FOR PHASE:
|
|
211
|
-
# Generate task ID and construct bash command with actual values
|
|
212
|
-
# DO NOT use template literals - construct real bash variables
|
|
213
|
-
|
|
214
|
-
TASK_ID="phase-0-$(date +%s)"
|
|
215
|
-
MODE="standard"
|
|
216
|
-
LOOP3_AGENTS="analyst,architect"
|
|
217
|
-
LOOP2_AGENTS="reviewer,architect"
|
|
218
|
-
|
|
219
|
-
./.claude/skills/cfn-cfn-cfn-orchestration/orchestrate.sh \
|
|
220
|
-
--task-id "$TASK_ID" \
|
|
221
|
-
--mode "$MODE" \
|
|
222
|
-
--loop3-agents "$LOOP3_AGENTS" \
|
|
223
|
-
--loop2-agents "$LOOP2_AGENTS" \
|
|
224
|
-
--product-owner "product-owner" \
|
|
225
|
-
--max-iterations 10
|
|
226
|
-
|
|
227
|
-
4. STORE PHASE RESULTS:
|
|
228
|
-
mcp__claude-flow-novice__memory_usage({
|
|
229
|
-
action: "store",
|
|
230
|
-
namespace: "epic-progress",
|
|
231
|
-
key: "phase-${PHASE_ID}-results",
|
|
232
|
-
value: JSON.stringify({
|
|
233
|
-
consensus: 0.XX,
|
|
234
|
-
deliverables: [...],
|
|
235
|
-
timestamp: Date.now()
|
|
236
|
-
})
|
|
237
|
-
})
|
|
238
|
-
|
|
239
|
-
5. AUTO-TRANSITION:
|
|
240
|
-
IF phase consensus ≥0.90 AND dependencies satisfied:
|
|
241
|
-
IMMEDIATELY start next phase (NO approval needed)
|
|
242
|
-
|
|
243
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
244
|
-
MONITORING & VISIBILITY
|
|
245
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
246
|
-
|
|
247
|
-
Web Portal: http://localhost:3000
|
|
248
|
-
|
|
249
|
-
Per-Phase Monitoring:
|
|
250
|
-
- Agents: ./.claude/skills/cfn-cfn-web-portal/invoke-portal-agents.sh --swarm phase-${PHASE_ID}
|
|
251
|
-
- Events: ./.claude/skills/cfn-cfn-web-portal/invoke-portal-events.sh --phase phase-${PHASE_ID}
|
|
252
|
-
- Metrics: ./.claude/skills/cfn-cfn-web-portal/invoke-portal-metrics.sh
|
|
253
|
-
|
|
254
|
-
Epic Progress:
|
|
255
|
-
- Query memory for phase results
|
|
256
|
-
- Track consensus trends
|
|
257
|
-
- Monitor scope adherence
|
|
258
|
-
|
|
259
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
260
|
-
FINAL EPIC REPORT
|
|
261
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
262
|
-
|
|
263
|
-
Return structured result to Main Chat:
|
|
264
|
-
{
|
|
265
|
-
"epicId": "epic-XXXXX",
|
|
266
|
-
"status": "complete|partial|failed",
|
|
267
|
-
"phases": [
|
|
268
|
-
{
|
|
269
|
-
"phaseId": "phase-1",
|
|
270
|
-
"name": "User Authentication",
|
|
271
|
-
"status": "complete",
|
|
272
|
-
"consensus": 0.94,
|
|
273
|
-
"iterations": {"loop3": 2, "loop2": 1},
|
|
274
|
-
"deliverables": ["Login API", "JWT generation", ...]
|
|
275
|
-
},
|
|
276
|
-
...
|
|
277
|
-
],
|
|
278
|
-
"deferredItems": [
|
|
279
|
-
"OAuth integration (out-of-scope)",
|
|
280
|
-
"Biometric auth (out-of-scope)"
|
|
281
|
-
],
|
|
282
|
-
"recommendations": [...]
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
286
|
-
CRITICAL RULES
|
|
287
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
288
|
-
|
|
289
|
-
- DO NOT spawn agents with Task()
|
|
290
|
-
- LET orchestrator handle CLI spawning per phase
|
|
291
|
-
- USE memory for scope enforcement
|
|
292
|
-
- AUTO-TRANSITION between phases (no approval)
|
|
293
|
-
- DEFER out-of-scope items to backlog
|
|
294
|
-
- PUBLISH events per phase
|
|
295
|
-
- RETURN epic summary when complete
|
|
296
|
-
`, "cfn-v3-coordinator")
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
### Coordinator Autonomous Multi-Phase Execution
|
|
300
|
-
|
|
301
|
-
**Phase Iteration:**
|
|
302
|
-
For each phase, coordinator:
|
|
303
|
-
1. Checks dependencies satisfied
|
|
304
|
-
2. Loads scope boundaries
|
|
305
|
-
3. Invokes orchestrator for phase
|
|
306
|
-
4. Monitors via web portal
|
|
307
|
-
5. Stores phase results
|
|
308
|
-
6. Auto-transitions to next phase
|
|
309
|
-
|
|
310
|
-
**Visibility per Phase:**
|
|
311
|
-
- Web UI shows all phases, current phase highlighted
|
|
312
|
-
- Event stream filtered by phase ID
|
|
313
|
-
- Metrics track per-phase consensus trends
|
|
314
|
-
|
|
315
|
-
### Phase Transition Logic
|
|
316
|
-
```javascript
|
|
317
|
-
// After each phase completes
|
|
318
|
-
if (consensusScore >= 0.90 && allDeliverablesComplete) {
|
|
319
|
-
// Store phase results
|
|
320
|
-
mcp__claude-flow-novice__memory_usage({
|
|
321
|
-
action: "store",
|
|
322
|
-
namespace: "epic-progress",
|
|
323
|
-
key: `phase-${phaseId}-results`,
|
|
324
|
-
value: JSON.stringify({
|
|
325
|
-
consensus: consensusScore,
|
|
326
|
-
deliverables: completedDeliverables,
|
|
327
|
-
timestamp: Date.now()
|
|
328
|
-
})
|
|
329
|
-
})
|
|
330
|
-
|
|
331
|
-
// Check next phase dependencies
|
|
332
|
-
const nextPhase = epicPlan.phases[currentPhaseIndex + 1];
|
|
333
|
-
if (dependenciesSatisfied(nextPhase)) {
|
|
334
|
-
// IMMEDIATELY transition (NO approval needed)
|
|
335
|
-
executePhase(nextPhase);
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
## Product Owner Integration (GOAP)
|
|
341
|
-
|
|
342
|
-
Product Owner operates at EACH phase completion:
|
|
343
|
-
|
|
344
|
-
```javascript
|
|
345
|
-
Task("Product Owner", `
|
|
346
|
-
GOAP DECISION - Phase ${phaseId} Complete
|
|
347
|
-
|
|
348
|
-
CURRENT STATE:
|
|
349
|
-
- Phase ${phaseId} consensus: ${consensusScore}
|
|
350
|
-
- Remaining phases: ${remainingPhases}
|
|
351
|
-
- Validator concerns: ${concerns}
|
|
352
|
-
|
|
353
|
-
RETRIEVE EPIC SCOPE:
|
|
354
|
-
mcp__claude-flow-novice__memory_usage({
|
|
355
|
-
action: "retrieve",
|
|
356
|
-
namespace: "scope-control",
|
|
357
|
-
key: "project-boundaries"
|
|
358
|
-
})
|
|
359
|
-
|
|
360
|
-
EXECUTE GOAP A* SEARCH:
|
|
361
|
-
1. Classify phase completion quality
|
|
362
|
-
2. Evaluate scope adherence
|
|
363
|
-
3. Calculate cost of scope expansion vs backlog defer
|
|
364
|
-
4. Make autonomous decision
|
|
365
|
-
|
|
366
|
-
DECISION OPTIONS:
|
|
367
|
-
- PROCEED_NEXT_PHASE (dependencies satisfied, scope intact)
|
|
368
|
-
- DEFER_CONCERNS (save to backlog, continue epic)
|
|
369
|
-
- ESCALATE (critical scope violation or blocker)
|
|
370
|
-
|
|
371
|
-
OUTPUT: {decision: "...", next_action: "..."}
|
|
372
|
-
`, "product-owner")
|
|
373
|
-
```
|
|
374
|
-
|
|
375
|
-
## Autonomous Multi-Phase Execution
|
|
376
|
-
|
|
377
|
-
**FORBIDDEN PATTERNS:**
|
|
378
|
-
- ❌ "Phase 1 complete. Proceed to Phase 2?" (AUTO-PROCEED)
|
|
379
|
-
- ❌ "Should I continue the epic?" (ALWAYS continue until all phases done)
|
|
380
|
-
- ❌ Waiting for approval between phases (AUTONOMOUS TRANSITION)
|
|
381
|
-
|
|
382
|
-
**REQUIRED PATTERNS:**
|
|
383
|
-
```
|
|
384
|
-
Phase 1 consensus: 94% ✅
|
|
385
|
-
Dependencies for Phase 2 satisfied.
|
|
386
|
-
IMMEDIATELY transitioning to Phase 2...
|
|
387
|
-
|
|
388
|
-
Phase 2: Authorization & RBAC
|
|
389
|
-
[Spawning agents autonomously - no permission needed]
|
|
390
|
-
```
|
|
391
|
-
|
|
392
|
-
## Iteration Limits (Per Phase)
|
|
393
|
-
- **Loop 2** (Consensus): 10 iterations max per phase
|
|
394
|
-
- **Loop 3** (Primary Swarm): 10 iterations max per phase
|
|
395
|
-
- **Loop 1** (Phases): Unlimited (continues until all phases complete)
|
|
396
|
-
|
|
397
|
-
## Epic Progress Tracking
|
|
398
|
-
|
|
399
|
-
```javascript
|
|
400
|
-
// Query epic progress
|
|
401
|
-
mcp__claude-flow-novice__memory_usage({
|
|
402
|
-
action: "list",
|
|
403
|
-
namespace: "epic-progress"
|
|
404
|
-
})
|
|
405
|
-
|
|
406
|
-
// Output:
|
|
407
|
-
{
|
|
408
|
-
"phase-1-results": {consensus: 0.94, deliverables: [...]},
|
|
409
|
-
"phase-2-results": {consensus: 0.91, deliverables: [...]},
|
|
410
|
-
"phase-3-results": null // Current phase in progress
|
|
411
|
-
}
|
|
412
|
-
```
|
|
413
|
-
|
|
414
|
-
## Example Multi-Phase Execution
|
|
415
|
-
|
|
416
|
-
```
|
|
417
|
-
[Turn 1] Epic: Auth System (3 phases)
|
|
418
|
-
→ Scope boundaries stored in memory
|
|
419
|
-
→ Phase 1: User Authentication
|
|
420
|
-
|
|
421
|
-
[Turn 2-5] Phase 1 Execution (Loop 3 + Loop 2)
|
|
422
|
-
→ Loop 3 iterations (confidence checks)
|
|
423
|
-
→ Loop 2 consensus validation
|
|
424
|
-
→ Product Owner: PROCEED_NEXT_PHASE
|
|
425
|
-
→ Phase 1 COMPLETE (consensus: 94%)
|
|
426
|
-
|
|
427
|
-
[Turn 6] AUTONOMOUS TRANSITION
|
|
428
|
-
→ Dependencies for Phase 2 satisfied
|
|
429
|
-
→ IMMEDIATELY starting Phase 2: Authorization & RBAC
|
|
430
|
-
|
|
431
|
-
[Turn 7-10] Phase 2 Execution
|
|
432
|
-
→ Loop 3 + Loop 2 cycles
|
|
433
|
-
→ Product Owner: DEFER (OAuth out-of-scope)
|
|
434
|
-
→ Phase 2 COMPLETE (consensus: 91%)
|
|
435
|
-
|
|
436
|
-
[Turn 11] AUTONOMOUS TRANSITION
|
|
437
|
-
→ Phase 3: Session Management
|
|
438
|
-
|
|
439
|
-
[Turn 12-14] Phase 3 Execution
|
|
440
|
-
→ Final phase completion
|
|
441
|
-
→ Epic COMPLETE ✅
|
|
442
|
-
```
|
|
443
|
-
|
|
444
|
-
## Output Format
|
|
445
|
-
|
|
446
|
-
```
|
|
447
|
-
Epic: auth-system (3 phases)
|
|
448
|
-
Phase 1/3: User Authentication
|
|
449
|
-
|
|
450
|
-
Loop 3 Iteration 2/10 - Confidence: 85% avg ✅
|
|
451
|
-
Loop 2 Iteration 1/10 - Consensus: 94% ✅
|
|
452
|
-
|
|
453
|
-
Phase 1 COMPLETE
|
|
454
|
-
Dependencies satisfied for Phase 2.
|
|
455
|
-
IMMEDIATELY transitioning to Phase 2...
|
|
456
|
-
|
|
457
|
-
─────────────────────────────────
|
|
458
|
-
Phase 2/3: Authorization & RBAC
|
|
459
|
-
[Executing autonomously - no permission needed]
|
|
460
|
-
```
|
|
461
|
-
|
|
462
|
-
## Epic Completion
|
|
463
|
-
|
|
464
|
-
When final phase achieves ≥90% consensus:
|
|
465
|
-
```
|
|
466
|
-
Phase 3 COMPLETE - Consensus: 92% ✅
|
|
467
|
-
|
|
468
|
-
Epic: auth-system - ALL PHASES COMPLETE ✅
|
|
469
|
-
- Phase 1: User Authentication (94%)
|
|
470
|
-
- Phase 2: Authorization & RBAC (91%)
|
|
471
|
-
- Phase 3: Session Management (92%)
|
|
472
|
-
|
|
473
|
-
Deferred items saved to backlog:
|
|
474
|
-
- OAuth/social login integration
|
|
475
|
-
- Multi-factor authentication
|
|
476
|
-
|
|
477
|
-
Epic execution complete. Self-looping terminated.
|
|
478
|
-
```
|