mindsystem-cc 3.17.1 → 3.18.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 (37) hide show
  1. package/agents/ms-consolidator.md +4 -4
  2. package/agents/ms-debugger.md +3 -3
  3. package/agents/ms-designer.md +33 -70
  4. package/agents/ms-executor.md +7 -6
  5. package/agents/ms-plan-writer.md +52 -26
  6. package/agents/ms-researcher.md +13 -13
  7. package/commands/ms/check-phase.md +1 -1
  8. package/commands/ms/complete-milestone.md +47 -54
  9. package/commands/ms/design-phase.md +33 -30
  10. package/commands/ms/review-design.md +106 -395
  11. package/mindsystem/references/principles.md +3 -3
  12. package/mindsystem/references/routing/next-phase-routing.md +1 -1
  13. package/mindsystem/references/scope-estimation.md +22 -35
  14. package/mindsystem/templates/design-iteration.md +13 -13
  15. package/mindsystem/templates/design.md +145 -327
  16. package/mindsystem/templates/knowledge.md +1 -1
  17. package/mindsystem/templates/milestone-archive.md +3 -3
  18. package/mindsystem/templates/phase-prompt.md +6 -7
  19. package/mindsystem/templates/research-subagent-prompt.md +2 -2
  20. package/mindsystem/templates/research.md +7 -7
  21. package/mindsystem/templates/roadmap.md +1 -1
  22. package/mindsystem/templates/verification-report.md +1 -1
  23. package/mindsystem/workflows/complete-milestone.md +52 -227
  24. package/mindsystem/workflows/discuss-phase.md +3 -3
  25. package/mindsystem/workflows/execute-plan.md +1 -1
  26. package/mindsystem/workflows/plan-phase.md +22 -50
  27. package/mindsystem/workflows/verify-phase.md +1 -1
  28. package/package.json +1 -1
  29. package/scripts/archive-milestone-files.sh +68 -0
  30. package/scripts/archive-milestone-phases.sh +138 -0
  31. package/scripts/gather-milestone-stats.sh +179 -0
  32. package/scripts/ms-lookup/ms_lookup/backends/context7.py +17 -5
  33. package/scripts/ms-lookup/ms_lookup/backends/perplexity.py +17 -3
  34. package/scripts/ms-lookup-wrapper.sh +1 -1
  35. package/scripts/scan-planning-context.py +186 -36
  36. package/scripts/validate-execution-order.sh +4 -5
  37. package/scripts/cleanup-phase-artifacts.sh +0 -68
@@ -72,7 +72,7 @@ src/
72
72
  **When to use:** [conditions]
73
73
  **Example:**
74
74
  ```typescript
75
- // [code example from Context7/official docs]
75
+ // [code example from official docs]
76
76
  ```
77
77
 
78
78
  ### Pattern 2: [Pattern Name]
@@ -131,19 +131,19 @@ Verified patterns from official sources:
131
131
 
132
132
  ### [Common Operation 1]
133
133
  ```typescript
134
- // Source: [Context7/official docs URL]
134
+ // Source: [official docs URL]
135
135
  [code]
136
136
  ```
137
137
 
138
138
  ### [Common Operation 2]
139
139
  ```typescript
140
- // Source: [Context7/official docs URL]
140
+ // Source: [official docs URL]
141
141
  [code]
142
142
  ```
143
143
 
144
144
  ### [Common Operation 3]
145
145
  ```typescript
146
- // Source: [Context7/official docs URL]
146
+ // Source: [official docs URL]
147
147
  [code]
148
148
  ```
149
149
  </code_examples>
@@ -185,7 +185,7 @@ Things that couldn't be fully resolved:
185
185
  ## Sources
186
186
 
187
187
  ### Primary (HIGH confidence)
188
- - [Context7 library ID] - [topics fetched]
188
+ - [ms-lookup docs library] - [topics fetched]
189
189
  - [Official docs URL] - [what was checked]
190
190
 
191
191
  ### Secondary (MEDIUM confidence)
@@ -479,10 +479,10 @@ function useVehicleControls(rigidBodyRef) {
479
479
  - Pitfalls: Performance, physics, feel
480
480
 
481
481
  **Confidence breakdown:**
482
- - Standard stack: HIGH - verified with Context7, widely used
482
+ - Standard stack: HIGH - verified with ms-lookup docs, widely used
483
483
  - Architecture: HIGH - from official examples
484
484
  - Pitfalls: HIGH - documented in discourse, verified in docs
485
- - Code examples: HIGH - from Context7/official sources
485
+ - Code examples: HIGH - from ms-lookup docs/official sources
486
486
 
487
487
  **Research date:** 2026-01-20
488
488
  **Valid until:** 2026-02-20 (30 days - R3F ecosystem stable)
@@ -123,7 +123,7 @@ Phases execute in numeric order: 2 → 2.1 → 2.2 → 3 → 3.1 → 4
123
123
  **Initial planning (v1.0):**
124
124
  - Phase count derived from actual work (not a target number)
125
125
  - Each phase delivers something coherent
126
- - Phases can have 1+ plans (split if >3 tasks or multiple subsystems)
126
+ - Phases can have 1+ plans (split if budget exceeds 45% or multiple subsystems)
127
127
  - Plans use naming: {phase}-{plan}-PLAN.md (e.g., 01-02-PLAN.md)
128
128
  - No time estimates (this isn't enterprise PM)
129
129
  - Progress table updated by execute workflow
@@ -180,7 +180,7 @@ None — all verifiable items checked programmatically.
180
180
  **Fix plan generation:**
181
181
  - Only generate if gaps_found
182
182
  - Group related fixes into single plans
183
- - Keep to 2-3 tasks per plan
183
+ - Budget-based grouping (weights within 45%)
184
184
  - Include verification task in each plan
185
185
 
186
186
  ---
@@ -1,8 +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, reorganizes ROADMAP.md with milestone groupings, and tags the release in git.
4
-
5
- This is the ritual that separates "development" from "shipped."
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.
6
4
 
7
5
  </purpose>
8
6
 
@@ -22,25 +20,14 @@ This is the ritual that separates "development" from "shipped."
22
20
 
23
21
  When a milestone completes, this workflow:
24
22
 
25
- 1. Cleans up raw phase artifacts (CONTEXT, DESIGN, RESEARCH, SUMMARY, UAT, VERIFICATION, EXECUTION-ORDER deleted)
26
- 2. Creates `.planning/milestones/v[X.Y]/` directory for all archive files
27
- 3. Extracts full milestone details to `.planning/milestones/v[X.Y]/ROADMAP.md`
28
- 4. Archives requirements to `.planning/milestones/v[X.Y]/REQUIREMENTS.md`
29
- 5. Archives milestone context to `.planning/milestones/v[X.Y]/CONTEXT.md`
30
- 6. Archives research files to `.planning/milestones/v[X.Y]/research/` (if exists)
31
- 7. Updates ROADMAP.md to replace milestone details with one-line summary
32
- 8. Deletes REQUIREMENTS.md (fresh one created for next milestone)
33
- 9. Performs full PROJECT.md evolution review
34
- 10. Routes to `/ms:new-milestone` for next milestone
35
-
36
- Knowledge files in `.planning/knowledge/` persist across milestones (maintained by phase-level consolidation in execute-phase).
37
-
38
- **Context Efficiency:**
39
-
40
- - Completed milestones: One line each (~50 tokens)
41
- - Full details: In archive files (loaded only when needed)
42
- - Result: ROADMAP.md stays constant size forever
43
- - Result: REQUIREMENTS.md is always milestone-scoped (not cumulative)
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`
26
+ 4. Archives milestone files via script (audit, context, research — whichever exist)
27
+ 5. Consolidates phase summaries, deletes artifacts, moves phase dirs via script
28
+ 6. Deletes REQUIREMENTS.md (fresh one created for next milestone)
29
+ 7. Performs full PROJECT.md evolution review
30
+ 8. Routes to `/ms:new-milestone` for next milestone
44
31
 
45
32
  **Archive Format:**
46
33
 
@@ -49,6 +36,10 @@ Knowledge files in `.planning/knowledge/` persist across milestones (maintained
49
36
  - Full phase details from roadmap
50
37
  - Milestone summary (decisions, issues, technical debt)
51
38
 
39
+ **PHASE-SUMMARIES** consolidates all `*-SUMMARY.md` files from phase directories, organized by phase and plan, before artifacts are deleted.
40
+
41
+ **phases/** contains the phase directories themselves (with remaining files like `.patch`, `mockups/`) moved from `.planning/phases/`.
42
+
52
43
  **REQUIREMENTS archive** contains:
53
44
  - All v1 requirements marked complete with outcomes
54
45
  - Traceability table with final status
@@ -60,32 +51,10 @@ Knowledge files in `.planning/knowledge/` persist across milestones (maintained
60
51
 
61
52
  <step name="verify_readiness">
62
53
 
63
- Check if milestone is truly complete:
54
+ Read roadmap to determine milestone phase range (`PHASE_START`, `PHASE_END`) for the stats script:
64
55
 
65
56
  ```bash
66
57
  cat .planning/ROADMAP.md
67
- ls .planning/phases/*/SUMMARY.md 2>/dev/null | wc -l
68
- ```
69
-
70
- **Questions to ask:**
71
-
72
- - Which phases belong to this milestone?
73
- - Are all those phases complete (all plans have summaries)?
74
- - Has the work been tested/validated?
75
- - Is this ready to ship/tag?
76
-
77
- Present:
78
-
79
- ```
80
- Milestone: [Name from user, e.g., "v1.0 MVP"]
81
-
82
- Appears to include:
83
- - Phase 1: Foundation (2/2 plans complete)
84
- - Phase 2: Authentication (2/2 plans complete)
85
- - Phase 3: Core Features (3/3 plans complete)
86
- - Phase 4: Polish (1/1 plan complete)
87
-
88
- Total: 4 phases, 8 plans, all complete
89
58
  ```
90
59
 
91
60
  <config-check>
@@ -96,74 +65,30 @@ cat .planning/config.json 2>/dev/null
96
65
 
97
66
  </config-check>
98
67
 
99
- ```
100
- ⚡ Auto-approved: Milestone scope verification
101
-
102
- [Show breakdown summary without prompting]
103
-
104
- Proceeding to stats gathering...
105
- ```
106
-
107
- Proceed directly to cleanup_artifacts step.
108
-
109
- </step>
110
-
111
- <step name="cleanup_artifacts">
112
-
113
- Delete remaining raw artifacts from phase directories. Knowledge files are already current from phase-level consolidation in execute-phase — no consolidation or learnings extraction needed.
68
+ Run the stats script to get readiness status and git statistics:
114
69
 
115
70
  ```bash
116
- ~/.claude/mindsystem/scripts/cleanup-phase-artifacts.sh $PHASE_START $PHASE_END
71
+ ~/.claude/mindsystem/scripts/gather-milestone-stats.sh $PHASE_START $PHASE_END
117
72
  ```
118
73
 
119
- Knowledge files in `.planning/knowledge/` persist (they ARE the milestone's knowledge output).
120
-
121
- **Present cleanup summary:**
122
-
123
- ```
124
- Raw artifacts cleaned from phase directories
125
- Knowledge files persist in .planning/knowledge/
126
- ```
127
-
128
- Continue to gather_stats step.
129
-
130
- </step>
74
+ The script outputs:
75
+ - **Readiness:** Phase/plan counts, completeness, list of incomplete plans
76
+ - **Git Stats:** Commit range, timeline, diff stats
131
77
 
132
- <step name="gather_stats">
78
+ If status is NOT READY, stop and report which plans are incomplete.
133
79
 
134
- Calculate milestone statistics:
80
+ If status is READY, present the combined output:
135
81
 
136
- ```bash
137
- # Count phases and plans in milestone
138
- # (user specified or detected from roadmap)
139
-
140
- # Find git range
141
- git log --oneline --grep="feat(" | head -20
142
-
143
- # Count files modified in range
144
- git diff --stat FIRST_COMMIT..LAST_COMMIT | tail -1
145
-
146
- # Count LOC (adapt to language)
147
- find . -name "*.swift" -o -name "*.ts" -o -name "*.py" | xargs wc -l 2>/dev/null
148
-
149
- # Calculate timeline
150
- git log --format="%ai" FIRST_COMMIT | tail -1 # Start date
151
- git log --format="%ai" LAST_COMMIT | head -1 # End date
152
82
  ```
83
+ ⚡ Auto-approved: Milestone scope verification
153
84
 
154
- Present summary:
155
-
156
- ```
157
- Milestone Stats:
158
- - Phases: [X-Y]
159
- - Plans: [Z] total
160
- - Tasks: [N] total (estimated from phase summaries)
161
- - Files modified: [M]
162
- - Lines of code: [LOC] [language]
163
- - Timeline: [Days] days ([Start] → [End])
164
- - Git range: feat(XX-XX) → feat(YY-YY)
85
+ Milestone: [Name from ROADMAP.md]
86
+ [Script readiness output — phases, plans, completeness]
87
+ [Script git stats — range, timeline, changes]
165
88
  ```
166
89
 
90
+ Proceed directly to extract_accomplishments step.
91
+
167
92
  </step>
168
93
 
169
94
  <step name="extract_accomplishments">
@@ -378,52 +303,6 @@ Initial user testing showed demand for shape tools.
378
303
 
379
304
  </step>
380
305
 
381
- <step name="reorganize_roadmap">
382
-
383
- Update `.planning/ROADMAP.md` to group completed milestone phases.
384
-
385
- Add milestone headers and collapse completed work:
386
-
387
- ```markdown
388
- # Roadmap: [Project Name]
389
-
390
- ## Milestones
391
-
392
- - ✅ **v1.0 MVP** — Phases 1-4 (shipped YYYY-MM-DD)
393
- - 🚧 **v1.1 Security** — Phases 5-6 (in progress)
394
- - 📋 **v2.0 Redesign** — Phases 7-10 (planned)
395
-
396
- ## Phases
397
-
398
- <details>
399
- <summary>✅ v1.0 MVP (Phases 1-4) — SHIPPED YYYY-MM-DD</summary>
400
-
401
- - [x] Phase 1: Foundation (2/2 plans) — completed YYYY-MM-DD
402
- - [x] Phase 2: Authentication (2/2 plans) — completed YYYY-MM-DD
403
- - [x] Phase 3: Core Features (3/3 plans) — completed YYYY-MM-DD
404
- - [x] Phase 4: Polish (1/1 plan) — completed YYYY-MM-DD
405
-
406
- </details>
407
-
408
- ### 🚧 v[Next] [Name] (In Progress / Planned)
409
-
410
- - [ ] Phase 5: [Name] ([N] plans)
411
- - [ ] Phase 6: [Name] ([N] plans)
412
-
413
- ## Progress
414
-
415
- | Phase | Milestone | Plans Complete | Status | Completed |
416
- | ----------------- | --------- | -------------- | ----------- | ---------- |
417
- | 1. Foundation | v1.0 | 2/2 | Complete | YYYY-MM-DD |
418
- | 2. Authentication | v1.0 | 2/2 | Complete | YYYY-MM-DD |
419
- | 3. Core Features | v1.0 | 3/3 | Complete | YYYY-MM-DD |
420
- | 4. Polish | v1.0 | 1/1 | Complete | YYYY-MM-DD |
421
- | 5. Security Audit | v1.1 | 0/1 | Not started | - |
422
- | 6. Hardening | v1.1 | 0/2 | Not started | - |
423
- ```
424
-
425
- </step>
426
-
427
306
  <step name="archive_milestone">
428
307
 
429
308
  Extract completed milestone details and create archive file.
@@ -478,7 +357,7 @@ Extract completed milestone details and create archive file.
478
357
  ✅ ROADMAP.md deleted (fresh one for next milestone)
479
358
  ```
480
359
 
481
- **Note:** Phase directories (`.planning/phases/`) are NOT deleted. They accumulate across milestones as the raw execution history. Phase numbering continues (v1.0 phases 1-4, v1.1 phases 5-8, etc.).
360
+ **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.).
482
361
 
483
362
  </step>
484
363
 
@@ -545,55 +424,43 @@ Archive requirements and prepare for fresh requirements in next milestone.
545
424
 
546
425
  </step>
547
426
 
548
- <step name="archive_audit">
427
+ <step name="archive_milestone_files">
549
428
 
550
- Move the milestone audit file to the archive (if it exists):
429
+ Archive optional milestone files (audit, context, research) to the milestone directory:
551
430
 
552
431
  ```bash
553
- # Move audit to milestone folder (if exists)
554
- [ -f .planning/v[X.Y]-MILESTONE-AUDIT.md ] && mv .planning/v[X.Y]-MILESTONE-AUDIT.md .planning/milestones/v[X.Y]/MILESTONE-AUDIT.md
432
+ ~/.claude/mindsystem/scripts/archive-milestone-files.sh v[X.Y]
555
433
  ```
556
434
 
557
- Confirm:
558
- ```
559
- ✅ Audit archived to milestones/v[X.Y]/MILESTONE-AUDIT.md
560
- ```
561
-
562
- (Skip silently if no audit file exists — audit is optional)
435
+ The script moves whichever files exist and reports what was archived. Files that don't exist are skipped silently.
563
436
 
564
437
  </step>
565
438
 
566
- <step name="archive_context">
439
+ <step name="archive_and_cleanup_phases">
567
440
 
568
- Archive the milestone context file (if it exists):
441
+ 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.
569
442
 
570
443
  ```bash
571
- [ -f .planning/MILESTONE-CONTEXT.md ] && mv .planning/MILESTONE-CONTEXT.md .planning/milestones/v[X.Y]/CONTEXT.md
572
- ```
573
-
574
- If archived:
575
- ```
576
- ✅ Context archived to milestones/v[X.Y]/CONTEXT.md
444
+ ~/.claude/mindsystem/scripts/archive-milestone-phases.sh $PHASE_START $PHASE_END v[X.Y]
577
445
  ```
578
446
 
579
- (Skip silently if no context file exists)
580
-
581
- </step>
582
-
583
- <step name="archive_research">
584
-
585
- Archive research files to milestone (if research directory exists):
447
+ Verify archive:
586
448
 
587
449
  ```bash
588
- [ -d .planning/research ] && mv .planning/research .planning/milestones/v[X.Y]/research
450
+ ls .planning/milestones/v[X.Y]/PHASE-SUMMARIES.md
451
+ ls .planning/milestones/v[X.Y]/phases/
589
452
  ```
590
453
 
591
- If archived:
454
+ Present:
455
+
592
456
  ```
593
- Research archived to milestones/v[X.Y]/research/
457
+ Phase summaries consolidated to milestones/v[X.Y]/PHASE-SUMMARIES.md
458
+ ✅ Raw artifacts deleted from phase directories
459
+ ✅ Phase directories moved to milestones/v[X.Y]/phases/
460
+ ✅ .planning/phases/ clean for next milestone
594
461
  ```
595
462
 
596
- (Skip silently if no research directory exists)
463
+ Knowledge files in `.planning/knowledge/` persist (they ARE the milestone's knowledge output).
597
464
 
598
465
  </step>
599
466
 
@@ -686,12 +553,15 @@ chore: complete v[X.Y] milestone
686
553
  Archived to milestones/v[X.Y]/:
687
554
  - ROADMAP.md
688
555
  - REQUIREMENTS.md
556
+ - PHASE-SUMMARIES.md (consolidated from phase directories)
557
+ - phases/ (phase directories moved from .planning/phases/)
689
558
  - MILESTONE-AUDIT.md (if audit was run)
690
559
  - CONTEXT.md (if milestone context existed)
691
560
  - research/ (if research existed)
692
561
 
693
562
  Cleaned:
694
- - Raw phase artifacts (CONTEXT, DESIGN, RESEARCH, SUMMARY, UAT, VERIFICATION, EXECUTION-ORDER)
563
+ - Raw phase artifacts deleted (CONTEXT, DESIGN, RESEARCH, SUMMARY, UAT, VERIFICATION, EXECUTION-ORDER)
564
+ - Phase directories moved to milestone archive
695
565
  - Knowledge files persist in .planning/knowledge/
696
566
 
697
567
  Deleted (fresh for next milestone):
@@ -752,62 +622,17 @@ Tag: v[X.Y]
752
622
 
753
623
  </process>
754
624
 
755
- <milestone_naming>
756
-
757
- **Version conventions:**
758
- - **v1.0** — Initial MVP
759
- - **v1.1, v1.2, v1.3** — Minor updates, new features, fixes
760
- - **v2.0, v3.0** — Major rewrites, breaking changes, significant new direction
761
-
762
- **Name conventions:**
763
- - v1.0 MVP
764
- - v1.1 Security
765
- - v1.2 Performance
766
- - v2.0 Redesign
767
- - v2.0 iOS Launch
768
-
769
- Keep names short (1-2 words describing the focus).
770
-
771
- </milestone_naming>
772
-
773
- <what_qualifies>
774
-
775
- **Create milestones for:**
776
- - Initial release (v1.0)
777
- - Public releases
778
- - Major feature sets shipped
779
- - Before archiving planning
780
-
781
- **Don't create milestones for:**
782
- - Every phase completion (too granular)
783
- - Work in progress (wait until shipped)
784
- - Internal dev iterations (unless truly shipped internally)
785
-
786
- If uncertain, ask: "Is this deployed/usable/shipped in some form?"
787
- If yes → milestone. If no → keep working.
788
-
789
- </what_qualifies>
790
-
791
625
  <success_criteria>
792
626
 
793
- Milestone completion is successful when:
627
+ Milestone completion is successful when (ordered by skip risk):
794
628
 
795
- - [ ] Raw artifacts cleaned from phase directories (CONTEXT, DESIGN, RESEARCH, SUMMARY, UAT, VERIFICATION, EXECUTION-ORDER)
796
- - [ ] Knowledge files persist in .planning/knowledge/
797
- - [ ] MILESTONES.md entry created with stats and accomplishments
798
- - [ ] PROJECT.md full evolution review completed
629
+ - [ ] PROJECT.md full evolution review completed (What This Is, Core Value, Requirements, Key Decisions, Context)
799
630
  - [ ] All shipped requirements moved to Validated in PROJECT.md
800
631
  - [ ] Key Decisions updated with outcomes
801
- - [ ] ROADMAP.md reorganized with milestone grouping
802
- - [ ] Milestone directory created (milestones/v[X.Y]/)
632
+ - [ ] MILESTONES.md entry created with stats and accomplishments
803
633
  - [ ] Roadmap archive created (milestones/v[X.Y]/ROADMAP.md)
804
634
  - [ ] Requirements archive created (milestones/v[X.Y]/REQUIREMENTS.md)
805
- - [ ] Research archived to milestone (milestones/v[X.Y]/research/) if .planning/research/ existed
806
635
  - [ ] REQUIREMENTS.md deleted (fresh for next milestone)
807
636
  - [ ] STATE.md updated with fresh project reference
808
- - [ ] Git tag created (v[X.Y])
809
- - [ ] Milestone commit made (includes archive files and deletion)
810
- - [ ] Context archive created if MILESTONE-CONTEXT.md existed
811
- - [ ] User knows next steps (starting with /ms:new-milestone)
812
637
 
813
638
  </success_criteria>
@@ -133,10 +133,10 @@ Based on their response, use AskUserQuestion:
133
133
 
134
134
  **3. Sharpen the core:**
135
135
 
136
- Use AskUserQuestion:
136
+ Use AskUserQuestion with multiSelect: true:
137
137
  - header: "Essential"
138
- - question: "What's the most important part of this phase?"
139
- - options: Key aspects they've mentioned + "All equally important" + "Something else"
138
+ - question: "What's most important to nail in this phase? Select all that apply."
139
+ - options: Key aspects they've mentioned
140
140
 
141
141
  **4. Capture specifics (optional):**
142
142
 
@@ -38,7 +38,7 @@ Parse plan sections:
38
38
 
39
39
  **If plan references CONTEXT.md:** The CONTEXT.md file provides the user's vision for this phase — how they imagine it working, what's essential, and what's out of scope. Honor this context throughout execution.
40
40
 
41
- **If plan references DESIGN.md:** The DESIGN.md provides visual/UX specifications — exact colors (hex), spacing (px), component states, and layouts. Use exact values from the spec, implement all component states, match wireframe layouts, include DESIGN.md verification criteria in task verification.
41
+ **If plan references DESIGN.md:** The DESIGN.md provides visual/UX specifications — Design Tokens table (hex colors, px spacing, font weights), inline wireframe annotations, per-screen States tables, Behavior notes, and Hints. Use exact token values, match wireframe layouts, implement all states. Derive verification criteria from token values, states, and behavior specs.
42
42
 
43
43
  **If `**Type:** tdd`:** Read `~/.claude/mindsystem/references/tdd-execution.md` for RED-GREEN-REFACTOR execution flow.
44
44
  </step>
@@ -283,49 +283,15 @@ uv run ~/.claude/mindsystem/scripts/scan-planning-context.py \
283
283
  ${SUBSYSTEM:+--subsystem "${SUBSYSTEM}"}
284
284
  ```
285
285
 
286
- **3. Parse JSON output.** Check `success` field. If the script fails or returns non-JSON, fall back to manual scanning (read SUMMARY frontmatter with sed as before). The scanner handles missing directories gracefully check `sources.*.skipped` for skip reasons.
286
+ The scanner outputs formatted markdown with sections for patterns, learnings,
287
+ summaries, knowledge files, and pending todos. Each section is omitted if empty.
288
+ If the script fails, fall back to manual scanning.
287
289
 
288
- **4. Present established patterns to user:**
290
+ **3. Conditionally read full summaries** — from "Summaries Needing Full Read" section, read each file. For "Other Relevant Summaries", read full body only if frontmatter context isn't sufficient (judgment).
289
291
 
290
- From `aggregated.patterns_established`, display:
292
+ **4. Read knowledge files** — from "Knowledge Files to Read" section, read each file.
291
293
 
292
- ```
293
- ### Established Patterns to Maintain
294
- - [Pattern: description] (from phase XX)
295
- ```
296
-
297
- If empty, skip.
298
-
299
- **5. Conditionally read full summaries.**
300
-
301
- Read full SUMMARY.md body ONLY for summaries where:
302
- - `relevance` is HIGH AND `has_readiness_warnings` is true
303
- - OR frontmatter alone doesn't provide enough context for task breakdown (use judgment)
304
-
305
- Extract from full reads: "Next Phase Readiness" warnings, "Issues Encountered", detailed accomplishments.
306
-
307
- Summaries scored MEDIUM or HIGH without readiness warnings → frontmatter data in JSON is sufficient (tech stack, patterns, key files, decisions already aggregated).
308
-
309
- **6. Present matched learnings:**
310
-
311
- **From `debug_learnings`** — present as warnings:
312
-
313
- ```
314
- ### Previous Debug Sessions in This Area
315
- - **{slug}** ({subsystem}): {root_cause} — Fix: {resolution}
316
- ```
317
-
318
- **From `adhoc_learnings`** — extract entries with non-empty `learnings` arrays for handoff context.
319
-
320
- If neither source has matches, skip.
321
-
322
- **7. Read knowledge files:**
323
-
324
- For each entry in `knowledge_files` where `matched` is true, read the full file. Knowledge files are prose (no frontmatter) so the LLM must read them to extract decisions, architecture, pitfalls.
325
-
326
- **8. Assess pending todos:**
327
-
328
- From `pending_todos` frontmatter in JSON, assess each todo's relevance. Read full body only for todos matching current phase subsystem/tags.
294
+ **5. Assess pending todos** — from "Pending Todos" section, assess relevance. Read full body for relevant ones.
329
295
 
330
296
  **From STATE.md:** Decisions → constrain approach. Pending todos → candidates. Blockers → may need to address.
331
297
 
@@ -337,13 +303,13 @@ From `pending_todos` frontmatter in JSON, assess each todo's relevance. Read ful
337
303
 
338
304
  **Track for handoff to ms-plan-writer:**
339
305
  - Which summaries were selected (for @context references)
340
- - Tech stack available (from `aggregated.tech_stack_added`)
341
- - Established patterns (from `aggregated.patterns_established`)
342
- - Key files to reference (from `aggregated.key_files_created` + `key_files_modified`)
343
- - Applicable decisions (from `aggregated.key_decisions` + full summary reads)
306
+ - Tech stack available (from formatted output)
307
+ - Established patterns (from formatted output)
308
+ - Key files to reference (from formatted output)
309
+ - Applicable decisions (from formatted output + full summary reads)
344
310
  - Todos being addressed (from pending todos)
345
311
  - Concerns being verified (from "Next Phase Readiness" in full reads)
346
- - Matched learnings (from `debug_learnings`, `adhoc_learnings`, patterns, knowledge files)
312
+ - Matched learnings (from formatted output + knowledge files)
347
313
  </step>
348
314
 
349
315
  <step name="gather_phase_context">
@@ -376,10 +342,10 @@ cat .planning/phases/XX-name/${PHASE}-DESIGN.md 2>/dev/null
376
342
  **If CONTEXT.md exists:** Honor vision, prioritize essential, respect boundaries, incorporate specifics. Track that CONTEXT.md exists for risk scoring.
377
343
 
378
344
  **If DESIGN.md exists:**
379
- - Tasks reference specific screens/components from design
380
- - Verification criteria include design verification items
345
+ - Tasks reference specific screens from design (wireframe + states + behavior + hints)
346
+ - Verification criteria inferred from States tables, Behavior notes, and token values
381
347
  - Must-Haves include design-specified observable behaviors
382
- - Task actions specify exact values (colors, spacing) from design
348
+ - Task actions specify exact values (colors, spacing) from Design Tokens table
383
349
 
384
350
  **If none exist:** Suggest /ms:research-phase for niche domains, /ms:discuss-phase for simpler domains, or proceed with roadmap only.
385
351
  </step>
@@ -517,7 +483,7 @@ Task(
517
483
  The subagent handles:
518
484
  - Building dependency graph from needs/creates
519
485
  - Assigning wave numbers
520
- - Grouping tasks into plans (2-3 changes per plan)
486
+ - Grouping tasks into plans (budget-based, ~45% cost target)
521
487
  - Deriving Must-Haves (goal-backward)
522
488
  - Estimating scope, splitting if needed
523
489
  - Writing PLAN.md files + EXECUTION-ORDER.md
@@ -559,6 +525,7 @@ Extract:
559
525
  - `plan_count`: Number of plans created
560
526
  - `wave_count`: Number of waves
561
527
  - `wave_structure`: Wave-to-plan mapping
528
+ - `grouping_rationale`: Optional table showing task weights and consolidation notes
562
529
  - `risk_score`: 0-100
563
530
  - `risk_tier`: "skip" | "optional" | "verify"
564
531
  - `risk_factors`: Top contributing factors
@@ -636,6 +603,11 @@ Wave 1 (parallel): {plan-01}, {plan-02}
636
603
  Wave 2: {plan-03}
637
604
  ...
638
605
 
606
+ {If grouping_rationale present, insert here:}
607
+
608
+ ## Grouping Notes
609
+ {grouping_rationale table from plan-writer}
610
+
639
611
  ---
640
612
 
641
613
  ## Next Up
@@ -690,7 +662,7 @@ Tasks are instructions for Claude, not Jira tickets.
690
662
  - [ ] PLAN file(s) created with pure markdown format
691
663
  - [ ] EXECUTION-ORDER.md created with wave groups
692
664
  - [ ] Each plan: Must-Haves section with observable truths
693
- - [ ] Each plan: 2-3 changes (~50% context)
665
+ - [ ] Each plan: budget-based grouping (target 25-45%, consolidate under 10%)
694
666
  - [ ] Wave structure maximizes parallelism
695
667
  - [ ] PLAN file(s) committed to git
696
668
  - [ ] Risk assessment presented (score + top factors)
@@ -532,7 +532,7 @@ Group related gaps into fix plans:
532
532
  ```
533
533
 
534
534
  3. **Keep plans focused:**
535
- - 2-3 tasks per plan
535
+ - Budget-based grouping (weights within 45%)
536
536
  - Single concern per plan
537
537
  - Include verification task
538
538
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mindsystem-cc",
3
- "version": "3.17.1",
3
+ "version": "3.18.1",
4
4
  "description": "A meta-prompting, context engineering and spec-driven development system for Claude Code by TÂCHES.",
5
5
  "bin": {
6
6
  "mindsystem-cc": "bin/install.js"