qualia-framework 3.2.1 → 3.3.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/bin/install.js CHANGED
@@ -81,6 +81,68 @@ function copy(src, dest) {
81
81
  fs.copyFileSync(src, dest);
82
82
  }
83
83
 
84
+ // Recursively copy a directory tree from src to dest.
85
+ // Skips hidden files (dot-prefixed) to avoid syncing .DS_Store, editor temp files, etc.
86
+ function copyTree(src, dest) {
87
+ if (!fs.existsSync(src)) return;
88
+ if (!fs.existsSync(dest)) fs.mkdirSync(dest, { recursive: true });
89
+ for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
90
+ if (entry.name.startsWith(".")) continue;
91
+ const srcPath = path.join(src, entry.name);
92
+ const destPath = path.join(dest, entry.name);
93
+ if (entry.isDirectory()) {
94
+ copyTree(srcPath, destPath);
95
+ } else if (entry.isFile()) {
96
+ fs.copyFileSync(srcPath, destPath);
97
+ }
98
+ }
99
+ }
100
+
101
+ // Surgically remove orphaned v2.6 install cruft from ~/.claude/ on upgrade.
102
+ // v2.6 installed a separate ~/.claude/qualia-framework/ directory with workflows/,
103
+ // references/, assets/, bin/qualia-tools.js. v3 doesn't use any of that — it was
104
+ // just never cleaned up. Also removes broken qualia-*.md agents from the v2.6 era
105
+ // that reference /home/qualia/ paths which don't exist.
106
+ function cleanupLegacyV26() {
107
+ const removed = { dirs: [], files: [] };
108
+
109
+ // Remove the entire v2.6 framework leftover directory.
110
+ const v26Dir = path.join(CLAUDE_DIR, "qualia-framework");
111
+ try {
112
+ if (fs.existsSync(v26Dir)) {
113
+ const versionFile = path.join(v26Dir, "VERSION");
114
+ // Safety: only remove if it has the v2.6 shape (VERSION file exists)
115
+ if (fs.existsSync(versionFile)) {
116
+ fs.rmSync(v26Dir, { recursive: true, force: true });
117
+ removed.dirs.push("~/.claude/qualia-framework/ (v2.6 leftover)");
118
+ }
119
+ }
120
+ } catch {}
121
+
122
+ // Remove broken v2.6 agent files that reference /home/qualia/ paths.
123
+ // The canonical v3 agents ship with the framework (planner.md, builder.md, etc.)
124
+ // — scan all qualia-*.md files in agents/ and remove any that contain the
125
+ // /home/qualia/ signature (v2.6 broken absolute paths).
126
+ const agentsDest = path.join(CLAUDE_DIR, "agents");
127
+ try {
128
+ if (fs.existsSync(agentsDest)) {
129
+ for (const name of fs.readdirSync(agentsDest)) {
130
+ if (!name.startsWith("qualia-") || !name.endsWith(".md")) continue;
131
+ const p = path.join(agentsDest, name);
132
+ try {
133
+ const content = fs.readFileSync(p, "utf8");
134
+ if (content.includes("/home/qualia/.claude")) {
135
+ fs.unlinkSync(p);
136
+ removed.files.push(`agents/${name}`);
137
+ }
138
+ } catch {}
139
+ }
140
+ }
141
+ } catch {}
142
+
143
+ return removed;
144
+ }
145
+
84
146
  // ─── Branded Header ─────────────────────────────────────
85
147
  const BOLD = "\x1b[1m";
86
148
  const TEAL_GLOW = "\x1b[38;2;0;170;175m";
@@ -227,20 +289,54 @@ async function main() {
227
289
  }
228
290
  }
229
291
 
230
- // ─── Templates ─────────────────────────────────────────
292
+ // ─── Templates (recursive — supports nested projects/ and research-project/) ─
231
293
  printSection("Templates");
232
294
  const tmplDir = path.join(FRAMEWORK_DIR, "templates");
233
295
  const tmplDest = path.join(CLAUDE_DIR, "qualia-templates");
234
296
  if (!fs.existsSync(tmplDest)) fs.mkdirSync(tmplDest, { recursive: true });
235
- for (const file of fs.readdirSync(tmplDir)) {
297
+ for (const entry of fs.readdirSync(tmplDir, { withFileTypes: true })) {
298
+ if (entry.name.startsWith(".")) continue;
299
+ const srcPath = path.join(tmplDir, entry.name);
300
+ const destPath = path.join(tmplDest, entry.name);
236
301
  try {
237
- copy(path.join(tmplDir, file), path.join(tmplDest, file));
238
- ok(file);
302
+ if (entry.isDirectory()) {
303
+ copyTree(srcPath, destPath);
304
+ ok(`${entry.name}/ (directory)`);
305
+ } else {
306
+ copy(srcPath, destPath);
307
+ ok(entry.name);
308
+ }
239
309
  } catch (e) {
240
- warn(`${file} — ${e.message}`);
310
+ warn(`${entry.name} — ${e.message}`);
241
311
  }
242
312
  }
243
313
 
314
+ // ─── References (methodology docs loaded by skills at runtime) ────
315
+ printSection("References");
316
+ const refDir = path.join(FRAMEWORK_DIR, "references");
317
+ const refDest = path.join(CLAUDE_DIR, "qualia-references");
318
+ if (fs.existsSync(refDir)) {
319
+ if (!fs.existsSync(refDest)) fs.mkdirSync(refDest, { recursive: true });
320
+ for (const file of fs.readdirSync(refDir)) {
321
+ try {
322
+ copy(path.join(refDir, file), path.join(refDest, file));
323
+ ok(file);
324
+ } catch (e) {
325
+ warn(`${file} — ${e.message}`);
326
+ }
327
+ }
328
+ } else {
329
+ log(`${DIM}(no references/ in framework — skipping)${RESET}`);
330
+ }
331
+
332
+ // ─── Cleanup legacy v2.6 install cruft ────────────────────
333
+ const legacy = cleanupLegacyV26();
334
+ if (legacy.dirs.length > 0 || legacy.files.length > 0) {
335
+ printSection("Cleanup (v2.6 leftover)");
336
+ for (const d of legacy.dirs) ok(`removed ${d}`);
337
+ for (const f of legacy.files) ok(`removed ${f}`);
338
+ }
339
+
244
340
  // ─── CLAUDE.md with role ───────────────────────────────
245
341
  printSection("Configuration");
246
342
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qualia-framework",
3
- "version": "3.2.1",
3
+ "version": "3.3.1",
4
4
  "description": "Claude Code workflow framework by Qualia Solutions. Plan, build, verify, ship.",
5
5
  "bin": {
6
6
  "qualia-framework": "./bin/cli.js"
@@ -32,6 +32,7 @@
32
32
  "rules/",
33
33
  "skills/",
34
34
  "templates/",
35
+ "references/",
35
36
  "tests/",
36
37
  "docs/",
37
38
  "CLAUDE.md",
@@ -0,0 +1,123 @@
1
+ # Questioning Guide
2
+
3
+ Project initialization is dream extraction, not requirements gathering. Help the user discover and articulate what they want. Collaborate, don't interrogate.
4
+
5
+ ## Philosophy
6
+
7
+ **You are a thinking partner.**
8
+
9
+ The user often has a fuzzy idea. Your job is to help them sharpen it. Ask questions that make them think "oh, I hadn't considered that" or "yes, that's exactly what I mean."
10
+
11
+ Don't follow a script. Follow the thread.
12
+
13
+ ## The Goal
14
+
15
+ By the end of questioning, you need enough clarity to write a PROJECT.md that downstream phases can act on:
16
+
17
+ - **Research** needs: what domain, what the user already knows, what unknowns exist
18
+ - **Requirements** needs: clear vision to scope v1 features
19
+ - **Roadmap** needs: clear vision to decompose into phases, what "done" looks like
20
+ - **Plan-phase** needs: specific requirements to break into tasks
21
+ - **Execute-phase** needs: success criteria to verify against
22
+
23
+ A vague PROJECT.md forces every downstream phase to guess. The cost compounds.
24
+
25
+ ## How to Question
26
+
27
+ **Start open.** Let them dump their mental model. Don't interrupt with structure.
28
+
29
+ **Follow energy.** Whatever they emphasized, dig into that. What excited them? What problem sparked this?
30
+
31
+ **Challenge vagueness.** Never accept fuzzy answers. "Good" means what? "Users" means who? "Simple" means how?
32
+
33
+ **Make the abstract concrete.** "Walk me through using this." "What does that actually look like?"
34
+
35
+ **Clarify ambiguity.** "When you say Z, do you mean A or B?"
36
+
37
+ **Know when to stop.** When you understand what they want, why they want it, who it's for, and what done looks like — offer to proceed.
38
+
39
+ ## Question Types
40
+
41
+ Use as inspiration, not a checklist. Pick what's relevant to the thread.
42
+
43
+ ### Motivation — why this exists
44
+
45
+ - "What prompted this?"
46
+ - "What are you doing today that this replaces?"
47
+ - "What would you do if this existed?"
48
+
49
+ ### Concreteness — what it actually is
50
+
51
+ - "Walk me through using this"
52
+ - "You said X — what does that actually look like?"
53
+ - "Give me an example"
54
+
55
+ ### Clarification — what they mean
56
+
57
+ - "When you say Z, do you mean A or B?"
58
+ - "You mentioned X — tell me more about that"
59
+
60
+ ### Success — how you'll know it's working
61
+
62
+ - "How will you know this is working?"
63
+ - "What does done look like?"
64
+
65
+ ## Using AskUserQuestion
66
+
67
+ Present concrete options the user can react to.
68
+
69
+ **Good options:**
70
+ - Interpretations of what they might mean
71
+ - Specific examples to confirm or deny
72
+ - Concrete choices that reveal priorities
73
+
74
+ **Bad options:**
75
+ - Generic categories ("Technical", "Business", "Other")
76
+ - Leading options that presume an answer
77
+ - Too many options (2-4 is ideal)
78
+
79
+ **Example — vague answer "it should be fast":**
80
+
81
+ - header: "Fast"
82
+ - question: "Fast how?"
83
+ - options: ["Sub-second response", "Handles large datasets", "Quick to build", "Let me explain"]
84
+
85
+ **Example — following a thread "frustrated with current tools":**
86
+
87
+ - header: "Frustration"
88
+ - question: "What specifically frustrates you?"
89
+ - options: ["Too many clicks", "Missing features", "Unreliable", "Let me explain"]
90
+
91
+ ## Context Checklist
92
+
93
+ Mental checklist, not conversation structure. Check as you go; weave questions naturally.
94
+
95
+ - [ ] What they're building (concrete enough to explain to a stranger)
96
+ - [ ] Why it needs to exist (the problem or desire driving it)
97
+ - [ ] Who it's for (even if just themselves)
98
+ - [ ] What "done" looks like (observable outcomes)
99
+
100
+ Four things. If they volunteer more, capture it.
101
+
102
+ ## Decision Gate
103
+
104
+ When you could write a clear PROJECT.md:
105
+
106
+ - header: "Ready?"
107
+ - question: "I think I understand what you're after. Ready to create PROJECT.md?"
108
+ - options:
109
+ - "Create PROJECT.md" — Let's move forward
110
+ - "Keep exploring" — I want to share more / ask me more
111
+
112
+ If "Keep exploring" — ask what they want to add, or identify gaps and probe naturally. Loop until approved.
113
+
114
+ ## Anti-Patterns
115
+
116
+ - **Checklist walking** — Going through domains regardless of what they said
117
+ - **Canned questions** — "What's your core value?" regardless of context
118
+ - **Corporate speak** — "What are your success criteria?" "Who are your stakeholders?"
119
+ - **Interrogation** — Firing questions without building on answers
120
+ - **Rushing** — Minimizing questions to get to "the work"
121
+ - **Shallow acceptance** — Taking vague answers without probing
122
+ - **Premature constraints** — Asking about tech stack before understanding the idea
123
+ - **User skills** — NEVER ask about user's technical experience. Claude builds.
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: qualia-discuss
3
+ description: "Capture phase decisions, trade-offs, and constraints BEFORE planning. Use for complex phases with regulatory, compliance, or architectural stakes. Creates .planning/phase-{N}-context.md that planner honors as locked input."
4
+ ---
5
+
6
+ # /qualia-discuss — Phase Context Capture
7
+
8
+ Before a complex phase gets planned, surface the decisions and trade-offs that must inform planning. Output: `.planning/phase-{N}-context.md` that the planner reads as locked input.
9
+
10
+ ## When to Use
11
+
12
+ - Regulated domains (legal, medical, financial) where wrong choices have legal cost
13
+ - Phases with architectural forks (e.g., "auth via middleware or RLS?")
14
+ - Phases with external dependencies you want to lock first
15
+ - Anytime the user says "wait, let's think about this one"
16
+
17
+ ## Process
18
+
19
+ ### 1. Determine Phase
20
+
21
+ ```bash
22
+ node ~/.claude/bin/state.js check 2>/dev/null
23
+ ```
24
+
25
+ If a phase number was passed as argument, use it. Otherwise use the current phase from STATE.md.
26
+
27
+ ### 2. Load Context
28
+
29
+ ```bash
30
+ cat .planning/PROJECT.md 2>/dev/null
31
+ cat .planning/ROADMAP.md 2>/dev/null
32
+ cat .planning/research/SUMMARY.md 2>/dev/null
33
+ ```
34
+
35
+ Identify:
36
+ - Phase goal from ROADMAP.md
37
+ - Requirements covered by this phase
38
+ - Research flags for this phase (from SUMMARY.md)
39
+
40
+ ### 3. Open the Conversation
41
+
42
+ Print the banner:
43
+ ```bash
44
+ node ~/.claude/bin/qualia-ui.js banner discuss {N} "{phase name from ROADMAP.md}"
45
+ ```
46
+
47
+ Ask inline (free text, not AskUserQuestion):
48
+
49
+ **"We're about to plan {phase name}. The goal is: {goal from ROADMAP.md}. Before I hand this to the planner, what decisions, trade-offs, or constraints should be locked in?"**
50
+
51
+ Wait for their response.
52
+
53
+ ### 4. Follow the Thread
54
+
55
+ Based on their answer, dig into specifics:
56
+
57
+ - If they mention a technology → "Why that one specifically?"
58
+ - If they mention a constraint → "What happens if we don't honor this?"
59
+ - If they mention a trade-off → "Which side do you want to land on, and why?"
60
+ - If they mention a concern → "What's the worst case?"
61
+
62
+ Use `AskUserQuestion` when there are clear interpretation forks. Free text otherwise.
63
+
64
+ ### 5. Capture Locked Decisions
65
+
66
+ Build up a list of **locked decisions** — things the planner MUST honor. Each decision has:
67
+ - The choice (what)
68
+ - The rationale (why)
69
+ - The source (who/when)
70
+
71
+ Also capture:
72
+ - **Discretion items** — things the planner can decide freely
73
+ - **Deferred ideas** — good ideas that are NOT in this phase
74
+ - **Risk flags** — things to watch during building
75
+ - **Open questions** — things that still need resolution
76
+
77
+ ### 6. Decision Gate
78
+
79
+ When you have enough context:
80
+
81
+ - header: "Ready to lock?"
82
+ - question: "Ready to lock these decisions and move to /qualia-plan {N}?"
83
+ - options:
84
+ - "Lock it in" — Write phase-{N}-context.md and done
85
+ - "Keep exploring" — I have more to say
86
+
87
+ Loop until "Lock it in".
88
+
89
+ ### 7. Write phase-{N}-context.md
90
+
91
+ Use the template at `~/.claude/qualia-templates/phase-context.md`. Fill every section with concrete content.
92
+
93
+ ```bash
94
+ # Write the file to .planning/phase-{N}-context.md
95
+ ```
96
+
97
+ ### 8. Commit
98
+
99
+ ```bash
100
+ git add .planning/phase-{N}-context.md
101
+ git commit -m "docs(phase-{N}): capture phase context before planning"
102
+ ```
103
+
104
+ ### 9. Route to Next
105
+
106
+ ```bash
107
+ node ~/.claude/bin/qualia-ui.js end "PHASE {N} CONTEXT LOCKED" "/qualia-plan {N}"
108
+ ```
109
+
110
+ ## Rules
111
+
112
+ 1. **One session, one phase.** Don't try to discuss phases 1 and 2 in the same invocation.
113
+ 2. **Locked decisions are NON-NEGOTIABLE.** The planner will honor them exactly. If you lock something you're not sure about, that's a mistake.
114
+ 3. **Don't redo research.** If the user asks a research question you don't know, suggest `/qualia-research {N}` instead.
115
+ 4. **Short context files are fine.** If the phase is simple, a 30-line context.md is better than a forced 200-line one.
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: qualia-map
3
+ description: "Map an existing codebase to infer architecture, stack, conventions, and what's already built. For brownfield projects — run BEFORE /qualia-new so Validated requirements get inferred from existing code."
4
+ ---
5
+
6
+ # /qualia-map — Codebase Mapping (Brownfield)
7
+
8
+ Scans an existing repo and produces `.planning/codebase/` — architecture, stack, conventions, concerns. Used by `/qualia-new` to infer what's already built and seed Validated requirements.
9
+
10
+ ## When to Use
11
+
12
+ - Taking over an existing client project
13
+ - Adding features to a repo you didn't build
14
+ - Before `/qualia-new` on any directory that already has code
15
+
16
+ ## Usage
17
+
18
+ `/qualia-map` — scan the current working directory
19
+
20
+ ## Process
21
+
22
+ ### 1. Check for Existing Code
23
+
24
+ ```bash
25
+ ls -la 2>/dev/null
26
+ test -f package.json && echo "HAS_PACKAGE"
27
+ test -d .git && echo "HAS_GIT"
28
+ test -d .planning/codebase && echo "ALREADY_MAPPED"
29
+ ```
30
+
31
+ If `ALREADY_MAPPED`, ask:
32
+ - header: "Re-map?"
33
+ - question: "Codebase already mapped. Re-scan?"
34
+ - options:
35
+ - "Re-scan" — overwrite existing map
36
+ - "Skip" — use existing map
37
+
38
+ ### 2. Banner
39
+
40
+ ```bash
41
+ node ~/.claude/bin/qualia-ui.js banner map
42
+ ```
43
+
44
+ ### 3. Spawn Parallel Mapper Agents
45
+
46
+ Map 4 dimensions in parallel for speed. Each writes one file in `.planning/codebase/`:
47
+
48
+ ```
49
+ Agent 1: Architecture scanner
50
+ Task(prompt="
51
+ Scan the current codebase and produce .planning/codebase/architecture.md.
52
+ Identify: entry points, folder structure, module boundaries, data flow.
53
+ Focus on WHAT the codebase does, not HOW to fix it.
54
+ ", subagent_type="general-purpose", description="Architecture scan")
55
+
56
+ Agent 2: Stack detector
57
+ Task(prompt="
58
+ Detect the tech stack. Read package.json, requirements.txt, Gemfile, etc.
59
+ Produce .planning/codebase/stack.md listing: runtime, framework, key libraries,
60
+ database, hosting, CI. Include version numbers.
61
+ ", subagent_type="general-purpose", description="Stack detection")
62
+
63
+ Agent 3: Conventions analyzer
64
+ Task(prompt="
65
+ Analyze code style and conventions. Sample 10-15 files across the codebase.
66
+ Produce .planning/codebase/conventions.md listing: naming, component patterns,
67
+ file organization, import style, test style, commit message format.
68
+ ", subagent_type="general-purpose", description="Conventions analysis")
69
+
70
+ Agent 4: Concerns scanner
71
+ Task(prompt="
72
+ Scan for code quality concerns — NOT to fix, just to document.
73
+ Look for: TODO/FIXME, deprecated APIs, outdated dependencies, missing tests,
74
+ security smells (hardcoded secrets, no input validation).
75
+ Produce .planning/codebase/concerns.md.
76
+ ", subagent_type="general-purpose", description="Concerns scan")
77
+ ```
78
+
79
+ ### 4. Wait for All 4
80
+
81
+ After all 4 agents complete, read the 4 output files.
82
+
83
+ ### 5. Synthesize
84
+
85
+ Create `.planning/codebase/README.md` — one-page summary linking to the 4 dimension files.
86
+
87
+ ```markdown
88
+ # Codebase Map
89
+
90
+ **Scanned:** {date}
91
+ **Repo:** {name}
92
+ **LOC:** {lines of code from wc -l}
93
+
94
+ ## At a Glance
95
+
96
+ - **Stack:** {from stack.md — one line}
97
+ - **Architecture:** {from architecture.md — one sentence}
98
+ - **Conventions:** {from conventions.md — one sentence}
99
+ - **Concerns:** {count of concerns found}
100
+
101
+ ## Validated Capabilities (Inferred)
102
+
103
+ Based on existing code, this project already does:
104
+ - {capability 1} (evidence: {file path})
105
+ - {capability 2} (evidence: {file path})
106
+ - {capability 3} (evidence: {file path})
107
+
108
+ These become **Validated requirements** in PROJECT.md when `/qualia-new` runs.
109
+
110
+ ## Dimension Details
111
+
112
+ - [Architecture](./architecture.md)
113
+ - [Stack](./stack.md)
114
+ - [Conventions](./conventions.md)
115
+ - [Concerns](./concerns.md)
116
+ ```
117
+
118
+ ### 6. Commit
119
+
120
+ ```bash
121
+ git add .planning/codebase/
122
+ git commit -m "docs: map existing codebase"
123
+ ```
124
+
125
+ ### 7. Route
126
+
127
+ ```bash
128
+ node ~/.claude/bin/qualia-ui.js end "CODEBASE MAPPED" "/qualia-new"
129
+ ```
130
+
131
+ ## What `/qualia-new` Does With This
132
+
133
+ When `/qualia-new` runs AFTER `/qualia-map`, it:
134
+ 1. Reads `.planning/codebase/README.md`
135
+ 2. Extracts Validated capabilities
136
+ 3. Pre-populates PROJECT.md with Validated requirements section
137
+ 4. Skips questions about things already built
138
+ 5. Focuses questioning on NEW capabilities being added
139
+
140
+ ## Rules
141
+
142
+ 1. **Non-destructive.** This skill only READS code, never modifies it.
143
+ 2. **Four parallel agents.** Don't sequential-scan — parallel is ~4x faster.
144
+ 3. **Dimension files are structured.** The orchestrator downstream (`/qualia-new`) reads them programmatically.
145
+ 4. **Concerns ≠ fixes.** This skill documents concerns. It does NOT fix them. Use `/qualia-optimize` for that.
@@ -0,0 +1,148 @@
1
+ ---
2
+ name: qualia-milestone
3
+ description: "Close out a completed milestone and prep the next one. Archives the current milestone's artifacts, updates REQUIREMENTS.md to mark v1 requirements Complete, and creates the next milestone roadmap."
4
+ ---
5
+
6
+ # /qualia-milestone — Milestone Closeout
7
+
8
+ Use when all feature phases in the current milestone are verified. Archives artifacts, marks requirements Complete, opens a new milestone for the next release.
9
+
10
+ ## When to Use
11
+
12
+ - After `/qualia-verify N` passes on the LAST phase of a milestone
13
+ - Before starting a v1.5 / v2.0 cycle
14
+ - NOT for individual phase completions — use `/qualia-verify N` for that
15
+
16
+ ## Usage
17
+
18
+ `/qualia-milestone` — close the current milestone, open the next
19
+
20
+ ## Process
21
+
22
+ ### 1. Validate Readiness
23
+
24
+ ```bash
25
+ node ~/.claude/bin/state.js check 2>/dev/null
26
+ ```
27
+
28
+ Check:
29
+ - All phases in STATE.md are `status: verified`
30
+ - `verification: pass` for every phase
31
+ - No open blockers
32
+
33
+ If not ready:
34
+ ```bash
35
+ node ~/.claude/bin/qualia-ui.js fail "Milestone not ready — {reason}"
36
+ ```
37
+ Exit.
38
+
39
+ ### 2. Banner
40
+
41
+ ```bash
42
+ node ~/.claude/bin/qualia-ui.js banner milestone
43
+ ```
44
+
45
+ ### 3. Confirm Closeout
46
+
47
+ Show:
48
+ - Milestone name (e.g., "v1 — Launch")
49
+ - Phases completed
50
+ - Requirements delivered
51
+
52
+ - header: "Close milestone?"
53
+ - question: "Close {milestone name} and move to the next milestone?"
54
+ - options:
55
+ - "Close it" — Archive and open next
56
+ - "Not yet" — I want to add more first
57
+
58
+ ### 4. Archive Current Milestone
59
+
60
+ ```bash
61
+ mkdir -p .planning/archive
62
+ cp .planning/ROADMAP.md .planning/archive/{milestone_slug}-ROADMAP.md
63
+ cp .planning/STATE.md .planning/archive/{milestone_slug}-STATE.md
64
+ cp -r .planning/phases .planning/archive/{milestone_slug}-phases
65
+ ```
66
+
67
+ ### 5. Update REQUIREMENTS.md
68
+
69
+ Open `.planning/REQUIREMENTS.md` and:
70
+ - Mark every v1 requirement as Complete in the traceability table
71
+ - Move the `## v1 Requirements` section content to `## Completed (v1)` at the top (for historical reference)
72
+ - Elevate `## v2 Requirements` → `## v1 Requirements` (next milestone's scope)
73
+
74
+ ### 6. Ask About Next Milestone
75
+
76
+ - header: "Next milestone"
77
+ - question: "What's the next milestone called?"
78
+ - options (dynamic):
79
+ - "v1.5 — {suggested name based on v2 requirements}"
80
+ - "v2.0 — {bigger rewrite}"
81
+ - "Custom name" — let me type it
82
+
83
+ ### 7. Create New Roadmap
84
+
85
+ Spawn the roadmapper to create a new ROADMAP.md for the next milestone:
86
+
87
+ ```
88
+ Agent(prompt="
89
+ Read your role: @~/.claude/agents/roadmapper.md
90
+
91
+ <task>
92
+ Create a new ROADMAP.md for the next milestone.
93
+
94
+ Milestone name: {milestone name}
95
+ Milestone number: {M+1}
96
+
97
+ The new v1 requirements (just promoted from old v2) are in .planning/REQUIREMENTS.md.
98
+ The previous milestone's archive is at .planning/archive/.
99
+
100
+ Build phases for the new milestone scope. Do NOT plan for already-completed requirements.
101
+ ", subagent_type="qualia-roadmapper", description="Create next milestone roadmap")
102
+ ```
103
+
104
+ ### 8. Reset STATE.md via state.js
105
+
106
+ ```bash
107
+ node ~/.claude/bin/state.js init \
108
+ --project "{project name}" \
109
+ --client "{client}" \
110
+ --type "{type}" \
111
+ --phases '{JSON from new roadmap}' \
112
+ --total_phases {new N}
113
+ ```
114
+
115
+ ### 9. Commit
116
+
117
+ ```bash
118
+ git add .planning/
119
+ git commit -m "feat({milestone_slug}): close milestone, open {next milestone}"
120
+ ```
121
+
122
+ ### 10. Route
123
+
124
+ ```bash
125
+ node ~/.claude/bin/qualia-ui.js end "MILESTONE {closed} CLOSED" "/qualia-plan 1"
126
+ ```
127
+
128
+ ## What Stays, What Changes
129
+
130
+ **Stays:**
131
+ - `.planning/PROJECT.md` — the project doesn't change
132
+ - `.planning/archive/` — historical milestones preserved
133
+ - Git history — every commit preserved
134
+
135
+ **Changes:**
136
+ - `.planning/REQUIREMENTS.md` — Completed section grows, v1 scope shifts
137
+ - `.planning/ROADMAP.md` — new phases for the new milestone
138
+ - `.planning/STATE.md` — reset to Phase 1 of new milestone
139
+
140
+ **Discarded (but archived):**
141
+ - `.planning/phases/` — the old phase folders move to archive
142
+
143
+ ## Rules
144
+
145
+ 1. **Don't close early.** All phases must be `verified` with `pass`. No partial milestones.
146
+ 2. **Archive, don't delete.** Old phase work stays accessible via `.planning/archive/`.
147
+ 3. **New milestone = new phase numbering.** The next phase is Phase 1 of the new milestone, not Phase {N+1} of the old.
148
+ 4. **ERP sync aware.** The ERP reads ROADMAP.md — after milestone close, push to GitHub so the ERP picks up the new phase structure.