@curdx/flow 1.1.11 → 2.0.0-beta.10
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 +3 -3
- package/.claude-plugin/plugin.json +4 -11
- package/CHANGELOG.md +99 -0
- package/README.md +74 -102
- package/README.zh.md +2 -2
- package/agent-preamble/preamble.md +81 -11
- package/agents/flow-adversary.md +41 -56
- package/agents/flow-architect.md +24 -11
- package/agents/flow-debugger.md +2 -2
- package/agents/flow-edge-hunter.md +20 -6
- package/agents/flow-executor.md +3 -3
- package/agents/flow-planner.md +51 -48
- package/agents/flow-product-designer.md +15 -2
- package/agents/flow-qa-engineer.md +4 -4
- package/agents/flow-researcher.md +18 -3
- package/agents/flow-reviewer.md +5 -1
- package/agents/flow-security-auditor.md +2 -2
- package/agents/flow-triage-analyst.md +4 -4
- package/agents/flow-ui-researcher.md +7 -7
- package/agents/flow-ux-designer.md +3 -3
- package/agents/flow-verifier.md +47 -14
- package/bin/curdx-flow.js +13 -1
- package/cli/doctor.js +28 -13
- package/cli/install.js +62 -36
- package/cli/protocols.js +63 -10
- package/cli/registry.js +73 -0
- package/cli/uninstall.js +9 -11
- package/cli/upgrade.js +6 -10
- package/cli/utils.js +104 -56
- package/commands/debug.md +10 -10
- package/commands/fast.md +1 -1
- package/commands/help.md +109 -87
- package/commands/implement.md +7 -7
- package/commands/init.md +18 -7
- package/commands/review.md +114 -130
- package/commands/spec.md +131 -89
- package/commands/start.md +130 -153
- package/commands/verify.md +110 -92
- package/gates/adversarial-review-gate.md +20 -20
- package/gates/coverage-audit-gate.md +1 -1
- package/gates/devex-gate.md +5 -6
- package/gates/edge-case-gate.md +2 -2
- package/gates/security-gate.md +3 -3
- package/hooks/hooks.json +0 -11
- package/hooks/scripts/quick-mode-guard.sh +12 -9
- package/hooks/scripts/session-start.sh +2 -2
- package/hooks/scripts/stop-watcher.sh +25 -15
- package/knowledge/epic-decomposition.md +2 -2
- package/knowledge/execution-strategies.md +10 -9
- package/knowledge/planning-reviews.md +6 -6
- package/knowledge/spec-driven-development.md +11 -10
- package/knowledge/two-stage-review.md +6 -5
- package/knowledge/wave-execution.md +5 -5
- package/package.json +4 -2
- package/skills/brownfield-index/SKILL.md +62 -0
- package/skills/browser-qa/SKILL.md +50 -0
- package/skills/epic/SKILL.md +68 -0
- package/skills/security-audit/SKILL.md +50 -0
- package/skills/ui-sketch/SKILL.md +49 -0
- package/templates/config.json.tmpl +1 -1
- package/templates/design.md.tmpl +32 -112
- package/templates/requirements.md.tmpl +25 -43
- package/templates/research.md.tmpl +37 -68
- package/templates/tasks.md.tmpl +27 -84
- package/agents/persona-amelia.md +0 -128
- package/agents/persona-david.md +0 -141
- package/agents/persona-emma.md +0 -179
- package/agents/persona-john.md +0 -105
- package/agents/persona-mary.md +0 -95
- package/agents/persona-oliver.md +0 -136
- package/agents/persona-rachel.md +0 -126
- package/agents/persona-serena.md +0 -175
- package/agents/persona-winston.md +0 -117
- package/commands/audit.md +0 -170
- package/commands/autoplan.md +0 -184
- package/commands/design.md +0 -155
- package/commands/discuss.md +0 -162
- package/commands/doctor.md +0 -124
- package/commands/index.md +0 -261
- package/commands/install-deps.md +0 -128
- package/commands/party.md +0 -241
- package/commands/plan-ceo.md +0 -117
- package/commands/plan-design.md +0 -107
- package/commands/plan-dx.md +0 -104
- package/commands/plan-eng.md +0 -108
- package/commands/qa.md +0 -118
- package/commands/requirements.md +0 -146
- package/commands/research.md +0 -141
- package/commands/security.md +0 -109
- package/commands/sketch.md +0 -118
- package/commands/spike.md +0 -181
- package/commands/status.md +0 -139
- package/commands/switch.md +0 -95
- package/commands/tasks.md +0 -189
- package/commands/triage.md +0 -160
- package/hooks/scripts/fail-tracker.sh +0 -31
package/commands/spike.md
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: spike
|
|
3
|
-
description: feasibility experiment — validate an idea with 2-5 small tests, no production code. Output conclusions to STATE.md
|
|
4
|
-
argument-hint: "\"<hypothesis to validate>\""
|
|
5
|
-
allowed-tools: [Read, Write, Edit, Bash, WebSearch, Grep, Glob]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Flow Spike — Feasibility Experiment
|
|
9
|
-
|
|
10
|
-
@${CLAUDE_PLUGIN_ROOT}/agent-preamble/preamble.md
|
|
11
|
-
|
|
12
|
-
**A spike is a short-duration experiment**, aimed at answering one technical question: "Can this approach work?" It is not about delivering a feature.
|
|
13
|
-
|
|
14
|
-
## Typical Scenarios
|
|
15
|
-
|
|
16
|
-
- "Can Redis Streams replace Kafka?"
|
|
17
|
-
- "How much faster is Bun than Node? Is our scenario a good fit?"
|
|
18
|
-
- "Is this API's rate limit 10 qps?"
|
|
19
|
-
- "Can the new TypeScript const generic solve problem X?"
|
|
20
|
-
|
|
21
|
-
## Step 1: Clarify the Hypothesis
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
HYPOTHESIS="$ARGUMENTS"
|
|
25
|
-
[ -z "$HYPOTHESIS" ] && { echo "Usage: /curdx-flow:spike \"<hypothesis>\""; exit 1; }
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Confirm with the user:
|
|
29
|
-
```
|
|
30
|
-
Hypothesis to validate: <HYPOTHESIS>
|
|
31
|
-
|
|
32
|
-
My understanding:
|
|
33
|
-
- What to validate: <...>
|
|
34
|
-
- Pass criteria: <...>
|
|
35
|
-
- What if it fails: <...>
|
|
36
|
-
- Time budget: recommend 30-60 minutes
|
|
37
|
-
|
|
38
|
-
Continue? (yes / correct me)
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Use AskUserQuestion (unless quickMode).
|
|
42
|
-
|
|
43
|
-
## Step 2: Design 2-5 Small Tests
|
|
44
|
-
|
|
45
|
-
**Rules**:
|
|
46
|
-
- Each test is independent
|
|
47
|
-
- Minimal code (50 lines max)
|
|
48
|
-
- Explicit pass/fail criteria
|
|
49
|
-
- Do not touch production code
|
|
50
|
-
|
|
51
|
-
Example (validating Redis Streams performance):
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
Test 1: Throughput of writing 1000 messages
|
|
55
|
-
Code: spike/redis-streams-write.ts
|
|
56
|
-
Expected: >= 10K msg/sec
|
|
57
|
-
|
|
58
|
-
Test 2: Consumer group latency
|
|
59
|
-
Code: spike/redis-streams-consume.ts
|
|
60
|
-
Expected: P99 < 10ms
|
|
61
|
-
|
|
62
|
-
Test 3: Persistence overhead
|
|
63
|
-
Code: compare AOF vs RDB
|
|
64
|
-
Expected: AOF write latency increase < 20%
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## Step 3: Create the spike directory
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
mkdir -p spike/$(date +%Y-%m-%d)-${HYPOTHESIS_SLUG}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
All experimental code lives here. **Absolutely do not touch production code**.
|
|
74
|
-
|
|
75
|
-
## Step 4: Run the Tests
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
for test in Test 1 2 3:
|
|
79
|
-
write code
|
|
80
|
-
run
|
|
81
|
-
record results
|
|
82
|
-
if blocked:
|
|
83
|
-
not "fix bug and continue", but record "blocker X, cannot test"
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
**context7 is mandatory**: look up all library APIs via context7, do not rely on memory.
|
|
87
|
-
|
|
88
|
-
## Step 5: Record Results
|
|
89
|
-
|
|
90
|
-
Create `spike/<date>-<slug>/RESULTS.md`:
|
|
91
|
-
|
|
92
|
-
```markdown
|
|
93
|
-
# Spike Results: <hypothesis>
|
|
94
|
-
|
|
95
|
-
Date: YYYY-MM-DD
|
|
96
|
-
Time: actually took N minutes
|
|
97
|
-
|
|
98
|
-
## Test Matrix
|
|
99
|
-
|
|
100
|
-
| Test | Expected | Actual | Conclusion |
|
|
101
|
-
|------|-----|------|------|
|
|
102
|
-
| 1 | >=10K msg/sec | 12K msg/sec | ✓ |
|
|
103
|
-
| 2 | P99 < 10ms | P99 = 15ms | ✗ |
|
|
104
|
-
| 3 | < 20% | 8% | ✓ |
|
|
105
|
-
|
|
106
|
-
## Conclusion
|
|
107
|
-
|
|
108
|
-
Hypothesis <HYPOTHESIS> is:
|
|
109
|
-
☐ Fully correct — recommended for adoption
|
|
110
|
-
☑ Partially correct — P99 latency exceeds expectations, needs deeper optimization
|
|
111
|
-
☐ Fully incorrect — not recommended
|
|
112
|
-
|
|
113
|
-
## Key Findings
|
|
114
|
-
|
|
115
|
-
- <finding 1>
|
|
116
|
-
- <finding 2>
|
|
117
|
-
|
|
118
|
-
## Recommendation
|
|
119
|
-
|
|
120
|
-
<how to handle this hypothesis if used in a real spec>
|
|
121
|
-
|
|
122
|
-
## Open Questions
|
|
123
|
-
|
|
124
|
-
<edges not yet tested>
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
## Step 6: Sync to STATE.md (if in a flow project)
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
if [ -f ".flow/STATE.md" ]; then
|
|
131
|
-
append to STATE.md:
|
|
132
|
-
## Spike: <hypothesis> (YYYY-MM-DD)
|
|
133
|
-
Conclusion: partially correct
|
|
134
|
-
Details: spike/<date>-<slug>/RESULTS.md
|
|
135
|
-
fi
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
This way, subsequent spec discussions can reference it.
|
|
139
|
-
|
|
140
|
-
## Step 7: Cleanup Decision
|
|
141
|
-
|
|
142
|
-
Ask the user:
|
|
143
|
-
```
|
|
144
|
-
Spike complete. Code is in spike/<date>-<slug>/
|
|
145
|
-
Keep it?
|
|
146
|
-
[keep] may reference later
|
|
147
|
-
[delete] conclusion recorded, code no longer valuable
|
|
148
|
-
[commit] commit into git as a historical reference
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
## Output
|
|
152
|
-
|
|
153
|
-
```
|
|
154
|
-
✓ Spike complete: <hypothesis>
|
|
155
|
-
|
|
156
|
-
Conclusion: partially correct (see RESULTS.md)
|
|
157
|
-
Tests: 3 / 3 executed
|
|
158
|
-
Actual time: 47 minutes
|
|
159
|
-
|
|
160
|
-
Next step suggestions:
|
|
161
|
-
- Go deeper: /curdx-flow:start <name> "do <specific feature> based on spike results"
|
|
162
|
-
- Abandon: recorded to STATE.md, do not adopt this direction
|
|
163
|
-
|
|
164
|
-
Artifacts:
|
|
165
|
-
spike/<date>-<slug>/RESULTS.md
|
|
166
|
-
spike/<date>-<slug>/*.ts (test code)
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
## Forbidden
|
|
170
|
-
|
|
171
|
-
- ✗ Mixing spike code into production code (src/)
|
|
172
|
-
- ✗ Spikes exceeding 2 hours (that's not a spike, that's a mini project)
|
|
173
|
-
- ✗ Claiming validation complete without recording results
|
|
174
|
-
- ✗ Using a spike to replace the real spec workflow
|
|
175
|
-
|
|
176
|
-
## spike vs research phase
|
|
177
|
-
|
|
178
|
-
- **spike** is **actually running code** to validate a hypothesis
|
|
179
|
-
- **research phase** is **reading docs / thinking** to determine direction
|
|
180
|
-
|
|
181
|
-
Research thinks approach A is feasible but has concerns → use a spike to verify → write the conclusion back into the "feasibility" section of research.md.
|
package/commands/status.md
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: status
|
|
3
|
-
description: view the current state of the CurDX-Flow project (specs, phases, progress)
|
|
4
|
-
argument-hint: "[--all | <spec-name>]"
|
|
5
|
-
allowed-tools: [Read, Bash, Glob]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Project Status
|
|
9
|
-
|
|
10
|
-
Shows an overview of the current state of the CurDX-Flow project.
|
|
11
|
-
|
|
12
|
-
## Execution Steps
|
|
13
|
-
|
|
14
|
-
### Step 1: Confirm the Project
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
if [ ! -d ".flow" ]; then
|
|
18
|
-
echo "✗ Current directory is not a CurDX-Flow project. Run /curdx-flow:init to initialize."
|
|
19
|
-
exit 0
|
|
20
|
-
fi
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Step 2: Load Global State
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
# Active spec
|
|
27
|
-
ACTIVE=$(cat .flow/.active-spec 2>/dev/null || echo "(none)")
|
|
28
|
-
|
|
29
|
-
# Project config
|
|
30
|
-
if [ -f ".flow/config.json" ]; then
|
|
31
|
-
MODE=$(python3 -c "import json; print(json.load(open('.flow/config.json')).get('mode','standard'))")
|
|
32
|
-
fi
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Step 3: Scan Specs
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
# List all specs
|
|
39
|
-
SPECS=$(ls -1 .flow/specs/ 2>/dev/null)
|
|
40
|
-
|
|
41
|
-
# List all Epics
|
|
42
|
-
EPICS=$(ls -1 .flow/_epics/ 2>/dev/null)
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
For each spec, read `.state.json` to get phase and progress:
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
for spec in $SPECS; do
|
|
49
|
-
STATE_FILE=".flow/specs/$spec/.state.json"
|
|
50
|
-
if [ -f "$STATE_FILE" ]; then
|
|
51
|
-
PHASE=$(python3 -c "import json; print(json.load(open('$STATE_FILE')).get('phase','unknown'))")
|
|
52
|
-
# Can also fetch task_index, total_tasks, etc.
|
|
53
|
-
fi
|
|
54
|
-
done
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### Step 4: Output Format
|
|
58
|
-
|
|
59
|
-
**Default (no arguments)** — global overview:
|
|
60
|
-
|
|
61
|
-
```
|
|
62
|
-
📋 CurDX-Flow Project Status
|
|
63
|
-
═══════════════════════════════════════
|
|
64
|
-
|
|
65
|
-
Project: my-awesome-app
|
|
66
|
-
Mode: standard
|
|
67
|
-
Active spec: auth-system
|
|
68
|
-
|
|
69
|
-
Spec list:
|
|
70
|
-
● auth-system design (45% — tasks pending)
|
|
71
|
-
○ user-profile execute (60% — 12/20 tasks)
|
|
72
|
-
✓ onboarding-flow completed (archived)
|
|
73
|
-
|
|
74
|
-
Epic list:
|
|
75
|
-
● payment-system 3/5 sub-specs (in progress)
|
|
76
|
-
|
|
77
|
-
Recent decisions (STATE.md):
|
|
78
|
-
D-05: use JWT instead of session cookie (2026-04-15)
|
|
79
|
-
D-06: bcrypt cost factor = 12 (2026-04-15)
|
|
80
|
-
|
|
81
|
-
═══════════════════════════════════════
|
|
82
|
-
Next step suggestion: /curdx-flow:tasks — generate task list for auth-system
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
**`<spec-name>`** — detail for a specific spec:
|
|
86
|
-
|
|
87
|
-
```
|
|
88
|
-
📋 Spec: auth-system
|
|
89
|
-
═══════════════════════════════════════
|
|
90
|
-
|
|
91
|
-
Phase: design
|
|
92
|
-
Progress: 45%
|
|
93
|
-
Created: 2026-04-12
|
|
94
|
-
|
|
95
|
-
Completed phases:
|
|
96
|
-
✓ research (research.md, 320 lines)
|
|
97
|
-
✓ requirements (requirements.md, 8 stories)
|
|
98
|
-
● design (design.md, in progress)
|
|
99
|
-
○ tasks
|
|
100
|
-
○ execute
|
|
101
|
-
|
|
102
|
-
Related decisions:
|
|
103
|
-
D-05: use JWT instead of session cookie
|
|
104
|
-
|
|
105
|
-
.progress.md summary:
|
|
106
|
-
- Confirmed JWT + refresh token architecture
|
|
107
|
-
- Researched bcrypt vs argon2, chose bcrypt (team familiarity)
|
|
108
|
-
- TODO: design token refresh flow
|
|
109
|
-
|
|
110
|
-
Next step: /curdx-flow:tasks — generate task list
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
**`--all`** — detailed mode, every spec expanded.
|
|
114
|
-
|
|
115
|
-
### Step 5: Empty-State Handling
|
|
116
|
-
|
|
117
|
-
If `.flow/` exists but no specs:
|
|
118
|
-
|
|
119
|
-
```
|
|
120
|
-
📋 CurDX-Flow Project
|
|
121
|
-
═══════════════════════════════════════
|
|
122
|
-
|
|
123
|
-
Project: my-awesome-app (just initialized)
|
|
124
|
-
Mode: standard
|
|
125
|
-
Active spec: (none)
|
|
126
|
-
|
|
127
|
-
No specs yet.
|
|
128
|
-
|
|
129
|
-
Start your first feature:
|
|
130
|
-
/curdx-flow:start <name> "<describe what you want to do>"
|
|
131
|
-
|
|
132
|
-
Example:
|
|
133
|
-
/curdx-flow:start auth-system "Add JWT authentication to API"
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
## Notes
|
|
137
|
-
|
|
138
|
-
- State data is read-only; this command does not modify any files
|
|
139
|
-
- If `.state.json` is corrupted or missing, degrade gracefully (show "state unknown" instead of failing)
|
package/commands/switch.md
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: switch
|
|
3
|
-
description: switch the active spec (updates .flow/.active-spec)
|
|
4
|
-
argument-hint: "<spec-name>"
|
|
5
|
-
allowed-tools: [Read, Write, Bash]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Switch Active Spec
|
|
9
|
-
|
|
10
|
-
Switch between multiple specs. The active spec is the default target for commands like `/curdx-flow:research`, `/curdx-flow:requirements`, etc.
|
|
11
|
-
|
|
12
|
-
## Step 1: Preflight Check
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
[ ! -d ".flow" ] && { echo "❌ Not a CurDX-Flow project. Run /curdx-flow:init first"; exit 1; }
|
|
16
|
-
|
|
17
|
-
SPEC_NAME="$ARGUMENTS"
|
|
18
|
-
if [ -z "$SPEC_NAME" ]; then
|
|
19
|
-
# No arguments → list all specs and prompt
|
|
20
|
-
echo "Current spec list:"
|
|
21
|
-
if [ -d ".flow/specs" ]; then
|
|
22
|
-
for spec in .flow/specs/*/; do
|
|
23
|
-
name=$(basename "$spec")
|
|
24
|
-
active=""
|
|
25
|
-
[ "$name" = "$(cat .flow/.active-spec 2>/dev/null)" ] && active=" ← currently active"
|
|
26
|
-
|
|
27
|
-
# Read phase
|
|
28
|
-
phase=$(python3 -c "import json; print(json.load(open('$spec/.state.json')).get('phase','?'))" 2>/dev/null || echo "?")
|
|
29
|
-
echo " • $name (phase: $phase)$active"
|
|
30
|
-
done
|
|
31
|
-
fi
|
|
32
|
-
echo ""
|
|
33
|
-
echo "Usage: /curdx-flow:switch <spec-name>"
|
|
34
|
-
exit 0
|
|
35
|
-
fi
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## Step 2: Verify Target Spec Exists
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
SPEC_DIR=".flow/specs/$SPEC_NAME"
|
|
42
|
-
if [ ! -d "$SPEC_DIR" ]; then
|
|
43
|
-
echo "❌ Spec does not exist: $SPEC_NAME"
|
|
44
|
-
echo ""
|
|
45
|
-
echo "Existing specs:"
|
|
46
|
-
ls .flow/specs/ 2>/dev/null || echo " (none)"
|
|
47
|
-
echo ""
|
|
48
|
-
echo "Create a new spec: /curdx-flow:start $SPEC_NAME \"<goal>\""
|
|
49
|
-
exit 1
|
|
50
|
-
fi
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Step 3: Perform the Switch
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
# Save old one for reference
|
|
57
|
-
OLD_ACTIVE=$(cat .flow/.active-spec 2>/dev/null || echo "(none)")
|
|
58
|
-
|
|
59
|
-
# Update
|
|
60
|
-
echo "$SPEC_NAME" > .flow/.active-spec
|
|
61
|
-
|
|
62
|
-
echo "✓ Active spec: $OLD_ACTIVE → $SPEC_NAME"
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Step 4: Display New Spec Status
|
|
66
|
-
|
|
67
|
-
```python
|
|
68
|
-
import json, os
|
|
69
|
-
s = json.load(open(f"$SPEC_DIR/.state.json"))
|
|
70
|
-
|
|
71
|
-
print(f"\n📋 {s['spec_name']}")
|
|
72
|
-
print(f" Goal: {s.get('goal','(undefined)')}")
|
|
73
|
-
print(f" Current phase: {s['phase']}")
|
|
74
|
-
|
|
75
|
-
# Phase progress bar
|
|
76
|
-
phases = ["research","requirements","design","tasks","execute","verify","ship"]
|
|
77
|
-
ph_status = s.get('phase_status', {})
|
|
78
|
-
bar = []
|
|
79
|
-
for p in phases:
|
|
80
|
-
st = ph_status.get(p, 'not_started')
|
|
81
|
-
bar.append({"completed":"✓","in_progress":"●","not_started":"○","failed":"✗","skipped":"—"}.get(st,"?"))
|
|
82
|
-
print(f" Progress: {' → '.join(bar)}")
|
|
83
|
-
print(f" {' → '.join(phases)}")
|
|
84
|
-
|
|
85
|
-
# Suggest next step
|
|
86
|
-
for p in phases:
|
|
87
|
-
if ph_status.get(p, 'not_started') in ("not_started","in_progress"):
|
|
88
|
-
print(f"\n Suggested next step: /curdx-flow:{p}")
|
|
89
|
-
break
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
## Error Recovery
|
|
93
|
-
|
|
94
|
-
- `.flow/.active-spec` permission error → check write permissions on `.flow/`
|
|
95
|
-
- .state.json corrupted → prompt `/curdx-flow:start <name>` to rebuild
|
package/commands/tasks.md
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: tasks
|
|
3
|
-
description: run the task decomposition phase — dispatch the flow-planner agent to decompose along POC-First 5 Phases and perform multi-source coverage audit. Produces tasks.md
|
|
4
|
-
argument-hint: "[spec-name] [--fine | --coarse]"
|
|
5
|
-
allowed-tools: [Read, Write, Bash, Task]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Task Decomposition Phase
|
|
9
|
-
|
|
10
|
-
Dispatch the `flow-planner` agent to decompose the design into an auto-verifiable task list.
|
|
11
|
-
|
|
12
|
-
## Step 1: Parse Arguments
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
# Support --fine / --coarse to override project default
|
|
16
|
-
TASK_SIZE="fine"
|
|
17
|
-
ARGS="$ARGUMENTS"
|
|
18
|
-
case "$ARGS" in
|
|
19
|
-
*--coarse*) TASK_SIZE="coarse" ;;
|
|
20
|
-
*--fine*) TASK_SIZE="fine" ;;
|
|
21
|
-
*)
|
|
22
|
-
# Read default from .flow/config.json
|
|
23
|
-
TASK_SIZE=$(python3 -c "
|
|
24
|
-
import json
|
|
25
|
-
try:
|
|
26
|
-
c = json.load(open('.flow/config.json'))
|
|
27
|
-
print(c.get('specs',{}).get('default_task_size','fine'))
|
|
28
|
-
except: print('fine')
|
|
29
|
-
")
|
|
30
|
-
;;
|
|
31
|
-
esac
|
|
32
|
-
|
|
33
|
-
SPEC_NAME="$(echo "$ARGS" | sed 's/--[a-z]*//g' | xargs)"
|
|
34
|
-
[ -z "$SPEC_NAME" ] && SPEC_NAME=$(cat .flow/.active-spec 2>/dev/null)
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Step 2: Preflight Check
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
DIR=".flow/specs/$SPEC_NAME"
|
|
41
|
-
for f in research.md requirements.md design.md; do
|
|
42
|
-
[ ! -f "$DIR/$f" ] && { echo "❌ Missing $f"; exit 1; }
|
|
43
|
-
done
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Step 3: Detect Project Commands (for planner reference)
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
# Collect actual project commands
|
|
50
|
-
PKG_MGR="npm"; TEST_CMD=""; LINT_CMD=""; BUILD_CMD=""
|
|
51
|
-
if [ -f "package.json" ]; then
|
|
52
|
-
command -v pnpm >/dev/null && [ -f "pnpm-lock.yaml" ] && PKG_MGR="pnpm"
|
|
53
|
-
command -v bun >/dev/null && [ -f "bun.lockb" ] && PKG_MGR="bun"
|
|
54
|
-
command -v yarn >/dev/null && [ -f "yarn.lock" ] && PKG_MGR="yarn"
|
|
55
|
-
|
|
56
|
-
# Parse scripts
|
|
57
|
-
TEST_CMD=$(python3 -c "import json; print(json.load(open('package.json')).get('scripts',{}).get('test',''))" 2>/dev/null)
|
|
58
|
-
LINT_CMD=$(python3 -c "import json; print(json.load(open('package.json')).get('scripts',{}).get('lint',''))" 2>/dev/null)
|
|
59
|
-
BUILD_CMD=$(python3 -c "import json; print(json.load(open('package.json')).get('scripts',{}).get('build',''))" 2>/dev/null)
|
|
60
|
-
fi
|
|
61
|
-
|
|
62
|
-
cat > "/tmp/flow-cmds.txt" <<EOF
|
|
63
|
-
Package Manager: $PKG_MGR
|
|
64
|
-
Test: ${TEST_CMD:-<no test script>}
|
|
65
|
-
Lint: ${LINT_CMD:-<no lint script>}
|
|
66
|
-
Build: ${BUILD_CMD:-<no build script>}
|
|
67
|
-
EOF
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## Step 4: Update State + Dispatch
|
|
71
|
-
|
|
72
|
-
```python
|
|
73
|
-
import json
|
|
74
|
-
p = f'.flow/specs/{SPEC_NAME}/.state.json'
|
|
75
|
-
s = json.load(open(p))
|
|
76
|
-
s.setdefault('phase_status',{})['tasks']='in_progress'
|
|
77
|
-
s['phase']='tasks'
|
|
78
|
-
s['task_size'] = TASK_SIZE # 'fine' or 'coarse'
|
|
79
|
-
json.dump(s, open(p,'w'), indent=2, ensure_ascii=False)
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Dispatch Task:
|
|
83
|
-
|
|
84
|
-
```
|
|
85
|
-
Task:
|
|
86
|
-
subagent_type: general-purpose
|
|
87
|
-
description: "task decomposition $SPEC_NAME"
|
|
88
|
-
prompt: |
|
|
89
|
-
You are the flow-planner agent. Full definition at:
|
|
90
|
-
${CLAUDE_PLUGIN_ROOT}/agents/flow-planner.md
|
|
91
|
-
|
|
92
|
-
Prerequisites (must read):
|
|
93
|
-
- .flow/specs/$SPEC_NAME/research.md
|
|
94
|
-
- .flow/specs/$SPEC_NAME/requirements.md
|
|
95
|
-
- .flow/specs/$SPEC_NAME/design.md
|
|
96
|
-
- .flow/STATE.md
|
|
97
|
-
- .flow/CONTEXT.md
|
|
98
|
-
|
|
99
|
-
Template:
|
|
100
|
-
${CLAUDE_PLUGIN_ROOT}/templates/tasks.md.tmpl
|
|
101
|
-
|
|
102
|
-
Knowledge base:
|
|
103
|
-
- ${CLAUDE_PLUGIN_ROOT}/knowledge/poc-first-workflow.md (**must read**)
|
|
104
|
-
|
|
105
|
-
Project-detected commands (use these, do not assume):
|
|
106
|
-
---
|
|
107
|
-
$(cat /tmp/flow-cmds.txt)
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
Task size: $TASK_SIZE (fine=40-60 tasks, coarse=10-20 tasks)
|
|
111
|
-
|
|
112
|
-
Output:
|
|
113
|
-
.flow/specs/$SPEC_NAME/tasks.md
|
|
114
|
-
|
|
115
|
-
Mandatory requirements:
|
|
116
|
-
1. Decompose along POC-First 5 Phases (Phase 1-5)
|
|
117
|
-
2. Each task has 5 fields: Do / Files / Done-when / Verify / Commit
|
|
118
|
-
3. Verify **must be an automated command** (no "manual testing")
|
|
119
|
-
4. At least 1 [VERIFY] checkpoint per Phase
|
|
120
|
-
5. Mark independent tasks with [P]
|
|
121
|
-
6. Must end with a **coverage audit table**:
|
|
122
|
-
- Which tasks correspond to each FR?
|
|
123
|
-
- Which tasks correspond to each AC?
|
|
124
|
-
- Which tasks correspond to each AD?
|
|
125
|
-
- Uncovered items must state the reason
|
|
126
|
-
|
|
127
|
-
Success criteria:
|
|
128
|
-
- Task count matches task_size requirement
|
|
129
|
-
- All Verify values are executable commands
|
|
130
|
-
- Coverage audit table complete
|
|
131
|
-
- Commit messages follow conventional format
|
|
132
|
-
|
|
133
|
-
Forbidden:
|
|
134
|
-
- Writing TODO or "manual" in Verify field
|
|
135
|
-
- Assuming project commands (use the ones detected above)
|
|
136
|
-
- Skipping FRs for "simplicity"
|
|
137
|
-
|
|
138
|
-
When done, return a brief: task count, Phase distribution, coverage audit result.
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
## Step 5: Coverage Audit Verification
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
TASKS=".flow/specs/$SPEC_NAME/tasks.md"
|
|
145
|
-
|
|
146
|
-
# Check that the coverage audit table exists
|
|
147
|
-
grep -q "coverage audit" "$TASKS" || echo "✗ Missing coverage audit table"
|
|
148
|
-
|
|
149
|
-
# Check that every task has Verify
|
|
150
|
-
# Rough: within 10 lines after each "- [ ]" there should be "Verify:"
|
|
151
|
-
TASKS_COUNT=$(grep -c "^- \[ \] \*\*" "$TASKS" || echo 0)
|
|
152
|
-
VERIFY_COUNT=$(grep -c "^\s*\*\*Verify\*\*:" "$TASKS" || echo 0)
|
|
153
|
-
|
|
154
|
-
if [ "$VERIFY_COUNT" -lt "$TASKS_COUNT" ]; then
|
|
155
|
-
echo "⚠ Task count $TASKS_COUNT vs Verify count $VERIFY_COUNT (some tasks may be missing the Verify field)"
|
|
156
|
-
fi
|
|
157
|
-
|
|
158
|
-
# Check for forbidden words
|
|
159
|
-
if grep -iE "(manual|manual test|todo|tbd)" "$TASKS" > /dev/null; then
|
|
160
|
-
echo "✗ tasks.md contains forbidden words (manual/TODO/TBD); check the Verify field"
|
|
161
|
-
fi
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
## Step 6: Output
|
|
165
|
-
|
|
166
|
-
```
|
|
167
|
-
✓ tasks phase complete
|
|
168
|
-
|
|
169
|
-
File: .flow/specs/$SPEC_NAME/tasks.md
|
|
170
|
-
Task size: $TASK_SIZE
|
|
171
|
-
Total tasks: N
|
|
172
|
-
Phase distribution:
|
|
173
|
-
POC: X
|
|
174
|
-
Refactor: Y
|
|
175
|
-
Testing: Z
|
|
176
|
-
Quality: W
|
|
177
|
-
PR: V
|
|
178
|
-
|
|
179
|
-
Coverage audit: FR / AC / AD all ✓
|
|
180
|
-
|
|
181
|
-
⚠ Phase 2 (Execution Engine) not yet released. tasks.md can be executed manually in order.
|
|
182
|
-
The /curdx-flow:implement command will be available in the next version.
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
## Error Recovery
|
|
186
|
-
|
|
187
|
-
- design.md missing or status is not completed → return to /curdx-flow:design
|
|
188
|
-
- Agent missed some FRs → rerun or manually append tasks at the end of tasks.md
|
|
189
|
-
- Verify contains the word "manual" → rerun and explicitly state "all Verify must be automated"
|