flow-cc 0.4.3 → 0.5.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.5.0] - 2026-02-13
9
+
10
+ ### Added
11
+ - Multi-PRD support — PRDs now live at `.planning/prds/{version-slug}.md` instead of a single root `PRD.md`
12
+ - 5-step PRD resolution logic across all skills: user argument → STATE.md Active PRD → slug derivation → legacy fallback → not found
13
+ - `**Milestone:**` header field in PRDs for ROADMAP correlation
14
+ - `Active PRD` field in STATE.md tracking the current milestone's PRD path
15
+ - Milestone Targeting in `/flow:spec` — pass a milestone name to pre-spec future milestones in parallel
16
+ - PRD inventory display in `/flow:status` showing active/ready tags per PRD file
17
+ - `/flow:setup` now creates `.planning/prds/` directory during project scaffolding
18
+
19
+ ### Changed
20
+ - `/flow:spec` writes PRDs to `.planning/prds/{version-slug}.md` (was root `PRD.md`)
21
+ - `/flow:go` resolves PRDs via 5-step resolution instead of hardcoded `PRD.md`
22
+ - `/flow:done` archives PRDs from `.planning/prds/` to `.planning/archive/PRD-{slug}.md`
23
+ - `/flow:status` lists all PRDs in `.planning/prds/` with active/ready status
24
+ - `/flow:task` reads active PRD from `.planning/prds/` via STATE.md
25
+ - All templates and docs updated to reflect new PRD paths
26
+ - Legacy root `PRD.md` still consumed transparently — migration happens organically
27
+
8
28
  ## [0.4.3] - 2026-02-12
9
29
 
10
30
  ### Changed
package/README.md CHANGED
@@ -19,17 +19,22 @@ npx flow-cc
19
19
 
20
20
  One command. Installs skills, hooks, templates, and configures your statusLine. Works on Mac, Linux, and Windows.
21
21
 
22
+ ---
23
+
22
24
  ## Why Flow?
23
25
 
24
26
  Claude Code is powerful but unstructured. Without a system, you lose context between sessions, repeat mistakes, and waste tokens re-explaining what you've already decided.
25
27
 
26
- Flow fixes this by giving Claude Code a **memory system and execution framework**:
28
+ Flow gives Claude Code a **memory system and execution framework**:
27
29
 
28
30
  - **Spec interviews** extract decisions upfront so agents execute instead of guessing
29
- - **PRDs become execution contracts** that agent teams follow phase-by-phase
30
- - **Session handoffs** preserve context across fresh sessions — no more "where was I?"
31
+ - **Per-milestone PRDs** in `.planning/prds/` become execution contracts spec future milestones in parallel
32
+ - **Wave-based agent teams** execute phases autonomously with built-in verification
33
+ - **Session handoffs** preserve full context across fresh sessions — no more "where was I?"
31
34
  - **Lessons compound** — mistakes get captured, refined, and promoted into permanent rules
32
35
 
36
+ ---
37
+
33
38
  ## How It Works
34
39
 
35
40
  **One-time setup**, then a repeating build cycle:
@@ -48,38 +53,101 @@ Flow fixes this by giving Claude Code a **memory system and execution framework*
48
53
 
49
54
  Run `/flow:go` repeatedly until all phases are done, then `/flow:done` to wrap up. Next session, paste the handoff prompt and keep going.
50
55
 
56
+ ---
57
+
58
+ ## Multi-PRD: Parallel Milestone Planning
59
+
60
+ <table>
61
+ <tr>
62
+ <td width="50%">
63
+
64
+ **Before (single PRD)**
65
+ ```
66
+ project/
67
+ └── PRD.md ← one at a time
68
+ ```
69
+ Finish or archive the current milestone before speccing the next. Serial bottleneck on large roadmaps.
70
+
71
+ </td>
72
+ <td width="50%">
73
+
74
+ **Now (per-milestone PRDs)**
75
+ ```
76
+ .planning/prds/
77
+ ├── v1-user-auth.md ← active
78
+ ├── v2-dashboard.md ← pre-specced
79
+ └── v3-payments.md ← pre-specced
80
+ ```
81
+ Spec any milestone at any time. Execute the current one while planning ahead.
82
+
83
+ </td>
84
+ </tr>
85
+ </table>
86
+
87
+ **How it works:**
88
+
89
+ - `/flow:spec` writes PRDs to `.planning/prds/{version-slug}.md` — one file per milestone
90
+ - `/flow:spec v3: Payments` targets a specific future milestone without changing your current position
91
+ - STATE.md tracks the **Active PRD** field so `/flow:go` always knows which spec to execute
92
+ - Smart resolution: user argument > STATE.md > slug derivation > legacy fallback
93
+ - Existing `PRD.md` at root? Still works — legacy files are consumed transparently and migrated on archive
94
+
95
+ ---
96
+
51
97
  ## Commands
52
98
 
53
- **The build cycle:**
99
+ ### The Build Cycle
100
+
101
+ | Command | When | What it does |
102
+ |---|---|---|
103
+ | `/flow:setup` | Once per project | Creates `.planning/`, CLAUDE.md, templates, full roadmap |
104
+ | `/flow:spec` | Once per milestone | Interview that produces an executable PRD in `.planning/prds/` |
105
+ | `/flow:go` | Once per phase | Executes the next phase with wave-based agent teams |
106
+ | `/flow:done` | End of session | Updates docs, captures lessons, generates handoff prompt |
107
+
108
+ ### Standalone
109
+
110
+ | Command | When | What it does |
111
+ |---|---|---|
112
+ | `/flow:task` | Anytime | Bug fixes, cleanup, small features — no PRD needed |
113
+ | `/flow:milestone` | Anytime | Add new milestones to the roadmap |
114
+
115
+ ### Utility
54
116
 
55
- | Command | When to use |
56
- |---|---|
57
- | `/flow:setup` | Once per project creates `.planning/`, CLAUDE.md, templates |
58
- | `/flow:spec` | Once per milestone interview that produces the PRD |
59
- | `/flow:go` | Once per phase executes the next phase with agent teams |
60
- | `/flow:done` | End of session — updates docs, generates handoff prompt |
117
+ | Command | When | What it does |
118
+ |---|---|---|
119
+ | `/flow:intro` | First time | Walkthrough of the entire system |
120
+ | `/flow:status` | Anytime | Where am I? What's next? Shows PRD inventory |
121
+ | `/flow:update` | Anytime | Update Flow to the latest version |
61
122
 
62
- **Standalone:**
123
+ ---
124
+
125
+ ## Project Structure
63
126
 
64
- | Command | When to use |
65
- |---|---|
66
- | `/flow:task` | Anytime — bug fixes, cleanup, small features (no PRD needed) |
67
- | `/flow:milestone` | Anytime — add new milestones to the roadmap |
127
+ Every Flow project gets this structure via `/flow:setup`:
68
128
 
69
- **Utility:**
129
+ ```
130
+ your-project/
131
+ ├── CLAUDE.md # Execution rules + learned rules
132
+ ├── .planning/
133
+ │ ├── STATE.md # Session GPS — current status, active PRD, next actions
134
+ │ ├── ROADMAP.md # Milestone phases and progress tracking
135
+ │ ├── prds/ # Per-milestone PRD specs
136
+ │ │ ├── v1-user-auth.md # One file per milestone
137
+ │ │ └── v2-dashboard.md # Pre-spec future milestones anytime
138
+ │ └── archive/ # Completed milestones and archived PRDs
139
+ └── tasks/
140
+ └── lessons.md # Active lessons (max 10) → promoted to CLAUDE.md
141
+ ```
70
142
 
71
- | Command | When to use |
72
- |---|---|
73
- | `/flow:intro` | First time — walkthrough of the system |
74
- | `/flow:status` | Anytime — where am I? What's next? |
75
- | `/flow:update` | Anytime — update Flow to the latest version |
143
+ ---
76
144
 
77
145
  ## What Gets Installed
78
146
 
79
147
  ```
80
148
  ~/.claude/
81
149
  ├── commands/flow/
82
- │ ├── flow-setup.md # 9 skill files
150
+ │ ├── flow-setup.md # 9 skill files
83
151
  │ ├── flow-milestone.md
84
152
  │ ├── flow-spec.md
85
153
  │ ├── flow-go.md
@@ -89,32 +157,18 @@ Run `/flow:go` repeatedly until all phases are done, then `/flow:done` to wrap u
89
157
  │ ├── flow-intro.md
90
158
  │ ├── flow-update.md
91
159
  │ ├── VERSION
92
- │ └── templates/ # Project scaffolding templates
160
+ │ └── templates/ # Project scaffolding templates
93
161
  │ ├── CLAUDE.md.template
94
162
  │ ├── STATE.md.template
95
163
  │ ├── ROADMAP.md.template
96
164
  │ └── lessons.md.template
97
165
  ├── hooks/
98
- │ ├── flow-check-update.js # Notifies when updates are available
99
- │ └── flow-statusline.js # Shows project context in statusLine
100
- └── settings.json # statusLine configured automatically
166
+ │ ├── flow-check-update.js # Notifies when updates are available
167
+ │ └── flow-statusline.js # Shows project context in statusLine
168
+ └── settings.json # statusLine configured automatically
101
169
  ```
102
170
 
103
- ## Project Structure
104
-
105
- Every Flow project gets this structure via `/flow:setup`:
106
-
107
- ```
108
- your-project/
109
- ├── CLAUDE.md # Project-specific execution rules
110
- ├── PRD.md # Current milestone spec (created by /flow:spec)
111
- ├── .planning/
112
- │ ├── STATE.md # Session GPS — current status, next actions
113
- │ ├── ROADMAP.md # Milestone phases and progress
114
- │ └── archive/ # Completed milestones and old PRDs
115
- └── tasks/
116
- └── lessons.md # Active lessons (max 10 one-liners) → promoted to CLAUDE.md
117
- ```
171
+ ---
118
172
 
119
173
  ## The Lessons System
120
174
 
@@ -125,9 +179,13 @@ Flow's knowledge compounding is what makes it get better over time:
125
179
 
126
180
  Hard caps prevent context bloat. Total worst-case: ~30 lines of lessons context per session.
127
181
 
182
+ ---
183
+
128
184
  ## Compatible With GSD
129
185
 
130
- Flow uses the same `.planning/` directory structure as [GSD](https://github.com/gsd-framework/gsd). You can use `/gsd:debug`, `/gsd:map-codebase`, and other GSD commands alongside Flow.
186
+ Flow uses the same `.planning/` directory structure as [GSD](https://github.com/gsd-framework/gsd). You can use `/gsd:debug`, `/gsd:map-codebase`, and other GSD commands alongside Flow without conflict.
187
+
188
+ ---
131
189
 
132
190
  ## Requirements
133
191
 
package/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.3
1
+ 0.5.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flow-cc",
3
- "version": "0.4.3",
3
+ "version": "0.5.1",
4
4
  "description": "Structured workflow system for Claude Code — spec interviews, agent-team execution, session handoffs, compounding knowledge",
5
5
  "author": "Troy Hoffman",
6
6
  "license": "MIT",
@@ -19,7 +19,7 @@ Read these files (in parallel where possible):
19
19
  - `.planning/ROADMAP.md` — milestone/phase progress
20
20
  - `tasks/lessons.md` — active lessons (max 10)
21
21
  - `CLAUDE.md` — project rules
22
- - `PRD.md` current spec (if exists)
22
+ - Active PRD from `.planning/prds/` (resolve via STATE.md "Active PRD" field, or fall back to legacy `PRD.md` at root)
23
23
 
24
24
  Also gather:
25
25
  - Run `git log --oneline -20` to see commits this session
@@ -38,6 +38,7 @@ Structure:
38
38
  - **Milestone:** [name] (vX)
39
39
  - **Phase:** [current phase status]
40
40
  - **Branch:** [current branch]
41
+ - **Active PRD:** [path to active PRD, or "None" if milestone complete]
41
42
  - **Last Session:** [today's date]
42
43
 
43
44
  ## Milestone Progress
@@ -69,7 +70,8 @@ Structure:
69
70
  - Create `.planning/archive/` if it doesn't already exist (use `mkdir -p` or equivalent)
70
71
  - Move milestone phase details to `.planning/archive/milestones-vX.md`
71
72
  - Keep only the summary row in the ROADMAP milestone table
72
- - Move `PRD.md` to `.planning/archive/PRD-vX.md`
73
+ - Archive the milestone's PRD: move `.planning/prds/{slug}.md` to `.planning/archive/PRD-{slug}.md`. If using legacy root `PRD.md`, move it to `.planning/archive/PRD-vX.md` instead.
74
+ - Clear STATE.md "Active PRD" field (set to "None")
73
75
  - Mark the milestone as "Complete" in the ROADMAP table
74
76
  - **Milestone transition:** Check ROADMAP.md for the NEXT milestone with status "Planned":
75
77
  - **If a next milestone exists:** Update its status from "Planned" to "Pending — needs `/flow:spec`". Update STATE.md current milestone to point to the new milestone.
@@ -104,7 +106,7 @@ Determine the next action and generate a copyable handoff prompt:
104
106
 
105
107
  - If next phase exists in PRD:
106
108
  ```
107
- Phase [N]: [Name] — [short description]. Read STATE.md, ROADMAP.md, and PRD.md (US-X).
109
+ Phase [N]: [Name] — [short description]. Read STATE.md, ROADMAP.md, and .planning/prds/{slug}.md (US-X).
108
110
  [One sentence of context]. [One sentence of what NOT to do if relevant].
109
111
  ```
110
112
  - If milestone is complete AND a next milestone was transitioned to (from Step 3):
package/skills/flow-go.md CHANGED
@@ -10,24 +10,36 @@ You are executing the `/flow:go` skill. This reads the PRD, identifies the next
10
10
 
11
11
  **Core principle:** The PRD is the execution contract. You execute what it specifies. Do not freelance.
12
12
 
13
- **Plan mode warning:** Do NOT use this skill with plan mode enabled. `/flow:go` is execution — plan mode's read-only constraint prevents it from creating files, running agents, and committing work. The PRD IS your plan; run `/flow:go` in normal mode.
13
+ **Plan mode warning:** Do NOT use this skill with plan mode enabled. `/flow:go` is execution — plan mode's read-only constraint prevents it from creating files, running agents, and committing work. The PRD is your plan; run `/flow:go` in normal mode.
14
14
 
15
15
  ## Step 1 — Orient
16
16
 
17
17
  Read these files (in parallel):
18
18
  - `.planning/STATE.md` — current position
19
19
  - `.planning/ROADMAP.md` — phase progress
20
- - `PRD.md` the execution spec
20
+ - The active PRD (see PRD Resolution below)
21
21
  - `tasks/lessons.md` — active lessons (max 10 one-liners)
22
22
  - `CLAUDE.md` — execution rules and verification commands
23
23
 
24
+ ### PRD Resolution
25
+
26
+ Resolve the PRD file to use, in this order:
27
+
28
+ 1. **User argument:** If the user passed an argument to `/flow:go` (e.g., `/flow:go v3-payments`), match it against files in `.planning/prds/` (by slug or milestone name from the `**Milestone:**` header field).
29
+ 2. **STATE.md Active PRD:** Read the "Active PRD" field from STATE.md's Current Position section. If it points to a valid file, use it.
30
+ 3. **Slug derivation:** Derive a slug from STATE.md's current milestone name — version-prefix + lowercase name, spaces/special chars → hyphens, collapse consecutive hyphens (e.g., "v2: Dashboard Analytics" → `v2-dashboard-analytics`). Check `.planning/prds/{slug}.md`.
31
+ 4. **Legacy fallback:** If `.planning/prds/` is empty or missing but `PRD.md` exists at the project root, use it. Print: "Using legacy PRD.md at project root. Future specs will use `.planning/prds/`."
32
+ 5. **Not found:** "No PRD found for [current milestone name]. Available PRDs: [list files in `.planning/prds/`]. Run `/flow:spec` first."
33
+
34
+ **Milestone match check:** After resolving the PRD, read its `**Milestone:**` header field. If it doesn't match STATE.md's current milestone, warn: "PRD milestone ([PRD milestone]) doesn't match current milestone ([STATE milestone]). Continuing, but verify you're executing the right spec."
35
+
24
36
  **Identify the next phase:** Find the first phase in ROADMAP.md with status "Pending" or the first unstarted phase in the PRD.
25
37
 
26
38
  ## Step 2 — Pre-flight Checks
27
39
 
28
40
  Run these checks before executing. If any fail, stop and tell the user what to do:
29
41
 
30
- 1. **PRD exists?** If `PRD.md` is missing: "No PRD found. Run `/flow:spec` first."
42
+ 1. **PRD resolved?** If PRD Resolution (above) reached step 5 (not found): stop with the "No PRD found" message and available PRD list.
31
43
  2. **Phase detailed enough?** The phase section in the PRD must have:
32
44
  - Wave structure with agent assignments
33
45
  - Explicit file lists per agent
@@ -146,6 +158,7 @@ Create an atomic commit for this phase:
146
158
  - Files created/modified (count + key names)
147
159
  - Commit SHA
148
160
  - Phase completion note
161
+ - Keep "Active PRD" field pointing to the resolved PRD path
149
162
 
150
163
  **ROADMAP.md:** Mark this phase as "Complete ([today's date])"
151
164
 
@@ -24,6 +24,8 @@ Flow is 6 commands that turn your specs into shipped code through agent teams. E
24
24
  full roadmap) | auto-transitions to |
25
25
  +---- next planned milestone ------+
26
26
 
27
+ /flow:spec ← can pre-spec future milestones (each gets its own PRD in .planning/prds/)
28
+
27
29
  /flow:milestone ← add milestones to roadmap anytime
28
30
  /flow:task ← standalone path for bug fixes, cleanup, small features (no PRD needed)
29
31
  ```
@@ -50,8 +52,9 @@ Flow is 6 commands that turn your specs into shipped code through agent teams. E
50
52
  **`/flow:spec`** — Run once per milestone
51
53
  - Interviews you about scope, user stories, technical design, trade-offs, and phasing
52
54
  - You can say "done" or "that's enough" anytime to cut the interview short
53
- - Produces `PRD.md` — the execution contract with wave-based phases, file lists, and acceptance criteria
54
- - Updates ROADMAP and STATE to reflect the plan
55
+ - Produces `.planning/prds/{milestone}.md` — the execution contract with wave-based phases, file lists, and acceptance criteria
56
+ - Can pre-spec future milestones in parallel terminal windows (each milestone gets its own PRD file)
57
+ - Updates ROADMAP and STATE to reflect the plan (for the current milestone; future milestone specs skip STATE updates)
55
58
 
56
59
  **`/flow:go`** — Run once per phase (this is where the work happens)
57
60
  - Reads the PRD, finds the next pending phase
@@ -81,6 +81,7 @@ Create these 5 files (create directories as needed):
81
81
  - **Milestone:** [first milestone name] (v1)
82
82
  - **Phase:** Not started — run `/flow:spec` to build PRD
83
83
  - **Branch:** main
84
+ - **Active PRD:** None — run `/flow:spec` to create
84
85
  - **Last Session:** [today's date]
85
86
 
86
87
  ## Milestone Progress
@@ -145,10 +146,10 @@ Note: The first milestone gets status "Pending — needs `/flow:spec`". All subs
145
146
  1. Read this file (CLAUDE.md)
146
147
  2. Read `.planning/STATE.md` for current status
147
148
  3. Read `.planning/ROADMAP.md` for milestone progress
148
- 4. Read `PRD.md` for current execution spec (if one exists)
149
+ 4. Read active PRD from `.planning/prds/` for current milestone (if one exists)
149
150
 
150
151
  ## Execution Rules
151
- - **Plan before building.** For non-trivial work, read the PRD phase section before touching anything.
152
+ - **Plan before building.** For non-trivial work, read the milestone's PRD in `.planning/prds/` before touching anything.
152
153
  - **Delegate immediately.** If a task touches 3+ files, spawn an agent team within your first 2 tool calls.
153
154
  - **Verify everything.** Run [verification commands from user] after agent work lands. Nothing is done until proven.
154
155
 
@@ -176,6 +177,8 @@ One-liner format: `- **[topic]** The rule`
176
177
  <!-- EXAMPLE: - **[agent context]** Always tell agents exactly which functions/lines to read — never "read file.ts", say "read file.ts lines 50-120" -->
177
178
  ```
178
179
 
180
+ **`.planning/prds/`** — Create this empty directory (use `mkdir -p` via Bash). PRDs are stored here per-milestone.
181
+
179
182
  **`.planning/archive/`** — Create this empty directory (use `mkdir -p` via Bash).
180
183
 
181
184
  ## Step 4: Print Completion Message
@@ -186,6 +189,7 @@ Project initialized:
186
189
  - .planning/STATE.md — session GPS
187
190
  - .planning/ROADMAP.md — milestone tracker
188
191
  - tasks/lessons.md — active lessons (max 10)
192
+ - .planning/prds/ — per-milestone PRD specs
189
193
  - .planning/archive/ — for completed milestones
190
194
 
191
195
  Run `/flow:spec` to plan your first milestone.
@@ -10,13 +10,16 @@ You are executing the `/flow:spec` skill. This is the KEYSTONE skill of the flow
10
10
 
11
11
  **Interview mode:** Always thorough by default. The user can say "done", "finalize", "that's enough", or "move on" at ANY time to wrap up early. Respect their signal and finalize with whatever depth has been achieved.
12
12
 
13
- **Plan mode warning:** Do NOT use this skill with plan mode enabled. Plan mode's read-only constraint prevents PRD.md from being written during the interview. `/flow:spec` IS the planning phase — plan mode on top of it is redundant and breaks the workflow.
13
+ **Plan mode warning:** Do NOT use this skill with plan mode enabled. Plan mode's read-only constraint prevents the PRD from being written during the interview. `/flow:spec` IS the planning phase — plan mode on top of it is redundant and breaks the workflow.
14
14
 
15
15
  ## Phase 1 — Context Gathering (automatic, no user input needed)
16
16
 
17
17
  1. Read `.planning/STATE.md` and `.planning/ROADMAP.md` — understand current milestone and what's done
18
18
  2. Read `CLAUDE.md` — understand project rules and tech stack
19
- 3. Read `PRD.md` if it exists — check for existing spec to build on
19
+ 3. Check for existing PRD:
20
+ - List `.planning/prds/` directory (if it exists) for existing PRD files
21
+ - Also check for legacy `PRD.md` at project root (backward compat)
22
+ - If a PRD exists for the target milestone, note it for resume/extend flow
20
23
  4. **Codebase scan** (brownfield projects) — spawn **3 parallel Explore subagents** via the Task tool to scan the codebase without consuming main context:
21
24
 
22
25
  | Agent | Focus | Looks For |
@@ -34,6 +37,25 @@ You are executing the `/flow:spec` skill. This is the KEYSTONE skill of the flow
34
37
 
35
38
  5. **Assemble summaries:** Collect the 3 agent summaries into a brief context block (~45 lines total). Print to user: "Here's what I found in the codebase: [key components, patterns, data layer]. Starting the spec interview."
36
39
 
40
+ ## Milestone Targeting
41
+
42
+ Before starting the interview, determine which milestone this PRD targets:
43
+
44
+ 1. **If the user passed an argument** (e.g., `/flow:spec v3: Payments`) — match against ROADMAP.md milestones. If no match, print available milestones and ask which one.
45
+
46
+ 2. **If no argument** — read ROADMAP.md and list all incomplete milestones. Use AskUserQuestion to let the user pick which milestone to spec. Pre-select the current milestone from STATE.md as the first option (marked as "current"). If only one incomplete milestone exists, skip the prompt and use it directly.
47
+
48
+ 3. **Derive the PRD slug:** Take the milestone's version prefix and name (e.g., "v3: Dashboard Analytics"), lowercase it, replace spaces and special characters with hyphens, collapse consecutive hyphens. Result: `v3-dashboard-analytics`. The PRD path is `.planning/prds/{slug}.md`.
49
+
50
+ 4. **Check for existing PRD at that path:**
51
+ - **If PRD exists** → Use AskUserQuestion: "A PRD already exists for this milestone at `.planning/prds/{slug}.md`. What would you like to do?"
52
+ - "Resume editing" — load the existing PRD and continue the interview from where it left off
53
+ - "Start fresh" — delete the existing PRD and start a new interview
54
+ - "Pick a different milestone" — show available milestones
55
+ - **If no PRD exists** → Proceed with a fresh interview
56
+
57
+ 5. **Future milestone detection:** If the target milestone is NOT the current milestone in STATE.md, note this — the PRD will be written but STATE.md's "Active PRD" field will NOT be updated (it stays pointing at the current milestone's PRD). Print: "Speccing future milestone [name]. STATE.md will not be updated — this PRD will be available when you reach this milestone."
58
+
37
59
  ## Phase 2 — Adaptive Interview
38
60
 
39
61
  ### CRITICAL RULES (follow these exactly)
@@ -50,7 +72,7 @@ You are executing the `/flow:spec` skill. This is the KEYSTONE skill of the flow
50
72
 
51
73
  3. **CONTINUE UNTIL THE USER SAYS STOP.** Do NOT stop after covering all 7 areas once. After each answer, immediately ask the next question. Keep going deeper until the user says "done", "finalize", "that's enough", "ship it", or similar. A thorough interview is 15-30 questions, not 5.
52
74
 
53
- 4. **MAINTAIN A RUNNING DRAFT.** Every 2-3 questions, update PRD.md with what you've learned so far. Print: "Updated PRD draft — added [brief summary]." The user should see the spec taking shape in real-time, not all at the end.
75
+ 4. **MAINTAIN A RUNNING DRAFT.** Every 2-3 questions, update `.planning/prds/{slug}.md` with what you've learned so far (create `.planning/prds/` directory if it doesn't exist). Print: "Updated PRD draft — added [brief summary]." The user should see the spec taking shape in real-time, not all at the end.
54
76
 
55
77
  5. **BE ADAPTIVE.** Base your next question on the previous answer. If the user reveals something surprising, probe deeper on THAT — don't robotically move to the next category. The best specs come from following interesting threads.
56
78
 
@@ -140,11 +162,12 @@ If any check fails, print what's missing and use AskUserQuestion:
140
162
 
141
163
  ### Write PRD
142
164
 
143
- Write `PRD.md` to the project root with this EXACT structure:
165
+ Write the PRD to `.planning/prds/{slug}.md` (create `.planning/prds/` directory first if it doesn't exist) with this EXACT structure:
144
166
 
145
167
  ```markdown
146
168
  # [Milestone Name] — Specification
147
169
 
170
+ **Milestone:** [full milestone name, e.g., "v3: Dashboard Analytics"]
148
171
  **Status:** Ready for execution
149
172
  **Branch:** feat/[milestone-slug]
150
173
  **Created:** [today's date]
@@ -233,21 +256,25 @@ Write `PRD.md` to the project root with this EXACT structure:
233
256
 
234
257
  ## Phase 4 — Post-PRD Updates
235
258
 
236
- After writing PRD.md:
259
+ After writing the PRD to `.planning/prds/{slug}.md`:
237
260
 
238
261
  1. **Update ROADMAP.md:** Add phase breakdown under the current milestone section. Each phase gets a row in the progress table with status "Pending".
239
262
 
240
- 2. **Update STATE.md:** Set current phase to "Phase 1 — ready for `/flow:go`". Update "Next Actions" to reference the first phase.
263
+ 2. **Update STATE.md** (current milestone only):
264
+ - Set current phase to "Phase 1 — ready for `/flow:go`"
265
+ - Set "Active PRD" to `.planning/prds/{slug}.md`
266
+ - Update "Next Actions" to reference the first phase
267
+ - **Skip this step if speccing a future milestone** — STATE.md stays pointing at the current milestone. Print: "PRD written to `.planning/prds/{slug}.md`. STATE.md not updated (future milestone)."
241
268
 
242
269
  3. **Generate Phase 1 handoff prompt:**
243
270
  ```
244
- Phase 1: [Name] — [short description]. Read STATE.md, ROADMAP.md, and PRD.md.
271
+ Phase 1: [Name] — [short description]. Read STATE.md, ROADMAP.md, and .planning/prds/{slug}.md.
245
272
  [One sentence of context about what Phase 1 builds].
246
273
  ```
247
274
 
248
275
  4. Print the handoff prompt in a fenced code block.
249
276
 
250
- 5. Print: "PRD ready. Run `/flow:go` to execute Phase 1, or review PRD.md first."
277
+ 5. Print: "PRD ready at `.planning/prds/{slug}.md`. Run `/flow:go` to execute Phase 1, or review the PRD first."
251
278
 
252
279
  ## Quality Gates
253
280
 
@@ -256,6 +283,7 @@ Before finalizing, self-check the PRD:
256
283
  - [ ] Every user story has checkbox acceptance criteria that are testable
257
284
  - [ ] Every phase has verification commands
258
285
  - [ ] "Key Existing Code" section references actual files/functions found in the codebase scan
286
+ - [ ] PRD is written to `.planning/prds/{slug}.md`, NOT to root `PRD.md`
259
287
  - [ ] No phase has more than 5 agents in a single wave (too many = coordination overhead)
260
288
  - [ ] Sacred code section is populated (even if empty with "None identified")
261
289
 
@@ -13,7 +13,9 @@ You are executing the `/flow:status` skill. This is a READ-ONLY operation. Do NO
13
13
  Read ALL of the following in parallel:
14
14
  - `.planning/STATE.md`
15
15
  - `.planning/ROADMAP.md`
16
- - `PRD.md` (if exists)
16
+ - List `.planning/prds/` directory for all PRD files (if directory exists)
17
+ - Also check for legacy `PRD.md` at project root (backward compat)
18
+ - Read the active PRD (from STATE.md "Active PRD" field) to get phase details
17
19
  - Count lessons in `tasks/lessons.md` (if exists)
18
20
 
19
21
  IF both STATE.md AND ROADMAP.md are missing:
@@ -36,12 +38,12 @@ RULE: Determine the next action from ROADMAP.md phase statuses, NOT from STATE.m
36
38
 
37
39
  Use this explicit decision tree:
38
40
 
39
- **IF pending phases exist in ROADMAP AND PRD.md exists:**
41
+ **IF pending phases exist in ROADMAP AND a PRD exists for the current milestone (in `.planning/prds/` or legacy root):**
40
42
  → Primary: `/flow:go` to execute Phase [N]: [name]
41
43
  → Alt: `/flow:done` if wrapping up the session
42
44
  → Alt: `/flow:task` for quick fixes or cleanup (no PRD needed)
43
45
 
44
- **IF pending phases exist in ROADMAP BUT PRD.md is missing:**
46
+ **IF pending phases exist in ROADMAP BUT no PRD exists for the current milestone:**
45
47
  → Primary: `/flow:spec` to create the execution plan
46
48
  → Alt: `/flow:task` for quick fixes or cleanup (no PRD needed)
47
49
 
@@ -66,9 +68,18 @@ Last session: [date] — [what was built]
66
68
  Next: Phase [N] — [name] ([short description])
67
69
  Lessons: [N]/10 active
68
70
 
71
+ PRDs:
72
+ * {slug}.md (active — current milestone)
73
+ [For each additional PRD in .planning/prds/:]
74
+ * {slug}.md (ready — future milestone)
75
+ [If legacy PRD.md at root:]
76
+ * PRD.md (legacy — at project root)
77
+
69
78
  [routing recommendations from Step 3]
70
79
  ```
71
80
 
81
+ The PRDs section shows all PRD files found. Mark the one matching STATE.md's "Active PRD" as "(active — current milestone)". Mark others as "(ready — future milestone)". If a legacy root `PRD.md` exists, show it as "(legacy — at project root)". Omit the PRDs section entirely if no PRD files exist anywhere.
82
+
72
83
  Adapt the block based on available information. If STATE.md is missing, omit "Last session". If ROADMAP.md is missing, omit phase counts and say "Run /flow:setup to set up tracking."
73
84
 
74
85
  ## Step 5 — No File Writes
@@ -20,7 +20,7 @@ Read ALL of the following in parallel. If any file is missing, skip it gracefull
20
20
  - `.planning/ROADMAP.md`
21
21
  - `CLAUDE.md`
22
22
  - `tasks/lessons.md`
23
- - `PRD.md`
23
+ - Active PRD from `.planning/prds/` (if STATE.md "Active PRD" field exists, use that path; else check for legacy `PRD.md` at root)
24
24
 
25
25
  If no `.planning/` directory exists, print:
26
26
  > No `.planning/` directory found — running standalone. Task will still be executed, verified, and committed.
@@ -98,7 +98,7 @@ IF `.planning/STATE.md` exists:
98
98
 
99
99
  RULES:
100
100
  - DO NOT update ROADMAP.md — tasks are not milestone phases.
101
- - DO NOT update PRD.md — tasks are not part of the spec.
101
+ - DO NOT update any PRD files in `.planning/prds/` — tasks are not part of the spec.
102
102
  - DO NOT create `.planning/` if it doesn't exist.
103
103
 
104
104
  Quick lessons prompt via AskUserQuestion:
@@ -9,10 +9,10 @@
9
9
  1. Read this file (CLAUDE.md)
10
10
  2. Read `.planning/STATE.md` for current status
11
11
  3. Read `.planning/ROADMAP.md` for milestone progress
12
- 4. Read `PRD.md` for current execution spec (if one exists)
12
+ 4. Read active PRD from `.planning/prds/` for current milestone (if one exists)
13
13
 
14
14
  ## Execution Rules
15
- - **Plan before building.** For non-trivial work, read the PRD phase section before touching anything.
15
+ - **Plan before building.** For non-trivial work, read the milestone's PRD in `.planning/prds/` before touching anything.
16
16
  - **Delegate immediately.** If a task touches 3+ files, spawn an agent team within your first 2 tool calls.
17
17
  - **Verify everything.** Run {{VERIFY_COMMANDS}} after agent work lands. Nothing is done until proven.
18
18
 
@@ -4,6 +4,7 @@
4
4
  - **Milestone:** {{FIRST_MILESTONE}} (v1)
5
5
  - **Phase:** Not started — run `/flow:spec` to build PRD
6
6
  - **Branch:** main
7
+ - **Active PRD:** None — run `/flow:spec` to create
7
8
  - **Last Session:** {{DATE}}
8
9
 
9
10
  ## Milestone Progress