@curdx/flow 1.1.10 → 2.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +2 -2
  3. package/CHANGELOG.md +79 -0
  4. package/README.md +74 -102
  5. package/agents/flow-adversary.md +1 -1
  6. package/agents/flow-architect.md +1 -1
  7. package/agents/flow-product-designer.md +1 -1
  8. package/agents/flow-qa-engineer.md +3 -3
  9. package/agents/flow-researcher.md +1 -1
  10. package/agents/flow-security-auditor.md +1 -1
  11. package/agents/flow-triage-analyst.md +3 -3
  12. package/agents/flow-ui-researcher.md +5 -5
  13. package/agents/flow-ux-designer.md +2 -2
  14. package/bin/curdx-flow.js +0 -20
  15. package/commands/debug.md +10 -10
  16. package/commands/help.md +109 -87
  17. package/commands/implement.md +4 -4
  18. package/commands/init.md +5 -5
  19. package/commands/review.md +107 -132
  20. package/commands/spec.md +110 -92
  21. package/commands/start.md +100 -153
  22. package/commands/verify.md +99 -94
  23. package/gates/adversarial-review-gate.md +1 -1
  24. package/gates/coverage-audit-gate.md +1 -1
  25. package/gates/devex-gate.md +1 -1
  26. package/gates/edge-case-gate.md +1 -1
  27. package/gates/security-gate.md +3 -3
  28. package/hooks/scripts/session-start.sh +1 -1
  29. package/knowledge/epic-decomposition.md +2 -2
  30. package/knowledge/execution-strategies.md +4 -4
  31. package/knowledge/planning-reviews.md +6 -6
  32. package/knowledge/spec-driven-development.md +3 -3
  33. package/knowledge/two-stage-review.md +2 -2
  34. package/knowledge/wave-execution.md +5 -5
  35. package/package.json +1 -1
  36. package/agents/persona-amelia.md +0 -128
  37. package/agents/persona-david.md +0 -141
  38. package/agents/persona-emma.md +0 -179
  39. package/agents/persona-john.md +0 -105
  40. package/agents/persona-mary.md +0 -95
  41. package/agents/persona-oliver.md +0 -136
  42. package/agents/persona-rachel.md +0 -126
  43. package/agents/persona-serena.md +0 -175
  44. package/agents/persona-winston.md +0 -117
  45. package/commands/audit.md +0 -170
  46. package/commands/autoplan.md +0 -184
  47. package/commands/design.md +0 -155
  48. package/commands/discuss.md +0 -162
  49. package/commands/doctor.md +0 -124
  50. package/commands/index.md +0 -261
  51. package/commands/install-deps.md +0 -128
  52. package/commands/party.md +0 -241
  53. package/commands/plan-ceo.md +0 -117
  54. package/commands/plan-design.md +0 -107
  55. package/commands/plan-dx.md +0 -104
  56. package/commands/plan-eng.md +0 -108
  57. package/commands/qa.md +0 -118
  58. package/commands/requirements.md +0 -146
  59. package/commands/research.md +0 -141
  60. package/commands/security.md +0 -109
  61. package/commands/sketch.md +0 -118
  62. package/commands/spike.md +0 -181
  63. package/commands/status.md +0 -139
  64. package/commands/switch.md +0 -95
  65. package/commands/tasks.md +0 -189
  66. package/commands/triage.md +0 -160
package/commands/spec.md CHANGED
@@ -1,135 +1,153 @@
1
1
  ---
2
2
  name: spec
3
- description: One-shot sequential run of research → requirements → design → tasks across all four stages
4
- argument-hint: "[spec-name] [--skip-research | --skip-requirements]"
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
- # One-Shot Full Spec Generation
8
+ # Generate or Refresh the Active Spec
9
9
 
10
- Runs the 4 spec stages sequentially, prompting the user between stages to decide whether to continue. Suitable for generating a full spec in one go.
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
- ## Step 1: Preflight + confirmation
12
+ ## Flags
13
13
 
14
- ```bash
15
- [ ! -d ".flow" ] && { echo "❌ Not a CurDX-Flow project"; exit 1; }
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
- SPEC_NAME="$(echo "$ARGUMENTS" | awk '{print $1}')"
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
- echo " No active spec. Run /curdx-flow:start <name> \"<goal>\" first"
22
- exit 1
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
- ## Step 2: Parse skip options
27
-
28
- ```bash
29
- SKIP_RESEARCH=0
30
- SKIP_REQUIREMENTS=0
31
- case "$ARGUMENTS" in
32
- *--skip-research*) SKIP_RESEARCH=1 ;;
33
- esac
34
- case "$ARGUMENTS" in
35
- *--skip-requirements*) SKIP_REQUIREMENTS=1 ;;
36
- esac
37
- ```
38
-
39
- ## Step 3: Execute the 4 stages in sequence
40
-
41
- ### Phase 1: Research
42
+ ## Flag parsing
42
43
 
43
44
  ```bash
44
- if [ "$SKIP_RESEARCH" = "1" ]; then
45
- echo " Skipping research"
46
- elif [ -f ".flow/specs/$SPEC_NAME/research.md" ]; then
47
- echo " research.md already exists; asking the user..."
48
- # AskUserQuestion: re-run research? (skip / rerun / abort)
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)
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;
53
55
  fi
54
56
  ```
55
57
 
56
- **Implementation 1** (recommended): Dispatch the agent directly, skipping SlashCommand:
58
+ ## Phase resolution
57
59
 
58
- Call the Task tool with the same content as the Task call in `/curdx-flow:research` (reading flow-researcher.md).
60
+ The ordered pipeline is `research requirements design tasks`. Resolve which phases to run:
59
61
 
60
- **Implementation 2**: If Claude Code supports the SlashCommand tool chain:
61
- ```
62
- SlashCommand: /curdx-flow:research $SPEC_NAME
63
- ```
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`.
64
68
 
65
- ### Intermediate confirmation after each stage
69
+ Read and update `.state.json.phase` after each phase succeeds.
66
70
 
67
- ```
68
- ✓ research stage complete
71
+ ## Phase execution
69
72
 
70
- Key findings:
71
- - ...
72
- - ...
73
+ For each phase in the resolved list, dispatch a sub-agent via the `Task` tool:
73
74
 
74
- The following open questions were found; recommend answering first:
75
- Q1: ...
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.
76
78
 
77
- Choose:
78
- [continue] Continue to requirements (agent will answer open questions with reasonable assumptions)
79
- [pause] Pause I'll review research.md myself, then manually run /curdx-flow:requirements
80
- [abort] Abort the entire /curdx-flow:spec
81
- ```
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).
82
86
 
83
- Use AskUserQuestion for the choice.
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.
84
90
 
85
- ### Phase 2: Requirements
91
+ After each phase completes successfully, update `.state.json`:
86
92
 
87
- If continue, dispatch flow-product-designer (mirroring the Task call in `/curdx-flow:requirements`).
93
+ ```json
94
+ {
95
+ "phase": "<just-completed-phase>",
96
+ "phase_status": { "<phase>": "completed" },
97
+ "updated_at": "<ISO8601 timestamp>"
98
+ }
99
+ ```
88
100
 
89
- Confirm again after completion.
101
+ ## Optional planning review
90
102
 
91
- ### Phase 3: Design
103
+ If `--review` (or `--review=<dims>`) is present:
92
104
 
93
- If continue, dispatch flow-architect (mirroring the Task call in `/curdx-flow:design`).
105
+ 1. **Precondition**: `design.md` must exist. If missing, error: "Design missing. Run `/curdx-flow:spec --phase=design` first."
106
+ 2. Parse the dims: `all` expands to `ceo,eng,design,dx`.
107
+ 3. Dispatch review agents in parallel via `Task` (one per dim):
94
108
 
95
- Confirm again after completion. **This step is especially important** because design freezes the technology choices — recommend that the user review the AD-NN entries before entering tasks.
109
+ | Dim | Agent | Focus |
110
+ |-----|-------|-------|
111
+ | `ceo` | `flow-architect` (review mode) | Strategic: scope fit, ROI, opportunity cost |
112
+ | `eng` | `flow-architect` (review mode) | Engineering: architecture lock-in, risk, technical debt |
113
+ | `design` | `flow-ux-designer` | UX / UI / accessibility / design system |
114
+ | `dx` | `flow-architect` (review mode) | Developer experience: naming, comments, structure, error handling, setup, types, tests, dev loop |
96
115
 
97
- ### Phase 4: Tasks
116
+ 4. Aggregate findings into `.flow/specs/<active>/spec-review.md` with one section per dim and a consolidated verdict (GO / GO-WITH-CHANGES / HOLD).
98
117
 
99
- If continue, dispatch flow-planner (mirroring the Task call in `/curdx-flow:tasks`).
118
+ ## Reporting
100
119
 
101
- ## Step 4: Final summary
120
+ Final console output:
102
121
 
103
122
  ```
104
- ═══════════════════════════════════════════════
105
- Full spec generated: $SPEC_NAME
106
-
107
- Output files:
108
- .flow/specs/$SPEC_NAME/research.md (N lines)
109
- .flow/specs/$SPEC_NAME/requirements.md (M lines)
110
- .flow/specs/$SPEC_NAME/design.md (K lines)
111
- .flow/specs/$SPEC_NAME/tasks.md (L lines)
112
-
113
- Stats:
114
- Research: 2-3 technical options, context7 queried X libraries
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
123
+ ✓ Spec <name> refreshed
124
+ Phases run: research, requirements, design, tasks
125
+ Review dims: ceo, eng, design, dx (if --review was used)
126
+ Files:
127
+ .flow/specs/<name>/research.md
128
+ .flow/specs/<name>/requirements.md
129
+ .flow/specs/<name>/design.md
130
+ .flow/specs/<name>/tasks.md
131
+ .flow/specs/<name>/spec-review.md (if --review was used)
132
+
133
+ Next: /curdx-flow:implement
123
134
  ```
124
135
 
125
- ## Auto mode (/curdx-flow:spec --yolo)
126
-
127
- If the user passes `--yolo`, all intermediate confirmations default to `continue`, running through in one pass.
136
+ ## Common invocations
128
137
 
129
- **Warning**: yolo mode may run to completion but not necessarily match the user's intent. Recommend using it only on sketch / fast projects.
138
+ ```
139
+ /curdx-flow:spec # full spec from current state
140
+ /curdx-flow:spec --phase=design # re-run only design (e.g., after requirements changed)
141
+ /curdx-flow:spec --phase=design,tasks # re-run design and tasks
142
+ /curdx-flow:spec --until=design # run up through design, stop (human review checkpoint)
143
+ /curdx-flow:spec --review # full spec + all 4 planning dimensions
144
+ /curdx-flow:spec --review=eng,dx # full spec + engineering + DX review only
145
+ /curdx-flow:spec --regenerate # clear all four phases and rebuild
146
+ /curdx-flow:spec --regenerate --phase=tasks # only rebuild tasks (keep research/requirements/design)
147
+ ```
130
148
 
131
- ## Error recovery
149
+ ## References
132
150
 
133
- - A stage fails stop without advancing; after manual fixes the user can re-run /curdx-flow:<phase>
134
- - User chooses abort → preserve generated files, but do not advance phase_status
135
- - sequential-thinking / context7 requirements at every stage match the per-command definitions
151
+ - Agents: `@${CLAUDE_PLUGIN_ROOT}/agents/flow-researcher.md`, `flow-product-designer.md`, `flow-architect.md`, `flow-planner.md`, `flow-ux-designer.md`
152
+ - Knowledge: `@${CLAUDE_PLUGIN_ROOT}/knowledge/spec-driven-development.md`, `poc-first-workflow.md`
153
+ - 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: intelligent entry point — create a new spec or resume an existing one, entering the corresponding phase
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
- CurDX-Flow's main entry point. Based on context, automatically:
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
- ## Step 1: Preflight Check
12
+ ## Invocation patterns
15
13
 
16
- ```bash
17
- # Must be initialized
18
- if [ ! -d ".flow" ]; then
19
- echo "❌ Current directory is not a CurDX-Flow project. Run /curdx-flow:init first"
20
- exit 1
21
- fi
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
- ## Step 2: Parse Arguments
23
+ ## Preflight
25
24
 
26
25
  ```bash
27
- ARGS="$ARGUMENTS"
28
-
29
- # Extract spec-name and goal
30
- # Format: flow-start my-feature "Add JWT auth to API"
31
- # or: flow-start my-feature (resume existing spec)
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
- ## Step 3: Determine New vs Resume
33
+ ## Flag parsing
49
34
 
50
35
  ```bash
51
- SPEC_DIR=".flow/specs/$SPEC_NAME"
52
-
53
- if [ -d "$SPEC_DIR" ]; then
54
- # Resume mode
55
- MODE="resume"
56
- echo "🔄 Resuming spec: $SPEC_NAME"
57
- else
58
- # New mode
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
- ## Step 4a: New Path
46
+ Mode must be `fast`, `standard`, or `enterprise`. Invalid → default to `standard` with a warning.
71
47
 
72
- If `MODE=new`:
48
+ ## Branch logic
73
49
 
74
- ```bash
75
- # Create directory
76
- mkdir -p "$SPEC_DIR"
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
- # Generate .state.json
79
- TODAY=$(date +%Y-%m-%d)
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
- cat > "$SPEC_DIR/.state.json" <<EOF
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
- "version": "1.0",
85
- "spec_name": "$SPEC_NAME",
66
+ "spec": "$SPEC_NAME",
86
67
  "goal": "$GOAL",
87
- "mode": "$CONFIG_MODE",
68
+ "mode": "$FLAG_MODE",
69
+ "phase": "created",
70
+ "phase_status": {},
88
71
  "strategy": "auto",
89
- "phase": "research",
90
- "phase_status": {
91
- "research": "not_started",
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
- EOF
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
- ## Step 4b: Resume Path
80
+ If `GOAL` is empty, `AskUserQuestion` to gather it before writing `.state.json`.
121
81
 
122
- If `MODE=resume`:
82
+ Then seed a minimal `.progress.md`:
123
83
 
124
84
  ```bash
125
- # Read current phase
126
- STATE_FILE="$SPEC_DIR/.state.json"
127
- if [ ! -f "$STATE_FILE" ]; then
128
- echo "✗ Spec directory exists but .state.json is missing. State may be corrupted."
129
- # Ask user
130
- # AskUserQuestion: "Rebuild state file?" (yes/no)
131
- exit 0
132
- fi
133
-
134
- # Set as active
135
- echo "$SPEC_NAME" > ".flow/.active-spec"
136
-
137
- # Show current progress
138
- python3 <<PYEOF
139
- import json
140
- s = json.load(open("$STATE_FILE"))
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
- ## Step 5: Summary Prompt
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
- ✓ Spec ready: $SPEC_NAME
170
-
171
- Workflow:
172
- 1. /curdx-flow:research ← research (deep exploration)
173
- 2. /curdx-flow:requirements ← requirements (user stories + acceptance criteria)
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
- ## Error Recovery
133
+ ## References
186
134
 
187
- - `.flow/` does not exist → prompt `/curdx-flow:init`
188
- - spec-name invalid → provide kebab-case example
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`