@curdx/flow 2.0.21 → 2.2.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-plugin/marketplace.json +25 -2
- package/.claude-plugin/plugin.json +10 -1
- package/CHANGELOG.md +106 -3
- package/README.md +3 -0
- package/README.zh.md +14 -5
- package/agent-preamble/preamble.md +3 -6
- package/agents/flow-qa-engineer.md +16 -15
- package/agents/flow-ui-researcher.md +2 -2
- package/agents/flow-verifier.md +3 -3
- package/bin/curdx-flow +5 -0
- package/cli/README.md +10 -9
- package/cli/install-bundled-mcps.js +37 -0
- package/cli/install-companions.js +19 -252
- package/cli/install-context7-config.js +97 -0
- package/cli/install-recommended-plugins.js +104 -0
- package/cli/install-required-plugins.js +57 -0
- package/cli/install-self-update.js +2 -91
- package/cli/install.js +12 -1
- package/cli/lib/claude.js +42 -11
- package/cli/lib/doctor-report.js +47 -8
- package/cli/lib/semver.js +95 -0
- package/cli/protocols-body.md +3 -2
- package/cli/utils.js +1 -0
- package/hooks/scripts/quick-mode-guard.sh +6 -7
- package/hooks/scripts/session-start.sh +6 -3
- package/knowledge/execution-strategies.md +5 -5
- package/knowledge/planning-reviews.md +2 -2
- package/knowledge/wave-execution.md +17 -17
- package/package.json +3 -3
- package/schemas/agent-frontmatter.schema.json +66 -0
- package/schemas/config.schema.json +24 -4
- package/schemas/gate-frontmatter.schema.json +30 -0
- package/schemas/hooks.schema.json +83 -0
- package/schemas/plugin-manifest.schema.json +66 -0
- package/schemas/skill-frontmatter.schema.json +72 -0
- package/schemas/spec-state.schema.json +7 -2
- package/skills/brownfield-index/SKILL.md +2 -1
- package/skills/browser-qa/SKILL.md +5 -4
- package/skills/debug/SKILL.md +105 -0
- package/skills/epic/SKILL.md +2 -1
- package/{commands/fast.md → skills/fast/SKILL.md} +2 -1
- package/{commands/help.md → skills/help/SKILL.md} +15 -5
- package/{commands/implement.md → skills/implement/SKILL.md} +14 -154
- package/skills/implement/references/wave-execution.md +162 -0
- package/{commands/init.md → skills/init/SKILL.md} +1 -0
- package/{commands/review.md → skills/review/SKILL.md} +38 -3
- package/skills/security-audit/SKILL.md +2 -1
- package/{commands/spec.md → skills/spec/SKILL.md} +4 -3
- package/{commands/start.md → skills/start/SKILL.md} +2 -1
- package/skills/ui-sketch/SKILL.md +2 -1
- package/skills/verify/SKILL.md +99 -0
- package/templates/CONTEXT.md.tmpl +1 -1
- package/templates/PROJECT.md.tmpl +1 -1
- package/templates/config.json.tmpl +6 -6
- package/templates/progress.md.tmpl +2 -2
- package/commands/debug.md +0 -199
- package/commands/verify.md +0 -142
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
name: implement
|
|
3
3
|
description: Execute spec tasks — the Strategy Router picks linear/subagent/stop-hook/wave based on task characteristics. Atomic commit per task.
|
|
4
4
|
argument-hint: "[spec-name] [--strategy=auto|linear|subagent|stop-hook|wave] [--task=<id>] [--quick]"
|
|
5
|
-
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
allowed-tools: [Read, Write, Edit, Bash, Agent, Grep, Glob]
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
# Flow Implement — Execute Spec
|
|
@@ -77,7 +78,7 @@ echo "✓ Selected strategy: $STRATEGY"
|
|
|
77
78
|
|
|
78
79
|
**Decision tree explanation**:
|
|
79
80
|
- Few tasks / strong dependencies → `linear` (main agent executes sequentially)
|
|
80
|
-
- Many parallel opportunities → `wave` (parallel
|
|
81
|
+
- Many parallel opportunities → `wave` (parallel Agent dispatch within a wave)
|
|
81
82
|
- Long chain + quick mode → `stop-hook` (auto-loop, requires hook support)
|
|
82
83
|
- Medium scale → `subagent` (isolated context per task)
|
|
83
84
|
|
|
@@ -127,7 +128,7 @@ If there are 5 failures, stop + TASK_FAILED.
|
|
|
127
128
|
For each remaining task, dispatch flow-executor:
|
|
128
129
|
|
|
129
130
|
```
|
|
130
|
-
|
|
131
|
+
Agent:
|
|
131
132
|
subagent_type: general-purpose
|
|
132
133
|
description: "Execute $SPEC_NAME task $TASK_ID"
|
|
133
134
|
prompt: |
|
|
@@ -159,160 +160,19 @@ After the agent completes, read the output marker:
|
|
|
159
160
|
|
|
160
161
|
### Strategy: wave
|
|
161
162
|
|
|
162
|
-
|
|
163
|
+
See `skills/implement/references/wave-execution.md` for the full walkthrough.
|
|
164
|
+
Knowledge-layer canonical algorithm: `@${CLAUDE_PLUGIN_ROOT}/knowledge/wave-execution.md`.
|
|
163
165
|
|
|
164
|
-
**Core**: consecutive `[P]` tasks form a wave
|
|
166
|
+
**Core**: consecutive `[P]` tasks form a wave; dispatch multiple Agent calls in parallel within a single response; serial across waves. The execution loop is:
|
|
165
167
|
|
|
166
|
-
|
|
168
|
+
1. **DAG analysis** — group remaining `[ ]` tasks by `[P]` / `[SEQUENTIAL]` / `[VERIFY]` tags; conflicting `Files` sets split into a new wave.
|
|
169
|
+
2. **Pre-conflict detection** — within each wave, assert per-task `Files` are disjoint; auto-split if not.
|
|
170
|
+
3. **Dispatch** — list multiple `Agent(...)` tool calls in a single main-agent response (splitting across responses = serial degradation; nested `Agent` dispatches forbidden). Each Agent prompt follows the subagent strategy's uniform format (see `references/wave-execution.md` Step 3).
|
|
171
|
+
4. **Aggregate** — parse each result for `TASK_COMPLETE` / `TASK_FAILED`; run post-hoc conflict detection via git diff to confirm executors only touched declared files.
|
|
172
|
+
5. **Failure handling** — 0 failed → next wave; 1 failed → `config.wave_fail_policy` (`continue-on-single` or `stop-on-any`); ≥2 failed → likely environment issue, stop immediately; cumulative `failed_attempts >= 3` → stop, user intervention.
|
|
173
|
+
6. **Progress feedback** — print a wave summary after each wave (see `references/wave-execution.md` Step 6).
|
|
167
174
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
```
|
|
171
|
-
for task in remaining tasks:
|
|
172
|
-
if task has [SEQUENTIAL] or [VERIFY]:
|
|
173
|
-
→ own wave (breaks parallelism)
|
|
174
|
-
elif task has [P]:
|
|
175
|
-
→ check whether Files conflict with current_wave
|
|
176
|
-
conflict → start a new wave
|
|
177
|
-
no conflict → add to current_wave
|
|
178
|
-
else:
|
|
179
|
-
→ own wave (no [P] = serial)
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
Output wave list:
|
|
183
|
-
```
|
|
184
|
-
Wave 1 [P×3]: 1.1 1.2 1.3
|
|
185
|
-
Wave 2 [VERIFY]: 1.4
|
|
186
|
-
Wave 3: 1.5
|
|
187
|
-
Wave 4 [P×2]: 1.6 1.7
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
#### Step 2: Pre-Conflict Detection
|
|
191
|
-
|
|
192
|
-
For each wave, verify that Files across all tasks are **disjoint**:
|
|
193
|
-
|
|
194
|
-
```python
|
|
195
|
-
for wave in waves:
|
|
196
|
-
all_files = []
|
|
197
|
-
for task in wave:
|
|
198
|
-
if set(task.files) & set(all_files):
|
|
199
|
-
warn(f"Within wave, {task.id} modifies the same file as a prior task")
|
|
200
|
-
# split into the next wave
|
|
201
|
-
all_files.extend(task.files)
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
If the planner mis-tagged `[P]` (modifies the same file), split the wave automatically at execution time rather than failing outright.
|
|
205
|
-
|
|
206
|
-
#### Step 3: Dispatch a Single Wave (**key: within a single response**)
|
|
207
|
-
|
|
208
|
-
```
|
|
209
|
-
# List multiple Task tool calls in one response of the main agent:
|
|
210
|
-
Task(description="Execute 1.1", prompt=<...flow-executor + task_id=1.1...>)
|
|
211
|
-
Task(description="Execute 1.2", prompt=<...flow-executor + task_id=1.2...>)
|
|
212
|
-
Task(description="Execute 1.3", prompt=<...flow-executor + task_id=1.3...>)
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
Each Task prompt follows a uniform format (similar to subagent strategy):
|
|
216
|
-
|
|
217
|
-
```
|
|
218
|
-
You are the flow-executor agent. Full definition:
|
|
219
|
-
${CLAUDE_PLUGIN_ROOT}/agents/flow-executor.md
|
|
220
|
-
|
|
221
|
-
Execute a single task:
|
|
222
|
-
spec_name: $SPEC_NAME
|
|
223
|
-
task_id: <specific ID, e.g., 1.2>
|
|
224
|
-
quick_mode: $QUICK
|
|
225
|
-
|
|
226
|
-
**You may only modify the following files** (touching anything else is disallowed):
|
|
227
|
-
<task.files>
|
|
228
|
-
|
|
229
|
-
Required reading:
|
|
230
|
-
- .flow/specs/$SPEC_NAME/tasks.md
|
|
231
|
-
- .flow/specs/$SPEC_NAME/.state.json
|
|
232
|
-
- .flow/specs/$SPEC_NAME/design.md (if referencing AD-NN)
|
|
233
|
-
|
|
234
|
-
Output:
|
|
235
|
-
- TASK_COMPLETE: <task_id> or
|
|
236
|
-
- TASK_FAILED: <task_id> + reason
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
**Not allowed**:
|
|
240
|
-
- Splitting multiple Task calls across multiple responses (that is serial degradation)
|
|
241
|
-
- Nesting another Task dispatch inside a Task
|
|
242
|
-
|
|
243
|
-
#### Step 4: Aggregate Wave Results
|
|
244
|
-
|
|
245
|
-
Wait for all Tasks to return:
|
|
246
|
-
|
|
247
|
-
```python
|
|
248
|
-
completed = []; failed = []
|
|
249
|
-
for task, result in zip(wave, results):
|
|
250
|
-
if "TASK_COMPLETE" in result:
|
|
251
|
-
completed.append(task)
|
|
252
|
-
elif "TASK_FAILED" in result:
|
|
253
|
-
failed.append(task)
|
|
254
|
-
|
|
255
|
-
# Post-hoc conflict detection (verify executors did not touch out-of-scope files)
|
|
256
|
-
for task in completed:
|
|
257
|
-
actual_files = git_diff_files_touched_by(task)
|
|
258
|
-
declared = set(task.files)
|
|
259
|
-
unexpected = actual_files - declared
|
|
260
|
-
if unexpected:
|
|
261
|
-
warn(f"Task {task.id} modified undeclared files: {unexpected}")
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
#### Step 5: Wave Failure Handling
|
|
265
|
-
|
|
266
|
-
```
|
|
267
|
-
len(failed) == 0:
|
|
268
|
-
→ continue to the next wave
|
|
269
|
-
|
|
270
|
-
len(failed) == 1:
|
|
271
|
-
→ failed_attempts += 1
|
|
272
|
-
→ based on config.wave_fail_policy:
|
|
273
|
-
"continue-on-single": continue to the next wave, report failure at the end
|
|
274
|
-
"stop-on-any": stop immediately
|
|
275
|
-
|
|
276
|
-
len(failed) >= 2:
|
|
277
|
-
→ likely environment issue (missing deps/tsc error/permissions)
|
|
278
|
-
→ stop immediately, suggest npx @curdx/flow doctor
|
|
279
|
-
|
|
280
|
-
failed_attempts >= 3 (cumulative):
|
|
281
|
-
→ stop, user intervention required
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
#### Step 6: Progress Feedback
|
|
285
|
-
|
|
286
|
-
```
|
|
287
|
-
▶ Wave 2/5 complete
|
|
288
|
-
✓ 1.1 feat(auth): create module skeleton (abc123)
|
|
289
|
-
✓ 1.2 feat(user): create user types (def456)
|
|
290
|
-
✓ 1.3 feat(session): init token module (ghi789)
|
|
291
|
-
|
|
292
|
-
▶ Wave 3/5 starting (VERIFY)...
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
#### Configuration
|
|
296
|
-
|
|
297
|
-
`.flow/config.json`:
|
|
298
|
-
```json
|
|
299
|
-
{
|
|
300
|
-
"execution": {
|
|
301
|
-
"strategy": "wave",
|
|
302
|
-
"max_parallel": 5,
|
|
303
|
-
"wave_fail_policy": "continue-on-single"
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
- `max_parallel`: max N parallel within a wave (to avoid API rate limits, default 5)
|
|
309
|
-
- `wave_fail_policy`: single-task failure behavior
|
|
310
|
-
|
|
311
|
-
#### Pitfalls (see knowledge/wave-execution.md for the detailed version)
|
|
312
|
-
|
|
313
|
-
- Stray `[P]` → conflict detection as a safety net
|
|
314
|
-
- Wave too large → max_parallel auto-splits
|
|
315
|
-
- Implicit read-write dependencies → planner should avoid this kind of `[P]`
|
|
175
|
+
Configuration under `.flow/config.json.execution`: `strategy: "wave"`, `max_parallel: 5` (wave-parallel ceiling), `wave_fail_policy: "continue-on-single" | "stop-on-any"`.
|
|
316
176
|
|
|
317
177
|
### Strategy: stop-hook
|
|
318
178
|
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Wave Execution Strategy — Detailed Walkthrough
|
|
2
|
+
|
|
3
|
+
Skill-scoped reference for `skills/implement/SKILL.md`. Loaded only when the
|
|
4
|
+
implement skill routes to the `wave` strategy. The knowledge-layer canonical
|
|
5
|
+
algorithm lives in `@${CLAUDE_PLUGIN_ROOT}/knowledge/wave-execution.md`;
|
|
6
|
+
this file is the walkthrough the skill itself embeds for implementers.
|
|
7
|
+
|
|
8
|
+
**Core**: consecutive `[P]` tasks form a wave, dispatch multiple Agent calls in
|
|
9
|
+
parallel within a single message, serial across waves.
|
|
10
|
+
|
|
11
|
+
## Step 1: DAG Analysis
|
|
12
|
+
|
|
13
|
+
Read remaining `[ ]` tasks from tasks.md and group per the rules:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
for task in remaining tasks:
|
|
17
|
+
if task has [SEQUENTIAL] or [VERIFY]:
|
|
18
|
+
→ own wave (breaks parallelism)
|
|
19
|
+
elif task has [P]:
|
|
20
|
+
→ check whether Files conflict with current_wave
|
|
21
|
+
conflict → start a new wave
|
|
22
|
+
no conflict → add to current_wave
|
|
23
|
+
else:
|
|
24
|
+
→ own wave (no [P] = serial)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Output wave list:
|
|
28
|
+
```
|
|
29
|
+
Wave 1 [P×3]: 1.1 1.2 1.3
|
|
30
|
+
Wave 2 [VERIFY]: 1.4
|
|
31
|
+
Wave 3: 1.5
|
|
32
|
+
Wave 4 [P×2]: 1.6 1.7
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Step 2: Pre-Conflict Detection
|
|
36
|
+
|
|
37
|
+
For each wave, verify that Files across all tasks are **disjoint**:
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
for wave in waves:
|
|
41
|
+
all_files = []
|
|
42
|
+
for task in wave:
|
|
43
|
+
if set(task.files) & set(all_files):
|
|
44
|
+
warn(f"Within wave, {task.id} modifies the same file as a prior task")
|
|
45
|
+
# split into the next wave
|
|
46
|
+
all_files.extend(task.files)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
If the planner mis-tagged `[P]` (modifies the same file), split the wave automatically at execution time rather than failing outright.
|
|
50
|
+
|
|
51
|
+
## Step 3: Dispatch a Single Wave (key: within a single response)
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
# List multiple Agent tool calls in one response of the main agent:
|
|
55
|
+
Agent(description="Execute 1.1", prompt=<...flow-executor + task_id=1.1...>)
|
|
56
|
+
Agent(description="Execute 1.2", prompt=<...flow-executor + task_id=1.2...>)
|
|
57
|
+
Agent(description="Execute 1.3", prompt=<...flow-executor + task_id=1.3...>)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Each Agent prompt follows a uniform format (similar to subagent strategy):
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
You are the flow-executor agent. Full definition:
|
|
64
|
+
${CLAUDE_PLUGIN_ROOT}/agents/flow-executor.md
|
|
65
|
+
|
|
66
|
+
Execute a single task:
|
|
67
|
+
spec_name: $SPEC_NAME
|
|
68
|
+
task_id: <specific ID, e.g., 1.2>
|
|
69
|
+
quick_mode: $QUICK
|
|
70
|
+
|
|
71
|
+
**You may only modify the following files** (touching anything else is disallowed):
|
|
72
|
+
<task.files>
|
|
73
|
+
|
|
74
|
+
Required reading:
|
|
75
|
+
- .flow/specs/$SPEC_NAME/tasks.md
|
|
76
|
+
- .flow/specs/$SPEC_NAME/.state.json
|
|
77
|
+
- .flow/specs/$SPEC_NAME/design.md (if referencing AD-NN)
|
|
78
|
+
|
|
79
|
+
Output:
|
|
80
|
+
- TASK_COMPLETE: <task_id> or
|
|
81
|
+
- TASK_FAILED: <task_id> + reason
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Not allowed**:
|
|
85
|
+
- Splitting multiple Agent calls across multiple responses (that is serial degradation)
|
|
86
|
+
- Nesting another Agent dispatch inside an Agent
|
|
87
|
+
|
|
88
|
+
## Step 4: Aggregate Wave Results
|
|
89
|
+
|
|
90
|
+
Wait for all Agent calls to return:
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
completed = []; failed = []
|
|
94
|
+
for task, result in zip(wave, results):
|
|
95
|
+
if "TASK_COMPLETE" in result:
|
|
96
|
+
completed.append(task)
|
|
97
|
+
elif "TASK_FAILED" in result:
|
|
98
|
+
failed.append(task)
|
|
99
|
+
|
|
100
|
+
# Post-hoc conflict detection (verify executors did not touch out-of-scope files)
|
|
101
|
+
for task in completed:
|
|
102
|
+
actual_files = git_diff_files_touched_by(task)
|
|
103
|
+
declared = set(task.files)
|
|
104
|
+
unexpected = actual_files - declared
|
|
105
|
+
if unexpected:
|
|
106
|
+
warn(f"Task {task.id} modified undeclared files: {unexpected}")
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Step 5: Wave Failure Handling
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
len(failed) == 0:
|
|
113
|
+
→ continue to the next wave
|
|
114
|
+
|
|
115
|
+
len(failed) == 1:
|
|
116
|
+
→ failed_attempts += 1
|
|
117
|
+
→ based on config.wave_fail_policy:
|
|
118
|
+
"continue-on-single": continue to the next wave, report failure at the end
|
|
119
|
+
"stop-on-any": stop immediately
|
|
120
|
+
|
|
121
|
+
len(failed) >= 2:
|
|
122
|
+
→ likely environment issue (missing deps/tsc error/permissions)
|
|
123
|
+
→ stop immediately, suggest npx @curdx/flow doctor
|
|
124
|
+
|
|
125
|
+
failed_attempts >= 3 (cumulative):
|
|
126
|
+
→ stop, user intervention required
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Step 6: Progress Feedback
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
▶ Wave 2/5 complete
|
|
133
|
+
✓ 1.1 feat(auth): create module skeleton (abc123)
|
|
134
|
+
✓ 1.2 feat(user): create user types (def456)
|
|
135
|
+
✓ 1.3 feat(session): init token module (ghi789)
|
|
136
|
+
|
|
137
|
+
▶ Wave 3/5 starting (VERIFY)...
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Configuration
|
|
141
|
+
|
|
142
|
+
`.flow/config.json`:
|
|
143
|
+
```json
|
|
144
|
+
{
|
|
145
|
+
"execution": {
|
|
146
|
+
"strategy": "wave",
|
|
147
|
+
"max_parallel": 5,
|
|
148
|
+
"wave_fail_policy": "continue-on-single"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
- `max_parallel`: max N parallel within a wave (to avoid API rate limits, default 5)
|
|
154
|
+
- `wave_fail_policy`: single-task failure behavior
|
|
155
|
+
|
|
156
|
+
## Pitfalls
|
|
157
|
+
|
|
158
|
+
See `@${CLAUDE_PLUGIN_ROOT}/knowledge/wave-execution.md` for the detailed version.
|
|
159
|
+
|
|
160
|
+
- Stray `[P]` → conflict detection as a safety net
|
|
161
|
+
- Wave too large → max_parallel auto-splits
|
|
162
|
+
- Implicit read-write dependencies → planner should avoid this kind of `[P]`
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review
|
|
3
|
-
description: Two-stage code review — Stage 1 spec compliance, Stage 2 code quality. Optional flags add adversarial review
|
|
4
|
-
argument-hint: "[--stage=<1|2|both>] [--adversarial] [--edge-case]"
|
|
5
|
-
|
|
3
|
+
description: Two-stage code review — Stage 1 spec compliance, Stage 2 code quality. Optional flags add adversarial review, edge-case hunting, or developer-experience audit.
|
|
4
|
+
argument-hint: "[--stage=<1|2|both>] [--adversarial] [--edge-case] [--devex]"
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
allowed-tools: [Read, Bash, Agent, Grep, Glob]
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
# Two-Stage Code Review
|
|
@@ -18,6 +19,7 @@ Distinct from `/curdx-flow:verify`:
|
|
|
18
19
|
| `--stage=<1\|2\|both>` | `both` | Stage 1 = spec compliance only. Stage 2 = code quality only. `both` = sequential. |
|
|
19
20
|
| `--adversarial` | off | Add an adversarial review pass across applicable categories (zero findings requires proof-of-checking, not fabrication). |
|
|
20
21
|
| `--edge-case` | off | Add edge-case hunting across applicable categories. Produces a test-gap checklist. |
|
|
22
|
+
| `--devex` | off | Apply the DevEx audit: naming, comments, structure, error handling, setup, types, tests, and developer loop. Gate: `@${CLAUDE_PLUGIN_ROOT}/gates/devex-gate.md`. |
|
|
21
23
|
|
|
22
24
|
## Preflight
|
|
23
25
|
|
|
@@ -38,6 +40,7 @@ done
|
|
|
38
40
|
FLAG_STAGE=$(echo "$ARGUMENTS" | grep -oP -- '--stage=\K[^\s]+' || echo "both")
|
|
39
41
|
FLAG_ADV=$(echo "$ARGUMENTS" | grep -q -- '--adversarial' && echo 1 || echo 0)
|
|
40
42
|
FLAG_EDGE=$(echo "$ARGUMENTS" | grep -q -- '--edge-case' && echo 1 || echo 0)
|
|
43
|
+
FLAG_DEVEX=$(echo "$ARGUMENTS" | grep -q -- '--devex' && echo 1 || echo 0)
|
|
41
44
|
```
|
|
42
45
|
|
|
43
46
|
## Stage 1 — Spec compliance
|
|
@@ -89,6 +92,27 @@ Dispatch `flow-edge-hunter` across the applicable categories (skip N/A with one-
|
|
|
89
92
|
|
|
90
93
|
Output: test-gap checklist with suggested test cases.
|
|
91
94
|
|
|
95
|
+
## Optional: DevEx audit
|
|
96
|
+
|
|
97
|
+
If `--devex`:
|
|
98
|
+
Pass the DevEx gate at `@${CLAUDE_PLUGIN_ROOT}/gates/devex-gate.md` as
|
|
99
|
+
additional context to `flow-reviewer`. The gate adds these dimensions to
|
|
100
|
+
Stage 2:
|
|
101
|
+
|
|
102
|
+
1. **Naming** — identifier clarity, consistency across modules.
|
|
103
|
+
2. **Comments** — only non-obvious WHY; no redundant WHAT.
|
|
104
|
+
3. **Structure** — file and function sizes, colocation of related code.
|
|
105
|
+
4. **Error handling** — at system boundaries only; no defensive guards inside trusted paths.
|
|
106
|
+
5. **Setup** — `npm install && npm test` green on a fresh clone.
|
|
107
|
+
6. **Types** — strictness, no unexplained `any` / `unknown`.
|
|
108
|
+
7. **Tests** — failure messages, fixture clarity, no flake.
|
|
109
|
+
8. **Dev loop** — time from code-change to feedback.
|
|
110
|
+
|
|
111
|
+
`flow-reviewer` is NOT edited for `--devex` — the gate file is injected
|
|
112
|
+
into the reviewer dispatch prompt as reference context, so the agent
|
|
113
|
+
stays generic. Output: a "DevEx" section in the review report with
|
|
114
|
+
per-dimension verdicts.
|
|
115
|
+
|
|
92
116
|
## Report
|
|
93
117
|
|
|
94
118
|
**Landing check**: sub-agent responses can be truncated. After dispatching review agents, verify the report actually landed on disk:
|
|
@@ -121,6 +145,15 @@ Consolidated output: `.flow/specs/$SPEC_NAME/review-report.md`:
|
|
|
121
145
|
## Edge Cases (if run)
|
|
122
146
|
...
|
|
123
147
|
|
|
148
|
+
## DevEx (if run)
|
|
149
|
+
- Naming: <verdict>
|
|
150
|
+
- Structure: <verdict>
|
|
151
|
+
- Error handling: <verdict>
|
|
152
|
+
- Setup: <verdict>
|
|
153
|
+
- Types: <verdict>
|
|
154
|
+
- Tests: <verdict>
|
|
155
|
+
- Dev loop: <verdict>
|
|
156
|
+
|
|
124
157
|
## Verdict
|
|
125
158
|
- [ ] APPROVED
|
|
126
159
|
- [X] CHANGES REQUIRED — <n> blockers
|
|
@@ -135,6 +168,7 @@ Consolidated output: `.flow/specs/$SPEC_NAME/review-report.md`:
|
|
|
135
168
|
Stage 2 findings: <n>
|
|
136
169
|
Adversarial findings: <n> (if --adversarial)
|
|
137
170
|
Edge-case gaps: <n> (if --edge-case)
|
|
171
|
+
DevEx findings: <n> (if --devex)
|
|
138
172
|
Verdict: CHANGES REQUIRED
|
|
139
173
|
|
|
140
174
|
Report: .flow/specs/<name>/review-report.md
|
|
@@ -149,4 +183,5 @@ Next: address blockers, then re-run /curdx-flow:review.
|
|
|
149
183
|
- `flow-edge-hunter` agent: `@${CLAUDE_PLUGIN_ROOT}/agents/flow-edge-hunter.md`
|
|
150
184
|
- `adversarial-review-gate`: `@${CLAUDE_PLUGIN_ROOT}/gates/adversarial-review-gate.md`
|
|
151
185
|
- `edge-case-gate`: `@${CLAUDE_PLUGIN_ROOT}/gates/edge-case-gate.md`
|
|
186
|
+
- `devex-gate`: `@${CLAUDE_PLUGIN_ROOT}/gates/devex-gate.md`
|
|
152
187
|
- Knowledge: `@${CLAUDE_PLUGIN_ROOT}/knowledge/two-stage-review.md`
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: security-audit
|
|
3
|
-
description:
|
|
3
|
+
description: Use when the user needs security review of code, specs, credentials, sensitive data, or dependency risk.
|
|
4
|
+
when_to_use: Triggers on "security", "auth", "authentication", "credential", "password", "secret", "API key", "token", "OWASP", "STRIDE", "CVE", "vulnerability", "injection", "XSS", "CSRF", "SSRF", "SQL injection", "hardcoded secret", "sensitive data", "leak", "will my API key leak", "is this safe".
|
|
4
5
|
allowed-tools: [Read, Grep, Glob, Bash, WebSearch]
|
|
5
6
|
---
|
|
6
7
|
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
name: spec
|
|
3
3
|
description: Generate or refresh a feature specification. By default runs research → requirements → design → tasks in sequence. Flags let you target a single phase, stop early, regenerate, or tack on a multi-dimensional planning review.
|
|
4
4
|
argument-hint: "[--phase=<X[,Y,...]>] [--until=<X>] [--review[=<dim[,dim]>]] [--regenerate] [--resume]"
|
|
5
|
-
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
allowed-tools: [Read, Write, Bash, Agent, AskUserQuestion]
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
# Generate or Refresh the Active Spec
|
|
@@ -70,7 +71,7 @@ Read and update `.state.json.phase` after each phase succeeds.
|
|
|
70
71
|
|
|
71
72
|
## Phase execution
|
|
72
73
|
|
|
73
|
-
For each phase in the resolved list, dispatch a
|
|
74
|
+
For each phase in the resolved list, dispatch a subagent via the `Agent` tool:
|
|
74
75
|
|
|
75
76
|
### research → `flow-researcher`
|
|
76
77
|
Inputs: spec goal + one-line description from `.state.json`.
|
|
@@ -176,7 +177,7 @@ If `--review` (or `--review=<dims>`) is present:
|
|
|
176
177
|
|
|
177
178
|
1. **Precondition**: `design.md` must exist. If missing, error: "Design missing. Run `/curdx-flow:spec --phase=design` first."
|
|
178
179
|
2. Parse the dims: `all` expands to `ceo,eng,design,dx`.
|
|
179
|
-
3. Dispatch review agents in parallel via `
|
|
180
|
+
3. Dispatch review agents in parallel via `Agent` (one per dim):
|
|
180
181
|
|
|
181
182
|
| Dim | Agent | Focus |
|
|
182
183
|
|-----|-------|-------|
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
name: start
|
|
3
3
|
description: Smart entry point — create a new spec, resume an existing one, or switch between specs. Replaces v1's /start + /switch.
|
|
4
4
|
argument-hint: "[<spec-name>] [\"<one-line goal>\"] [--resume] [--list] [--mode=<fast|standard|enterprise>]"
|
|
5
|
-
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
allowed-tools: [Read, Write, Bash, AskUserQuestion, Agent]
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
# Start or Resume a Feature Spec
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ui-sketch
|
|
3
|
-
description:
|
|
3
|
+
description: Use when the user needs UI design drafts, layout variants, mockups, prototypes, or styling direction.
|
|
4
|
+
when_to_use: Triggers on "design UI", "UI design", "component layout", "variants", "wireframe", "mockup", "prototype", "sketch", "draft layout", "visual design", "styling", "CSS", "theming", "dark mode", "responsive design", "color scheme", "build me a UI", "show several variants", "try different colors".
|
|
4
5
|
allowed-tools: [Read, Write, Bash, WebSearch]
|
|
5
6
|
---
|
|
6
7
|
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verify
|
|
3
|
+
description: Goal-backward verification — trace from every FR / AC / AD in the active spec to the code and tests, detect stubs and fake completions. The differentiator command. Optionally adds multi-source coverage audit with --strict.
|
|
4
|
+
argument-hint: "[--strict]"
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
context: fork
|
|
7
|
+
agent: flow-verifier
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Goal-Backward Verification
|
|
11
|
+
|
|
12
|
+
Verify the active `.flow/` spec using goal-backward analysis. This is the
|
|
13
|
+
differentiator step — catches Claude's most common failure: claiming "done"
|
|
14
|
+
while the code is a stub, a fake completion, or an untested AC.
|
|
15
|
+
|
|
16
|
+
**Arguments**: `$ARGUMENTS` (optionally `--strict` for multi-source coverage audit).
|
|
17
|
+
|
|
18
|
+
## Preflight
|
|
19
|
+
|
|
20
|
+
- `.flow/` must exist and `.flow/.active-spec` must be non-empty.
|
|
21
|
+
- `.flow/specs/<active>/requirements.md`, `design.md`, `tasks.md` must all exist.
|
|
22
|
+
|
|
23
|
+
If any precondition fails, emit a clear error and stop.
|
|
24
|
+
|
|
25
|
+
## What to verify
|
|
26
|
+
|
|
27
|
+
Read the active spec's `requirements.md` (for FR-NN and AC-N.N),
|
|
28
|
+
`design.md` (for AD-NN), `tasks.md` (for T-N.M with per-task Verify
|
|
29
|
+
commands), and `.flow/STATE.md` (for D-NN decisions).
|
|
30
|
+
|
|
31
|
+
For EACH assertion in the spec, walk goal-backward:
|
|
32
|
+
|
|
33
|
+
1. Classify the assertion as **UI-facing** (uses words like "user sees",
|
|
34
|
+
"click", "render", or names a UI element) vs. **code-only** (schema,
|
|
35
|
+
API response, performance, error envelope, etc.).
|
|
36
|
+
2. For **code-only**: grep the codebase for matching symbols, find the
|
|
37
|
+
implementing file + line, find a test that exercises it, run the test
|
|
38
|
+
(`npm test` or the declared `Verify` command), capture pass/fail.
|
|
39
|
+
3. For **UI-facing**: browser verification via `mcp__chrome_devtools__*`
|
|
40
|
+
is required. `jsdom` / `happy-dom` unit tests are insufficient. If the
|
|
41
|
+
browser MCP isn't available, mark the AC **unverified — browser MCP
|
|
42
|
+
missing** and include a CRITICAL section in the report; do NOT
|
|
43
|
+
silently pass based on code reading alone.
|
|
44
|
+
|
|
45
|
+
Also scan for **stub / fake-completion** patterns on FR-covered paths:
|
|
46
|
+
|
|
47
|
+
- `throw new Error("not implemented")`, `// TODO:` on critical paths
|
|
48
|
+
- `return null` / `return {}` where real output is expected
|
|
49
|
+
- tests with only `it.skip(...)` or no assertions
|
|
50
|
+
- code returning mocked fixtures instead of calling real collaborators
|
|
51
|
+
|
|
52
|
+
Run the per-task `Verify` commands from `tasks.md` and record pass/fail.
|
|
53
|
+
|
|
54
|
+
## --strict mode
|
|
55
|
+
|
|
56
|
+
When `$ARGUMENTS` contains `--strict`, also apply the multi-source coverage
|
|
57
|
+
audit at `@${CLAUDE_PLUGIN_ROOT}/gates/coverage-audit-gate.md`. Cross-check:
|
|
58
|
+
|
|
59
|
+
- Every FR ↔ AC ↔ AD ↔ task ↔ test ↔ commit must reference each other.
|
|
60
|
+
- Research conclusions: was the recommended library / approach actually used?
|
|
61
|
+
- Every D-NN in `.flow/STATE.md` that references this spec is honored.
|
|
62
|
+
|
|
63
|
+
## Deliverables
|
|
64
|
+
|
|
65
|
+
Write `.flow/specs/<name>/verification-report.md` with:
|
|
66
|
+
|
|
67
|
+
- Summary counts (FR / AC / AD coverage, stub count, failing Verify count)
|
|
68
|
+
- Detailed Checklist (one section per FR / AC / AD with Evidence + Verdict)
|
|
69
|
+
- Stub / fake findings with file paths
|
|
70
|
+
- Verdict: `PASS` / `PARTIAL` / `MISSING`
|
|
71
|
+
|
|
72
|
+
Exact format schema is in `agents/flow-verifier.md` Step 6 (loaded via the
|
|
73
|
+
`agent: flow-verifier` frontmatter field — its system prompt governs).
|
|
74
|
+
|
|
75
|
+
**Landing check**: your FIRST substantive action after gathering findings
|
|
76
|
+
must be the `Write` tool call with the complete report. Do NOT preview the
|
|
77
|
+
report as assistant text first; that doubles output tokens and risks
|
|
78
|
+
truncating inside the Write call. After Write succeeds, respond with a
|
|
79
|
+
≤ 5-line summary only.
|
|
80
|
+
|
|
81
|
+
## Apply the gate
|
|
82
|
+
|
|
83
|
+
Per `@${CLAUDE_PLUGIN_ROOT}/gates/verification-gate.md`:
|
|
84
|
+
|
|
85
|
+
- Any `STUB` or `MISSING` finding on a non-deferred FR blocks completion.
|
|
86
|
+
- Any failing Verify command blocks completion.
|
|
87
|
+
- Waive only with an explicit D-NN decision logged in `.flow/STATE.md`.
|
|
88
|
+
|
|
89
|
+
## Output to user (≤ 5 lines after Write succeeds)
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
✓ Verification complete: <spec-name>
|
|
93
|
+
FR coverage: N/M implemented (S stub, K missing)
|
|
94
|
+
AC coverage: N/M tested
|
|
95
|
+
Verdict: PASS | PARTIAL | MISSING
|
|
96
|
+
Report: .flow/specs/<name>/verification-report.md
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Next: address findings, then re-run `/curdx-flow:verify`, or run `/curdx-flow:review`.
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/wdx/curdx-flow/main/schemas/config.schema.json",
|
|
3
3
|
"version": "1.0",
|
|
4
4
|
"mode": "standard",
|
|
5
|
-
"_mode_options": "
|
|
5
|
+
"_mode_options": "fast | standard | enterprise",
|
|
6
6
|
|
|
7
7
|
"execution": {
|
|
8
8
|
"strategy": "auto",
|
|
9
9
|
"_strategy_options": "auto | subagent | stop-hook | wave | linear",
|
|
10
10
|
"max_parallel": 5,
|
|
11
|
-
"subagent_threshold": 8
|
|
11
|
+
"subagent_threshold": 8,
|
|
12
|
+
"wave_fail_policy": "continue-on-single"
|
|
12
13
|
},
|
|
13
14
|
|
|
14
15
|
"gates": {
|
|
@@ -18,14 +19,13 @@
|
|
|
18
19
|
],
|
|
19
20
|
"standard_mode": [
|
|
20
21
|
"tdd-gate",
|
|
21
|
-
"coverage-audit-gate"
|
|
22
|
-
"simplicity-gate"
|
|
22
|
+
"coverage-audit-gate"
|
|
23
23
|
],
|
|
24
24
|
"enterprise_mode": [
|
|
25
25
|
"adversarial-review-gate",
|
|
26
26
|
"edge-case-gate",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
27
|
+
"security-gate",
|
|
28
|
+
"devex-gate"
|
|
29
29
|
]
|
|
30
30
|
},
|
|
31
31
|
|
|
@@ -45,7 +45,7 @@ _(none)_
|
|
|
45
45
|
|
|
46
46
|
<!-- What to do next. Must be filled in before ending the session. -->
|
|
47
47
|
|
|
48
|
-
- [ ] Enter the research phase: run `/flow
|
|
48
|
+
- [ ] Enter the research phase: run `/curdx-flow:spec --phase=research`
|
|
49
49
|
|
|
50
50
|
## Questions for User
|
|
51
51
|
|
|
@@ -55,4 +55,4 @@ _(none)_
|
|
|
55
55
|
|
|
56
56
|
---
|
|
57
57
|
|
|
58
|
-
_Spec initialized on {{CREATED_DATE}}._
|
|
58
|
+
_Spec initialized by `/curdx-flow:start` on {{CREATED_DATE}}._
|