mindsystem-cc 3.21.0 → 3.22.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 (87) hide show
  1. package/README.md +4 -12
  2. package/agents/ms-debugger.md +196 -880
  3. package/agents/ms-plan-checker.md +30 -30
  4. package/agents/ms-plan-writer.md +1 -1
  5. package/agents/ms-product-researcher.md +4 -2
  6. package/agents/ms-verifier.md +25 -117
  7. package/commands/ms/add-phase.md +3 -4
  8. package/commands/ms/add-todo.md +3 -4
  9. package/commands/ms/adhoc.md +3 -4
  10. package/commands/ms/audit-milestone.md +4 -3
  11. package/commands/ms/complete-milestone.md +2 -2
  12. package/commands/ms/config.md +36 -9
  13. package/commands/ms/create-roadmap.md +3 -4
  14. package/commands/ms/debug.md +27 -28
  15. package/commands/ms/design-phase.md +8 -5
  16. package/commands/ms/discuss-phase.md +2 -2
  17. package/commands/ms/doctor.md +9 -6
  18. package/commands/ms/execute-phase.md +2 -5
  19. package/commands/ms/help.md +2 -2
  20. package/commands/ms/insert-phase.md +3 -4
  21. package/commands/ms/map-codebase.md +1 -2
  22. package/commands/ms/new-milestone.md +1 -3
  23. package/commands/ms/new-project.md +3 -5
  24. package/commands/ms/plan-milestone-gaps.md +3 -4
  25. package/commands/ms/plan-phase.md +2 -3
  26. package/commands/ms/progress.md +1 -0
  27. package/commands/ms/remove-phase.md +3 -4
  28. package/commands/ms/research-phase.md +4 -4
  29. package/commands/ms/research-project.md +9 -16
  30. package/commands/ms/review-design.md +4 -2
  31. package/commands/ms/verify-work.md +6 -8
  32. package/mindsystem/templates/config.json +2 -1
  33. package/mindsystem/templates/roadmap.md +1 -1
  34. package/mindsystem/templates/state.md +2 -2
  35. package/mindsystem/templates/verification-report.md +3 -26
  36. package/mindsystem/workflows/diagnose-issues.md +0 -1
  37. package/mindsystem/workflows/discuss-phase.md +7 -3
  38. package/mindsystem/workflows/execute-phase.md +2 -18
  39. package/mindsystem/workflows/map-codebase.md +6 -12
  40. package/mindsystem/workflows/mockup-generation.md +46 -22
  41. package/mindsystem/workflows/plan-phase.md +12 -5
  42. package/mindsystem/workflows/verify-work.md +96 -69
  43. package/package.json +1 -1
  44. package/scripts/__pycache__/ms-tools.cpython-314.pyc +0 -0
  45. package/scripts/__pycache__/test_ms_tools.cpython-314-pytest-9.0.2.pyc +0 -0
  46. package/scripts/ms-tools.py +751 -6
  47. package/scripts/test_ms_tools.py +786 -0
  48. package/skills/senior-review/AGENTS.md +531 -0
  49. package/skills/{flutter-senior-review → senior-review}/SKILL.md +47 -36
  50. package/skills/senior-review/principles/dependencies-api-boundary-design.md +32 -0
  51. package/skills/senior-review/principles/dependencies-data-not-flags.md +32 -0
  52. package/skills/senior-review/principles/dependencies-temporal-coupling.md +32 -0
  53. package/skills/senior-review/principles/pragmatism-consistent-error-handling.md +32 -0
  54. package/skills/senior-review/principles/pragmatism-speculative-generality.md +32 -0
  55. package/skills/senior-review/principles/state-invalid-states.md +33 -0
  56. package/skills/senior-review/principles/state-single-source-of-truth.md +32 -0
  57. package/skills/senior-review/principles/state-type-hierarchies.md +32 -0
  58. package/skills/senior-review/principles/structure-composition-over-config.md +32 -0
  59. package/skills/senior-review/principles/structure-feature-isolation.md +32 -0
  60. package/skills/senior-review/principles/structure-module-cohesion.md +32 -0
  61. package/agents/ms-flutter-code-quality.md +0 -169
  62. package/agents/ms-flutter-reviewer.md +0 -211
  63. package/agents/ms-flutter-simplifier.md +0 -79
  64. package/mindsystem/references/debugging/debugging-mindset.md +0 -11
  65. package/mindsystem/references/debugging/hypothesis-testing.md +0 -11
  66. package/mindsystem/references/debugging/investigation-techniques.md +0 -11
  67. package/mindsystem/references/debugging/verification-patterns.md +0 -11
  68. package/mindsystem/references/debugging/when-to-research.md +0 -11
  69. package/mindsystem/references/git-integration.md +0 -254
  70. package/mindsystem/references/verification-patterns.md +0 -595
  71. package/mindsystem/workflows/debug.md +0 -14
  72. package/mindsystem/workflows/verify-phase.md +0 -625
  73. package/skills/flutter-code-quality/SKILL.md +0 -143
  74. package/skills/flutter-code-simplification/SKILL.md +0 -102
  75. package/skills/flutter-senior-review/AGENTS.md +0 -869
  76. package/skills/flutter-senior-review/principles/dependencies-data-not-callbacks.md +0 -75
  77. package/skills/flutter-senior-review/principles/dependencies-provider-tree.md +0 -85
  78. package/skills/flutter-senior-review/principles/dependencies-temporal-coupling.md +0 -97
  79. package/skills/flutter-senior-review/principles/pragmatism-consistent-error-handling.md +0 -130
  80. package/skills/flutter-senior-review/principles/pragmatism-speculative-generality.md +0 -91
  81. package/skills/flutter-senior-review/principles/state-data-clumps.md +0 -64
  82. package/skills/flutter-senior-review/principles/state-invalid-states.md +0 -53
  83. package/skills/flutter-senior-review/principles/state-single-source-of-truth.md +0 -68
  84. package/skills/flutter-senior-review/principles/state-type-hierarchies.md +0 -75
  85. package/skills/flutter-senior-review/principles/structure-composition-over-config.md +0 -105
  86. package/skills/flutter-senior-review/principles/structure-shared-visual-patterns.md +0 -107
  87. package/skills/flutter-senior-review/principles/structure-wrapper-pattern.md +0 -90
@@ -274,34 +274,18 @@ grep "^status:" "$PHASE_DIR"/*-VERIFICATION.md | cut -d: -f2 | tr -d ' '
274
274
  | Status | Action |
275
275
  |--------|--------|
276
276
  | `passed` | Continue to code_review |
277
- | `human_needed` | Present items to user, get approval or feedback |
278
277
  | `gaps_found` | Present gap summary, offer `/ms:plan-phase {phase} --gaps` |
279
278
 
280
279
  **If passed:**
281
280
 
282
281
  Phase goal verified. Proceed to code_review.
283
282
 
284
- **If human_needed:**
283
+ If the verifier's return includes "Items Not Verified Programmatically" (uncertain > 0), surface that section to the user before proceeding:
285
284
 
286
285
  ```markdown
287
- ## Phase {X}: {Name} Human Verification Required
288
-
289
- All automated checks passed. {N} items need human testing:
290
-
291
- ### Human Verification Checklist
292
-
293
- {Extract from VERIFICATION.md human_verification section}
294
-
295
- ---
296
-
297
- **After testing:**
298
- - "approved" → continue to code_review
299
- - Report issues → will route to gap closure planning
286
+ **Note:** {N} items could not be verified by structural checks alone. Consider `/ms:verify-work {phase}` to validate these through UAT.
300
287
  ```
301
288
 
302
- If user approves → continue to code_review.
303
- If user reports issues → treat as gaps_found.
304
-
305
289
  **If gaps_found:**
306
290
 
307
291
  Present gaps and offer next command:
@@ -96,18 +96,12 @@ Write these documents to .planning/codebase/:
96
96
  - STACK.md - Languages, runtime, frameworks, dependencies, configuration
97
97
  - INTEGRATIONS.md - External APIs, databases, auth providers, webhooks
98
98
 
99
- After writing STACK.md, update config.json code_review fields with the appropriate agent names:
100
- 1. Read STACK.md to detect primary framework
101
- 2. Map framework to code review agent names:
102
- - Flutter/Dart:
103
- - adhoc: "ms-flutter-code-quality"
104
- - phase: "ms-flutter-code-quality"
105
- - milestone: "ms-flutter-reviewer"
106
- - All others (React, Next.js, Node, Swift, Kotlin, etc.):
107
- - adhoc: "ms-code-simplifier"
108
- - phase: "ms-code-simplifier"
109
- - milestone: (leave as null — runtime defaults to ms-flutter-reviewer)
110
- 3. If .planning/config.json exists: update all three code_review fields
99
+ After writing STACK.md, update config.json code_review fields with the default agent names:
100
+ 1. Default for all frameworks:
101
+ - adhoc: "ms-code-simplifier"
102
+ - phase: "ms-code-simplifier"
103
+ - milestone: null
104
+ 2. If .planning/config.json exists: update all three code_review fields
111
105
  If not: note the recommended code review agents for later config creation
112
106
 
113
107
  Explore thoroughly. Write documents directly using templates. Return confirmation only.
@@ -6,8 +6,6 @@ Called by design-phase command (step 4b) when user opts into mockup generation.
6
6
 
7
7
  <required_reading>
8
8
  @~/.claude/mindsystem/references/design-directions.md
9
- @~/.claude/mindsystem/templates/mockup-mobile.md (if mobile)
10
- @~/.claude/mindsystem/templates/mockup-web.md (if web)
11
9
  </required_reading>
12
10
 
13
11
  <process>
@@ -82,17 +80,18 @@ Extract the HTML scaffold from the `<template>` block.
82
80
  <step name="spawn_agents">
83
81
  ```bash
84
82
  PHASE_DIR=$(ls -d .planning/phases/${PHASE}-* 2>/dev/null | head -1)
83
+ # Assumes single match. If empty, phase directory is missing — stop and report.
85
84
  mkdir -p "${PHASE_DIR}/mockups"
86
85
  ```
87
86
 
88
87
  Spawn 3 ms-mockup-designer agents IN PARALLEL, each receiving:
89
- - `<product_context>` — From PROJECT.md
90
- - `<phase_context>` — From ROADMAP.md phase entry
91
- - `<design_direction>` — One of the 3 derived directions (name, philosophy, concrete choices)
92
- - `<platform>` — `mobile` or `web`
93
- - `<feature_grounding>` — The screen/feature being mocked
94
- - `<existing_aesthetic>` — Colors/fonts from project UI skill or codebase (if exists)
95
- - `<mockup_template>` — The HTML scaffold from the template file
88
+ - `<product_context>` — from PROJECT.md "What This Is" section
89
+ - `<phase_context>` — from ROADMAP.md phase entry
90
+ - `<design_direction>` — one of the 3 directions from `derive_directions` (name, philosophy, concrete choices)
91
+ - `<platform>` — `mobile` or `web` from `determine_platform`
92
+ - `<feature_grounding>` — screen/feature identified in `identify_primary_screen`
93
+ - `<existing_aesthetic>` — from project UI skill (`SKILL.md` with design tokens) if exists, else scan codebase theme/style files for colors and fonts. If greenfield, state "No existing aesthetic."
94
+ - `<mockup_template>` — HTML scaffold from `read_template`
96
95
  - Output path: `.planning/phases/{phase}-{slug}/mockups/variant-a.html` (b, c for others)
97
96
 
98
97
  ```
@@ -107,13 +106,24 @@ After all 3 agents return, run the comparison script to create the comparison pa
107
106
 
108
107
  ```bash
109
108
  ms-compare-mockups "${PHASE_DIR}/mockups"
110
- open "${PHASE_DIR}/mockups/comparison.html"
111
109
  ```
112
110
 
113
- Display summary:
111
+ Read the `open_mockups` config setting:
112
+
113
+ ```bash
114
+ OPEN_MOCKUPS=$(cat .planning/config.json 2>/dev/null | jq -r '.open_mockups // "auto"')
115
+ ```
116
+
117
+ Branch on the value:
118
+
119
+ - **`"auto"` (default):** Run `open "${PHASE_DIR}/mockups/comparison.html"`. Display summary with "comparison page opened in browser."
120
+ - **`"ask"`:** Display summary with "comparison page ready." Ask "Open mockup comparison in browser?" (Yes/No). If Yes, run `open`.
121
+ - **`"off"`:** Display summary with explicit comparison page path. No open.
122
+
123
+ **Summary template** (adapt first line per branch above):
114
124
 
115
125
  ```markdown
116
- 3 mockup variants generated — comparison page opened in browser.
126
+ 3 mockup variants generated — {status line from branch}.
117
127
 
118
128
  Individual variants for reference:
119
129
  - **A: {Direction A name}** — `.planning/phases/{phase}-{slug}/mockups/variant-a.html`
@@ -121,7 +131,7 @@ Individual variants for reference:
121
131
  - **C: {Direction C name}** — `.planning/phases/{phase}-{slug}/mockups/variant-c.html`
122
132
  ```
123
133
 
124
- Use AskUserQuestion:
134
+ **After displaying summary**, use AskUserQuestion:
125
135
  > "Which direction works best?"
126
136
  > 1. **A: {name}** — Use this direction
127
137
  > 2. **B: {name}** — Use this direction
@@ -145,15 +155,29 @@ Handle user response:
145
155
  </step>
146
156
 
147
157
  <step name="extract_specs">
148
- Read the chosen HTML file. Extract from the inline CSS:
149
- - Direction name and description (from the derived direction that was selected)
150
- - Color palette — `background`, `color`, CSS custom properties, repeated accent values
151
- - Layout structure — container arrangement (sidebar/topnav/stacked, grid/list)
152
- - Typography `font-size`, `font-weight`, `line-height` from headings and body
153
- - Spacing `padding`, `gap`, `margin` values used consistently
154
- - User preferences (any specific feedback from selection)
155
-
156
- Assemble into a `<mockup_direction>` block for ms-designer. See the `<mockup_direction>` template in `design-phase.md` step 5 for the expected format.
158
+ Read the chosen HTML file. Extract from the inline CSS and assemble into a `<mockup_direction>` block with this exact structure:
159
+
160
+ ```xml
161
+ <mockup_direction>
162
+ Direction: [chosen direction name]
163
+ Philosophy: [direction one-sentence philosophy]
164
+
165
+ Color palette:
166
+ [Extracted hex values background, text, accent, secondary from `background`, `color`, CSS custom properties, repeated accent values]
167
+
168
+ Layout structure:
169
+ [Container arrangement from CSS — sidebar/topnav/stacked, grid/list]
170
+
171
+ Typography:
172
+ [`font-size`, `font-weight`, `line-height` from headings and body]
173
+
174
+ Spacing:
175
+ [`padding`, `gap`, `margin` values used consistently]
176
+
177
+ User preferences:
178
+ [Any specific feedback from mockup selection — "I liked X but want Y changed"]
179
+ </mockup_direction>
180
+ ```
157
181
 
158
182
  Return this block to the design-phase orchestrator.
159
183
  </step>
@@ -447,9 +447,15 @@ Tasks: {task_ids} — {brief rationale}
447
447
  **Waves:** {wave structure}
448
448
  ```
449
449
 
450
- The user may adjust, merge, or split plans. Once confirmed (or if the user proceeds without objection), pass the proposed grouping to the plan-writer.
451
-
452
450
  **TDD plans are always standalone** — propose them as dedicated plans regardless of budget.
451
+
452
+ **Confirm via AskUserQuestion:**
453
+ - header: "Plan Structure"
454
+ - question: "Does this plan structure look good?"
455
+ - Options: "Looks good, proceed", "Adjust grouping"
456
+
457
+ **"Looks good, proceed":** Continue to discover_skills.
458
+ **"Adjust grouping":** User describes changes in free-text. Apply adjustments, re-present, and confirm again.
453
459
  </step>
454
460
 
455
461
  <step name="discover_skills">
@@ -462,9 +468,10 @@ After the user confirms the plan structure, check if project skills could improv
462
468
  - The domain of the tasks identified (UI patterns, API design, state management, etc.)
463
469
  - Keywords from RESEARCH.md or CONTEXT.md if they exist
464
470
 
465
- **If matches found:** Present via AskUserQuestion:
466
- - List each matching skill with its description
467
- - Always include an escape hatch option for the user to name skills manually or skip entirely
471
+ **If matches found:** Present via AskUserQuestion with `multiSelect: true`:
472
+ - Each matching skill is one option (label: skill name, description: what it provides)
473
+ - Always include a "None skip skill loading" option
474
+ - User selects which to load, skips, or types a skill name in the free-text field
468
475
 
469
476
  **If no matches:** Skip silently — no need to ask the user.
470
477
 
@@ -175,21 +175,27 @@ Each batch has: batch number, name, mock_type, and test list.
175
175
  </step>
176
176
 
177
177
  <step name="create_uat_file">
178
- **Create UAT file:**
178
+ **Create UAT file via ms-tools:**
179
+
180
+ Construct JSON from classified tests and batch data, pipe to `uat-init`:
179
181
 
180
182
  ```bash
181
- mkdir -p "$PHASE_DIR"
183
+ ms-tools uat-init $PHASE_NUMBER <<'EOF'
184
+ {"source":["XX-01-SUMMARY.md"],"tests":[{"name":"...","expected":"...","mock_required":false,"mock_type":null}],"batches":[{"name":"No Mocks","mock_type":null,"tests":[1,2]}]}
185
+ EOF
182
186
  ```
183
187
 
184
- Create file at `.planning/phases/XX-name/{phase}-UAT.md` following the template structure in context. Populate with classified tests and batch data from previous steps.
188
+ - `source`: list of SUMMARY.md filenames tested
189
+ - `tests`: array of `{name, expected, mock_required, mock_type}` from classification
190
+ - `batches`: array of `{name, mock_type, tests: [nums]}` from batch grouping
185
191
 
186
- Proceed to `execute_batch`.
192
+ stdout confirms path and counts. Proceed to `execute_batch`.
187
193
  </step>
188
194
 
189
195
  <step name="execute_batch">
190
196
  **Execute current batch:**
191
197
 
192
- Read current batch from UAT.md.
198
+ Read current batch from UAT.md (test descriptions needed for presenting to user).
193
199
 
194
200
  **1. Handle mock generation (if needed):**
195
201
 
@@ -198,7 +204,7 @@ If `mock_type` is not null AND different from previous batch:
198
204
  ```bash
199
205
  git checkout -- <mocked_files>
200
206
  ```
201
- - Clear `mocked_files` in frontmatter
207
+ - Clear mocked_files: `ms-tools uat-update $PHASE_NUMBER --session mocked_files=`
202
208
  - Go to `generate_mocks`
203
209
 
204
210
  If `mock_type` is null or same as previous:
@@ -314,11 +320,24 @@ For each question:
314
320
  | color, font, spacing, alignment, visual | cosmetic |
315
321
  | Default | major |
316
322
 
317
- **Update UAT.md after processing all responses in batch:**
318
- - Update each test's result
319
- - Update Progress counts
320
- - Update Batches section
321
- - Update timestamp
323
+ **Update UAT.md via ms-tools after processing each response:**
324
+
325
+ ```bash
326
+ # Pass:
327
+ ms-tools uat-update $PHASE_NUMBER --test N result=pass
328
+
329
+ # Blocked:
330
+ ms-tools uat-update $PHASE_NUMBER --test N result=blocked
331
+
332
+ # Skipped:
333
+ ms-tools uat-update $PHASE_NUMBER --test N result=skipped
334
+ echo '{"test":N,"name":"...","expected":"...","reason":"..."}' | ms-tools uat-update $PHASE_NUMBER --append-assumption
335
+
336
+ # Issue:
337
+ ms-tools uat-update $PHASE_NUMBER --test N result=issue reported="user description" severity=major fix_status=investigating retry_count=0
338
+ ```
339
+
340
+ Progress auto-recalculates on every `uat-update` call. No manual progress recalculation needed.
322
341
 
323
342
  **For each issue found:** Go to `investigate_issue` before processing next test.
324
343
  </step>
@@ -372,21 +391,31 @@ Use `mocked_files` list from UAT.md frontmatter.
372
391
  - Edit the file(s)
373
392
  - Test that fix compiles/runs
374
393
 
375
- **3. Commit with proper message:**
394
+ **3. Commit (amend on retry when safe):**
376
395
  ```bash
377
396
  git add [specific files]
378
- git commit -m "fix({phase}-uat): {description}"
397
+
398
+ # Check if this is a retry AND HEAD matches the test's previous fix_commit:
399
+ PREV_FIX=$(ms-tools uat-status $PHASE_NUMBER | python3 -c "import sys,json; d=json.load(sys.stdin); t=[x for x in d['fixing_tests'] if x['num']==N]; print(t[0].get('fix_commit','') if t else '')" 2>/dev/null)
400
+ HEAD_SHORT=$(git rev-parse --short HEAD)
401
+
402
+ if [ "$PREV_FIX" = "$HEAD_SHORT" ] && [ -n "$PREV_FIX" ]; then
403
+ git commit --amend --no-edit
404
+ else
405
+ git commit -m "fix({phase}-uat): {description}"
406
+ fi
379
407
  ```
380
408
 
381
- **4. Record in UAT.md:**
382
- - Update test: `fix_status: applied`, `fix_commit: {hash}`
383
- - Append to Fixes Applied section:
384
- ```yaml
385
- - commit: {hash}
386
- test: {N}
387
- description: "{what was fixed}"
388
- files: [{changed files}]
389
- ```
409
+ Safety: only amend if HEAD matches recorded fix_commit. If HEAD has moved (other fixes in between), create new commit.
410
+
411
+ **4. Record in UAT.md via ms-tools:**
412
+ ```bash
413
+ FIX_HASH=$(git rev-parse --short HEAD)
414
+ ms-tools uat-update $PHASE_NUMBER --test N fix_status=applied fix_commit=$FIX_HASH
415
+ echo '{"commit":"'$FIX_HASH'","test":N,"description":"what was fixed","files":["changed.ts"]}' | ms-tools uat-update $PHASE_NUMBER --append-fix
416
+ ```
417
+
418
+ `append-fix` updates in-place if a fix for the same test already exists (amend support).
390
419
 
391
420
  **5. Restore mocks:**
392
421
  ```bash
@@ -459,7 +488,7 @@ Mocks are stashed — working tree is clean.
459
488
  **3. Handle fixer return:**
460
489
 
461
490
  **If FIX COMPLETE:**
462
- - Update UAT.md with fix details
491
+ - Record fix via ms-tools (same as `apply_fix` step 4: `uat-update --test N` + `--append-fix`)
463
492
  - Restore mocks: `git stash pop`
464
493
  - Handle conflicts as in `apply_fix`
465
494
  - Request re-test
@@ -484,11 +513,15 @@ Mocks are stashed — working tree is clean.
484
513
  AskUserQuestion: Pass / Still broken / New issue.
485
514
 
486
515
  **If Pass:**
487
- - Update test: `result: pass`, `fix_status: verified`
516
+ ```bash
517
+ ms-tools uat-update $PHASE_NUMBER --test N result=pass fix_status=verified
518
+ ```
488
519
  - Continue to next issue or next batch
489
520
 
490
521
  **If Still broken (retry_count < 2):**
491
- - Increment `retry_count` in UAT.md test entry
522
+ ```bash
523
+ ms-tools uat-update $PHASE_NUMBER --test N retry_count=1
524
+ ```
492
525
  - Go back to `investigate_issue` with new context
493
526
 
494
527
  **If Still broken (retry_count >= 2):**
@@ -513,7 +546,12 @@ AskUserQuestion: Pass / Still broken / New issue.
513
546
  <step name="resume_from_file">
514
547
  **Resume testing from UAT file:**
515
548
 
516
- Read full UAT file.
549
+ Use `uat-status` for compact status determination:
550
+ ```bash
551
+ ms-tools uat-status $PHASE_NUMBER
552
+ ```
553
+
554
+ Returns JSON with: `status`, `current_batch`, `total_batches`, `progress`, `mocked_files`, `fixing_tests`, `pending_tests`, `blocked_tests`, `pre_work_stash`, `path`.
517
555
 
518
556
  Check `mocked_files` — if non-empty, verify mocks are still present:
519
557
  ```bash
@@ -522,19 +560,17 @@ git diff --name-only
522
560
  If mocked files have uncommitted changes, mocks are still active — continue.
523
561
  If mocked files are clean, mocks were lost — regenerate for current batch.
524
562
 
525
- Find current position:
526
- - current_batch
527
- - Tests with `[pending]` or `blocked` or `fixing` status
563
+ Read full UAT.md only if test descriptions needed (for re-presenting tests to user).
528
564
 
529
565
  Announce:
530
566
  ```
531
567
  Resuming: Phase {phase} UAT
532
- Batch: {current} of {total}
568
+ Batch: {current_batch} of {total_batches}
533
569
  Progress: {tested}/{total}
534
570
  Issues being fixed: {fixing count}
535
571
  ```
536
572
 
537
- If `fix_status: fixing` exists, go to `handle_retest` for that issue.
573
+ If `fixing_tests` is non-empty, go to `handle_retest` for that issue.
538
574
  Otherwise, go to `execute_batch`.
539
575
  </step>
540
576
 
@@ -548,17 +584,15 @@ If blocked tests exist AND no issues remain in `fixing` status:
548
584
  - Re-present the blocked tests via `present_tests`
549
585
  - Blocked tests were waiting on other issues to be fixed first
550
586
 
551
- **2. Update Batches section (when no blocked tests remain):**
587
+ **2. Update batch and session via ms-tools (when no blocked tests remain):**
552
588
 
553
- ```yaml
554
- ### Batch {N}: [Name]
555
- tests: [...]
556
- status: complete
557
- mock_type: [...]
558
- passed: {count}
559
- issues: {count}
589
+ ```bash
590
+ ms-tools uat-update $PHASE_NUMBER --batch N status=complete passed=X issues=Y
591
+ ms-tools uat-update $PHASE_NUMBER --session current_batch=N+1
560
592
  ```
561
593
 
594
+ The `--session current_batch=N` call auto-syncs the Current Batch section with the new batch's info.
595
+
562
596
  **If more batches remain:**
563
597
  - Increment current_batch
564
598
  - Check if next batch needs different mock_type
@@ -591,15 +625,12 @@ PRE_WORK_STASH=$(git stash list | grep "pre-verify-work" | head -1 | cut -d: -f1
591
625
  [ -n "$PRE_WORK_STASH" ] && git stash pop "$PRE_WORK_STASH"
592
626
  ```
593
627
 
594
- **4. Update UAT.md:**
595
- - status: complete
596
- - Clear current_batch, mocked_files
597
- - Final Progress counts
598
-
599
- **5. Commit UAT.md:**
628
+ **4. Update UAT.md and commit together with STATE.md:**
600
629
  ```bash
601
- git add ".planning/phases/XX-name/{phase}-UAT.md"
602
- git commit -m "test({phase}): complete UAT - {passed} passed, {fixed} fixed, {skipped} assumptions"
630
+ ms-tools uat-update $PHASE_NUMBER --session status=complete current_batch= mocked_files=
631
+ ms-tools set-last-command "ms:verify-work $ARGUMENTS"
632
+ git add "$PHASE_DIR/${PHASE}-UAT.md" .planning/STATE.md
633
+ git commit -m "test(${PHASE}): complete UAT - {passed} passed, {fixed} fixed, {skipped} assumptions"
603
634
  ```
604
635
 
605
636
  **5.5. Update knowledge pitfalls (lightweight):**
@@ -653,28 +684,24 @@ Check if more phases remain in ROADMAP.md:
653
684
  **Issue adds:** reported, severity, fix_status (investigating | applied | verified), fix_commit, retry_count
654
685
  **Skipped adds:** reason
655
686
 
656
- **Write UAT.md after:**
657
- - Each batch of responses processed
658
- - Each fix applied
659
- - Each re-test completed
660
- - Session complete
661
-
662
- | Section | Rule | When |
663
- |---------|------|------|
664
- | Frontmatter.status | OVERWRITE | Phase transitions |
665
- | Frontmatter.current_batch | OVERWRITE | Batch transitions |
666
- | Frontmatter.mocked_files | OVERWRITE | Mock generation/cleanup |
667
- | Frontmatter.pre_work_stash | OVERWRITE | Dirty tree handling |
668
- | Frontmatter.updated | OVERWRITE | Every write |
669
- | Progress | OVERWRITE | After each test result |
670
- | Current Batch | OVERWRITE | Batch transitions |
671
- | Tests.{N}.result | OVERWRITE | When user responds |
672
- | Tests.{N}.fix_status | OVERWRITE | During fix flow |
673
- | Tests.{N}.fix_commit | OVERWRITE | After fix committed |
674
- | Tests.{N}.retry_count | OVERWRITE | On re-test failure |
675
- | Fixes Applied | APPEND | After each fix committed |
676
- | Batches.{N}.status | OVERWRITE | Batch transitions |
677
- | Assumptions | APPEND | When test skipped |
687
+ **All UAT.md updates use ms-tools commands.** Never Read/Edit UAT.md manually for field updates.
688
+
689
+ | Trigger | Command |
690
+ |---------|---------|
691
+ | User responds to test | `ms-tools uat-update $PHASE --test N result=pass` |
692
+ | Issue found | `ms-tools uat-update $PHASE --test N result=issue severity=major fix_status=investigating retry_count=0` |
693
+ | Fix applied | `ms-tools uat-update $PHASE --test N fix_status=applied fix_commit=HASH` |
694
+ | Fix verified | `ms-tools uat-update $PHASE --test N result=pass fix_status=verified` |
695
+ | Re-test failed | `ms-tools uat-update $PHASE --test N retry_count=N` |
696
+ | Record fix | `echo '{"commit":"...","test":N,...}' \| ms-tools uat-update $PHASE --append-fix` |
697
+ | Test skipped | `ms-tools uat-update $PHASE --test N result=skipped` + `--append-assumption` |
698
+ | Batch complete | `ms-tools uat-update $PHASE --batch N status=complete passed=X issues=Y` |
699
+ | Batch transition | `ms-tools uat-update $PHASE --session current_batch=N` |
700
+ | Mock files changed | `ms-tools uat-update $PHASE --session mocked_files=a.dart,b.dart` |
701
+ | Session complete | `ms-tools uat-update $PHASE --session status=complete current_batch= mocked_files=` |
702
+ | Resume session | `ms-tools uat-status $PHASE` (read-only JSON) |
703
+
704
+ Progress auto-recalculates on every `uat-update` call. Timestamp auto-updates on every write.
678
705
  </update_rules>
679
706
 
680
707
  <severity_inference>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mindsystem-cc",
3
- "version": "3.21.0",
3
+ "version": "3.22.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"