@curdx/flow 1.1.3 → 1.1.5

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.
Files changed (100) hide show
  1. package/.claude-plugin/marketplace.json +25 -0
  2. package/.claude-plugin/plugin.json +43 -0
  3. package/CHANGELOG.md +279 -0
  4. package/agent-preamble/preamble.md +214 -0
  5. package/agents/flow-adversary.md +216 -0
  6. package/agents/flow-architect.md +190 -0
  7. package/agents/flow-debugger.md +325 -0
  8. package/agents/flow-edge-hunter.md +273 -0
  9. package/agents/flow-executor.md +246 -0
  10. package/agents/flow-planner.md +204 -0
  11. package/agents/flow-product-designer.md +146 -0
  12. package/agents/flow-qa-engineer.md +276 -0
  13. package/agents/flow-researcher.md +155 -0
  14. package/agents/flow-reviewer.md +280 -0
  15. package/agents/flow-security-auditor.md +398 -0
  16. package/agents/flow-triage-analyst.md +290 -0
  17. package/agents/flow-ui-researcher.md +227 -0
  18. package/agents/flow-ux-designer.md +247 -0
  19. package/agents/flow-verifier.md +283 -0
  20. package/agents/persona-amelia.md +128 -0
  21. package/agents/persona-david.md +141 -0
  22. package/agents/persona-emma.md +179 -0
  23. package/agents/persona-john.md +105 -0
  24. package/agents/persona-mary.md +95 -0
  25. package/agents/persona-oliver.md +136 -0
  26. package/agents/persona-rachel.md +126 -0
  27. package/agents/persona-serena.md +175 -0
  28. package/agents/persona-winston.md +117 -0
  29. package/bin/curdx-flow.js +5 -2
  30. package/cli/init.js +18 -2
  31. package/cli/install.js +44 -5
  32. package/commands/audit.md +170 -0
  33. package/commands/autoplan.md +184 -0
  34. package/commands/debug.md +199 -0
  35. package/commands/design.md +155 -0
  36. package/commands/discuss.md +162 -0
  37. package/commands/doctor.md +124 -0
  38. package/commands/fast.md +128 -0
  39. package/commands/help.md +119 -0
  40. package/commands/implement.md +381 -0
  41. package/commands/index.md +261 -0
  42. package/commands/init.md +105 -0
  43. package/commands/install-deps.md +128 -0
  44. package/commands/party.md +241 -0
  45. package/commands/plan-ceo.md +117 -0
  46. package/commands/plan-design.md +107 -0
  47. package/commands/plan-dx.md +104 -0
  48. package/commands/plan-eng.md +108 -0
  49. package/commands/qa.md +118 -0
  50. package/commands/requirements.md +146 -0
  51. package/commands/research.md +141 -0
  52. package/commands/review.md +168 -0
  53. package/commands/security.md +109 -0
  54. package/commands/sketch.md +118 -0
  55. package/commands/spec.md +135 -0
  56. package/commands/spike.md +181 -0
  57. package/commands/start.md +189 -0
  58. package/commands/status.md +139 -0
  59. package/commands/switch.md +95 -0
  60. package/commands/tasks.md +189 -0
  61. package/commands/triage.md +160 -0
  62. package/commands/verify.md +124 -0
  63. package/gates/adversarial-review-gate.md +219 -0
  64. package/gates/coverage-audit-gate.md +184 -0
  65. package/gates/devex-gate.md +255 -0
  66. package/gates/edge-case-gate.md +194 -0
  67. package/gates/karpathy-gate.md +130 -0
  68. package/gates/security-gate.md +218 -0
  69. package/gates/tdd-gate.md +188 -0
  70. package/gates/verification-gate.md +183 -0
  71. package/hooks/hooks.json +56 -0
  72. package/hooks/scripts/fail-tracker.sh +31 -0
  73. package/hooks/scripts/inject-karpathy.sh +52 -0
  74. package/hooks/scripts/quick-mode-guard.sh +64 -0
  75. package/hooks/scripts/session-start.sh +76 -0
  76. package/hooks/scripts/stop-watcher.sh +166 -0
  77. package/knowledge/atomic-commits.md +262 -0
  78. package/knowledge/epic-decomposition.md +307 -0
  79. package/knowledge/execution-strategies.md +278 -0
  80. package/knowledge/karpathy-guidelines.md +219 -0
  81. package/knowledge/planning-reviews.md +211 -0
  82. package/knowledge/poc-first-workflow.md +227 -0
  83. package/knowledge/spec-driven-development.md +183 -0
  84. package/knowledge/systematic-debugging.md +384 -0
  85. package/knowledge/two-stage-review.md +233 -0
  86. package/knowledge/wave-execution.md +387 -0
  87. package/package.json +13 -2
  88. package/schemas/config.schema.json +100 -0
  89. package/schemas/spec-frontmatter.schema.json +42 -0
  90. package/schemas/spec-state.schema.json +117 -0
  91. package/templates/CONTEXT.md.tmpl +53 -0
  92. package/templates/PROJECT.md.tmpl +59 -0
  93. package/templates/ROADMAP.md.tmpl +50 -0
  94. package/templates/STATE.md.tmpl +49 -0
  95. package/templates/config.json.tmpl +48 -0
  96. package/templates/design.md.tmpl +163 -0
  97. package/templates/progress.md.tmpl +58 -0
  98. package/templates/requirements.md.tmpl +94 -0
  99. package/templates/research.md.tmpl +114 -0
  100. package/templates/tasks.md.tmpl +141 -0
@@ -0,0 +1,307 @@
1
+ # Epic Decomposition — Vertical Slicing of Epics
2
+
3
+ > How do you break down a large feature? The core principle is **vertical slicing** (by user value), not **horizontal layering** (by technical layer).
4
+ >
5
+ > Agents reference this via `@${CLAUDE_PLUGIN_ROOT}/knowledge/epic-decomposition.md`.
6
+
7
+ ---
8
+
9
+ ## What is an Epic?
10
+
11
+ An Epic = **a collection of sub-specs** that together deliver a large user goal.
12
+
13
+ Typical scenarios:
14
+ - "Add payment system"
15
+ - "Refactor authentication module"
16
+ - "Migrate from REST to GraphQL"
17
+ - "Add internationalization support"
18
+
19
+ These are all too large to do as a single spec. They must be broken down.
20
+
21
+ ---
22
+
23
+ ## Vertical Slicing vs Horizontal Layering
24
+
25
+ ### ✗ Horizontal layering (bad)
26
+
27
+ ```
28
+ Epic: Add payment system
29
+ Spec 1: Frontend (all payment UI)
30
+ Spec 2: Backend (all payment APIs)
31
+ Spec 3: DB (orders / transactions / refunds tables)
32
+ ```
33
+
34
+ **Problems**:
35
+ - Each spec alone delivers **no user value** (frontend cannot call a non-existent backend)
36
+ - All 3 must ship together — no incremental release
37
+ - If spec 2 is abandoned halfway, spec 1 and 3 are wasted
38
+ - Hard to test (no frontend-only E2E without a backend)
39
+
40
+ ### ✓ Vertical slicing (good)
41
+
42
+ ```
43
+ Epic: Add payment system
44
+ Spec 1: Credit card payment (UI + API + DB, end-to-end)
45
+ Spec 2: Alipay payment (UI + API + DB)
46
+ Spec 3: Refund flow (UI + API + DB)
47
+ Spec 4: Transaction history query (UI + API)
48
+ ```
49
+
50
+ **Advantages**:
51
+ - Each spec ships independently = real user value
52
+ - Incremental release (credit card first, Alipay a week later)
53
+ - Failure isolation (delaying refunds doesn't block payments)
54
+ - Each spec is independently E2E testable
55
+
56
+ ---
57
+
58
+ ## Deciding When to Break Into an Epic
59
+
60
+ Ask yourself:
61
+
62
+ 1. **Effort**: Can this be done in 1-2 weeks?
63
+ - Yes → single spec
64
+ - No → Epic
65
+
66
+ 2. **Independent delivery**: Can it be split into multiple parts "the user can perceive separately"?
67
+ - Yes → Epic (split along those)
68
+ - No → keep refining, or it shouldn't be split
69
+
70
+ 3. **Dependencies**: Are sub-parts hard or soft dependencies?
71
+ - All hard (must serialize) → consider not splitting; do as one large spec
72
+ - Mostly soft (can parallelize) → Epic
73
+
74
+ ---
75
+
76
+ ## Slicing Dimensions
77
+
78
+ ### 1. By user type
79
+
80
+ ```
81
+ Epic: Multi-user payment system
82
+ Spec 1: Personal user credit card payment
83
+ Spec 2: Enterprise user bank transfer
84
+ Spec 3: Platform merchant collection
85
+ ```
86
+
87
+ ### 2. By use case
88
+
89
+ ```
90
+ Epic: Order management
91
+ Spec 1: Checkout flow
92
+ Spec 2: Post-payment shipping
93
+ Spec 3: Refund flow
94
+ Spec 4: After-sales support
95
+ ```
96
+
97
+ ### 3. By channel
98
+
99
+ ```
100
+ Epic: Multi-channel payment
101
+ Spec 1: Credit card (Stripe)
102
+ Spec 2: Alipay
103
+ Spec 3: WeChat Pay
104
+ Spec 4: Apple Pay
105
+ ```
106
+
107
+ ### 4. By data dimension
108
+
109
+ ```
110
+ Epic: User profile system
111
+ Spec 1: Basic info profile
112
+ Spec 2: Behavior profile
113
+ Spec 3: Preference profile
114
+ Spec 4: Profile query API
115
+ ```
116
+
117
+ ### 5. By business phase (MVP → Full)
118
+
119
+ ```
120
+ Epic: Recommendation system
121
+ Spec 1: Hot list (minimal MVP)
122
+ Spec 2: Collaborative filtering
123
+ Spec 3: Deep learning model
124
+ Spec 4: Personalized re-rank
125
+ ```
126
+
127
+ ---
128
+
129
+ ## Dependency Identification
130
+
131
+ ### Hard Dependency
132
+
133
+ B needs A's data structures or interfaces to work. A must be completed first.
134
+
135
+ ```
136
+ A: define Order type + create orders table
137
+ B: consume Order to implement payment logic
138
+ → B hard-depends on A
139
+ ```
140
+
141
+ ### Soft Dependency
142
+
143
+ B's **final integration** needs A, but can be stubbed earlier.
144
+
145
+ ```
146
+ A: payment gateway integration
147
+ B: refund flow
148
+ → B can mock the payment API and build the happy path first
149
+ → integrate with the real API once A is done
150
+ → B soft-depends on A
151
+ ```
152
+
153
+ ### Parallel
154
+
155
+ A and B do not depend on each other. Can fully parallelize.
156
+
157
+ ```
158
+ A: credit card payment
159
+ B: Alipay payment
160
+ → independent UI/API/DB
161
+ → two teams can work in parallel
162
+ ```
163
+
164
+ ### Express with mermaid
165
+
166
+ ```mermaid
167
+ flowchart LR
168
+ A[Spec 1: Order basics] --> B[Spec 2: Credit card]
169
+ A --> C[Spec 3: Alipay]
170
+ B -.software-dep.-> D[Spec 4: Refund]
171
+ C -.software-dep.-> D
172
+ ```
173
+
174
+ Solid line = hard dependency; dashed line + "software-dep" = soft dependency.
175
+
176
+ ---
177
+
178
+ ## Freezing Shared Interfaces
179
+
180
+ Multiple sub-specs use the same type (e.g., `Order`). That type must be frozen at the Epic level.
181
+
182
+ ### Define in epic.md
183
+
184
+ ```typescript
185
+ // All sub-specs must comply
186
+ interface Order {
187
+ id: string;
188
+ userId: string;
189
+ amount: number; // cents (integer)
190
+ currency: "CNY" | "USD";
191
+ status: OrderStatus;
192
+ paymentMethod: PaymentMethod;
193
+ createdAt: string;
194
+ updatedAt: string;
195
+ }
196
+
197
+ type OrderStatus =
198
+ | "pending"
199
+ | "paid"
200
+ | "refunded"
201
+ | "failed";
202
+
203
+ type PaymentMethod =
204
+ | { kind: "credit_card"; lastFour: string }
205
+ | { kind: "alipay"; openId: string }
206
+ | { kind: "wechat"; openId: string };
207
+ ```
208
+
209
+ ### Change rules
210
+
211
+ - During Epic development, the interface is **frozen**
212
+ - If a change is unavoidable, bump the Epic version (1.0 → 1.1)
213
+ - Re-review all completed sub-specs
214
+ - Avoid "one spec changed the interface, another didn't know"
215
+
216
+ ---
217
+
218
+ ## Execution Order Suggestions
219
+
220
+ ### Topological sort
221
+
222
+ ```
223
+ 1. Specs with no dependencies can start in parallel
224
+ 2. Hard-dependent specs wait for upstream to complete
225
+ 3. Soft-dependent specs can start early (using mocks)
226
+ ```
227
+
228
+ ### Typical pattern
229
+
230
+ ```
231
+ Week 1-2: Spec 1 (Order basics) [critical path]
232
+ Week 3-4: Spec 2 (credit card) + Spec 3 (Alipay) in parallel
233
+ Week 5-6: Spec 4 (refund) + Spec 5 (query)
234
+ ```
235
+
236
+ ---
237
+
238
+ ## Epic Lifecycle
239
+
240
+ ```
241
+ 1. /curdx-flow:triage "Epic goal"
242
+ ↓ flow-triage-analyst decomposes
243
+ 2. Generates .flow/_epics/<name>/epic.md + sub-spec skeletons
244
+ 3. User reviews epic.md
245
+
246
+ 4. For each sub-spec:
247
+ /curdx-flow:switch <sub-spec-name>
248
+ /curdx-flow:spec
249
+ /curdx-flow:implement
250
+ /curdx-flow:review
251
+
252
+ 5. All sub-specs done → Epic complete
253
+ 6. /curdx-flow:retro (Phase 6+) for Epic-level retrospective
254
+ ```
255
+
256
+ ---
257
+
258
+ ## Anti-patterns
259
+
260
+ ### 1. "Treating the mermaid diagram as the spec"
261
+
262
+ The Epic dependency graph is only high-level planning. Each sub-spec still needs a full research / requirements / design / tasks cycle.
263
+
264
+ ### 2. Too many sub-specs (> 10)
265
+
266
+ Granularity is too fine. Merge. Or this is not one Epic but multiple Epics.
267
+
268
+ ### 3. Too few sub-specs (< 3)
269
+
270
+ Not split finely enough, or shouldn't be split at all. Treat as a single large spec.
271
+
272
+ ### 4. Sub-specs form a hard-dep chain
273
+
274
+ ```
275
+ A → B → C → D → E
276
+ ```
277
+
278
+ A "serial chain" is no different from not splitting. Rethink the slicing approach.
279
+
280
+ ### 5. Interface not frozen
281
+
282
+ "Each spec defines its own Order type" → incompatibility surfaces at integration time. The interface must be defined once, at the Epic level.
283
+
284
+ ---
285
+
286
+ ## Real Example: Migrating to GraphQL
287
+
288
+ Wrong decomposition (horizontal):
289
+ ```
290
+ Spec 1: Write all GraphQL schema
291
+ Spec 2: Write all resolvers
292
+ Spec 3: Adapt frontend to GraphQL client
293
+ ```
294
+ → Users see nothing until all 3 are done
295
+
296
+ Correct decomposition (vertical):
297
+ ```
298
+ Spec 1: User module migration (schema + resolver + 1 frontend page)
299
+ Spec 2: Order module migration
300
+ Spec 3: Product module migration
301
+ Spec 4: Retire old REST
302
+ ```
303
+ → Spec 1 can partially ship, users start experiencing GraphQL benefits
304
+
305
+ ---
306
+
307
+ _Sources: XP's User Story Splitting + BMAD-METHOD's Epic design._
@@ -0,0 +1,278 @@
1
+ # Execution Strategies — 4 Execution Strategies Explained
2
+
3
+ > `/curdx-flow:implement`'s Strategy Router picks a strategy based on task characteristics. This doc describes how each strategy works, its trade-offs, and when to use it.
4
+ >
5
+ > Agents reference this via `@${CLAUDE_PLUGIN_ROOT}/knowledge/execution-strategies.md`.
6
+
7
+ ---
8
+
9
+ ## Overview
10
+
11
+ ```
12
+ Task list (tasks.md)
13
+
14
+ ┌──────────────────────────────────────────────┐
15
+ │ Strategy Router │
16
+ │ │
17
+ │ Task count < 5 and strong deps? → linear │
18
+ │ [P] markers and independent? → wave │
19
+ │ Task count > 10 and quality-first? → subagent │
20
+ │ Long chain, unattended? → stop-hook │
21
+ │ No explicit preference? → auto (picks sub) │
22
+ └──────────────────────────────────────────────┘
23
+ ```
24
+
25
+ ---
26
+
27
+ ## Strategy 1: Linear (sequential, inline)
28
+
29
+ ### How it works
30
+ The main agent runs all tasks sequentially **in the current session**. When one task ends, it starts the next — no subagent is dispatched.
31
+
32
+ ```
33
+ main agent → task 1 → task 2 → task 3 → ... → done
34
+ (same context)
35
+ ```
36
+
37
+ ### When to use
38
+ - ✓ Task count < 5
39
+ - ✓ Strong dependencies between tasks (the next must read the previous result)
40
+ - ✓ Debugging scenarios (you want to see the full process)
41
+ - ✓ Simple bug fixes
42
+ - ✓ Phase 0 / Phase 5 (few tasks)
43
+
44
+ ### Advantages
45
+ - Full context is visible, debugging-friendly
46
+ - No subagent communication overhead
47
+ - Easy for a human to take over on failure
48
+
49
+ ### Disadvantages
50
+ - A long task chain exhausts context
51
+ - Cannot parallelize
52
+ - Quality decay curve (output degrades after 50% context)
53
+
54
+ ### Enable
55
+ ```bash
56
+ /curdx-flow:implement --strategy=linear
57
+ ```
58
+
59
+ ---
60
+
61
+ ## Strategy 2: Subagent (isolated context per task)
62
+
63
+ ### How it works
64
+ The main agent reads tasks.md and **dispatches a fresh flow-executor subagent per task**. Each subagent has a clean context — it does not inherit the main agent's history.
65
+
66
+ ```
67
+ main agent
68
+ ├─ Task() → subagent(task 1) → TASK_COMPLETE
69
+ ├─ Task() → subagent(task 2) → TASK_COMPLETE
70
+ └─ ...
71
+ (each subagent has isolated context)
72
+ ```
73
+
74
+ ### When to use
75
+ - ✓ Task count > 10
76
+ - ✓ Quality-first (every task must be high-quality, avoid context pollution)
77
+ - ✓ Moderate task size (2-15 minutes)
78
+ - ✓ Tasks relatively independent, no complex shared context needed
79
+ - ✓ Superpowers style
80
+
81
+ ### Advantages
82
+ - Each subagent uses at most ~30% context → stable quality
83
+ - Debugging a failed task doesn't pollute the main agent
84
+ - Composable: subagents share files (tasks.md / .progress.md)
85
+
86
+ ### Disadvantages
87
+ - Dispatch overhead (each subagent reloads context)
88
+ - Cross-task info sharing goes through files (.progress.md)
89
+ - Not parallel (a single Task call is serial)
90
+
91
+ ### Enable
92
+ ```bash
93
+ /curdx-flow:implement --strategy=subagent
94
+ ```
95
+
96
+ Or (default):
97
+ ```bash
98
+ /curdx-flow:implement # auto routing picks subagent
99
+ ```
100
+
101
+ ---
102
+
103
+ ## Strategy 3: Stop-Hook (auto-loop)
104
+
105
+ ### How it works
106
+ - Main agent executes 1 task → ends naturally (Stop event)
107
+ - `stop-watcher.sh` hook fires
108
+ - Checks whether `.state.json` still has unfinished tasks
109
+ - If yes, it outputs `{"decision": "block", "reason": "continue task N"}`
110
+ - Claude Code treats `decision=block` as "issue another response round", and the main agent automatically continues with the next task
111
+ - Repeats until `TASK_FAILED` or `ALL_TASKS_COMPLETE`
112
+
113
+ ```
114
+ main agent → task N → Stop → stop-watcher.sh
115
+
116
+ still tasks? → "block, continue task N+1"
117
+ → main agent continues (new round)
118
+
119
+ no tasks? → allow stop
120
+ ```
121
+
122
+ ### When to use
123
+ - ✓ Long task chains (20+)
124
+ - ✓ Unattended execution (overnight automation)
125
+ - ✓ You don't want to trigger each step manually
126
+ - ✓ smart-ralph style
127
+
128
+ ### Advantages
129
+ - Truly autonomous execution — the user can walk away
130
+ - Each "round" session has an independent context (auto-cleaned)
131
+ - On failure the hook can halt the loop, preventing infinite failure
132
+
133
+ ### Disadvantages
134
+ - Each round reloads context (.progress.md, tasks.md)
135
+ - Needs `quick-mode-guard` to disable AskUserQuestion (otherwise it stalls)
136
+ - Harder to debug (Stop events are asynchronous)
137
+
138
+ ### Enable
139
+ ```bash
140
+ /curdx-flow:implement --strategy=stop-hook --quick
141
+ ```
142
+
143
+ `--quick` is the recommended pairing, otherwise the agent will ask on ambiguities and the loop will stall.
144
+
145
+ ---
146
+
147
+ ## Strategy 4: Wave (DAG parallel)
148
+
149
+ ### How it works
150
+ - Tasks in tasks.md marked `[P]` are "parallel-safe"
151
+ - The main agent identifies consecutive `[P]` tasks as one wave
152
+ - **In a single message**, it dispatches multiple Task() tool calls simultaneously
153
+ - All tasks within a wave run in parallel
154
+ - Waves run serially relative to each other
155
+
156
+ ```
157
+ main agent
158
+ ├─ Wave 1: [P] task1, [P] task2, [P] task3 ← parallel
159
+ ├─ Wave 2: [VERIFY] task4 ← serial checkpoint
160
+ ├─ Wave 3: [P] task5, [P] task6 ← parallel again
161
+ └─ ...
162
+ ```
163
+
164
+ ### When to use
165
+ - ✓ Many `[P]` markers in tasks.md
166
+ - ✓ Tasks are independent (different files, different components)
167
+ - ✓ Time-pressured (parallelism is faster)
168
+ - ✓ get-shit-done style
169
+
170
+ ### Advantages
171
+ - Wall-clock time greatly reduced (N parallel tasks at once)
172
+ - DAG analysis makes dependencies explicit
173
+ - Precise failure localization (which task in which wave)
174
+
175
+ ### Disadvantages
176
+ - Parallel conflict risk (e.g., two tasks editing the same file)
177
+ - Requires flow-planner to have tagged `[P]` (Phase 1-generated tasks.md should)
178
+ - Main agent manages many Task calls, high context pressure
179
+
180
+ ### Enable
181
+ ```bash
182
+ /curdx-flow:implement --strategy=wave
183
+ ```
184
+
185
+ ### Parallel-safety rules
186
+ `[P]` tasks must:
187
+ - Not edit the same file
188
+ - Not read output of another `[P]` task
189
+ - `[VERIFY]` checkpoints break the parallel group
190
+ - `[SEQUENTIAL]` forces serial execution (overrides `[P]`)
191
+
192
+ ---
193
+
194
+ ## Strategy 5 (default): Auto
195
+
196
+ ### Decision tree
197
+
198
+ ```python
199
+ if args.strategy:
200
+ return args.strategy
201
+
202
+ if majority "[SEQUENTIAL]" or strong task dependencies:
203
+ return "linear"
204
+
205
+ if "[P]" markers >= 40% of tasks:
206
+ return "wave"
207
+
208
+ if task count >= 20 and user requests unattended:
209
+ return "stop-hook"
210
+
211
+ if task count >= 8:
212
+ return "subagent"
213
+
214
+ return "linear"
215
+ ```
216
+
217
+ ### Configuration
218
+ `.flow/config.json`'s `execution.strategy` can override the default:
219
+ - `"auto"` — use the decision tree above (default)
220
+ - Other concrete strategies
221
+
222
+ ---
223
+
224
+ ## Failure Handling (common to all strategies)
225
+
226
+ `flow-executor` agent's 5-round retry mechanism:
227
+
228
+ ```
229
+ Rounds 1-2: agent retries autonomously (edit code, rerun Verify)
230
+ Round 3: sequential-thinking root-cause analysis ≥ 5 rounds
231
+ Round 4: read related source + trace data flow
232
+ Round 5: report TASK_FAILED
233
+ ```
234
+
235
+ ### Extra protections for Stop-Hook strategy
236
+ - 3 consecutive TASK_FAILED → stop-watcher.sh halts the loop
237
+ - 10 consecutive Stop triggers with no progress → halt (anti-deadlock)
238
+ - A single spec exceeding 100 rounds → force halt (requires user check)
239
+
240
+ ### Subagent strategy
241
+ - Each subagent at most 30 turns (beyond flow-executor's maxTurns)
242
+ - Timed-out subagents get marked failed by the main agent, which moves on (or halts, depending on strategy)
243
+
244
+ ---
245
+
246
+ ## Switching Strategies
247
+
248
+ Can you switch strategies mid-execution? Not recommended.
249
+
250
+ - Linear → Subagent: wastes existing context, better to stay linear
251
+ - Subagent → Stop-Hook: needs to clean `execute_state`, messy
252
+ - Any → Wave: needs `[P]` markers in tasks.md
253
+
254
+ If you really must switch, do it manually:
255
+ 1. `/curdx-flow:doctor` to check status
256
+ 2. Manually edit `.flow/specs/<name>/.state.json`'s `strategy` field
257
+ 3. Rerun `/curdx-flow:implement`
258
+
259
+ ---
260
+
261
+ ## Monitoring and Interruption
262
+
263
+ ### View progress
264
+ ```bash
265
+ /curdx-flow:status # global
266
+ /curdx-flow:status <name> # single-spec details
267
+ ```
268
+
269
+ ### Interrupt
270
+ - `Ctrl+C` interrupts the current session → Stop event triggers, state is saved
271
+ - Next `/curdx-flow:switch <name>` resumes from `task_index`
272
+
273
+ ### Snapshots
274
+ `/curdx-flow:save <label>` saves a checkpoint (Phase 5+ rollout).
275
+
276
+ ---
277
+
278
+ _Adapted from smart-ralph (stop-hook), superpowers (subagent), get-shit-done (wave)._