@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/spec.md
CHANGED
|
@@ -1,135 +1,177 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: spec
|
|
3
|
-
description:
|
|
4
|
-
argument-hint: "[
|
|
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
|
+
argument-hint: "[--phase=<X[,Y,...]>] [--until=<X>] [--review[=<dim[,dim]>]] [--regenerate] [--resume]"
|
|
5
5
|
allowed-tools: [Read, Write, Bash, Task, AskUserQuestion]
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# Generate or Refresh the Active Spec
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
This command writes the four spec documents (`research.md`, `requirements.md`, `design.md`, `tasks.md`) inside `.flow/specs/<active-spec>/`. It replaces the v1 commands `/research`, `/requirements`, `/design`, `/tasks`, `/plan-ceo`, `/plan-eng`, `/plan-design`, `/plan-dx`, and `/autoplan` — all expressed here as flags.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Flags
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
| Flag | Default | Purpose |
|
|
15
|
+
|------|---------|---------|
|
|
16
|
+
| `--phase=<X[,Y]>` | (inferred from `.state.json`) | Run only the listed phase(s). `X ∈ {research, requirements, design, tasks}`. Accepts comma-separated list. |
|
|
17
|
+
| `--until=<X>` | (none) | Run from the current phase forward, stopping after `X`. Mutually exclusive with `--phase`. |
|
|
18
|
+
| `--review[=<dim[,dim]>]` | (not run) | After phases complete, run a planning review. `dim ∈ {ceo, eng, design, dx, all}`. Bare `--review` = `--review=all`. |
|
|
19
|
+
| `--regenerate` | (resume) | Wipe existing phase output for the targeted phases and rebuild from scratch. |
|
|
20
|
+
| `--resume` | (default) | Continue from `.state.json.phase`. This is the default when no flag is given. |
|
|
16
21
|
|
|
17
|
-
|
|
18
|
-
[ -z "$SPEC_NAME" ] && SPEC_NAME=$(cat .flow/.active-spec 2>/dev/null)
|
|
22
|
+
## Preflight
|
|
19
23
|
|
|
24
|
+
```bash
|
|
25
|
+
# 1. A .flow project must exist
|
|
26
|
+
[ ! -d ".flow" ] && {
|
|
27
|
+
echo "✗ Not a CurDX-Flow project. Run /curdx-flow:init first.";
|
|
28
|
+
exit 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
# 2. An active spec must be set
|
|
32
|
+
SPEC_NAME=$(cat .flow/.active-spec 2>/dev/null)
|
|
20
33
|
if [ -z "$SPEC_NAME" ]; then
|
|
21
|
-
|
|
22
|
-
|
|
34
|
+
echo "✗ No active spec. Run /curdx-flow:start <name> \"<goal>\" first.";
|
|
35
|
+
exit 1;
|
|
23
36
|
fi
|
|
37
|
+
SPEC_DIR=".flow/specs/$SPEC_NAME"
|
|
38
|
+
STATE_FILE="$SPEC_DIR/.state.json"
|
|
39
|
+
[ ! -f "$STATE_FILE" ] && { echo "✗ Missing $STATE_FILE"; exit 1; }
|
|
24
40
|
```
|
|
25
41
|
|
|
26
|
-
##
|
|
42
|
+
## Flag parsing
|
|
27
43
|
|
|
28
44
|
```bash
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
45
|
+
# $ARGUMENTS is the raw argument string
|
|
46
|
+
FLAG_PHASE=$(echo "$ARGUMENTS" | grep -oP -- '--phase=\K[^\s]+' || true)
|
|
47
|
+
FLAG_UNTIL=$(echo "$ARGUMENTS" | grep -oP -- '--until=\K[^\s]+' || true)
|
|
48
|
+
FLAG_REVIEW=$(echo "$ARGUMENTS" | grep -oP -- '--review(?:=[^\s]+)?' || true)
|
|
49
|
+
FLAG_REGENERATE=$(echo "$ARGUMENTS" | grep -q -- '--regenerate' && echo "1" || echo "0")
|
|
50
|
+
|
|
51
|
+
# Rule: --phase and --until are mutually exclusive
|
|
52
|
+
if [ -n "$FLAG_PHASE" ] && [ -n "$FLAG_UNTIL" ]; then
|
|
53
|
+
echo "✗ --phase and --until cannot be combined. Pick one.";
|
|
54
|
+
exit 1;
|
|
55
|
+
fi
|
|
37
56
|
```
|
|
38
57
|
|
|
39
|
-
##
|
|
58
|
+
## Phase resolution
|
|
40
59
|
|
|
41
|
-
|
|
60
|
+
The ordered pipeline is `research → requirements → design → tasks`. Resolve which phases to run:
|
|
42
61
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
else
|
|
50
|
-
echo "▶ Running research stage..."
|
|
51
|
-
# Via SlashCommand or directly dispatch the agent
|
|
52
|
-
# Recommended: directly invoke the /curdx-flow:research logic (inline or via the SlashCommand tool)
|
|
53
|
-
fi
|
|
54
|
-
```
|
|
62
|
+
- No flags → start at `state.json.phase`, run forward to `tasks`.
|
|
63
|
+
- `--phase=design` → run only `design`.
|
|
64
|
+
- `--phase=design,tasks` → run `design` then `tasks`.
|
|
65
|
+
- `--until=design` → start at `state.json.phase`, stop after `design`.
|
|
66
|
+
- `--regenerate` (no other phase flag) → same as default but clear existing output for each phase before running.
|
|
67
|
+
- `--regenerate --phase=X` → clear `X`'s output, re-run only `X`.
|
|
55
68
|
|
|
56
|
-
|
|
69
|
+
Read and update `.state.json.phase` after each phase succeeds.
|
|
57
70
|
|
|
58
|
-
|
|
71
|
+
## Phase execution
|
|
59
72
|
|
|
60
|
-
|
|
61
|
-
```
|
|
62
|
-
SlashCommand: /curdx-flow:research $SPEC_NAME
|
|
63
|
-
```
|
|
73
|
+
For each phase in the resolved list, dispatch a sub-agent via the `Task` tool:
|
|
64
74
|
|
|
65
|
-
###
|
|
75
|
+
### research → `flow-researcher`
|
|
76
|
+
Inputs: spec goal + one-line description from `.state.json`.
|
|
77
|
+
Output: `research.md` covering problem space, prior art (library candidates via `context7`), constraints, technical recommendation.
|
|
66
78
|
|
|
67
|
-
|
|
68
|
-
|
|
79
|
+
### requirements → `flow-product-designer`
|
|
80
|
+
Inputs: `research.md`.
|
|
81
|
+
Output: `requirements.md` with user stories (US-NN), acceptance criteria (AC-N.N), functional requirements (FR-NN), non-functional requirements (NFR-*).
|
|
82
|
+
|
|
83
|
+
### design → `flow-architect`
|
|
84
|
+
Inputs: `research.md` + `requirements.md`.
|
|
85
|
+
Output: `design.md` with architecture decisions (AD-NN), component boundaries, data models, error-path design, mermaid diagrams. Must use `sequential-thinking` MCP (≥8 thoughts).
|
|
69
86
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
87
|
+
### tasks → `flow-planner`
|
|
88
|
+
Inputs: all three prior files + `.flow/PROJECT.md` tech stack.
|
|
89
|
+
Output: `tasks.md` — POC-First 5-phase decomposition with per-task Verify commands, multi-source coverage audit against FR/AC/AD/Research/Decisions.
|
|
73
90
|
|
|
74
|
-
|
|
75
|
-
Q1: ...
|
|
91
|
+
After each phase completes successfully, update `.state.json`:
|
|
76
92
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"phase": "<just-completed-phase>",
|
|
96
|
+
"phase_status": { "<phase>": "completed" },
|
|
97
|
+
"updated_at": "<ISO8601 timestamp>"
|
|
98
|
+
}
|
|
81
99
|
```
|
|
82
100
|
|
|
83
|
-
|
|
101
|
+
### Artifact landing check (mandatory after every phase)
|
|
84
102
|
|
|
85
|
-
|
|
103
|
+
Sub-agent responses can be truncated by the model's output-length limit, which means the `Write` tool call for the phase's Markdown artifact may never fire. Do NOT trust the agent's return value alone — always verify the file actually landed.
|
|
86
104
|
|
|
87
|
-
|
|
105
|
+
For each phase just dispatched, run:
|
|
88
106
|
|
|
89
|
-
|
|
107
|
+
```bash
|
|
108
|
+
ARTIFACT=".flow/specs/$SPEC_NAME/<phase>.md"
|
|
109
|
+
if [ ! -f "$ARTIFACT" ]; then
|
|
110
|
+
echo "⚠ $ARTIFACT did not land. Re-dispatching <phase> agent with an explicit 'write the file' prompt."
|
|
111
|
+
# Re-dispatch the same agent, but in the prompt, front-load:
|
|
112
|
+
# "Your ONLY job is to call the Write tool with the full <phase>.md content now.
|
|
113
|
+
# Do not explain. Do not narrate. Write the file and stop."
|
|
114
|
+
# This pattern produces an artifact even when prior verbosity caused truncation.
|
|
115
|
+
fi
|
|
116
|
+
|
|
117
|
+
# Minimum-size sanity check — if the file is <500 bytes, the write likely truncated
|
|
118
|
+
if [ -f "$ARTIFACT" ] && [ "$(wc -c < "$ARTIFACT" | tr -d ' ')" -lt 500 ]; then
|
|
119
|
+
echo "⚠ $ARTIFACT looks truncated (<500 bytes). Re-dispatching to complete it."
|
|
120
|
+
fi
|
|
121
|
+
```
|
|
90
122
|
|
|
91
|
-
|
|
123
|
+
Only advance `.state.json.phase` after both the file exists AND passes the size sanity check. If a re-dispatch also fails to produce the artifact, stop and surface the issue to the user instead of silently advancing — that prevents later phases from consuming an empty upstream file.
|
|
92
124
|
|
|
93
|
-
|
|
125
|
+
## Optional planning review
|
|
94
126
|
|
|
95
|
-
|
|
127
|
+
If `--review` (or `--review=<dims>`) is present:
|
|
96
128
|
|
|
97
|
-
|
|
129
|
+
1. **Precondition**: `design.md` must exist. If missing, error: "Design missing. Run `/curdx-flow:spec --phase=design` first."
|
|
130
|
+
2. Parse the dims: `all` expands to `ceo,eng,design,dx`.
|
|
131
|
+
3. Dispatch review agents in parallel via `Task` (one per dim):
|
|
98
132
|
|
|
99
|
-
|
|
133
|
+
| Dim | Agent | Focus |
|
|
134
|
+
|-----|-------|-------|
|
|
135
|
+
| `ceo` | `flow-architect` (review mode) | Strategic: scope fit, ROI, opportunity cost |
|
|
136
|
+
| `eng` | `flow-architect` (review mode) | Engineering: architecture lock-in, risk, technical debt |
|
|
137
|
+
| `design` | `flow-ux-designer` | UX / UI / accessibility / design system |
|
|
138
|
+
| `dx` | `flow-architect` (review mode) | Developer experience: naming, comments, structure, error handling, setup, types, tests, dev loop |
|
|
100
139
|
|
|
101
|
-
|
|
140
|
+
4. Aggregate findings into `.flow/specs/<active>/spec-review.md` with one section per dim and a consolidated verdict (GO / GO-WITH-CHANGES / HOLD).
|
|
141
|
+
|
|
142
|
+
## Reporting
|
|
143
|
+
|
|
144
|
+
Final console output:
|
|
102
145
|
|
|
103
146
|
```
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
Requirements: P US, Q FR, R AC
|
|
116
|
-
Design: S AD, T components
|
|
117
|
-
Tasks: U tasks (fine / coarse)
|
|
118
|
-
|
|
119
|
-
Next steps:
|
|
120
|
-
- Review all 4 files
|
|
121
|
-
- To modify, run /curdx-flow:research / /curdx-flow:requirements / ... individually
|
|
122
|
-
- After Phase 2 ships: /curdx-flow:implement
|
|
147
|
+
✓ Spec <name> refreshed
|
|
148
|
+
Phases run: research, requirements, design, tasks
|
|
149
|
+
Review dims: ceo, eng, design, dx (if --review was used)
|
|
150
|
+
Files:
|
|
151
|
+
.flow/specs/<name>/research.md
|
|
152
|
+
.flow/specs/<name>/requirements.md
|
|
153
|
+
.flow/specs/<name>/design.md
|
|
154
|
+
.flow/specs/<name>/tasks.md
|
|
155
|
+
.flow/specs/<name>/spec-review.md (if --review was used)
|
|
156
|
+
|
|
157
|
+
Next: /curdx-flow:implement
|
|
123
158
|
```
|
|
124
159
|
|
|
125
|
-
##
|
|
126
|
-
|
|
127
|
-
If the user passes `--yolo`, all intermediate confirmations default to `continue`, running through in one pass.
|
|
160
|
+
## Common invocations
|
|
128
161
|
|
|
129
|
-
|
|
162
|
+
```
|
|
163
|
+
/curdx-flow:spec # full spec from current state
|
|
164
|
+
/curdx-flow:spec --phase=design # re-run only design (e.g., after requirements changed)
|
|
165
|
+
/curdx-flow:spec --phase=design,tasks # re-run design and tasks
|
|
166
|
+
/curdx-flow:spec --until=design # run up through design, stop (human review checkpoint)
|
|
167
|
+
/curdx-flow:spec --review # full spec + all 4 planning dimensions
|
|
168
|
+
/curdx-flow:spec --review=eng,dx # full spec + engineering + DX review only
|
|
169
|
+
/curdx-flow:spec --regenerate # clear all four phases and rebuild
|
|
170
|
+
/curdx-flow:spec --regenerate --phase=tasks # only rebuild tasks (keep research/requirements/design)
|
|
171
|
+
```
|
|
130
172
|
|
|
131
|
-
##
|
|
173
|
+
## References
|
|
132
174
|
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
175
|
+
- Agents: `@${CLAUDE_PLUGIN_ROOT}/agents/flow-researcher.md`, `flow-product-designer.md`, `flow-architect.md`, `flow-planner.md`, `flow-ux-designer.md`
|
|
176
|
+
- Knowledge: `@${CLAUDE_PLUGIN_ROOT}/knowledge/spec-driven-development.md`, `poc-first-workflow.md`
|
|
177
|
+
- Preamble: `@${CLAUDE_PLUGIN_ROOT}/agent-preamble/preamble.md`
|
package/commands/start.md
CHANGED
|
@@ -1,189 +1,136 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: start
|
|
3
|
-
description:
|
|
4
|
-
argument-hint: "<spec-name> \"<goal>\""
|
|
5
|
-
allowed-tools: [Read, Write, Bash, AskUserQuestion]
|
|
3
|
+
description: Smart entry point — create a new spec, resume an existing one, or switch between specs. Replaces v1's /start + /switch.
|
|
4
|
+
argument-hint: "[<spec-name>] [\"<one-line goal>\"] [--resume] [--list] [--mode=<fast|standard|enterprise>]"
|
|
5
|
+
allowed-tools: [Read, Write, Bash, AskUserQuestion, Task]
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
# Start a Spec
|
|
8
|
+
# Start or Resume a Feature Spec
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
- New spec → create directory + templates + enter research phase
|
|
12
|
-
- Existing spec → resume from the last phase
|
|
10
|
+
Entry point for every feature. Works in four modes depending on flags and existing state.
|
|
13
11
|
|
|
14
|
-
##
|
|
12
|
+
## Invocation patterns
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
| Pattern | Behavior |
|
|
15
|
+
|---------|----------|
|
|
16
|
+
| `/curdx-flow:start my-feature "Add JWT auth to REST API"` | Create a fresh spec named `my-feature`, set it active, seed draft requirements. |
|
|
17
|
+
| `/curdx-flow:start my-feature` (name exists) | Switch active spec to `my-feature` (same as v1 `/switch`). |
|
|
18
|
+
| `/curdx-flow:start --resume` | Resume the last active spec from `.flow/.active-spec`. |
|
|
19
|
+
| `/curdx-flow:start --list` | List all specs with their phase and last-updated time, prompt to pick. |
|
|
20
|
+
| `/curdx-flow:start` (no args) | Interactive: ask the user whether to create new, resume recent, or list all. |
|
|
21
|
+
| Add `--mode=<fast\|standard\|enterprise>` | Set the execution mode for this spec (stored in `.state.json`). |
|
|
23
22
|
|
|
24
|
-
##
|
|
23
|
+
## Preflight
|
|
25
24
|
|
|
26
25
|
```bash
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
SPEC_NAME=$(echo "$ARGS" | awk '{print $1}')
|
|
33
|
-
GOAL=$(echo "$ARGS" | sed -E "s/^[a-z0-9-]+\s*//" | sed 's/^["\x27]//;s/["\x27]$//')
|
|
34
|
-
|
|
35
|
-
if [ -z "$SPEC_NAME" ]; then
|
|
36
|
-
echo "Usage: /curdx-flow:start <spec-name> \"<goal>\""
|
|
37
|
-
echo "Example: /curdx-flow:start auth-system \"Add JWT authentication to REST API\""
|
|
38
|
-
exit 1
|
|
39
|
-
fi
|
|
40
|
-
|
|
41
|
-
# Validate that spec-name is kebab-case
|
|
42
|
-
if ! echo "$SPEC_NAME" | grep -Eq '^[a-z][a-z0-9-]*$'; then
|
|
43
|
-
echo "❌ spec-name must be kebab-case (start with lowercase letter, only letters, digits, hyphens)"
|
|
44
|
-
exit 1
|
|
45
|
-
fi
|
|
26
|
+
# Require a .flow project
|
|
27
|
+
[ ! -d ".flow" ] && {
|
|
28
|
+
echo "✗ Not a CurDX-Flow project. Run /curdx-flow:init first.";
|
|
29
|
+
exit 1;
|
|
30
|
+
}
|
|
46
31
|
```
|
|
47
32
|
|
|
48
|
-
##
|
|
33
|
+
## Flag parsing
|
|
49
34
|
|
|
50
35
|
```bash
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
MODE="new"
|
|
60
|
-
echo "🆕 New spec: $SPEC_NAME"
|
|
61
|
-
|
|
62
|
-
if [ -z "$GOAL" ]; then
|
|
63
|
-
# If no goal given, ask the user
|
|
64
|
-
echo "Please provide a one-sentence goal, then continue."
|
|
65
|
-
exit 0
|
|
66
|
-
fi
|
|
67
|
-
fi
|
|
36
|
+
FLAG_RESUME=$(echo "$ARGUMENTS" | grep -q -- '--resume' && echo 1 || echo 0)
|
|
37
|
+
FLAG_LIST=$(echo "$ARGUMENTS" | grep -q -- '--list' && echo 1 || echo 0)
|
|
38
|
+
FLAG_MODE=$(echo "$ARGUMENTS" | grep -oP -- '--mode=\K[^\s]+' || echo "standard")
|
|
39
|
+
|
|
40
|
+
# Strip flags from ARGUMENTS to leave the positional args
|
|
41
|
+
POS=$(echo "$ARGUMENTS" | sed -E 's/--[a-z-]+(=[^ ]+)?//g' | xargs)
|
|
42
|
+
SPEC_NAME=$(echo "$POS" | awk '{print $1}')
|
|
43
|
+
GOAL=$(echo "$POS" | awk '{$1=""; print $0}' | sed 's/^"//; s/"$//' | xargs)
|
|
68
44
|
```
|
|
69
45
|
|
|
70
|
-
|
|
46
|
+
Mode must be `fast`, `standard`, or `enterprise`. Invalid → default to `standard` with a warning.
|
|
71
47
|
|
|
72
|
-
|
|
48
|
+
## Branch logic
|
|
73
49
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
50
|
+
### Branch A: `--list`
|
|
51
|
+
Enumerate every directory under `.flow/specs/`, read each `.state.json` for `phase` and `updated_at`, print a numbered list, then `AskUserQuestion` to pick one. Picking sets `.flow/.active-spec` and exits.
|
|
52
|
+
|
|
53
|
+
### Branch B: `--resume` (no name)
|
|
54
|
+
Read `.flow/.active-spec`. If it points to a valid spec dir, report its current phase and next suggested command (`/curdx-flow:spec` if incomplete, `/curdx-flow:implement` if tasks ready). If `.active-spec` is empty or stale, fall back to Branch A.
|
|
77
55
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
CONFIG_MODE=$(python3 -c "import json; print(json.load(open('.flow/config.json')).get('mode','standard'))" 2>/dev/null || echo "standard")
|
|
56
|
+
### Branch C: `SPEC_NAME` provided, spec exists
|
|
57
|
+
Switch `.flow/.active-spec` to `SPEC_NAME`. Confirm with the user if they intended to switch (not overwrite). Report current phase.
|
|
81
58
|
|
|
82
|
-
|
|
59
|
+
### Branch D: `SPEC_NAME` provided, spec does NOT exist
|
|
60
|
+
Create a new spec:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
mkdir -p ".flow/specs/$SPEC_NAME"
|
|
64
|
+
cat > ".flow/specs/$SPEC_NAME/.state.json" <<JSON
|
|
83
65
|
{
|
|
84
|
-
"
|
|
85
|
-
"spec_name": "$SPEC_NAME",
|
|
66
|
+
"spec": "$SPEC_NAME",
|
|
86
67
|
"goal": "$GOAL",
|
|
87
|
-
"mode": "$
|
|
68
|
+
"mode": "$FLAG_MODE",
|
|
69
|
+
"phase": "created",
|
|
70
|
+
"phase_status": {},
|
|
88
71
|
"strategy": "auto",
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
"requirements": "not_started",
|
|
93
|
-
"design": "not_started",
|
|
94
|
-
"tasks": "not_started"
|
|
95
|
-
},
|
|
96
|
-
"decisions": [],
|
|
97
|
-
"created": "$TODAY",
|
|
98
|
-
"updated": "$TODAY"
|
|
72
|
+
"execute_state": {},
|
|
73
|
+
"created_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
|
|
74
|
+
"updated_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
|
99
75
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
# Generate progress.md (from template)
|
|
103
|
-
python3 <<PYEOF
|
|
104
|
-
from pathlib import Path
|
|
105
|
-
tmpl = Path("${CLAUDE_PLUGIN_ROOT}/templates/progress.md.tmpl").read_text()
|
|
106
|
-
content = tmpl.replace("{{SPEC_NAME}}", "$SPEC_NAME").replace("{{CREATED_DATE}}", "$TODAY")
|
|
107
|
-
Path("$SPEC_DIR/.progress.md").write_text(content)
|
|
108
|
-
PYEOF
|
|
109
|
-
|
|
110
|
-
# Set as active spec
|
|
111
|
-
echo "$SPEC_NAME" > ".flow/.active-spec"
|
|
112
|
-
|
|
113
|
-
echo "✓ Spec directory created: $SPEC_DIR"
|
|
114
|
-
echo " Goal: $GOAL"
|
|
115
|
-
echo ""
|
|
116
|
-
echo "Next step (automatically entering research):"
|
|
117
|
-
echo " /curdx-flow:research"
|
|
76
|
+
JSON
|
|
77
|
+
echo "$SPEC_NAME" > .flow/.active-spec
|
|
118
78
|
```
|
|
119
79
|
|
|
120
|
-
|
|
80
|
+
If `GOAL` is empty, `AskUserQuestion` to gather it before writing `.state.json`.
|
|
121
81
|
|
|
122
|
-
|
|
82
|
+
Then seed a minimal `.progress.md`:
|
|
123
83
|
|
|
124
84
|
```bash
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
print(f"✓ Spec activated: $SPEC_NAME")
|
|
142
|
-
print(f" Goal: {s.get('goal','(undefined)')}")
|
|
143
|
-
print(f" Current phase: {s['phase']}")
|
|
144
|
-
print(f" Progress:")
|
|
145
|
-
|
|
146
|
-
ph_emoji = {"completed": "✓", "in_progress": "●", "not_started": "○", "failed": "✗", "skipped": "—"}
|
|
147
|
-
for phase, status in s.get('phase_status',{}).items():
|
|
148
|
-
emoji = ph_emoji.get(status, "?")
|
|
149
|
-
print(f" {emoji} {phase:<15} {status}")
|
|
150
|
-
|
|
151
|
-
print()
|
|
152
|
-
|
|
153
|
-
# Recommend next step
|
|
154
|
-
phase_order = ["research", "requirements", "design", "tasks", "execute", "verify", "ship"]
|
|
155
|
-
for p in phase_order:
|
|
156
|
-
st = s.get('phase_status',{}).get(p, 'not_started')
|
|
157
|
-
if st in ("not_started", "in_progress"):
|
|
158
|
-
print(f"Next step: /curdx-flow:{p}")
|
|
159
|
-
break
|
|
160
|
-
else:
|
|
161
|
-
print("All phases complete! Use /curdx-flow:status to see details.")
|
|
162
|
-
PYEOF
|
|
85
|
+
cat > ".flow/specs/$SPEC_NAME/.progress.md" <<MD
|
|
86
|
+
# Progress Log — $SPEC_NAME
|
|
87
|
+
|
|
88
|
+
**Goal**: $GOAL
|
|
89
|
+
**Mode**: $FLAG_MODE
|
|
90
|
+
**Created**: $(date -u +%Y-%m-%d)
|
|
91
|
+
|
|
92
|
+
## Decisions
|
|
93
|
+
(populated during /curdx-flow:spec)
|
|
94
|
+
|
|
95
|
+
## Learnings
|
|
96
|
+
(populated during /curdx-flow:implement)
|
|
97
|
+
MD
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Branch E: no args, no flags
|
|
163
101
|
```
|
|
102
|
+
AskUserQuestion:
|
|
103
|
+
"No spec name given. What would you like to do?"
|
|
104
|
+
Options:
|
|
105
|
+
- Create a new spec (prompts for name + goal)
|
|
106
|
+
- Resume the last active spec
|
|
107
|
+
- List all specs
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Route to the matching branch.
|
|
164
111
|
|
|
165
|
-
##
|
|
112
|
+
## Mode semantics
|
|
113
|
+
|
|
114
|
+
The `mode` field in `.state.json` drives behavior in later commands:
|
|
115
|
+
|
|
116
|
+
| Mode | `/curdx-flow:spec` default | `/curdx-flow:implement` default | Gates applied |
|
|
117
|
+
|------|---------------------------|--------------------------------|---------------|
|
|
118
|
+
| `fast` | skipped (use `/curdx-flow:fast` instead) | linear strategy | karpathy + verification |
|
|
119
|
+
| `standard` | full 4 phases | auto strategy | + tdd + coverage-audit |
|
|
120
|
+
| `enterprise` | full 4 phases + `--review=all` | auto strategy + stricter gates | + adversarial + edge-case + security |
|
|
121
|
+
|
|
122
|
+
## Post-create reporting
|
|
166
123
|
|
|
167
124
|
```
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
3. /curdx-flow:design ← design (architectural decisions, freeze choices)
|
|
175
|
-
4. /curdx-flow:tasks ← task decomposition (auto-verifiable tasks)
|
|
176
|
-
|
|
177
|
-
One-shot version: /curdx-flow:spec ← run research/req/design/tasks in sequence
|
|
178
|
-
|
|
179
|
-
Fast modes:
|
|
180
|
-
/curdx-flow:fast ← skip spec and implement directly
|
|
181
|
-
/curdx-flow:sketch ← UI prototype exploration
|
|
182
|
-
═══════════════════════════════════════════════
|
|
125
|
+
✓ Spec ready: <name>
|
|
126
|
+
Goal: <goal>
|
|
127
|
+
Mode: <mode>
|
|
128
|
+
Path: .flow/specs/<name>/
|
|
129
|
+
|
|
130
|
+
Next: /curdx-flow:spec
|
|
183
131
|
```
|
|
184
132
|
|
|
185
|
-
##
|
|
133
|
+
## References
|
|
186
134
|
|
|
187
|
-
-
|
|
188
|
-
-
|
|
189
|
-
- Spec directory corrupted → ask user whether to delete-and-rebuild or repair
|
|
135
|
+
- State schema: `@${CLAUDE_PLUGIN_ROOT}/schemas/spec-state.schema.json`
|
|
136
|
+
- Mode semantics: `@${CLAUDE_PLUGIN_ROOT}/knowledge/execution-strategies.md`
|