@massu/core 2.5.1 → 2.5.3

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 (92) hide show
  1. package/CHANGELOG.md +240 -0
  2. package/agents/massu-output-scorer.md +2 -2
  3. package/agents/massu-plan-auditor.md +1 -1
  4. package/commands/_shared-references/test-first-protocol.md +4 -4
  5. package/commands/_shared-references/verification-table.md +5 -5
  6. package/commands/massu-audit-deps.md +2 -2
  7. package/commands/massu-batch.md +3 -3
  8. package/commands/massu-checkpoint.md +7 -7
  9. package/commands/massu-ci-fix.md +1 -1
  10. package/commands/massu-cleanup.md +16 -16
  11. package/commands/massu-commit.md +7 -7
  12. package/commands/massu-create-plan.md +7 -7
  13. package/commands/massu-dead-code.md +3 -3
  14. package/commands/massu-debug/references/common-shortcuts.md +1 -1
  15. package/commands/massu-debug/references/investigation-phases.md +4 -4
  16. package/commands/massu-debug/references/report-format.md +2 -2
  17. package/commands/massu-deploy.md +1 -1
  18. package/commands/massu-deps.md +5 -5
  19. package/commands/massu-doc-gen.md +3 -3
  20. package/commands/massu-docs.md +6 -6
  21. package/commands/massu-estimate.md +3 -3
  22. package/commands/massu-golden-path/references/competitive-mode.md +2 -2
  23. package/commands/massu-golden-path/references/phase-1-plan-creation.md +1 -1
  24. package/commands/massu-golden-path/references/phase-2-implementation.md +2 -2
  25. package/commands/massu-golden-path/references/phase-4-commit.md +3 -3
  26. package/commands/massu-golden-path/references/phase-5-push.md +5 -5
  27. package/commands/massu-guide.md +3 -3
  28. package/commands/massu-hotfix.md +14 -14
  29. package/commands/massu-loop/references/checkpoint-audit.md +3 -3
  30. package/commands/massu-loop/references/iteration-structure.md +3 -3
  31. package/commands/massu-loop/references/loop-controller.md +5 -5
  32. package/commands/massu-loop/references/plan-extraction.md +4 -4
  33. package/commands/massu-loop/references/vr-plan-spec.md +3 -3
  34. package/commands/massu-loop-playwright.md +5 -5
  35. package/commands/massu-loop.md +1 -1
  36. package/commands/massu-new-feature.md +6 -24
  37. package/commands/massu-perf.md +1 -1
  38. package/commands/massu-plan.md +21 -21
  39. package/commands/massu-push-light.md +9 -9
  40. package/commands/massu-recap.md +1 -1
  41. package/commands/massu-refactor.md +8 -8
  42. package/commands/massu-release.md +3 -3
  43. package/commands/massu-review.md +1 -1
  44. package/commands/massu-rollback.md +6 -6
  45. package/commands/massu-scaffold-page.md +1 -1
  46. package/commands/massu-scaffold-router.md +1 -1
  47. package/commands/massu-status.md +9 -9
  48. package/commands/massu-tdd.md +2 -2
  49. package/commands/massu-test.md +13 -13
  50. package/commands/massu-verify-playwright.md +1 -1
  51. package/commands/massu-verify.md +20 -20
  52. package/dist/cli.js +1731 -976
  53. package/dist/hooks/auto-learning-pipeline.js +745 -87
  54. package/dist/hooks/classify-failure.js +747 -45
  55. package/dist/hooks/cost-tracker.js +89 -28
  56. package/dist/hooks/fix-detector.js +536 -48
  57. package/dist/hooks/incident-pipeline.js +96 -29
  58. package/dist/hooks/intent-suggester.js +89 -28
  59. package/dist/hooks/memory-recall.js +89 -28
  60. package/dist/hooks/post-edit-context.js +137 -29
  61. package/dist/hooks/post-tool-use.js +95 -30
  62. package/dist/hooks/pre-compact.js +89 -28
  63. package/dist/hooks/pre-delete-check.js +137 -31
  64. package/dist/hooks/pre-tool-use-gate.js +271 -43
  65. package/dist/hooks/quality-event.js +89 -28
  66. package/dist/hooks/rule-enforcement-pipeline.js +89 -28
  67. package/dist/hooks/security-gate.js +219 -39
  68. package/dist/hooks/session-end.js +92 -28
  69. package/dist/hooks/session-start.js +140 -62
  70. package/dist/hooks/user-prompt.js +89 -28
  71. package/fragments/feature-components.md +15 -0
  72. package/fragments/feature-components.python.md +15 -0
  73. package/fragments/feature-components.typescript.md +15 -0
  74. package/package.json +6 -5
  75. package/patterns/testing-patterns.md +8 -8
  76. package/protocols/plan-implementation.md +2 -2
  77. package/protocols/verification.md +4 -4
  78. package/reference/lessons-learned.md +4 -4
  79. package/reference/vr-verification-reference.md +9 -9
  80. package/templates/aspnet/massu.config.yaml +2 -0
  81. package/templates/go-chi/massu.config.yaml +2 -0
  82. package/templates/multi-runtime/massu.config.yaml +4 -2
  83. package/templates/phoenix/massu.config.yaml +2 -0
  84. package/templates/python-django/massu.config.yaml +3 -1
  85. package/templates/python-fastapi/massu.config.yaml +3 -1
  86. package/templates/python-flask/massu.config.yaml +3 -1
  87. package/templates/rails/massu.config.yaml +4 -2
  88. package/templates/rust-actix/massu.config.yaml +2 -0
  89. package/templates/spring/massu.config.yaml +2 -0
  90. package/templates/swift-ios/massu.config.yaml +3 -1
  91. package/templates/ts-nestjs/massu.config.yaml +2 -0
  92. package/templates/ts-nextjs/massu.config.yaml +2 -0
@@ -127,17 +127,17 @@ WHILE true:
127
127
  Fix any plan document gaps you find.
128
128
 
129
129
  CONTEXT: Massu is a TypeScript monorepo with:
130
- - packages/core/src/ (MCP server source)
131
- - packages/core/src/__tests__/ (vitest tests)
130
+ - {{paths.source}}/ (MCP server source)
131
+ - {{paths.tests | default("tests")}}/ (vitest tests)
132
132
  - packages/core/src/hooks/ (esbuild-compiled hooks)
133
133
  - massu.config.yaml (project config)
134
134
  - Tool registration: 3-function pattern (getDefs, isTool, handleCall) wired in tools.ts
135
135
 
136
136
  VR-* CHECKS (use ONLY these, per CLAUDE.md):
137
137
  - VR-FILE, VR-GREP, VR-NEGATIVE, VR-COUNT (generic)
138
- - VR-BUILD: npm run build (tsc + hooks)
139
- - VR-TYPE: cd packages/core && npx tsc --noEmit
140
- - VR-TEST: npm test (vitest)
138
+ - VR-BUILD: {{verify.build | default("(this stack declares no build step)")}} (tsc + hooks)
139
+ - VR-TYPE: {{verify.type | default("declare verification.LANG.type in massu.config.yaml")}}
140
+ - VR-TEST: {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}} (vitest)
141
141
  - VR-TOOL-REG: tool definitions + handler wired in tools.ts
142
142
  - VR-HOOK-BUILD: cd packages/core && npm run build:hooks
143
143
  - VR-CONFIG: massu.config.yaml parses
@@ -243,9 +243,9 @@ Run a repeatable audit->fix->re-audit loop that verifies the entire plan against
243
243
 
244
244
  | Item # | Type | Description | Expected Location | Verification Command |
245
245
  |--------|------|-------------|-------------------|---------------------|
246
- | P1-001 | MODULE | foo-tools.ts | packages/core/src/ | ls -la [path] |
246
+ | P1-001 | MODULE | foo-tools.ts | {{paths.source}}/ | ls -la [path] |
247
247
  | P1-002 | TOOL_WIRE | Wire into tools.ts | packages/core/src/tools.ts | grep [module] tools.ts |
248
- | P2-001 | TEST | foo-tools.test.ts | packages/core/src/__tests__/ | npm test |
248
+ | P2-001 | TEST | foo-tools.test.ts | {{paths.tests | default("tests")}}/ | {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}} |
249
249
  | P-003 | REMOVAL | Remove pattern | all files | grep -rn "pattern" = 0 |
250
250
 
251
251
  ### Item Types: MODULE (exists), TOOL_WIRE (registered), TEST (passes), CONFIG (parses), HOOK (compiles), REMOVAL (0 matches)
@@ -271,7 +271,7 @@ For files plan modifies: `ls -la [file_path]`. For directories plan creates in:
271
271
  If ANY feature uses config-stored values, verify VALUES match code expectations:
272
272
  ```bash
273
273
  # Find what the CODE expects
274
- grep -rn "getConfig\(\)\." packages/core/src/ | grep -oE 'getConfig\(\)\.\w+' | sort -u
274
+ grep -rn "getConfig\(\)\." {{paths.source}}/ | grep -oE 'getConfig\(\)\.\w+' | sort -u
275
275
  ```
276
276
  Compare config keys to code expectations. Mismatches = FAIL. Add plan items to fix alignment BEFORE implementation.
277
277
 
@@ -442,10 +442,10 @@ grep -rn "[violation pattern]" [directories] | wc -l
442
442
 
443
443
  ```bash
444
444
  # Module inventory
445
- find packages/core/src -name "*.ts" -not -path "*__tests__*" -not -path "*node_modules*" | sort
445
+ find {{paths.source}} -name "*.ts" -not -path "*__tests__*" -not -path "*node_modules*" | sort
446
446
 
447
447
  # Tool definition files
448
- find packages/core/src -name "*-tools.ts" | sort
448
+ find {{paths.source}} -name "*-tools.ts" | sort
449
449
 
450
450
  # Hook files
451
451
  find packages/core/src/hooks -name "*.ts" 2>/dev/null | sort
@@ -457,10 +457,10 @@ Verify: all planned modules exist, all tool files follow naming convention, hook
457
457
 
458
458
  ```bash
459
459
  # Tool definitions in each module
460
- grep -rn "getToolDefinitions\|getDefs" packages/core/src/ | grep -v node_modules | grep -v __tests__
460
+ grep -rn "getToolDefinitions\|getDefs" {{paths.source}}/ | grep -v node_modules | grep -v __tests__
461
461
 
462
462
  # Handler registrations
463
- grep -rn "handleToolCall\|handleCall" packages/core/src/ | grep -v node_modules | grep -v __tests__
463
+ grep -rn "handleToolCall\|handleCall" {{paths.source}}/ | grep -v node_modules | grep -v __tests__
464
464
 
465
465
  # Wiring in tools.ts
466
466
  grep -rn "import\|getDefs\|isTool\|handleCall" packages/core/src/tools.ts
@@ -481,7 +481,7 @@ Verify: all tools have definitions + handlers + wiring in tools.ts. A tool that
481
481
  #### B3. Data Layer Integrity
482
482
 
483
483
  ```bash
484
- cd packages/core && npx tsc --noEmit
484
+ {{verify.type | default("declare verification.LANG.type in massu.config.yaml")}}
485
485
  # Compare module interfaces to usage
486
486
  grep -A 10 "export interface\|export type" packages/core/src/[MODULE].ts
487
487
  ```
@@ -533,13 +533,13 @@ Reuse existing modules per CLAUDE.md. Do NOT create one-off modules when reusabl
533
533
  #### B8. Import/Export Integrity
534
534
 
535
535
  ```bash
536
- cd packages/core && npx tsc --noEmit 2>&1 | grep -i "cannot find module\|not found"
536
+ {{verify.type | default("declare verification.LANG.type in massu.config.yaml")}} 2>&1 | grep -i "cannot find module\|not found"
537
537
  ```
538
538
 
539
539
  #### B9. Environment & Configuration
540
540
 
541
541
  ```bash
542
- grep -rn "process.env\." packages/core/src/ | grep -v node_modules | grep -oE 'process\.env\.\w+' | sort -u
542
+ grep -rn "process.env\." {{paths.source}}/ | grep -v node_modules | grep -oE 'process\.env\.\w+' | sort -u
543
543
  ls -la tsconfig.json package.json massu.config.yaml 2>/dev/null
544
544
  ```
545
545
 
@@ -547,10 +547,10 @@ ls -la tsconfig.json package.json massu.config.yaml 2>/dev/null
547
547
 
548
548
  ```bash
549
549
  # Test files
550
- find packages/core/src/__tests__ -name "*.test.ts" | sort
550
+ find {{paths.tests | default("tests")}} -name "*.test.ts" | sort
551
551
 
552
552
  # Run tests
553
- npm test
553
+ {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}
554
554
  ```
555
555
 
556
556
  Verify: all new modules have corresponding test files, all tests pass.
@@ -558,8 +558,8 @@ Verify: all new modules have corresponding test files, all tests pass.
558
558
  #### B11. Third-Party Integration
559
559
 
560
560
  ```bash
561
- grep -rn "fetch(\|axios\." packages/core/src/ | grep -v node_modules | grep -v __tests__ | head -20
562
- grep -rn "https://\|http://" packages/core/src/ | grep -v node_modules | grep -v ".env\|localhost" | head -10
561
+ grep -rn "fetch(\|axios\." {{paths.source}}/ | grep -v node_modules | grep -v __tests__ | head -20
562
+ grep -rn "https://\|http://" {{paths.source}}/ | grep -v node_modules | grep -v ".env\|localhost" | head -10
563
563
  ```
564
564
 
565
565
  ### Blast Radius Verification
@@ -567,7 +567,7 @@ grep -rn "https://\|http://" packages/core/src/ | grep -v node_modules | grep -v
567
567
  When plan changes ANY constant/path/value:
568
568
  ```bash
569
569
  # For EACH changed value:
570
- grep -rn '"[OLD_VALUE]"' packages/core/src/ --include="*.ts" | grep -v node_modules
570
+ grep -rn '"[OLD_VALUE]"' {{paths.source}}/ --include="*.ts" | grep -v node_modules
571
571
  # ALL matches must be accounted for in blast radius analysis
572
572
  ```
573
573
 
@@ -605,7 +605,7 @@ ITERATION N:
605
605
  **Plan Coverage**: 100% items verified with VR-* proof.
606
606
  **Requirements**: 100% Implemented with evidence.
607
607
  **Pattern Compliance**: massu-pattern-scanner exits 0, all VR-NEGATIVE checks pass.
608
- **Build & Types**: `npm run build` exit 0, `cd packages/core && npx tsc --noEmit` 0 errors, `npm test` passes.
608
+ **Build & Types**: `{{verify.build | default("(this stack declares no build step)")}}` exit 0, `{{verify.type | default("declare verification.LANG.type in massu.config.yaml")}}` 0 errors, `{{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}` passes.
609
609
  **Blast Radius** (if applicable): Zero uncategorized references.
610
610
  **Technical Debt**: Empty OR fully planned with cleanup steps.
611
611
 
@@ -40,7 +40,7 @@ bash scripts/massu-security-scanner.sh
40
40
 
41
41
  ### 4. TypeScript Check (~30s)
42
42
  ```bash
43
- cd packages/core && npx tsc --noEmit
43
+ {{verify.type | default("declare verification.LANG.type in massu.config.yaml")}}
44
44
  ```
45
45
  **Catches:** Type errors, missing imports, interface mismatches
46
46
 
@@ -52,13 +52,13 @@ cd packages/core && npm run build:hooks
52
52
 
53
53
  ### 6. Unit Tests (~30s)
54
54
  ```bash
55
- npm test
55
+ {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}
56
56
  ```
57
57
  **Catches:** Regressions, broken logic, handler errors
58
58
 
59
59
  ### 7. Build (~20s)
60
60
  ```bash
61
- npm run build
61
+ {{verify.build | default("(this stack declares no build step)")}}
62
62
  ```
63
63
  **Catches:** Build failures, compilation errors
64
64
 
@@ -101,7 +101,7 @@ else
101
101
  fi
102
102
 
103
103
  echo "[4/7] TypeScript Check..."
104
- if cd packages/core && npx tsc --noEmit 2>&1; then
104
+ if {{verify.type | default("declare verification.LANG.type in massu.config.yaml")}} 2>&1; then
105
105
  echo " PASS"
106
106
  else
107
107
  echo " FAIL"
@@ -117,7 +117,7 @@ else
117
117
  fi
118
118
 
119
119
  echo "[6/7] Unit Tests..."
120
- if npm test > /dev/null 2>&1; then
120
+ if {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}} > /dev/null 2>&1; then
121
121
  echo " PASS"
122
122
  else
123
123
  echo " FAIL - Tests failing"
@@ -125,7 +125,7 @@ else
125
125
  fi
126
126
 
127
127
  echo "[7/7] Build..."
128
- if npm run build > /dev/null 2>&1; then
128
+ if {{verify.build | default("(this stack declares no build step)")}} > /dev/null 2>&1; then
129
129
  echo " PASS"
130
130
  else
131
131
  echo " FAIL - Build error"
@@ -201,7 +201,7 @@ ALL CHECKS PASSED - Safe to push
201
201
  | Pattern Scanner | Run `bash scripts/massu-pattern-scanner.sh` to see details |
202
202
  | Generalization Scanner | Run `bash scripts/massu-generalization-scanner.sh` for details |
203
203
  | Security Scanner | Run `bash scripts/massu-security-scanner.sh` for details |
204
- | TypeScript | Run `cd packages/core && npx tsc --noEmit` for full error output |
204
+ | TypeScript | Run `{{verify.type | default("declare verification.LANG.type in massu.config.yaml")}}` for full error output |
205
205
  | Hook Compilation | Run `cd packages/core && npm run build:hooks` for error details |
206
- | Unit Tests | Run `npm test` to see failing tests |
207
- | Build | Run `npm run build` for full error output |
206
+ | Unit Tests | Run `{{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}` to see failing tests |
207
+ | Build | Run `{{verify.build | default("(this stack declares no build step)")}}` for full error output |
@@ -132,7 +132,7 @@ matches, 0 commits ever touching the path — it was copied from another repo's
132
132
  The instruction to "note it as unavailable" is what let a mandatory check report nothing
133
133
  for months, because "could not look" and "looked and found nothing" read identically.
134
134
  The checker is now version-controlled at `~/.claude/bin/memory-contradiction-check`, has a
135
- caller in `npm test` (`memory-contradiction-check-caller.test.ts`), a fixture suite, and a
135
+ caller in `{{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}` (`memory-contradiction-check-caller.test.ts`), a fixture suite, and a
136
136
  live-fire attack — so its absence is itself a red test.
137
137
 
138
138
  ### Step 3: Update Session State
@@ -82,7 +82,7 @@ For each export, function, type, or constant being changed:
82
82
 
83
83
  ```bash
84
84
  # Find all references in the codebase
85
- grep -rn "[export_name]" packages/core/src/ --include="*.ts"
85
+ grep -rn "[export_name]" {{paths.source}}/ --include="*.ts"
86
86
  grep -rn "[export_name]" packages/ --include="*.ts" --include="*.tsx"
87
87
  grep -rn "[export_name]" .claude/commands/ --include="*.md"
88
88
  grep -rn "[export_name]" scripts/ --include="*.sh"
@@ -112,7 +112,7 @@ Capture the behavioral baseline BEFORE making any changes:
112
112
  ### 2a. Test Baseline
113
113
 
114
114
  ```bash
115
- npm test 2>&1
115
+ {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}} 2>&1
116
116
  ```
117
117
 
118
118
  Record:
@@ -129,7 +129,7 @@ Record:
129
129
  ### 2b. Type Check Baseline
130
130
 
131
131
  ```bash
132
- cd packages/core && npx tsc --noEmit 2>&1
132
+ {{verify.type | default("declare verification.LANG.type in massu.config.yaml")}} 2>&1
133
133
  ```
134
134
 
135
135
  Record:
@@ -185,9 +185,9 @@ TRANSFORMATION LOOP:
185
185
  1. Select next batch (max 3 files)
186
186
  2. Apply changes to batch
187
187
  3. Run type check:
188
- cd packages/core && npx tsc --noEmit 2>&1
188
+ {{verify.type | default("declare verification.LANG.type in massu.config.yaml")}} 2>&1
189
189
  4. Run tests:
190
- npm test 2>&1
190
+ {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}} 2>&1
191
191
  5. Compare against baseline:
192
192
  - Type errors must be <= baseline
193
193
  - Passing tests must be >= baseline
@@ -225,7 +225,7 @@ TRANSFORMATION LOOP:
225
225
 
226
226
  ```bash
227
227
  # Verify old name no longer exists in source
228
- grep -rn "[old_name]" packages/core/src/ --include="*.ts"
228
+ grep -rn "[old_name]" {{paths.source}}/ --include="*.ts"
229
229
  # MUST return 0 matches
230
230
  ```
231
231
 
@@ -262,13 +262,13 @@ bash scripts/massu-pattern-scanner.sh
262
262
 
263
263
  ### Gate 2: Type Check (VR-TYPE)
264
264
  ```bash
265
- cd packages/core && npx tsc --noEmit
265
+ {{verify.type | default("declare verification.LANG.type in massu.config.yaml")}}
266
266
  # MUST show 0 errors (or <= baseline)
267
267
  ```
268
268
 
269
269
  ### Gate 3: All Tests (VR-TEST)
270
270
  ```bash
271
- npm test
271
+ {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}
272
272
  # MUST exit 0, all tests pass
273
273
  ```
274
274
 
@@ -108,7 +108,7 @@ bash scripts/massu-pattern-scanner.sh
108
108
  # MUST exit 0
109
109
 
110
110
  # 1.2 TypeScript
111
- cd packages/core && npx tsc --noEmit
111
+ {{verify.type | default("declare verification.LANG.type in massu.config.yaml")}}
112
112
  # MUST show 0 errors
113
113
 
114
114
  # 1.3 Hook Build
@@ -120,7 +120,7 @@ cd packages/core && npm run build:hooks
120
120
 
121
121
  ```bash
122
122
  # 2.1 All tests
123
- npm test
123
+ {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}
124
124
  # MUST exit 0, all tests pass
125
125
  ```
126
126
 
@@ -138,7 +138,7 @@ npm audit --audit-level=high 2>&1 || true
138
138
 
139
139
  # 3.2 Secrets scan
140
140
  grep -rn 'sk-[a-zA-Z0-9]\{20,\}\|password.*=.*["\x27][^"\x27]\{8,\}' --include="*.ts" --include="*.tsx" \
141
- packages/core/src/ 2>/dev/null \
141
+ {{paths.source}}/ 2>/dev/null \
142
142
  | grep -v "process.env\|RegExp\|regex\|REDACT\|redact\|sanitize\|mask\|\.test\.ts:" \
143
143
  | wc -l
144
144
  # MUST be 0
@@ -53,7 +53,7 @@ git diff --cached
53
53
 
54
54
  ## DIMENSION 1: CLAUDE.md PATTERN COMPLIANCE
55
55
 
56
- For each changed file in `packages/core/src/`:
56
+ For each changed file in `{{paths.source}}/`:
57
57
 
58
58
  | Check | What | How |
59
59
  |-------|------|-----|
@@ -413,10 +413,10 @@ CREATE POLICY "[old_policy_name]" ON [table]
413
413
  ### 6.1 Code Verification
414
414
  ```bash
415
415
  # Type check
416
- npx tsc --noEmit
416
+ {{verify.type | default("declare verification.LANG.type in massu.config.yaml")}}
417
417
 
418
418
  # Build
419
- npm run build
419
+ {{verify.build | default("(this stack declares no build step)")}}
420
420
 
421
421
  # Pattern scanner
422
422
  ./scripts/pattern-scanner.sh
@@ -426,7 +426,7 @@ npm run build
426
426
  # Expected: Exit 0 - all backend features exposed in UI
427
427
 
428
428
  # Tests
429
- npm test
429
+ {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}
430
430
  ```
431
431
 
432
432
  ### 6.2 Database Verification
@@ -462,11 +462,11 @@ curl -I http://localhost:3000/api/health
462
462
 
463
463
  | Check | Command | Expected | Actual | Status |
464
464
  |-------|---------|----------|--------|--------|
465
- | Type check | npx tsc --noEmit | 0 errors | [N] | PASS/FAIL |
466
- | Build | npm run build | Exit 0 | [exit code] | PASS/FAIL |
465
+ | Type check | {{verify.type | default("declare verification.LANG.type in massu.config.yaml")}} | 0 errors | [N] | PASS/FAIL |
466
+ | Build | {{verify.build | default("(this stack declares no build step)")}} | Exit 0 | [exit code] | PASS/FAIL |
467
467
  | Patterns | pattern-scanner.sh | Exit 0 | [exit code] | PASS/FAIL |
468
468
  | VR-COUPLING | check-coupling.sh | Exit 0 | [exit code] | PASS/FAIL |
469
- | Tests | npm test | All pass | [result] | PASS/FAIL |
469
+ | Tests | {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}} | All pass | [result] | PASS/FAIL |
470
470
  | DB Schema | SQL query | [expected] | [actual] | PASS/FAIL |
471
471
  | App starts | npm run dev | No errors | [result] | PASS/FAIL |
472
472
 
@@ -105,7 +105,7 @@ export default function Error({ error, reset }: { error: Error; reset: () => voi
105
105
  ### Verification
106
106
 
107
107
  ```bash
108
- npm run build 2>&1 | tail -20 # or pnpm/yarn equivalent
108
+ {{verify.build | default("(this stack declares no build step)")}} 2>&1 | tail -20 # or pnpm/yarn equivalent
109
109
  ```
110
110
 
111
111
  ---
@@ -119,7 +119,7 @@ export const appRouter = createTRPCRouter({
119
119
  2. Run VR-SCHEMA-PRE to verify table columns exist
120
120
  3. Create router file with proper patterns
121
121
  4. Register in root.ts
122
- 5. Run `npx tsc --noEmit` to verify types
122
+ 5. Run `{{verify.type | default("declare verification.LANG.type in massu.config.yaml")}}` to verify types
123
123
 
124
124
  ## START NOW
125
125
 
@@ -29,7 +29,7 @@ Provide a comprehensive READ-ONLY snapshot of the project's health across all di
29
29
  ### 1. Test Suite Health
30
30
 
31
31
  ```bash
32
- npm test 2>&1
32
+ {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}} 2>&1
33
33
  ```
34
34
 
35
35
  | Metric | Value | Status |
@@ -42,7 +42,7 @@ npm test 2>&1
42
42
  ### 2. Type Safety
43
43
 
44
44
  ```bash
45
- cd packages/core && npx tsc --noEmit 2>&1
45
+ {{verify.type | default("declare verification.LANG.type in massu.config.yaml")}} 2>&1
46
46
  ```
47
47
 
48
48
  | Metric | Value | Status |
@@ -121,12 +121,12 @@ grep -c "startsWith" packages/core/src/tools.ts
121
121
 
122
122
  ```bash
123
123
  # Source line counts
124
- find packages/core/src -name "*.ts" -not -path "*/__tests__/*" -not -path "*/node_modules/*" | xargs wc -l | tail -1
125
- find packages/core/src/__tests__ -name "*.test.ts" | xargs wc -l | tail -1
124
+ find {{paths.source}} -name "*.ts" -not -path "*/__tests__/*" -not -path "*/node_modules/*" | xargs wc -l | tail -1
125
+ find {{paths.tests | default("tests")}} -name "*.test.ts" | xargs wc -l | tail -1
126
126
 
127
127
  # File counts
128
- find packages/core/src -name "*.ts" -not -path "*/__tests__/*" -not -path "*/node_modules/*" | wc -l
129
- find packages/core/src/__tests__ -name "*.test.ts" | wc -l
128
+ find {{paths.source}} -name "*.ts" -not -path "*/__tests__/*" -not -path "*/node_modules/*" | wc -l
129
+ find {{paths.tests | default("tests")}} -name "*.test.ts" | wc -l
130
130
  ```
131
131
 
132
132
  | Metric | Value |
@@ -158,7 +158,7 @@ fi
158
158
  # List source modules without test files
159
159
  for f in packages/core/src/*.ts; do
160
160
  base=$(basename "$f" .ts)
161
- test_file="packages/core/src/__tests__/${base}.test.ts"
161
+ test_file="{{paths.tests | default("tests")}}/${base}.test.ts"
162
162
  if [ ! -f "$test_file" ]; then
163
163
  echo "MISSING: $base"
164
164
  fi
@@ -271,8 +271,8 @@ fi
271
271
  - **UNHEALTHY**: Failing tests, type errors, or security vulns
272
272
 
273
273
  ### Quick Fix Commands (if degraded/unhealthy)
274
- - Tests failing: `npm test` to see failures, then fix
275
- - Type errors: `cd packages/core && npx tsc --noEmit` for details
274
+ - Tests failing: `{{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}` to see failures, then fix
275
+ - Type errors: `{{verify.type | default("declare verification.LANG.type in massu.config.yaml")}}` for details
276
276
  - Pattern violations: `bash scripts/massu-pattern-scanner.sh` for details
277
277
  - Vulnerabilities: `npm audit` for details, `/massu-audit-deps` for full audit
278
278
  ```
@@ -108,7 +108,7 @@ If more scenarios needed (edge cases, error handling, additional features):
108
108
  If complete:
109
109
  ```bash
110
110
  # Run full test suite to confirm no regressions
111
- npm test
111
+ {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}
112
112
  ```
113
113
 
114
114
  **VR-TEST proof**: Full suite passes.
@@ -144,7 +144,7 @@ npm test
144
144
  +--------v----------------+
145
145
  | Step 4: COMPLETE |
146
146
  | Full suite passes |
147
- | VR-TEST: npm test |
147
+ | VR-TEST: {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}} |
148
148
  +-------------------------+
149
149
  ```
150
150
 
@@ -35,7 +35,7 @@ Run tests intelligently, analyze failures, detect coverage gaps, and generate mi
35
35
  - In `--generate` mode: follow vitest patterns from existing tests exactly
36
36
  - Report ALL failures, not just the first one
37
37
  - **FIX ALL ISSUES ENCOUNTERED (CR-9)** — in `--fix` mode, fix every failing test, not just one
38
- - **VR-TEST verification** — `npm test` must pass before commit
38
+ - **VR-TEST verification** — `{{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}` must pass before commit
39
39
  - **Critical paths first** — Tool handlers, config parsing, DB operations need tests
40
40
  - **Isolation** — Tests must not depend on external state
41
41
  - **Deterministic** — Same code = same result
@@ -106,7 +106,7 @@ ELSE:
106
106
 
107
107
  ```bash
108
108
  # Run the full test suite with output capture
109
- npm test 2>&1
109
+ {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}} 2>&1
110
110
  ```
111
111
 
112
112
  **For AFFECTED mode, skip to STEP 6 first, then run only affected tests.**
@@ -176,7 +176,7 @@ For each failing test (ordered by classification priority: CODE_BUG > TEST_BUG >
176
176
  3. **If still failing:** Re-analyze and retry (max 3 attempts per test)
177
177
  4. **After all fixes applied:** Run the full suite to verify no regressions:
178
178
  ```bash
179
- npm test 2>&1
179
+ {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}} 2>&1
180
180
  ```
181
181
 
182
182
  ```
@@ -192,7 +192,7 @@ FIX LOOP:
192
192
  - Mark as MANUAL_FIX_NEEDED
193
193
  - Continue to next test
194
194
  AFTER all fixes:
195
- - Run full suite: npm test
195
+ - Run full suite: {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}
196
196
  - IF new failures introduced: REVERT last fix, investigate
197
197
  ```
198
198
 
@@ -268,11 +268,11 @@ git diff --cached --name-only
268
268
 
269
269
  ### 6b. Trace to Test Files
270
270
 
271
- For each changed source file in `packages/core/src/`:
271
+ For each changed source file in `{{paths.source}}/`:
272
272
 
273
273
  ```bash
274
274
  # Find test files that import or reference this module
275
- grep -rl "[module-name]" packages/core/src/__tests__/ --include="*.test.ts"
275
+ grep -rl "[module-name]" {{paths.tests | default("tests")}}/ --include="*.test.ts"
276
276
  ```
277
277
 
278
278
  ### 6c. Run Affected Tests Only
@@ -367,7 +367,7 @@ npx vitest run packages/core/src/__tests__/[module].test.ts 2>&1
367
367
  1. Read the error output carefully
368
368
  2. Fix the test (NOT the source code — unless it reveals an actual bug)
369
369
  3. Re-run until passing
370
- 4. Run full suite to verify no regressions: `npm test`
370
+ 4. Run full suite to verify no regressions: `{{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}`
371
371
 
372
372
  ---
373
373
 
@@ -377,13 +377,13 @@ After any modifications (--fix or --generate modes):
377
377
 
378
378
  ### Gate 1: All Tests Pass (VR-TEST)
379
379
  ```bash
380
- npm test
380
+ {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}
381
381
  # MUST exit 0, all tests pass
382
382
  ```
383
383
 
384
384
  ### Gate 2: Type Safety (VR-TYPE)
385
385
  ```bash
386
- cd packages/core && npx tsc --noEmit
386
+ {{verify.type | default("declare verification.LANG.type in massu.config.yaml")}}
387
387
  # MUST show 0 errors
388
388
  ```
389
389
 
@@ -402,13 +402,13 @@ bash scripts/massu-pattern-scanner.sh
402
402
  ### Check for Anti-Patterns
403
403
  ```bash
404
404
  # Find tests without assertions
405
- grep -rn "it(.*{" packages/core/src/__tests__/ | grep -v "expect\|assert" | head -10
405
+ grep -rn "it(.*{" {{paths.tests | default("tests")}}/ | grep -v "expect\|assert" | head -10
406
406
 
407
407
  # Find tests with only console.log
408
- grep -rn "console.log" packages/core/src/__tests__/ | head -10
408
+ grep -rn "console.log" {{paths.tests | default("tests")}}/ | head -10
409
409
 
410
410
  # Find flaky patterns (setTimeout, random)
411
- grep -rn "setTimeout\|Math.random" packages/core/src/__tests__/ | head -10
411
+ grep -rn "setTimeout\|Math.random" {{paths.tests | default("tests")}}/ | head -10
412
412
  ```
413
413
 
414
414
  ### Test Quality Matrix
@@ -467,7 +467,7 @@ If the bad pattern is detectable by grep, consider adding it to `scripts/massu-p
467
467
 
468
468
  ### Step 3: Search Codebase-Wide (CR-9)
469
469
  ```bash
470
- grep -rn "[bad_pattern]" packages/core/src/ --include="*.ts"
470
+ grep -rn "[bad_pattern]" {{paths.source}}/ --include="*.ts"
471
471
  ```
472
472
  Fix ALL instances found, not just the one that was reported.
473
473
 
@@ -517,7 +517,7 @@ Update session state with the WRONG vs CORRECT pattern discovered.
517
517
  If the bad pattern is detectable by grep, add check to `scripts/massu-pattern-scanner.sh`.
518
518
 
519
519
  ### Step 4: Search Codebase-Wide (CR-9)
520
- `grep -rn "[bad_pattern]" packages/core/src/ src/` - fix ALL instances of the same issue.
520
+ `grep -rn "[bad_pattern]" {{paths.source}}/ src/` - fix ALL instances of the same issue.
521
521
 
522
522
  ---
523
523