@massu/core 2.5.2 → 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 +70 -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 +1265 -876
  53. package/dist/hooks/auto-learning-pipeline.js +517 -56
  54. package/dist/hooks/classify-failure.js +495 -47
  55. package/dist/hooks/cost-tracker.js +65 -27
  56. package/dist/hooks/fix-detector.js +496 -47
  57. package/dist/hooks/incident-pipeline.js +72 -28
  58. package/dist/hooks/intent-suggester.js +65 -27
  59. package/dist/hooks/memory-recall.js +65 -27
  60. package/dist/hooks/post-edit-context.js +65 -27
  61. package/dist/hooks/post-tool-use.js +70 -29
  62. package/dist/hooks/pre-compact.js +65 -27
  63. package/dist/hooks/pre-delete-check.js +65 -27
  64. package/dist/hooks/pre-tool-use-gate.js +193 -37
  65. package/dist/hooks/quality-event.js +65 -27
  66. package/dist/hooks/rule-enforcement-pipeline.js +65 -27
  67. package/dist/hooks/security-gate.js +197 -38
  68. package/dist/hooks/session-end.js +68 -27
  69. package/dist/hooks/session-start.js +116 -61
  70. package/dist/hooks/user-prompt.js +65 -27
  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
@@ -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
 
@@ -33,7 +33,7 @@ Run ALL applicable VR-* verification checks and produce proof output. This comma
33
33
  **ALL tests MUST pass before verification can be marked complete. Tests are NEVER optional.**
34
34
 
35
35
  ```bash
36
- npm test
36
+ {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}
37
37
  # Expected: Exit 0, ALL tests pass
38
38
  ```
39
39
 
@@ -114,21 +114,21 @@ grep -n "[pattern]" [file]
114
114
  ### VR-NEGATIVE: Removal Verification (CRITICAL)
115
115
  ```bash
116
116
  # For each pattern claimed to be removed:
117
- grep -rn "[removed_pattern]" packages/core/src/ | wc -l
117
+ grep -rn "[removed_pattern]" {{paths.source}}/ | wc -l
118
118
  # Expected: 0
119
119
  # Failure: Any matches found
120
120
  ```
121
121
 
122
122
  ### VR-BUILD: Build Integrity Verification
123
123
  ```bash
124
- npm run build
124
+ {{verify.build | default("(this stack declares no build step)")}}
125
125
  # Expected: Exit 0, "Build complete" message
126
126
  # Failure: Exit non-zero or errors
127
127
  ```
128
128
 
129
129
  ### VR-TYPE: Type Safety Verification
130
130
  ```bash
131
- npx tsc --noEmit
131
+ {{verify.type | default("declare verification.LANG.type in massu.config.yaml")}}
132
132
  # Expected: 0 errors
133
133
  # Failure: Any type errors
134
134
  ```
@@ -149,10 +149,10 @@ grep -c "[pattern]" [file]
149
149
  node -e "const yaml = require('yaml'); const fs = require('fs'); yaml.parse(fs.readFileSync('massu.config.yaml', 'utf-8'));"
150
150
 
151
151
  # VR-CONFIG-002: Extract ALL config keys used in code
152
- grep -rn "getConfig()" packages/core/src/ | sed 's/.*\(config\.[a-zA-Z_]*\).*/\1/' | sort -u
152
+ grep -rn "getConfig()" {{paths.source}}/ | sed 's/.*\(config\.[a-zA-Z_]*\).*/\1/' | sort -u
153
153
 
154
154
  # VR-CONFIG-003: Verify config values match code expectations
155
- grep -rn "toolPrefix\|config\." packages/core/src/ | head -20
155
+ grep -rn "toolPrefix\|config\." {{paths.source}}/ | head -20
156
156
  ```
157
157
 
158
158
  **VR-CONFIG Alignment Checklist:**
@@ -209,14 +209,14 @@ grep "<ComponentName" src/app/**/page.tsx
209
209
  ### VR-INTEGRATION: Full Integration Verification
210
210
  ```bash
211
211
  # Module is imported AND registered AND build passes
212
- grep "[ModuleName]" packages/core/src/tools.ts && npm run build
212
+ grep "[ModuleName]" packages/core/src/tools.ts && {{verify.build | default("(this stack declares no build step)")}}
213
213
  # Expected: Both checks pass
214
214
  ```
215
215
 
216
216
  ### VR-REUSE: Component/Code Reuse Verification
217
217
  ```bash
218
218
  # BEFORE creating new module, search for existing:
219
- grep -rn "[functionality]" packages/core/src/
219
+ grep -rn "[functionality]" {{paths.source}}/
220
220
 
221
221
  # Expected: Use existing or document why new needed
222
222
  ```
@@ -343,7 +343,7 @@ grep -A 10 "[procedure]:" src/server/api/routers/[router].ts | grep "input"
343
343
 
344
344
  ```bash
345
345
  # Step 1: Find all env var usage
346
- grep -rn "process.env\." packages/core/src/ src/ | sed 's/.*\(process\.env\.[a-zA-Z_]*\).*/\1/' | sort -u
346
+ grep -rn "process.env\." {{paths.source}}/ src/ | sed 's/.*\(process\.env\.[a-zA-Z_]*\).*/\1/' | sort -u
347
347
 
348
348
  # Step 2: Compare to .env.example
349
349
  cat .env.example | grep -v "^#" | cut -d= -f1 | sort
@@ -388,8 +388,8 @@ For each feature/change:
388
388
 
389
389
  ```bash
390
390
  # Find code defaults
391
- grep -rn "default:" packages/core/src/
392
- grep -rn "?? '" packages/core/src/ | grep -v node_modules
391
+ grep -rn "default:" {{paths.source}}/
392
+ grep -rn "?? '" {{paths.source}}/ | grep -v node_modules
393
393
  ```
394
394
 
395
395
  ```markdown
@@ -409,7 +409,7 @@ Read the plan document and extract ALL deliverables:
409
409
 
410
410
  | Item # | Type | Description | Expected Location | Verification | Status |
411
411
  |--------|------|-------------|-------------------|--------------|--------|
412
- | P-001 | FILE | module.ts | packages/core/src/ | ls -la | PENDING |
412
+ | P-001 | FILE | module.ts | {{paths.source}}/ | ls -la | PENDING |
413
413
  | P-002 | TOOL | tool_action | tools.ts | grep | PENDING |
414
414
  | P-003 | REMOVAL | old_pattern | all files | grep = 0 | PENDING |
415
415
 
@@ -459,7 +459,7 @@ git diff --cached --name-only | grep -E '\.(env|pem|key|secret)' && echo "FAIL:
459
459
 
460
460
  ### No Credentials in Code
461
461
  ```bash
462
- grep -rn "sk-\|password.*=.*['\"]" --include="*.ts" --include="*.tsx" packages/core/src/ src/ | grep -v "process.env" | wc -l
462
+ grep -rn "sk-\|password.*=.*['\"]" --include="*.ts" --include="*.tsx" {{paths.source}}/ src/ | grep -v "process.env" | wc -l
463
463
  # Expected: 0
464
464
  ```
465
465
 
@@ -501,7 +501,7 @@ grep -rn "sk-\|password.*=.*['\"]" --include="*.ts" --include="*.tsx" packages/c
501
501
 
502
502
  ## VR-BUILD Verification
503
503
  ```bash
504
- npm run build
504
+ {{verify.build | default("(this stack declares no build step)")}}
505
505
  ```
506
506
  **Status**: PASS/FAIL
507
507
  **Output**: [build output summary]
@@ -510,7 +510,7 @@ npm run build
510
510
 
511
511
  ## VR-TYPE Verification
512
512
  ```bash
513
- npx tsc --noEmit
513
+ {{verify.type | default("declare verification.LANG.type in massu.config.yaml")}}
514
514
  ```
515
515
  **Status**: PASS/FAIL
516
516
  **Errors**: 0/N
@@ -600,8 +600,8 @@ For faster verification, use **Task agents** to run independent checks simultane
600
600
  ```markdown
601
601
  ### Launch Parallel Verification Agents (single message, all at once)
602
602
  - Agent 1: "Run pattern scanner" -> bash scripts/massu-pattern-scanner.sh
603
- - Agent 2: "Run TypeScript check" -> npx tsc --noEmit
604
- - Agent 3: "Run unit tests" -> npm test
603
+ - Agent 2: "Run TypeScript check" -> {{verify.type | default("declare verification.LANG.type in massu.config.yaml")}}
604
+ - Agent 3: "Run unit tests" -> {{verify.test | default("declare verification.LANG.test in massu.config.yaml")}}
605
605
  ```
606
606
 
607
607
  ### Benefits
@@ -620,8 +620,8 @@ For quick checks without full report:
620
620
  ```bash
621
621
  # Run all critical checks
622
622
  bash scripts/massu-pattern-scanner.sh && \
623
- npx tsc --noEmit && \
624
- npm run build && \
623
+ {{verify.type | default("declare verification.LANG.type in massu.config.yaml")}} && \
624
+ {{verify.build | default("(this stack declares no build step)")}} && \
625
625
  echo "QUICK VERIFY: PASS"
626
626
  ```
627
627
 
@@ -750,7 +750,7 @@ Update session state with the WRONG vs CORRECT pattern discovered.
750
750
  If the bad pattern is detectable by grep, add check to `scripts/massu-pattern-scanner.sh`.
751
751
 
752
752
  ### Step 3: Search Codebase-Wide (CR-9)
753
- `grep -rn "[bad_pattern]" packages/core/src/` - fix ALL instances of the same issue.
753
+ `grep -rn "[bad_pattern]" {{paths.source}}/` - fix ALL instances of the same issue.
754
754
 
755
755
  ---
756
756