mindsystem-cc 4.2.0 → 4.3.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 (37) hide show
  1. package/README.md +19 -1
  2. package/agents/ms-browser-verifier.md +95 -40
  3. package/agents/ms-compounder.md +2 -2
  4. package/agents/ms-researcher.md +2 -1
  5. package/agents/ms-roadmapper.md +33 -0
  6. package/commands/ms/add-todo.md +4 -4
  7. package/commands/ms/adhoc.md +2 -1
  8. package/commands/ms/audit-milestone.md +3 -2
  9. package/commands/ms/complete-milestone.md +2 -3
  10. package/commands/ms/compound.md +3 -3
  11. package/commands/ms/config.md +3 -4
  12. package/commands/ms/create-roadmap.md +25 -14
  13. package/commands/ms/design-phase.md +13 -14
  14. package/commands/ms/execute-phase.md +31 -10
  15. package/commands/ms/help.md +1 -0
  16. package/commands/ms/map-codebase.md +1 -2
  17. package/commands/ms/new-milestone.md +3 -7
  18. package/commands/ms/new-project.md +6 -9
  19. package/commands/ms/progress.md +8 -62
  20. package/commands/ms/remove-phase.md +2 -9
  21. package/commands/ms/research-milestone.md +3 -8
  22. package/commands/ms/research-phase.md +17 -17
  23. package/commands/ms/verify-work.md +8 -2
  24. package/mindsystem/references/browser-verification.md +76 -9
  25. package/mindsystem/references/prework-status.md +2 -1
  26. package/mindsystem/references/routing/next-phase-routing.md +6 -5
  27. package/mindsystem/workflows/adhoc.md +14 -15
  28. package/mindsystem/workflows/compound.md +28 -17
  29. package/mindsystem/workflows/define-requirements.md +2 -1
  30. package/mindsystem/workflows/discuss-phase.md +11 -32
  31. package/mindsystem/workflows/execute-phase.md +57 -13
  32. package/mindsystem/workflows/execute-plan.md +3 -1
  33. package/mindsystem/workflows/map-codebase.md +4 -1
  34. package/mindsystem/workflows/mockup-generation.md +3 -2
  35. package/mindsystem/workflows/verify-work.md +21 -2
  36. package/package.json +1 -1
  37. package/scripts/ms-tools.py +27 -4
@@ -80,8 +80,9 @@ cat .planning/knowledge/{subsystem}.md 2>/dev/null
80
80
  Check if CONTEXT.md already exists for this phase:
81
81
 
82
82
  ```bash
83
- ls .planning/phases/${PHASE}-*/CONTEXT.md 2>/dev/null
84
- ls .planning/phases/${PHASE}-*/${PHASE}-CONTEXT.md 2>/dev/null
83
+ ms-tools find-phase "${PHASE}"
84
+ # Extract PHASE_DIR from the `dir` field, PHASE from `phase` field (normalized, e.g. "02")
85
+ ls ${PHASE_DIR}/*CONTEXT.md 2>/dev/null
85
86
  ```
86
87
 
87
88
  **If exists:**
@@ -242,10 +243,10 @@ Create CONTEXT.md capturing the user's vision and decisions.
242
243
 
243
244
  Use template from ~/.claude/mindsystem/templates/context.md
244
245
 
245
- **File location:** `.planning/phases/${PHASE}-${SLUG}/${PHASE}-CONTEXT.md`
246
+ **File location:** `${PHASE_DIR}/${PHASE}-CONTEXT.md`
246
247
 
247
248
  **If phase directory doesn't exist yet:**
248
- Create it: `.planning/phases/${PHASE}-${SLUG}/`
249
+ Create it using normalized `${PHASE}` from find-phase output: `.planning/phases/${PHASE}-${SLUG}/`
249
250
 
250
251
  Use roadmap phase name for slug (lowercase, hyphens).
251
252
 
@@ -271,7 +272,7 @@ Write file.
271
272
  Present CONTEXT.md summary:
272
273
 
273
274
  ```
274
- Created: .planning/phases/${PHASE}-${SLUG}/${PHASE}-CONTEXT.md
275
+ Created: ${PHASE_DIR}/${PHASE}-CONTEXT.md
275
276
 
276
277
  ## Vision
277
278
  [How they imagine it working]
@@ -279,32 +280,18 @@ Created: .planning/phases/${PHASE}-${SLUG}/${PHASE}-CONTEXT.md
279
280
  ## Essential
280
281
  [What must be nailed]
281
282
 
282
- ---
283
-
284
- ## ▶ Next Up
285
-
286
- **Phase ${PHASE}: [Name]** — [Goal from ROADMAP.md]
287
-
288
- `/ms:plan-phase ${PHASE}`
289
-
290
- <sub>`/clear` first → fresh context window</sub>
291
-
292
- ---
293
-
294
- **Also available:**
295
- - `/ms:research-phase ${PHASE}` — investigate unknowns
296
- - Review/edit CONTEXT.md before continuing
297
-
298
283
  ---
299
284
  ```
300
285
 
301
286
  </step>
302
287
 
303
- <step name="git_commit">
304
- Commit phase context:
288
+ <step name="commit">
289
+
290
+ **Update state and commit:**
305
291
 
306
292
  ```bash
307
- git add .planning/phases/${PHASE}-${SLUG}/${PHASE}-CONTEXT.md
293
+ ms-tools set-last-command "ms:discuss-phase ${PHASE}"
294
+ git add ${PHASE_DIR}/${PHASE}-CONTEXT.md .planning/STATE.md
308
295
  git commit -m "$(cat <<'EOF'
309
296
  docs(${PHASE}): capture phase context
310
297
 
@@ -315,20 +302,12 @@ Phase ${PHASE}: ${PHASE_NAME}
315
302
  EOF
316
303
  )"
317
304
  ```
318
-
319
- Confirm: "Committed: docs(${PHASE}): capture phase context"
320
305
  </step>
321
306
 
322
307
  <step name="show_prework_status">
323
308
  Read `~/.claude/mindsystem/references/prework-status.md` and present what's done vs still needed for this phase.
324
309
  </step>
325
310
 
326
- <step name="update_state">
327
- ```bash
328
- ms-tools set-last-command "ms:discuss-phase ${PHASE}"
329
- ```
330
- </step>
331
-
332
311
  </process>
333
312
 
334
313
  <success_criteria>
@@ -39,11 +39,9 @@ Options:
39
39
  Confirm phase exists and has plans:
40
40
 
41
41
  ```bash
42
- PHASE_DIR=$(ls -d .planning/phases/${PHASE_ARG}* 2>/dev/null | head -1)
43
- if [ -z "$PHASE_DIR" ]; then
44
- echo "ERROR: No phase directory matching '${PHASE_ARG}'"
45
- exit 1
46
- fi
42
+ ms-tools find-phase "${PHASE_ARG}"
43
+ # Extract PHASE_DIR from the `dir` field of the JSON output
44
+ # If dir is null, error: "No phase directory matching '${PHASE_ARG}'"
47
45
 
48
46
  PLAN_COUNT=$(ls -1 "$PHASE_DIR"/*-PLAN.md 2>/dev/null | wc -l | tr -d ' ')
49
47
  if [ "$PLAN_COUNT" -eq 0 ]; then
@@ -300,11 +298,13 @@ ms-tools browser-check
300
298
 
301
299
  **If exit 0 (READY):**
302
300
 
303
- Read `~/.claude/mindsystem/references/browser-verification.md` and follow its Auth Flow and Spawn sections.
301
+ Ensure `$PHASE_DIR/*-SUMMARY.md` files are available (needed for checklist derivation — may already be in context from wave reports).
304
302
 
305
- After verifier returns, if fixes were made:
306
- - Report: "Browser verification: {N} issues found and fixed"
307
- - Include report summary in consolidator prompt (step `consolidate_knowledge`)
303
+ Read `~/.claude/mindsystem/references/browser-verification.md` and follow its sections in order:
304
+ 1. **Auth Flow** establish browser authentication
305
+ 2. **Derive Browser Checklist** transform SUMMARYs into visual checklist items
306
+ 3. **Spawn** — launch verifier with derived checklist
307
+ 4. **Post-Verifier Handling** — route by report status
308
308
 
309
309
  **If exit 1 (MISSING_DEPS):**
310
310
 
@@ -509,23 +509,67 @@ git commit -m "docs: update codebase map after phase {X}"
509
509
  <step name="offer_next">
510
510
  Present next steps based on milestone status.
511
511
 
512
+ **Thoroughness by default:** Verification is the natural next step after execution. The user can skip, but the system always suggests it first.
513
+
512
514
  **First, surface user actions:**
513
515
 
514
516
  Read `## User Actions Required` from all `*-SUMMARY.md` files in the phase directory. If any non-empty actions exist, present as `## ⚠ Action Required` block before route-specific content. Skip if all "None".
515
517
 
518
+ **Then, assess skip context** from SUMMARYs and VERIFICATION.md already in context:
519
+ - If all Must-Haves verified programmatically (uncertain = 0) AND phase involved only internal/structural changes (no user-facing UI, behavior, or API changes): include a brief skip note.
520
+ - Otherwise: present verify-work without qualification — human verification adds clear value.
521
+
522
+ **Present verify-work as Next Up:**
523
+
524
+ ```markdown
525
+ ## ✓ Phase {Z}: {Name} Complete
526
+
527
+ All {Y} plans finished. Phase goal verified.
528
+
529
+ ---
530
+
531
+ ## ▶ Next Up
532
+
533
+ `/ms:verify-work {Z}` — validate {phase name} through manual acceptance testing
534
+
535
+ <sub>`/clear` first → fresh context window</sub>
536
+
537
+ {If skip context applies: "Phase involved only {description} with no user-facing changes — skip if structural verification is sufficient."}
538
+ ```
539
+
540
+ **Then present "Also available" based on milestone status:**
541
+
516
542
  **If more phases remain:**
517
543
 
518
- Read `~/.claude/mindsystem/references/routing/next-phase-routing.md` and follow its instructions to present "Next Up" with pre-work context for the next phase.
544
+ Read `~/.claude/mindsystem/references/routing/next-phase-routing.md` to determine the most appropriate command for the next phase (discuss/design/research/plan based on pre-work flags). Present concisely under "Also available":
519
545
 
520
- After the "Next Up" section, add:
521
546
  ```markdown
547
+ ---
548
+
549
+ **Phase {Z+1}: {Name}** — {Goal}
550
+ {If pre-work flagged: brief note about recommendations}
551
+
522
552
  **Also available:**
523
- - `/ms:verify-work {Z}` — manual acceptance testing before continuing
553
+ - `/ms:{suggested} {Z+1}` — {reason from routing}
554
+ - `/ms:plan-phase {Z+1}` — skip pre-work, plan directly
555
+
556
+ ---
524
557
  ```
525
558
 
559
+ Include the pre-work recommendations table from the routing reference if any pre-work is flagged as "Likely".
560
+
526
561
  **If milestone complete:**
527
562
 
528
- Read `~/.claude/mindsystem/references/routing/milestone-complete-routing.md` and follow its instructions to present the milestone complete section.
563
+ ```markdown
564
+ ---
565
+
566
+ **Also available:**
567
+ - `/ms:audit-milestone` — verify requirements, cross-phase integration, E2E flows
568
+ - `/ms:complete-milestone` — skip audit, archive directly
569
+ - `/ms:add-phase <description>` — add another phase first
570
+
571
+ ---
572
+ ```
529
573
  </step>
530
574
 
531
575
  </process>
@@ -260,7 +260,9 @@ completed: YYYY-MM-DD
260
260
  ---
261
261
  ```
262
262
 
263
- **Subsystem:** Use inline `**Subsystem:**` metadata from plan header if present. Otherwise select from `ms-tools config-get subsystems`. If novel, append to config.json and log in decisions.
263
+ **Subsystem:** Use inline `**Subsystem:**` metadata from plan header if present. Otherwise select the best match from `ms-tools config-get subsystems`.
264
+
265
+ **Novel subsystem (safety net):** If the plan's work genuinely doesn't fit any existing subsystem, append: `ms-tools config-set subsystems --append "{name}"`. Use in SUMMARY frontmatter and log the addition in Decisions Made. This is a fallback — `create-roadmap` handles most subsystem additions proactively.
264
266
 
265
267
  **Mock hints:** Reflect on what you built. If UI with transient states (loading, animations, async transitions) or external data dependencies, populate accordingly. If purely backend or no async UI, write `mock_hints: none # reason`. Always populate.
266
268
 
@@ -217,10 +217,13 @@ Continue to commit_codebase_map.
217
217
  </step>
218
218
 
219
219
  <step name="commit_codebase_map">
220
- Commit the codebase map:
220
+
221
+ **Update state and commit:**
221
222
 
222
223
  ```bash
224
+ ms-tools set-last-command "ms:map-codebase $ARGUMENTS"
223
225
  git add .planning/codebase/*.md
226
+ [ -f .planning/STATE.md ] && git add .planning/STATE.md
224
227
  git commit -m "$(cat <<'EOF'
225
228
  docs: map existing codebase
226
229
 
@@ -79,8 +79,9 @@ Extract the HTML scaffold from the `<template>` block.
79
79
 
80
80
  <step name="spawn_agents">
81
81
  ```bash
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.
82
+ ms-tools find-phase "${PHASE}"
83
+ # Extract PHASE_DIR from the `dir` field of the JSON output
84
+ # If dir is null, phase directory is missing — stop and report.
84
85
  mkdir -p "${PHASE_DIR}/mockups"
85
86
  ```
86
87
 
@@ -6,6 +6,7 @@ Complete verify-and-fix session: by session end, everything verified, issues fix
6
6
 
7
7
  <execution_context>
8
8
  <!-- mock-patterns.md loaded on demand for transient_state mocks (see generate_mocks step) -->
9
+ <!-- knowledge files loaded on first fix attempt (see investigate_issue step) -->
9
10
  </execution_context>
10
11
 
11
12
  <process>
@@ -74,7 +75,8 @@ Provide a phase number to start testing (e.g., /ms:verify-work 4)
74
75
  **Find SUMMARY.md files for the phase:**
75
76
 
76
77
  ```bash
77
- PHASE_DIR=$(ls -d .planning/phases/${PHASE_ARG}* 2>/dev/null | head -1)
78
+ ms-tools find-phase "${PHASE_ARG}"
79
+ # Extract PHASE_DIR from the `dir` field of the JSON output
78
80
  ls "$PHASE_DIR"/*-SUMMARY.md 2>/dev/null
79
81
  ```
80
82
 
@@ -341,6 +343,19 @@ Progress auto-recalculates on every `uat-update` call. No manual progress recalc
341
343
  <step name="investigate_issue">
342
344
  **Investigate reported issue:**
343
345
 
346
+ **0. Load knowledge (first issue only):**
347
+
348
+ If this is the first issue requiring investigation in this session, load knowledge files now. On subsequent issues, knowledge is already in context — skip to step 1.
349
+
350
+ ```bash
351
+ ms-tools config-get subsystems
352
+ grep "^subsystem:" "$PHASE_DIR"/*-SUMMARY.md 2>/dev/null
353
+ ```
354
+
355
+ Match SUMMARY.md subsystem values against config subsystems. Read matching `.planning/knowledge/{subsystem}.md` files (1-3 most relevant).
356
+
357
+ This knowledge informs investigation (where to look, known pitfalls) and any subsequent fixes.
358
+
344
359
  **1. Lightweight investigation (2-3 tool calls):**
345
360
 
346
361
  ```
@@ -440,6 +455,10 @@ You are a Mindsystem verify-fixer. Investigate this issue, find the root cause,
440
455
 
441
456
  {lightweight_investigation_results}
442
457
 
458
+ ## Knowledge Context
459
+
460
+ {loaded_knowledge_content or "No knowledge files loaded for this session."}
461
+
443
462
  ## Your task
444
463
 
445
464
  1. Investigate to find root cause
@@ -590,7 +609,7 @@ PRE_WORK_STASH=$(git stash list | grep "pre-verify-work" | head -1 | cut -d: -f1
590
609
  [ -n "$PRE_WORK_STASH" ] && git stash pop "$PRE_WORK_STASH"
591
610
  ```
592
611
 
593
- **4. Update UAT.md and commit together with STATE.md:**
612
+ **4. Update state and commit:**
594
613
  ```bash
595
614
  ms-tools uat-update $PHASE_NUMBER --session status=complete current_batch= mocked_files=
596
615
  ms-tools set-last-command "ms:verify-work $ARGUMENTS"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mindsystem-cc",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "description": "The engineer's meta-prompting system for Claude Code.",
5
5
  "bin": {
6
6
  "mindsystem-cc": "bin/install.js"
@@ -1198,6 +1198,7 @@ def cmd_doctor_scan(args: argparse.Namespace) -> None:
1198
1198
 
1199
1199
  # ---- CHECK 11: Browser Verification ----
1200
1200
  print("=== Browser Verification ===")
1201
+ is_web, web_signal = False, "not checked"
1201
1202
  bv_enabled = True
1202
1203
  bv_config = config.get("browser_verification", {})
1203
1204
  if isinstance(bv_config, dict):
@@ -1233,6 +1234,28 @@ def cmd_doctor_scan(args: argparse.Namespace) -> None:
1233
1234
  record("PASS", "Browser Verification")
1234
1235
  print()
1235
1236
 
1237
+ # ---- CHECK 12: Screenshot Optimization ----
1238
+ print("=== Screenshot Optimization ===")
1239
+ if not bv_enabled:
1240
+ print("Status: SKIP")
1241
+ print("Browser verification disabled")
1242
+ record("SKIP", "Screenshot Optimization")
1243
+ elif not is_web:
1244
+ print("Status: SKIP")
1245
+ print(f"Not a web project ({web_signal})")
1246
+ record("SKIP", "Screenshot Optimization")
1247
+ else:
1248
+ if shutil.which("cwebp"):
1249
+ print("Status: PASS")
1250
+ print("cwebp available — screenshots will be converted to WebP")
1251
+ record("PASS", "Screenshot Optimization")
1252
+ else:
1253
+ print("Status: WARN")
1254
+ print("cwebp not found — browser screenshots will remain as PNG (larger files)")
1255
+ print("Install: brew install webp | apt install webp | choco install webp")
1256
+ record("WARN", "Screenshot Optimization")
1257
+ print()
1258
+
1236
1259
  # ---- SUMMARY ----
1237
1260
  total = pass_count + warn_count + fail_count + skip_count
1238
1261
  print("=== Summary ===")
@@ -3126,7 +3149,7 @@ def _load_uat(args_phase: str) -> tuple[Path, "UATFile"]:
3126
3149
  if phase_dir is None:
3127
3150
  print(f"Error: Phase directory not found for {phase}", file=sys.stderr)
3128
3151
  sys.exit(1)
3129
- uat_path = phase_dir / f"{phase_dir.name}-UAT.md"
3152
+ uat_path = phase_dir / f"{phase}-UAT.md"
3130
3153
  if not uat_path.is_file():
3131
3154
  print(f"Error: UAT file not found: {uat_path}", file=sys.stderr)
3132
3155
  sys.exit(1)
@@ -3166,7 +3189,7 @@ def cmd_uat_init(args: argparse.Namespace) -> None:
3166
3189
  phase_name = phase_dir.name
3167
3190
  uat = UATFile.from_init_json(data, phase_name)
3168
3191
 
3169
- out_path = phase_dir / f"{phase_name}-UAT.md"
3192
+ out_path = phase_dir / f"{phase}-UAT.md"
3170
3193
  out_path.write_text(uat.serialize(), encoding="utf-8")
3171
3194
 
3172
3195
  n_tests = len(uat.tests)
@@ -3196,7 +3219,7 @@ def cmd_uat_update(args: argparse.Namespace) -> None:
3196
3219
  print(f"Error: Phase directory not found for {phase}", file=sys.stderr)
3197
3220
  sys.exit(1)
3198
3221
 
3199
- uat_path = phase_dir / f"{phase_dir.name}-UAT.md"
3222
+ uat_path = phase_dir / f"{phase}-UAT.md"
3200
3223
  if not uat_path.is_file():
3201
3224
  print(f"Error: UAT file not found: {uat_path}", file=sys.stderr)
3202
3225
  sys.exit(1)
@@ -3264,7 +3287,7 @@ def cmd_uat_status(args: argparse.Namespace) -> None:
3264
3287
  print(f"Error: Phase directory not found for {phase}", file=sys.stderr)
3265
3288
  sys.exit(1)
3266
3289
 
3267
- uat_path = phase_dir / f"{phase_dir.name}-UAT.md"
3290
+ uat_path = phase_dir / f"{phase}-UAT.md"
3268
3291
  if not uat_path.is_file():
3269
3292
  print(f"Error: UAT file not found: {uat_path}", file=sys.stderr)
3270
3293
  sys.exit(1)