mindsystem-cc 3.20.0 → 3.21.0

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 (79) hide show
  1. package/README.md +5 -6
  2. package/agents/ms-mockup-designer.md +1 -1
  3. package/agents/ms-product-researcher.md +69 -0
  4. package/agents/ms-research-synthesizer.md +1 -1
  5. package/agents/ms-researcher.md +8 -8
  6. package/agents/ms-roadmapper.md +9 -13
  7. package/bin/install.js +68 -5
  8. package/commands/ms/add-phase.md +4 -4
  9. package/commands/ms/adhoc.md +1 -1
  10. package/commands/ms/audit-milestone.md +12 -12
  11. package/commands/ms/complete-milestone.md +25 -22
  12. package/commands/ms/config.md +202 -0
  13. package/commands/ms/design-phase.md +3 -8
  14. package/commands/ms/discuss-phase.md +26 -22
  15. package/commands/ms/doctor.md +22 -202
  16. package/commands/ms/execute-phase.md +18 -7
  17. package/commands/ms/help.md +46 -39
  18. package/commands/ms/insert-phase.md +3 -3
  19. package/commands/ms/new-milestone.md +40 -16
  20. package/commands/ms/new-project.md +53 -42
  21. package/commands/ms/plan-milestone-gaps.md +4 -5
  22. package/commands/ms/plan-phase.md +2 -2
  23. package/commands/ms/progress.md +2 -4
  24. package/commands/ms/research-phase.md +7 -12
  25. package/commands/ms/research-project.md +12 -12
  26. package/mindsystem/references/continuation-format.md +3 -3
  27. package/mindsystem/references/principles.md +1 -1
  28. package/mindsystem/references/routing/audit-result-routing.md +12 -11
  29. package/mindsystem/references/routing/between-milestones-routing.md +2 -2
  30. package/mindsystem/references/routing/milestone-complete-routing.md +1 -1
  31. package/mindsystem/references/routing/next-phase-routing.md +4 -2
  32. package/mindsystem/templates/context.md +7 -6
  33. package/mindsystem/templates/milestone-archive.md +5 -5
  34. package/mindsystem/templates/milestone-context.md +1 -1
  35. package/mindsystem/templates/milestone.md +9 -9
  36. package/mindsystem/templates/project.md +2 -2
  37. package/mindsystem/templates/research-subagent-prompt.md +3 -3
  38. package/mindsystem/templates/roadmap-milestone.md +14 -14
  39. package/mindsystem/templates/roadmap.md +9 -7
  40. package/mindsystem/workflows/adhoc.md +1 -1
  41. package/mindsystem/workflows/complete-milestone.md +40 -75
  42. package/mindsystem/workflows/discuss-phase.md +137 -65
  43. package/mindsystem/workflows/doctor-fixes.md +273 -0
  44. package/mindsystem/workflows/execute-phase.md +7 -3
  45. package/mindsystem/workflows/execute-plan.md +3 -0
  46. package/mindsystem/workflows/map-codebase.md +2 -2
  47. package/mindsystem/workflows/mockup-generation.md +1 -1
  48. package/mindsystem/workflows/plan-phase.md +1 -1
  49. package/mindsystem/workflows/transition.md +2 -2
  50. package/mindsystem/workflows/verify-work.md +1 -1
  51. package/package.json +1 -1
  52. package/scripts/__pycache__/ms-tools.cpython-314.pyc +0 -0
  53. package/scripts/__pycache__/test_ms_tools.cpython-314-pytest-9.0.2.pyc +0 -0
  54. package/scripts/fixtures/scan-context/.planning/ROADMAP.md +16 -0
  55. package/scripts/fixtures/scan-context/.planning/adhoc/20260220-fix-token-SUMMARY.md +12 -0
  56. package/scripts/fixtures/scan-context/.planning/config.json +3 -0
  57. package/scripts/fixtures/scan-context/.planning/debug/resolved/token-bug.md +11 -0
  58. package/scripts/fixtures/scan-context/.planning/knowledge/auth.md +11 -0
  59. package/scripts/fixtures/scan-context/.planning/phases/02-infra/02-1-SUMMARY.md +20 -0
  60. package/scripts/fixtures/scan-context/.planning/phases/04-setup/04-1-SUMMARY.md +21 -0
  61. package/scripts/fixtures/scan-context/.planning/phases/05-auth/05-1-SUMMARY.md +28 -0
  62. package/scripts/fixtures/scan-context/.planning/todos/done/setup-db.md +10 -0
  63. package/scripts/fixtures/scan-context/.planning/todos/pending/add-logout.md +10 -0
  64. package/scripts/fixtures/scan-context/expected-output.json +257 -0
  65. package/scripts/ms-tools.py +2139 -0
  66. package/scripts/test_ms_tools.py +836 -0
  67. package/commands/ms/list-phase-assumptions.md +0 -56
  68. package/mindsystem/workflows/list-phase-assumptions.md +0 -178
  69. package/scripts/__pycache__/compare_mockups.cpython-314.pyc +0 -0
  70. package/scripts/archive-milestone-files.sh +0 -68
  71. package/scripts/archive-milestone-phases.sh +0 -138
  72. package/scripts/doctor-scan.sh +0 -402
  73. package/scripts/gather-milestone-stats.sh +0 -179
  74. package/scripts/generate-adhoc-patch.sh +0 -79
  75. package/scripts/generate-phase-patch.sh +0 -169
  76. package/scripts/scan-artifact-subsystems.sh +0 -55
  77. package/scripts/scan-planning-context.py +0 -839
  78. package/scripts/update-state.sh +0 -59
  79. package/scripts/validate-execution-order.sh +0 -104
@@ -1,6 +1,6 @@
1
1
  <purpose>
2
2
 
3
- Mark a shipped version (v1.0, v1.1, v2.0) as complete. This creates a historical record in MILESTONES.md, performs full PROJECT.md evolution review, archives ROADMAP.md and REQUIREMENTS.md, and tags the release in git.
3
+ Mark a shipped milestone as complete. This creates a historical record in MILESTONES.md, performs full PROJECT.md evolution review, and archives ROADMAP.md and REQUIREMENTS.md.
4
4
 
5
5
  </purpose>
6
6
 
@@ -20,9 +20,9 @@ Mark a shipped version (v1.0, v1.1, v2.0) as complete. This creates a historical
20
20
 
21
21
  When a milestone completes, this workflow:
22
22
 
23
- 1. Creates `.planning/milestones/v[X.Y]/` directory for all archive files
24
- 2. Extracts full milestone details to `.planning/milestones/v[X.Y]/ROADMAP.md`
25
- 3. Archives requirements to `.planning/milestones/v[X.Y]/REQUIREMENTS.md`
23
+ 1. Creates `.planning/milestones/{slug}/` directory for all archive files
24
+ 2. Extracts full milestone details to `.planning/milestones/{slug}/ROADMAP.md`
25
+ 3. Archives requirements to `.planning/milestones/{slug}/REQUIREMENTS.md`
26
26
  4. Archives milestone files via script (audit, context, research — whichever exist)
27
27
  5. Consolidates phase summaries, deletes artifacts, moves phase dirs via script
28
28
  6. Deletes REQUIREMENTS.md (fresh one created for next milestone)
@@ -68,7 +68,7 @@ cat .planning/config.json 2>/dev/null
68
68
  Run the stats script to get readiness status and git statistics:
69
69
 
70
70
  ```bash
71
- ~/.claude/mindsystem/scripts/gather-milestone-stats.sh $PHASE_START $PHASE_END
71
+ ms-tools gather-milestone-stats $PHASE_START $PHASE_END
72
72
  ```
73
73
 
74
74
  The script outputs:
@@ -133,7 +133,7 @@ If exists, prepend new entry (reverse chronological order).
133
133
  Use template from `templates/milestone.md`:
134
134
 
135
135
  ```markdown
136
- ## v[Version] [Name] (Shipped: YYYY-MM-DD)
136
+ ## [Name] (Shipped: YYYY-MM-DD)
137
137
 
138
138
  **Delivered:** [One sentence from user]
139
139
 
@@ -185,7 +185,7 @@ cat .planning/phases/*-*/*-SUMMARY.md
185
185
 
186
186
  **Validated section:**
187
187
  - All requirements shipped in this milestone → Add to Validated
188
- - Format: `- ✓ [Requirement] — v[X.Y]`
188
+ - Format: `- ✓ [Requirement] — [Name]`
189
189
 
190
190
  **Out of Scope audit:**
191
191
  - Review each item — is the reasoning still valid?
@@ -218,10 +218,10 @@ Make all edits inline. Update "Last updated" footer:
218
218
 
219
219
  ```markdown
220
220
  ---
221
- *Last updated: [date] after v[X.Y] milestone*
221
+ *Last updated: [date] after [Name] milestone*
222
222
  ```
223
223
 
224
- **Example full evolution (v1.0v1.1 prep):**
224
+ **Example full evolution (MVPSecurity & Polish prep):**
225
225
 
226
226
  Before:
227
227
 
@@ -249,7 +249,7 @@ Currently using Miro or physical whiteboards.
249
249
  - Video chat — use external tools
250
250
  ```
251
251
 
252
- After v1.0:
252
+ After MVP:
253
253
 
254
254
  ```markdown
255
255
  ## What This Is
@@ -267,9 +267,9 @@ Currently using Miro but frustrated by complexity and latency.
267
267
 
268
268
  ## Validated
269
269
 
270
- - ✓ Canvas drawing tools — v1.0
271
- - ✓ Real-time sync < 500ms — v1.0 (achieved 200ms avg)
272
- - ✓ User authentication — v1.0
270
+ - ✓ Canvas drawing tools — MVP
271
+ - ✓ Real-time sync < 500ms — MVP (achieved 200ms avg)
272
+ - ✓ User authentication — MVP
273
273
 
274
274
  ## Out of Scope
275
275
 
@@ -279,7 +279,7 @@ Currently using Miro but frustrated by complexity and latency.
279
279
 
280
280
  ## Technical Context
281
281
 
282
- Shipped v1.0 with 2,400 LOC TypeScript.
282
+ Shipped MVP with 2,400 LOC TypeScript.
283
283
  Tech stack: Next.js, Supabase, Canvas API.
284
284
  Initial user testing showed demand for shape tools.
285
285
  ```
@@ -305,9 +305,9 @@ Extract completed milestone details and create archive file.
305
305
 
306
306
  1. Create milestone directory and archive file:
307
307
  ```bash
308
- mkdir -p .planning/milestones/v[X.Y]
308
+ mkdir -p .planning/milestones/{slug}
309
309
  ```
310
- Archive file path: `.planning/milestones/v[X.Y]/ROADMAP.md`
310
+ Archive file path: `.planning/milestones/{slug}/ROADMAP.md`
311
311
 
312
312
  2. Read `~/.claude/mindsystem/templates/milestone-archive.md` template
313
313
 
@@ -332,7 +332,7 @@ Extract completed milestone details and create archive file.
332
332
  - {{DECISIONS_FROM_PROJECT}} — Key decisions from PROJECT.md
333
333
  - {{ISSUES_RESOLVED_DURING_MILESTONE}} — From summaries
334
334
 
335
- 6. Write filled template to `.planning/milestones/v[X.Y]/ROADMAP.md`
335
+ 6. Write filled template to `.planning/milestones/{slug}/ROADMAP.md`
336
336
 
337
337
  7. Delete ROADMAP.md (fresh one created for next milestone):
338
338
  ```bash
@@ -341,17 +341,17 @@ Extract completed milestone details and create archive file.
341
341
 
342
342
  8. Verify archive exists:
343
343
  ```bash
344
- ls .planning/milestones/v[X.Y]/ROADMAP.md
344
+ ls .planning/milestones/{slug}/ROADMAP.md
345
345
  ```
346
346
 
347
347
  9. Confirm roadmap archive complete:
348
348
 
349
349
  ```
350
- v[X.Y] roadmap archived to milestones/v[X.Y]/ROADMAP.md
350
+ Roadmap archived to milestones/{slug}/ROADMAP.md
351
351
  ✅ ROADMAP.md deleted (fresh one for next milestone)
352
352
  ```
353
353
 
354
- **Note:** Phase directories are moved to `milestones/v[X.Y]/phases/` by the archive_and_cleanup_phases step. After milestone completion, `.planning/phases/` contains only the next milestone's work. Phase numbering continues (v1.0 phases 1-4, v1.1 phases 5-8, etc.).
354
+ **Note:** Phase directories are moved to `milestones/{slug}/phases/` by the archive_and_cleanup_phases step. After milestone completion, `.planning/phases/` contains only the next milestone's work. Phase numbering continues (MVP phases 1-4, next milestone phases 5-8, etc.).
355
355
 
356
356
  </step>
357
357
 
@@ -366,7 +366,7 @@ Archive requirements and prepare for fresh requirements in next milestone.
366
366
  cat .planning/REQUIREMENTS.md
367
367
  ```
368
368
 
369
- 2. Create archive file: `.planning/milestones/v[X.Y]/REQUIREMENTS.md`
369
+ 2. Create archive file: `.planning/milestones/{slug}/REQUIREMENTS.md`
370
370
 
371
371
  3. Transform requirements for archive:
372
372
  - Mark all v1 requirements as `[x]` complete
@@ -379,12 +379,12 @@ Archive requirements and prepare for fresh requirements in next milestone.
379
379
 
380
380
  4. Write archive file with header:
381
381
  ```markdown
382
- # Requirements Archive: v[X.Y] [Milestone Name]
382
+ # Requirements Archive: [Milestone Name]
383
383
 
384
384
  **Archived:** [DATE]
385
385
  **Status:** ✅ SHIPPED
386
386
 
387
- This is the archived requirements specification for v[X.Y].
387
+ This is the archived requirements specification for [Milestone Name].
388
388
  For current requirements, see `.planning/REQUIREMENTS.md` (created for next milestone).
389
389
 
390
390
  ---
@@ -400,7 +400,7 @@ Archive requirements and prepare for fresh requirements in next milestone.
400
400
  **Dropped:** [list any requirements removed and why]
401
401
 
402
402
  ---
403
- *Archived: [DATE] as part of v[X.Y] milestone completion*
403
+ *Archived: [DATE] as part of [Milestone Name] milestone completion*
404
404
  ```
405
405
 
406
406
  5. Delete original REQUIREMENTS.md:
@@ -410,7 +410,7 @@ Archive requirements and prepare for fresh requirements in next milestone.
410
410
 
411
411
  6. Confirm:
412
412
  ```
413
- ✅ Requirements archived to milestones/v[X.Y]/REQUIREMENTS.md
413
+ ✅ Requirements archived to milestones/{slug}/REQUIREMENTS.md
414
414
  ✅ REQUIREMENTS.md deleted (fresh one needed for next milestone)
415
415
  ```
416
416
 
@@ -423,7 +423,7 @@ Archive requirements and prepare for fresh requirements in next milestone.
423
423
  Archive optional milestone files (audit, context, research) to the milestone directory:
424
424
 
425
425
  ```bash
426
- ~/.claude/mindsystem/scripts/archive-milestone-files.sh v[X.Y]
426
+ ms-tools archive-milestone-files {slug}
427
427
  ```
428
428
 
429
429
  The script moves whichever files exist and reports what was archived. Files that don't exist are skipped silently.
@@ -435,22 +435,22 @@ The script moves whichever files exist and reports what was archived. Files that
435
435
  Consolidate phase summaries, delete raw artifacts, and move phase directories to the milestone archive. This runs after all steps that read summaries (extract_accomplishments, evolve_project_full_review) and after archive_milestone creates the milestone directory.
436
436
 
437
437
  ```bash
438
- ~/.claude/mindsystem/scripts/archive-milestone-phases.sh $PHASE_START $PHASE_END v[X.Y]
438
+ ms-tools archive-milestone-phases $PHASE_START $PHASE_END {slug}
439
439
  ```
440
440
 
441
441
  Verify archive:
442
442
 
443
443
  ```bash
444
- ls .planning/milestones/v[X.Y]/PHASE-SUMMARIES.md
445
- ls .planning/milestones/v[X.Y]/phases/
444
+ ls .planning/milestones/{slug}/PHASE-SUMMARIES.md
445
+ ls .planning/milestones/{slug}/phases/
446
446
  ```
447
447
 
448
448
  Present:
449
449
 
450
450
  ```
451
- ✅ Phase summaries consolidated to milestones/v[X.Y]/PHASE-SUMMARIES.md
451
+ ✅ Phase summaries consolidated to milestones/{slug}/PHASE-SUMMARIES.md
452
452
  ✅ Raw artifacts deleted from phase directories
453
- ✅ Phase directories moved to milestones/v[X.Y]/phases/
453
+ ✅ Phase directories moved to milestones/{slug}/phases/
454
454
  ✅ .planning/phases/ clean for next milestone
455
455
  ```
456
456
 
@@ -479,7 +479,7 @@ See: .planning/PROJECT.md (updated [today])
479
479
  Phase: [Next phase] of [Total] ([Phase name])
480
480
  Plan: Not started
481
481
  Status: Ready to plan
482
- Last activity: [today] — v[X.Y] milestone complete
482
+ Last activity: [today] — [Name] milestone complete
483
483
 
484
484
  Progress: [updated progress bar]
485
485
  ```
@@ -492,45 +492,13 @@ Progress: [updated progress bar]
492
492
 
493
493
  </step>
494
494
 
495
- <step name="git_tag">
496
-
497
- Create git tag for milestone:
498
-
499
- ```bash
500
- git tag -a v[X.Y] -m "$(cat <<'EOF'
501
- v[X.Y] [Name]
502
-
503
- Delivered: [One sentence]
504
-
505
- Key accomplishments:
506
- - [Item 1]
507
- - [Item 2]
508
- - [Item 3]
509
-
510
- See .planning/MILESTONES.md for full details.
511
- EOF
512
- )"
513
- ```
514
-
515
- Confirm: "Tagged: v[X.Y]"
516
-
517
- Ask: "Push tag to remote? (y/n)"
518
-
519
- If yes:
520
-
521
- ```bash
522
- git push origin v[X.Y]
523
- ```
524
-
525
- </step>
526
-
527
495
  <step name="git_commit_milestone">
528
496
 
529
497
  Commit milestone completion including archive files and deletions.
530
498
 
531
499
  ```bash
532
500
  # Stage archive directory (covers ROADMAP, REQUIREMENTS, AUDIT, CONTEXT, research)
533
- git add .planning/milestones/v[X.Y]/
501
+ git add .planning/milestones/{slug}/
534
502
 
535
503
  # Stage updated files
536
504
  git add .planning/MILESTONES.md
@@ -542,9 +510,9 @@ git add -u .planning/
542
510
 
543
511
  # Commit with descriptive message
544
512
  git commit -m "$(cat <<'EOF'
545
- chore: complete v[X.Y] milestone
513
+ chore: complete [Name] milestone
546
514
 
547
- Archived to milestones/v[X.Y]/:
515
+ Archived to milestones/{slug}/:
548
516
  - ROADMAP.md
549
517
  - REQUIREMENTS.md
550
518
  - PHASE-SUMMARIES.md (consolidated from phase directories)
@@ -567,32 +535,29 @@ Updated:
567
535
  - MILESTONES.md (new entry)
568
536
  - PROJECT.md (requirements → Validated)
569
537
  - STATE.md (reset for next milestone)
570
-
571
- Tagged: v[X.Y]
572
538
  EOF
573
539
  )"
574
540
  ```
575
541
 
576
- Confirm: "Committed: chore: complete v[X.Y] milestone"
542
+ Confirm: "Committed: chore: complete [Name] milestone"
577
543
 
578
544
  </step>
579
545
 
580
546
  <step name="offer_next">
581
547
 
582
548
  ```
583
- ✅ Milestone v[X.Y] [Name] complete
549
+ ✅ Milestone [Name] complete
584
550
 
585
551
  Shipped:
586
552
  - [N] phases ([M] plans, [P] tasks)
587
553
  - [One sentence of what shipped]
588
554
 
589
- Archived to milestones/v[X.Y]/:
555
+ Archived to milestones/{slug}/:
590
556
  - ROADMAP.md
591
557
  - REQUIREMENTS.md
592
558
  - research/ (if existed)
593
559
 
594
560
  Summary: .planning/MILESTONES.md
595
- Tag: v[X.Y]
596
561
 
597
562
  ---
598
563
 
@@ -624,8 +589,8 @@ Milestone completion is successful when (ordered by skip risk):
624
589
  - [ ] All shipped requirements moved to Validated in PROJECT.md
625
590
  - [ ] Key Decisions updated with outcomes
626
591
  - [ ] MILESTONES.md entry created with stats and accomplishments
627
- - [ ] Roadmap archive created (milestones/v[X.Y]/ROADMAP.md)
628
- - [ ] Requirements archive created (milestones/v[X.Y]/REQUIREMENTS.md)
592
+ - [ ] Roadmap archive created (milestones/{slug}/ROADMAP.md)
593
+ - [ ] Requirements archive created (milestones/{slug}/REQUIREMENTS.md)
629
594
  - [ ] REQUIREMENTS.md deleted (fresh for next milestone)
630
595
  - [ ] STATE.md updated with fresh project reference
631
596
 
@@ -1,29 +1,25 @@
1
1
  <purpose>
2
- Gather phase context through collaborative thinking before planning. Help the user articulate their vision for how this phase should work, look, and feel.
2
+ Gather phase context through product-informed collaborative thinking before planning. Act as a collaborative product owner loading milestone-level artifacts, surfacing assumptions, optionally researching competitors, and grounding every question in product analysis.
3
3
 
4
- You are a thinking partner, not an interviewer. The user is the visionary — you are the builder. Your job is to understand their vision, not interrogate them about technical details you can figure out yourself.
4
+ You are a thinking partner, not an interviewer. The user is the visionary — you are the builder with product sense. Your job is to understand their vision, ground it in industry context, and help them make informed decisions.
5
5
  </purpose>
6
6
 
7
7
  <philosophy>
8
- **User = founder/visionary. Claude = builder.**
8
+ The user knows vision, priorities, and preferences. They don't know codebase patterns, technical risks, or implementation constraints — you figure those out.
9
9
 
10
- The user doesn't know (and shouldn't need to know):
11
- - Codebase patterns (you read the code)
12
- - Technical risks (you identify during research)
13
- - Implementation constraints (you figure those out)
14
- - Success metrics (you infer from the work)
15
-
16
- The user DOES know:
17
- - How they imagine it working
18
- - What it should look/feel like
19
- - What's essential vs nice-to-have
20
- - Any specific things they have in mind
10
+ **Product-thinking lens (analytical tool, not checklist):**
11
+ - Ground analysis in target audience (Who It's For from PROJECT.md)
12
+ - Focus on what moves the needle (Core Value)
13
+ - Think in systems, not features — how does this phase connect to the whole?
14
+ - Validate against industry patterns, don't blindly follow them
21
15
 
22
- Ask about vision. Figure out implementation yourself.
16
+ Ask about vision. Apply product thinking. Figure out implementation yourself.
23
17
  </philosophy>
24
18
 
25
19
  <process>
26
20
 
21
+ <!-- STAGE 1: LOAD + ASSESS -->
22
+
27
23
  <step name="validate_phase" priority="first">
28
24
  Phase number: $ARGUMENTS (required)
29
25
 
@@ -51,30 +47,33 @@ Parse phase details from roadmap:
51
47
  - Phase description
52
48
  - Status (should be "Not started" or "In progress")
53
49
 
54
- Continue to load_prior_knowledge.
50
+ Continue to load_context.
55
51
  </step>
56
52
 
57
- <step name="load_prior_knowledge">
58
- Determine which subsystem(s) this phase touches from ROADMAP.md phase description + config.json:
53
+ <step name="load_context">
54
+ Load milestone artifacts and prior knowledge. Handle gracefully when any file is missing.
59
55
 
60
56
  ```bash
57
+ cat .planning/PROJECT.md 2>/dev/null
58
+ cat .planning/MILESTONE-CONTEXT.md 2>/dev/null
59
+ cat .planning/REQUIREMENTS.md 2>/dev/null
61
60
  jq -r '.subsystems[]' .planning/config.json 2>/dev/null
62
61
  grep -A20 "Phase ${PHASE}:" .planning/ROADMAP.md
63
62
  ```
64
63
 
65
- Load matching `knowledge/{subsystem}.md` files:
64
+ Extract from PROJECT.md: **Who It's For**, **Core Value**, **How It's Different**
65
+
66
+ Extract from REQUIREMENTS.md: Requirements mapped to this phase (match phase number/name against requirement tags)
67
+
68
+ Load matching `knowledge/{subsystem}.md` files for subsystems this phase touches:
66
69
 
67
70
  ```bash
68
71
  cat .planning/knowledge/{subsystem}.md 2>/dev/null
69
72
  ```
70
73
 
71
- Handle gracefully when `.planning/knowledge/` doesn't exist (first milestone, no phases executed yet).
72
-
73
- **If knowledge exists:** Present a brief "What we know so far" summary to the user before questioning — prior decisions, architectural patterns, and pitfalls relevant to this phase. This grounds the discussion without interrogating.
74
+ **If knowledge exists:** Present a brief "What we know so far" summary — prior decisions, patterns, and pitfalls relevant to this phase.
74
75
 
75
76
  **If no knowledge files exist:** Skip silently (normal for first phase).
76
-
77
- Continue to check_existing.
78
77
  </step>
79
78
 
80
79
  <step name="check_existing">
@@ -98,75 +97,142 @@ What's next?
98
97
 
99
98
  Wait for user response.
100
99
 
101
- If "Update context": Load existing CONTEXT.md, continue to questioning
100
+ If "Update context": Load existing CONTEXT.md, continue to assess_and_research
102
101
  If "View existing": Read and display CONTEXT.md, then offer update/skip
103
102
  If "Skip": Exit workflow
104
103
 
105
104
  **If doesn't exist:**
106
- Continue to questioning.
105
+ Continue to assess_and_research.
107
106
  </step>
108
107
 
109
- <step name="questioning">
110
- **CRITICAL: ALL questions use AskUserQuestion. Never ask inline text questions.**
108
+ <!-- STAGE 2: BRIEFING + CONDITIONAL RESEARCH -->
109
+
110
+ <step name="assess_and_research">
111
+ Parse the requirements mapped to this phase from REQUIREMENTS.md and the phase description from ROADMAP.md.
112
+
113
+ **Assess whether product research would add value:**
111
114
 
112
- Present initial context from roadmap, then immediately use AskUserQuestion:
115
+ Research is valuable when the phase involves user-facing product decisions where competitor context, UX patterns, or audience expectations would inform better choices. Examples: UI layouts, user flows, feature scope, interaction patterns.
116
+
117
+ Research is NOT valuable for: backend infrastructure, data migrations, build tooling, refactoring, developer-facing work with no UX decisions.
118
+
119
+ **If research would add value:**
120
+
121
+ Use AskUserQuestion:
122
+ - header: "Research"
123
+ - question: "This phase involves product decisions where competitor and UX research could help. Want me to research how others handle this before we discuss?"
124
+ - options:
125
+ - "Research first" — Investigate competitors and UX patterns (~30s)
126
+ - "Skip research" — Discuss based on what we know
127
+
128
+ **If user selects "Research first":**
129
+
130
+ Spawn ms-product-researcher subagent via Task tool:
113
131
 
114
132
  ```
115
- Phase ${PHASE}: ${PHASE_NAME}
133
+ <product_context>
134
+ [Who It's For, Core Value, How It's Different from PROJECT.md]
135
+ </product_context>
136
+
137
+ <phase_requirements>
138
+ [Phase goal, description, mapped requirements from ROADMAP.md/REQUIREMENTS.md]
139
+ </phase_requirements>
116
140
 
117
- From the roadmap: ${PHASE_DESCRIPTION}
141
+ <research_focus>
142
+ [Specific product questions relevant to this phase — what would help the user decide?]
143
+ </research_focus>
118
144
  ```
119
145
 
120
- **1. Open:**
146
+ Store research findings for use in present_briefing and questioning steps.
121
147
 
122
- Use AskUserQuestion:
123
- - header: "Vision"
124
- - question: "How do you imagine this working?"
125
- - options: 2-3 interpretations based on the phase description + "Let me describe it"
148
+ **If user selects "Skip research" or research not valuable:**
149
+ Continue without research findings.
150
+ </step>
151
+
152
+ <step name="present_briefing">
153
+ Present a consolidated briefing that weaves together all loaded context.
154
+
155
+ ```
156
+ ## Phase ${PHASE}: ${PHASE_NAME}
126
157
 
127
- **2. Follow the thread:**
158
+ ### What This Phase Delivers
159
+ [Requirements mapped to this phase from REQUIREMENTS.md, or phase goal from ROADMAP.md if no requirements mapping]
128
160
 
129
- Based on their response, use AskUserQuestion:
130
- - header: "[Topic they mentioned]"
131
- - question: "You mentioned [X] — what would that look like?"
132
- - options: 2-3 interpretations + "Something else"
161
+ ### My Assumptions
162
+ - **Approach:** How Claude would tackle this
163
+ - **Scope:** What's included vs excluded
164
+ - **Risks/Dependencies:** Where Claude expects complexity or unknowns
133
165
 
134
- **3. Sharpen the core:**
166
+ [If research findings available:]
167
+ ### Industry Context
168
+ [Key findings from product research — competitor patterns, UX conventions, audience expectations. Dense, prescriptive summary.]
169
+ ```
135
170
 
136
- Use AskUserQuestion with multiSelect: true:
137
- - header: "Essential"
138
- - question: "What's most important to nail in this phase? Select all that apply."
139
- - options: Key aspects they've mentioned
171
+ Then use AskUserQuestion:
172
+ - header: "Assumptions"
173
+ - question: "Are these assumptions on track? Anything I'm getting wrong or missing?"
174
+ - options:
175
+ - "Looks right" — Assumptions are accurate, let's continue
176
+ - "Some corrections" — I have specific corrections
177
+ - "Way off" — Let me reframe this
140
178
 
141
- **4. Capture specifics (optional):**
179
+ **If "Some corrections" or "Way off":** Receive corrections, acknowledge, update understanding. Then continue to questioning.
180
+ **If "Looks right":** Continue to questioning.
181
+ </step>
142
182
 
143
- If they seem to have specific ideas, use AskUserQuestion:
144
- - header: "Specifics"
145
- - question: "Any particular look/feel/behavior in mind?"
146
- - options: Contextual options based on what they've said + "No specifics" + "Let me describe"
183
+ <!-- STAGE 3: INFORMED DISCUSSION -->
147
184
 
148
- CRITICAL — What NOT to ask:
185
+ <step name="questioning">
186
+ **ALL questions use AskUserQuestion. Never ask inline text questions.**
187
+
188
+ What NOT to ask — the user doesn't know and shouldn't be asked about:
149
189
  - Technical risks (you figure those out)
150
190
  - Codebase patterns (you read the code)
151
191
  - Success metrics (too corporate)
152
192
  - Constraints they didn't mention (don't interrogate)
153
193
  - What's out of scope (implicit from roadmap)
154
194
 
155
- **5. Decision gate:**
195
+ **Scope guardrail:** Phase boundary from ROADMAP.md is FIXED. Discussion clarifies HOW to implement, not WHETHER to add more. If user suggests new capabilities: "That sounds like its own phase. I'll note it in Deferred Ideas."
196
+
197
+ **Product lens:** Before each question, show brief analysis — audience needs, competitor patterns (from research if available), tradeoffs and recommendation. This grounds the user's decision.
198
+
199
+ **1. Open:**
200
+
201
+ Present brief product analysis, then use AskUserQuestion:
202
+ - header: "Vision"
203
+ - question: "How do you imagine this working?"
204
+ - options: 2-3 interpretations based on phase description, requirements, and industry context + "Let me describe it"
205
+
206
+ **2. Follow the thread (2-4 rounds typical):**
207
+
208
+ Follow the user's thread. Each round: apply product lens to the topic they raised, then AskUserQuestion with 2-3 interpretations + escape hatch. Use multiSelect for priority/essential questions. Stop when vision is clear — don't over-question.
209
+
210
+ **3. Decision gate:**
211
+
212
+ Present a coverage summary before offering to finalize:
213
+
214
+ ```
215
+ ### Coverage Summary
216
+ **Discussed:** [Topics covered during this conversation]
217
+ **From artifacts:** [Context loaded from PROJECT.md, REQUIREMENTS.md, research]
218
+ **Open areas:** [Anything from the requirements/roadmap not yet discussed — or "None" if comprehensive]
219
+ ```
156
220
 
157
221
  Use AskUserQuestion:
158
222
  - header: "Ready?"
159
223
  - question: "Ready to capture this context, or explore more?"
160
224
  - options (ALL THREE REQUIRED):
161
- - "Create CONTEXT.md" - I've shared my vision
162
- - "Ask more questions" - Help me think through this more
163
- - "Let me add context" - I have more to share
225
+ - "Create CONTEXT.md" I've shared my vision
226
+ - "Ask more questions" Help me think through this more
227
+ - "Let me add context" I have more to share
164
228
 
165
229
  If "Ask more questions" → return to step 2 with new probes.
166
230
  If "Let me add context" → receive input → return to step 2.
167
231
  Loop until "Create CONTEXT.md" selected.
168
232
  </step>
169
233
 
234
+ <!-- STAGE 4: OUTPUT -->
235
+
170
236
  <step name="write_context">
171
237
  Create CONTEXT.md capturing the user's vision and decisions.
172
238
 
@@ -188,15 +254,10 @@ Populate template sections:
188
254
  - `<notes>`: Any other context gathered
189
255
 
190
256
  **Decision context (for downstream agents):**
191
- - `<decisions>`: Concrete choices made during discussion (locked)
257
+ - `<decisions>`: Concrete choices made during discussion (locked). Include inline reasoning grounded in vision, audience, competitor patterns, or tradeoff analysis: `- [Decision] — [Why: reasoning]`
192
258
  - `### Claude's Discretion`: Areas where user said "you decide" or didn't express preference
193
259
  - `<deferred>`: Ideas mentioned but explicitly out of scope
194
260
 
195
- **Scope guardrail:**
196
- - Phase boundary from ROADMAP.md is FIXED
197
- - Discussion clarifies HOW to implement, not WHETHER to add more
198
- - If user suggests new capabilities: "That sounds like its own phase. I'll note it in Deferred Ideas."
199
-
200
261
  Do NOT populate with your own technical analysis. That comes during research/planning.
201
262
 
202
263
  Write file.
@@ -254,12 +315,23 @@ EOF
254
315
  Confirm: "Committed: docs(${PHASE}): capture phase context"
255
316
  </step>
256
317
 
318
+ <step name="show_prework_status">
319
+ Read `~/.claude/mindsystem/references/prework-status.md` and present what's done vs still needed for this phase.
320
+ </step>
321
+
322
+ <step name="update_state">
323
+ Update `.planning/STATE.md` Last Command field:
324
+
325
+ Format: `Last Command: ms:discuss-phase ${PHASE} | YYYY-MM-DD HH:MM`
326
+ </step>
327
+
257
328
  </process>
258
329
 
259
330
  <success_criteria>
260
331
 
261
- - Vision gathered through collaborative thinking (not interrogation)
262
- - User's imagination captured: how it works, what's essential
332
+ - Assumptions surfaced and validated with user before deep questioning
333
+ - Product research offered for user-facing phases (skipped silently for infra/backend)
334
+ - Vision gathered through product-informed collaborative thinking (not interrogation)
335
+ - CONTEXT.md captures: vision, essentials, and decisions with inline reasoning
263
336
  - User knows next steps (typically: research or plan the phase)
264
- - CONTEXT.md committed to git
265
337
  </success_criteria>