@curdx/flow 1.1.11 → 2.0.0-beta.2
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 +2 -2
- package/CHANGELOG.md +79 -0
- package/README.md +74 -102
- package/agents/flow-adversary.md +1 -1
- package/agents/flow-architect.md +1 -1
- package/agents/flow-product-designer.md +1 -1
- package/agents/flow-qa-engineer.md +3 -3
- package/agents/flow-researcher.md +1 -1
- package/agents/flow-security-auditor.md +1 -1
- package/agents/flow-triage-analyst.md +3 -3
- package/agents/flow-ui-researcher.md +5 -5
- package/agents/flow-ux-designer.md +2 -2
- package/cli/install.js +16 -5
- package/commands/debug.md +10 -10
- package/commands/help.md +109 -87
- package/commands/implement.md +4 -4
- package/commands/init.md +5 -5
- package/commands/review.md +114 -130
- package/commands/spec.md +131 -89
- package/commands/start.md +100 -153
- package/commands/verify.md +110 -92
- package/gates/adversarial-review-gate.md +1 -1
- package/gates/coverage-audit-gate.md +1 -1
- package/gates/devex-gate.md +1 -1
- package/gates/edge-case-gate.md +1 -1
- package/gates/security-gate.md +3 -3
- package/hooks/scripts/session-start.sh +1 -1
- package/knowledge/epic-decomposition.md +2 -2
- package/knowledge/execution-strategies.md +4 -4
- package/knowledge/planning-reviews.md +6 -6
- package/knowledge/spec-driven-development.md +3 -3
- package/knowledge/two-stage-review.md +2 -2
- package/knowledge/wave-execution.md +5 -5
- package/package.json +1 -1
- 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/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"
|
package/commands/triage.md
DELETED
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: triage
|
|
3
|
-
description: Epic decomposition — slice a big goal vertically by user value, generate dependency graph + multiple sub-specs. Dispatches flow-triage-analyst.
|
|
4
|
-
argument-hint: "\"<epic goal>\" [--specs=<N>]"
|
|
5
|
-
allowed-tools: [Read, Write, Bash, Task, WebSearch]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Flow Triage — Epic Decomposition
|
|
9
|
-
|
|
10
|
-
@${CLAUDE_PLUGIN_ROOT}/knowledge/epic-decomposition.md
|
|
11
|
-
|
|
12
|
-
Break down a big goal (needs 4+ sub-specs to complete) into an Epic of vertical slices.
|
|
13
|
-
|
|
14
|
-
## When to Use
|
|
15
|
-
|
|
16
|
-
- Goal is clearly more than 2 weeks of work
|
|
17
|
-
- Involves multiple "independently usable" features
|
|
18
|
-
- At `/curdx-flow:start`, you realize the goal is too big — switch to `/curdx-flow:triage`
|
|
19
|
-
|
|
20
|
-
## When Not to Use
|
|
21
|
-
|
|
22
|
-
- Goal fits in 1-2 weeks → use `/curdx-flow:start`
|
|
23
|
-
- Emergency fix → use `/curdx-flow:fast`
|
|
24
|
-
- Exploratory validation → use `/curdx-flow:spike`
|
|
25
|
-
|
|
26
|
-
## Step 1: Preflight Check
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
[ ! -d ".flow" ] && { echo "❌ Not a CurDX-Flow project"; exit 1; }
|
|
30
|
-
|
|
31
|
-
GOAL="$ARGUMENTS"
|
|
32
|
-
# Extract --specs argument
|
|
33
|
-
TARGET_SPECS=""
|
|
34
|
-
case "$GOAL" in
|
|
35
|
-
*--specs=*)
|
|
36
|
-
TARGET_SPECS=$(echo "$GOAL" | grep -oE -- '--specs=[0-9]+' | cut -d= -f2)
|
|
37
|
-
GOAL=$(echo "$GOAL" | sed 's/--specs=[0-9]*//g' | xargs)
|
|
38
|
-
;;
|
|
39
|
-
esac
|
|
40
|
-
|
|
41
|
-
[ -z "$GOAL" ] && { echo "Usage: /curdx-flow:triage \"<epic goal>\""; exit 1; }
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Step 2: Generate Epic Name
|
|
45
|
-
|
|
46
|
-
Derive a kebab-case name from the goal, or ask the user:
|
|
47
|
-
|
|
48
|
-
```python
|
|
49
|
-
# Rough inference
|
|
50
|
-
slug = re.sub(r'\s+', '-', goal.lower())
|
|
51
|
-
slug = re.sub(r'[^a-z0-9-]', '', slug)[:40]
|
|
52
|
-
# e.g.: "add payment system" → "payment-system"
|
|
53
|
-
# May need AskUserQuestion to confirm
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Step 3: Create Epic Directory
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
EPIC_DIR=".flow/_epics/$EPIC_NAME"
|
|
60
|
-
mkdir -p "$EPIC_DIR"
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## Step 4: Dispatch flow-triage-analyst
|
|
64
|
-
|
|
65
|
-
```
|
|
66
|
-
Task:
|
|
67
|
-
subagent_type: general-purpose
|
|
68
|
-
description: "Epic decomposition: $EPIC_NAME"
|
|
69
|
-
prompt: |
|
|
70
|
-
You are the flow-triage-analyst agent. Full definition:
|
|
71
|
-
${CLAUDE_PLUGIN_ROOT}/agents/flow-triage-analyst.md
|
|
72
|
-
|
|
73
|
-
Knowledge base (must read):
|
|
74
|
-
${CLAUDE_PLUGIN_ROOT}/knowledge/epic-decomposition.md
|
|
75
|
-
|
|
76
|
-
Input:
|
|
77
|
-
- Epic goal: "$GOAL"
|
|
78
|
-
- Epic name: $EPIC_NAME
|
|
79
|
-
- Suggested sub-spec count: ${TARGET_SPECS:-auto (4-8)}
|
|
80
|
-
- Project context: .flow/PROJECT.md + .flow/CONTEXT.md + .flow/STATE.md
|
|
81
|
-
|
|
82
|
-
Mandatory workflow:
|
|
83
|
-
1. sequential-thinking >= 5 rounds to understand the goal
|
|
84
|
-
2. context7 to validate the key technologies involved
|
|
85
|
-
3. claude-mem to retrieve history
|
|
86
|
-
4. sequential-thinking 5+ rounds to brainstorm decomposition
|
|
87
|
-
5. Vertical slice by user value (not by technical layer)
|
|
88
|
-
6. Define shared interfaces (freeze)
|
|
89
|
-
7. Identify dependencies (hard/soft/parallel)
|
|
90
|
-
8. Generate epic.md + sub-spec skeletons
|
|
91
|
-
|
|
92
|
-
Output files:
|
|
93
|
-
- .flow/_epics/$EPIC_NAME/epic.md (Epic master document)
|
|
94
|
-
- .flow/_epics/$EPIC_NAME/.epic-state.json
|
|
95
|
-
- .flow/specs/<sub-1>/.state.json
|
|
96
|
-
- .flow/specs/<sub-2>/.state.json
|
|
97
|
-
- ...(skeleton for each sub-spec)
|
|
98
|
-
|
|
99
|
-
Success criteria:
|
|
100
|
-
- Sub-spec count: 4-8
|
|
101
|
-
- Each sub-spec has independent user value
|
|
102
|
-
- Dependency graph is clear (mermaid)
|
|
103
|
-
- Shared interfaces frozen (TypeScript types)
|
|
104
|
-
- Out of Scope is explicit
|
|
105
|
-
|
|
106
|
-
When done, return a brief:
|
|
107
|
-
- Sub-spec list (name + one-sentence description)
|
|
108
|
-
- Dependency graph
|
|
109
|
-
- Recommended execution order
|
|
110
|
-
- Estimated total duration
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
## Step 5: Validate Output
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
EPIC_FILE="$EPIC_DIR/epic.md"
|
|
117
|
-
[ ! -f "$EPIC_FILE" ] && { echo "❌ Epic document not generated"; exit 1; }
|
|
118
|
-
|
|
119
|
-
# Count sub-specs
|
|
120
|
-
SUB_COUNT=$(grep -c "^### Spec [0-9]" "$EPIC_FILE" || echo 0)
|
|
121
|
-
[ $SUB_COUNT -lt 3 ] && echo "⚠ Fewer than 3 sub-specs; may not be decomposed enough"
|
|
122
|
-
[ $SUB_COUNT -gt 10 ] && echo "⚠ More than 10 sub-specs; granularity may be too fine"
|
|
123
|
-
|
|
124
|
-
# Check mermaid graph
|
|
125
|
-
grep -q "mermaid" "$EPIC_FILE" || echo "✗ No mermaid dependency graph found"
|
|
126
|
-
|
|
127
|
-
# Check shared interfaces
|
|
128
|
-
grep -q "shared interface" "$EPIC_FILE" || echo "✗ Shared interfaces not defined"
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
## Step 6: Show Results to User
|
|
132
|
-
|
|
133
|
-
```
|
|
134
|
-
✓ Epic decomposition complete: $EPIC_NAME
|
|
135
|
-
|
|
136
|
-
Files:
|
|
137
|
-
.flow/_epics/$EPIC_NAME/epic.md
|
|
138
|
-
.flow/_epics/$EPIC_NAME/.epic-state.json
|
|
139
|
-
|
|
140
|
-
Sub-specs: $SUB_COUNT (skeletons created)
|
|
141
|
-
|
|
142
|
-
Dependency graph: see epic.md
|
|
143
|
-
|
|
144
|
-
Recommended execution order:
|
|
145
|
-
Week 1: /curdx-flow:switch <sub-1> → /curdx-flow:spec → /curdx-flow:implement
|
|
146
|
-
Week 2: /curdx-flow:switch <sub-2> (parallel with sub-3 if independent)
|
|
147
|
-
Week 3: /curdx-flow:switch <sub-4> (depends on sub-1 being done)
|
|
148
|
-
...
|
|
149
|
-
|
|
150
|
-
Next steps:
|
|
151
|
-
1. Review .flow/_epics/$EPIC_NAME/epic.md to confirm the decomposition is reasonable
|
|
152
|
-
2. First sub-spec: /curdx-flow:switch <sub-1-name>
|
|
153
|
-
3. Then proceed with the normal /curdx-flow:spec → /curdx-flow:implement flow
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
## Error Recovery
|
|
157
|
-
|
|
158
|
-
- triage-analyst fails → the goal may be too abstract; refine the description manually and rerun
|
|
159
|
-
- Too many/too few sub-specs → use `--specs=N` to force a count
|
|
160
|
-
- Incomplete interface definitions → go back to epic.md and add interfaces manually, or rerun the agent to fill them in
|