@massu/core 0.6.0 → 0.6.2

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 (26) hide show
  1. package/commands/_shared-preamble.md +14 -0
  2. package/commands/massu-ci-fix.md +2 -2
  3. package/commands/massu-gap-enhancement-analyzer.md +85 -345
  4. package/commands/massu-golden-path/references/approval-points.md +9 -12
  5. package/commands/massu-golden-path/references/competitive-mode.md +9 -7
  6. package/commands/massu-golden-path/references/error-handling.md +4 -2
  7. package/commands/massu-golden-path/references/phase-0-requirements.md +3 -3
  8. package/commands/massu-golden-path/references/phase-1-plan-creation.md +41 -52
  9. package/commands/massu-golden-path/references/phase-2-implementation.md +50 -151
  10. package/commands/massu-golden-path/references/phase-2.5-gap-analyzer.md +14 -34
  11. package/commands/massu-golden-path/references/phase-3-simplify.md +5 -5
  12. package/commands/massu-golden-path/references/phase-4-commit.md +20 -46
  13. package/commands/massu-golden-path/references/phase-5-push.md +14 -47
  14. package/commands/massu-golden-path/references/phase-6-completion.md +8 -58
  15. package/commands/massu-golden-path.md +25 -30
  16. package/commands/massu-loop/references/checkpoint-audit.md +14 -18
  17. package/commands/massu-loop/references/guardrails.md +3 -3
  18. package/commands/massu-loop/references/iteration-structure.md +46 -14
  19. package/commands/massu-loop/references/loop-controller.md +72 -63
  20. package/commands/massu-loop/references/plan-extraction.md +19 -11
  21. package/commands/massu-loop/references/vr-plan-spec.md +20 -28
  22. package/commands/massu-loop.md +36 -56
  23. package/commands/massu-review.md +2 -2
  24. package/dist/cli.js +0 -0
  25. package/package.json +1 -1
  26. package/README.md +0 -40
@@ -24,7 +24,7 @@ WHILE iteration < MAX_ITERATIONS:
24
24
  iteration += 1
25
25
 
26
26
  result = Task(subagent_type="gap-analyzer", prompt="
27
- Gap & Enhancement Analysis Iteration {iteration}
27
+ Gap & Enhancement Analysis -- Iteration {iteration}
28
28
 
29
29
  CONTEXT:
30
30
  - Plan file: {PLAN_PATH}
@@ -54,53 +54,33 @@ WHILE iteration < MAX_ITERATIONS:
54
54
  - Missing confirmation for destructive actions (AlertDialog)
55
55
  - Missing keyboard navigation (tabIndex, onKeyDown for Enter)
56
56
  - Missing responsive behavior (sm:/md:/lg: breakpoints)
57
- - Inconsistent spacing (page-container class, gap values)
57
+ - Inconsistent spacing (layout classes, gap values)
58
58
  - Missing breadcrumbs or navigation context
59
- - VR-VISUAL weighted score < 3.0 on affected routes
60
59
 
61
60
  C. DATA INTEGRITY GAPS
62
61
  - Optimistic updates without rollback
63
62
  - Missing query invalidation after mutations
64
63
  - Stale data after navigation (missing refetch)
65
64
  - Missing pagination for large datasets
66
- - Unhandled BigInt/Decimal serialization
65
+ - Unhandled serialization edge cases
67
66
 
68
67
  D. SECURITY GAPS
69
- - Missing protectedProcedure on mutations
70
- - Missing input validation on router inputs
71
- - Missing RLS policies on new tables
72
- - Exposed sensitive data in client responses
68
+ - Missing input validation on handler inputs
69
+ - Exposed sensitive data in responses
70
+ - Missing access controls on new endpoints
73
71
 
74
72
  E. PATTERN COMPLIANCE
75
- - Run ./scripts/pattern-scanner.sh on changed files
76
- - Check for pattern violations
77
- - Check for hardcoded colors (should use design tokens)
73
+ - Run bash scripts/massu-pattern-scanner.sh on changed files
74
+ - Check for ESM compliance (.ts extensions, no require())
75
+ - Check for config-driven patterns (no hardcoded project-specific values)
76
+ - Check for TypeScript strict mode compliance
78
77
 
79
78
  F. ENHANCEMENT OPPORTUNITIES
80
79
  - Type safety improvements (replace 'any' with proper types)
81
80
  - Code deduplication (extract shared logic)
82
- - Performance (unnecessary re-renders, missing useMemo/useCallback)
81
+ - Performance (unnecessary re-renders, missing caching)
83
82
  - Accessibility (aria-labels, alt text, focus management)
84
83
 
85
- G. E2E WIRING GAPS
86
- - For each data flow in changed files, verify VR-ROUNDTRIP:
87
- WRITE: mutation/action reachable from UI or cron
88
- STORE: data persists in a real table
89
- READ: query reads from that same table
90
- DISPLAY: component renders the query data (or cron logs output)
91
- - Background-only features (crons, webhooks): WRITE->STORE->READ sufficient
92
- - Query-only features (read views): READ->DISPLAY sufficient
93
-
94
- H. SPRINT CONTRACT COMPLIANCE (if contracts exist from Phase 2A.5)
95
- - Read the sprint contracts from the Phase 2A tracking table
96
- - For EACH plan item with a sprint contract:
97
- 1. List all acceptance criteria from the contract
98
- 2. Verify EACH criterion with specific evidence (grep, screenshot, DOM state, network response)
99
- 3. Any unmet criterion = GAP (P1 severity minimum)
100
- - Contract criteria are IN ADDITION TO categories A-G — both must pass
101
- - Skip condition: items marked `Contract: N/A` in the tracking table
102
- - If no sprint contracts were negotiated (Phase 2A.5 skipped), skip this category
103
-
104
84
  FOR EACH FINDING:
105
85
  1. Classify: GAP (must fix) or ENHANCEMENT (should fix)
106
86
  2. Severity: P0 (broken) / P1 (incorrect) / P2 (polish)
@@ -115,14 +95,14 @@ WHILE iteration < MAX_ITERATIONS:
115
95
 
116
96
  | # | Type | Severity | Description | File | Fixed |
117
97
  |---|------|----------|-------------|------|-------|
118
- | 1 | GAP | P0 | Missing error boundary | src/app/.../page.tsx | YES |
98
+ | 1 | GAP | P0 | Missing error boundary | src/... | YES |
119
99
  ```
120
100
  ")
121
101
 
122
102
  gaps = parse GAPS_DISCOVERED from result
123
103
 
124
104
  IF gaps == 0:
125
- Output: "Gap analysis clean in iteration {iteration} zero gaps found"
105
+ Output: "Gap analysis clean in iteration {iteration} -- zero gaps found"
126
106
  BREAK
127
107
  ELSE:
128
108
  Output: "Iteration {iteration}: {gaps} gaps found and fixed, re-analyzing..."
@@ -142,7 +122,7 @@ IF iteration == MAX_ITERATIONS AND gaps > 0:
142
122
  | **Full re-pass required** | After fixes, a fresh pass must find ZERO to exit |
143
123
  | **P0 gaps block** | Any P0 gap that can't be fixed stops the golden path |
144
124
  | **Enhancements are mandatory** | Enhancements found MUST be applied (this is golden path, not quick fix) |
145
- | **Pattern scanner gates** | `./scripts/pattern-scanner.sh` must exit 0 after each iteration |
125
+ | **Pattern scanner gates** | `bash scripts/massu-pattern-scanner.sh` must exit 0 after each iteration |
146
126
  | **No new files without reason** | Don't create helper files that aren't needed |
147
127
 
148
128
  ---
@@ -9,7 +9,7 @@
9
9
  ## 3.1 Fast Gate
10
10
 
11
11
  ```bash
12
- ./scripts/pattern-scanner.sh # Fix ALL violations before semantic analysis
12
+ bash scripts/massu-pattern-scanner.sh # Fix ALL violations before semantic analysis
13
13
  ```
14
14
 
15
15
  ## 3.1.5 Dead Code Detection
@@ -23,13 +23,13 @@ Review output for unused exports, files, and dependencies. Remove dead code befo
23
23
 
24
24
  ## 3.2 Parallel Semantic Review (3 Agents)
25
25
 
26
- Spawn IN PARALLEL (Principle #20 -- one task per agent):
26
+ Spawn IN PARALLEL (one task per agent):
27
27
 
28
- **Efficiency Reviewer** (haiku): Query inefficiency (findMany.length -> SQL COUNT, N+1, unbounded queries), React inefficiency (useState for derived, useEffect->setState, missing useMemo/useCallback), algorithmic inefficiency (O(n^2), repeated sort/filter).
28
+ **Efficiency Reviewer** (haiku): Query inefficiency (findMany equivalent vs SQL COUNT, N+1 queries, unbounded queries), algorithmic inefficiency (O(n^2), repeated sort/filter), unnecessary allocations, missing caching opportunities.
29
29
 
30
- **Reuse Reviewer** (haiku): Known utilities (formatFileSize, serializeUnifiedProduct, mergeWhereWithTenant, emptyToNull, PhoneInputField, sanitizeContentHtml), component duplication against src/components/shared/ and ui/, pattern duplication across new files.
30
+ **Reuse Reviewer** (haiku): Known utilities (getConfig(), stripPrefix(), tool registration patterns, memDb lifecycle pattern), module duplication against existing tool modules, pattern duplication across new files, config values that should be in massu.config.yaml.
31
31
 
32
- **Pattern Compliance Reviewer** (haiku): React Query v5 (no onSuccess in useQuery), DB patterns (Object.assign->mergeWhereWithTenant, include:->3-step, BigInt Number()), UI patterns (Select value="", missing states, Suspense), security (z.string()->z.enum() for orderBy, CR-5 precedence, CRON_SECRET guard), architecture (link table scoping, SQL aggregates, client/server boundary).
32
+ **Pattern Compliance Reviewer** (haiku): ESM compliance (.ts import extensions, no require()), config-driven patterns (no hardcoded project-specific values -- VR-GENERIC), TypeScript strict mode compliance, tool registration (3-function pattern preferred), hook compilation (esbuild compatible), memDb lifecycle (try/finally close), security (input validation, no eval/exec).
33
33
 
34
34
  ## 3.3 Apply ALL Findings
35
35
 
@@ -10,58 +10,33 @@
10
10
 
11
11
  | Gate | Command | Expected |
12
12
  |------|---------|----------|
13
- | 1. Pattern Scanner | `./scripts/pattern-scanner.sh` | Exit 0 |
14
- | 2. Type Safety (VR-TYPE) | `NODE_OPTIONS="--max-old-space-size=8192" npx tsc --noEmit` | 0 errors |
13
+ | 1. Pattern Scanner | `bash scripts/massu-pattern-scanner.sh` | Exit 0 |
14
+ | 2. Type Safety (VR-TYPE) | `cd packages/core && npx tsc --noEmit` | 0 errors |
15
15
  | 3. Build (VR-BUILD) | `npm run build` | Exit 0 |
16
- | 4. Lint | `npm run lint` | Exit 0 |
17
- | 5. Prisma Validate | `npx prisma validate` | Exit 0 |
18
- | 6. Secrets Staged | `git diff --cached --name-only \| grep -E '\.(env\|pem\|key\|secret)'` | 0 files |
19
- | 7. Credentials in Code | `grep -rn "sk-\|password.*=.*['\"]" --include="*.ts" --include="*.tsx" src/ \| grep -v "process.env" \| wc -l` | 0 |
20
- | 8. Schema Mismatch | Extract tables from staged routers -> query columns via MCP | All exist |
21
- | 9. VR-RENDER | For EACH staged component: `grep "<ComponentName" src/app/**/page.tsx` | Match found |
22
- | 9.5. VR-COLOR | `git diff --cached \| grep "text-red-\|bg-green-\|..."` | 0 matches |
23
- | 9.6. VR-COUPLING | `massu_coupling_check` or `./scripts/check-coupling.sh` | Exit 0 |
24
- | 10. Plan Coverage | Verify ALL plan items with VR-* proof | 100% |
25
- | 11. VR-PLAN-STATUS | `grep "IMPLEMENTATION STATUS" [plan]` | Match |
26
- | 12. Dependency Security | `npm audit --audit-level=high` | 0 high/crit |
27
- | 13. Test Coverage | Check test files exist for new code | WARN level |
28
- | 14. VR-VISUAL | `bash scripts/ui-review.sh [route]` (if UI files changed) | VR_VISUAL_STATUS: PASS |
16
+ | 4. Tests (VR-TEST) | `npm test` | ALL pass |
17
+ | 5. Hook Compilation (VR-HOOK-BUILD) | `cd packages/core && npm run build:hooks` | Exit 0 |
18
+ | 6. Generalization (VR-GENERIC) | `bash scripts/massu-generalization-scanner.sh` | Exit 0 |
19
+ | 7. Security Scanner | `bash scripts/massu-security-scanner.sh` | Exit 0 |
20
+ | 8. Secrets Staged | `git diff --cached --name-only \| grep -E '\.(env\|pem\|key\|secret)'` | 0 files |
21
+ | 9. Credentials in Code | `grep -rn "sk-\|password.*=.*['\"]" --include="*.ts" packages/ \| grep -v "process.env" \| wc -l` | 0 |
22
+ | 10. VR-TOOL-REG | For EACH new tool: verify definitions + handler wired in tools.ts | All wired |
23
+ | 11. Plan Coverage | Verify ALL plan items with VR-* proof | 100% |
24
+ | 12. VR-PLAN-STATUS | `grep "IMPLEMENTATION STATUS" [plan]` | Match |
25
+ | 13. Dependency Security | `npm audit --audit-level=high` | 0 high/crit |
29
26
 
30
- For each modified file: `massu_validate_file`, `massu_security_score`, `massu_security_heatmap`. If any file scores > 7/10 risk, flag for review.
27
+ ## 4.2 Quality Scoring Gate
31
28
 
32
- Spawn `massu-pattern-reviewer` agent for deep CR rule checks, import chain validation, semantic pattern matching.
29
+ Spawn `massu-output-scorer` (sonnet): Code Clarity, Pattern Compliance, Error Handling, Test Coverage, Config-Driven Design (1-5 each). All >= 3: PASS. Any < 3: FAIL.
33
30
 
34
- ## 4.2 Database Verification (All Environments)
35
-
36
- For EACH affected table, query all configured environments via MCP:
37
-
38
- | Env | MCP Prefix | Verify |
39
- |-----|-----------|--------|
40
- | DEV | `mcp__supabase__DEV__execute_sql` | Table, columns, RLS, grants |
41
- | PROD | `mcp__supabase__PROD__execute_sql` | Table, columns, RLS, grants |
42
-
43
- VR-DATA: If config-driven features, query actual config values and compare to code expectations.
44
-
45
- ## 4.3 Help Site Auto-Sync
46
-
47
- 1. Get staged files -> pass to `massu_docs_audit`
48
- 2. For STALE/NEW pages: update MDX, set `lastVerified`, add changelog
49
- 3. Commit to help site repo (separate git)
50
- 4. Return to main app repo
51
-
52
- ## 4.4 Quality Scoring Gate
53
-
54
- Spawn `massu-output-scorer` (sonnet): Code Clarity, Pattern Compliance, Error Handling, UX Quality, Test Coverage (1-5 each). All >= 3: PASS. Any < 3: FAIL.
55
-
56
- ## 4.5 If ANY Gate Fails
31
+ ## 4.3 If ANY Gate Fails
57
32
 
58
33
  **DO NOT PAUSE** -- Fix automatically, re-run ALL gates, repeat until all pass.
59
34
 
60
- ## 4.6 Auto-Learning Protocol
35
+ ## 4.4 Auto-Learning Protocol
61
36
 
62
- - For each bug fixed: `massu_memory_ingest` type="bugfix", update MEMORY.md
63
- - For new patterns: `massu_memory_ingest` type="pattern"
64
- - Add detection to `scripts/pattern-scanner.sh` if grep-able
37
+ - For each bug fixed: update memory files
38
+ - For new patterns: record in memory
39
+ - Add detection to `scripts/massu-pattern-scanner.sh` if grep-able
65
40
  - Codebase-wide search: no other instances of same bad pattern (CR-9)
66
41
  - Record user corrections to `memory/corrections.md`
67
42
 
@@ -85,8 +60,7 @@ Changes:
85
60
 
86
61
  Verified:
87
62
  - Pattern scanner: PASS | Type check: 0 errors | Build: PASS
88
- - DB: All environments verified
89
- - Help site: UP TO DATE
63
+ - Tests: ALL pass | Hooks: compiled | Generalization: PASS
90
64
 
91
65
  Co-Authored-By: Claude <noreply@anthropic.com>
92
66
  EOF
@@ -18,13 +18,11 @@ Run in parallel where possible:
18
18
 
19
19
  | Check | Command |
20
20
  |-------|---------|
21
- | Pattern Scanner | `./scripts/pattern-scanner.sh` |
22
- | VR-COUPLING | `./scripts/check-coupling.sh` |
23
- | VR-UX | `./scripts/check-ux-quality.sh` |
24
- | TypeScript | `NODE_OPTIONS="--max-old-space-size=8192" npx tsc --noEmit` |
21
+ | Pattern Scanner | `bash scripts/massu-pattern-scanner.sh` |
22
+ | Generalization | `bash scripts/massu-generalization-scanner.sh` |
23
+ | TypeScript | `cd packages/core && npx tsc --noEmit` |
25
24
  | Build | `npm run build` |
26
- | Prisma | `npx prisma validate` |
27
- | Schema Mismatch | `./scripts/check-schema-mismatches.sh` |
25
+ | Hook Compilation | `cd packages/core && npm run build:hooks` |
28
26
 
29
27
  ## 5.3 Tier 2: Test Suite (CRITICAL)
30
28
 
@@ -33,33 +31,29 @@ Run in parallel where possible:
33
31
  ```bash
34
32
  # Establish baseline on main
35
33
  git stash && git checkout main -q
36
- npm run test:run 2>&1 | tee /tmp/baseline-tests.txt
34
+ npm test 2>&1 | tee /tmp/baseline-tests.txt
37
35
  git checkout - -q && git stash pop -q
38
36
 
39
37
  # Run on current branch
40
- npm run test:run 2>&1 | tee /tmp/current-tests.txt
38
+ npm test 2>&1 | tee /tmp/current-tests.txt
41
39
 
42
40
  # Compare: any test passing on main but failing now = REGRESSION
43
41
  # Regressions MUST be fixed before push
44
42
  ```
45
43
 
46
- ### 5.3.1-5.3.5 Test Execution
44
+ ### 5.3.1-5.3.3 Test Execution
47
45
 
48
46
  Use **parallel Task agents** for independent checks:
49
47
 
50
48
  ```
51
49
  Agent Group A (parallel):
52
- - Agent 1: npm run test:run (unit tests)
50
+ - Agent 1: npm test (unit tests)
53
51
  - Agent 2: npm audit --audit-level=high
54
- - Agent 3: npx tsx scripts/detect-secrets.ts
55
-
56
- Agent Group B (parallel, after A):
57
- - Agent 1: npm run test:e2e (E2E tests)
58
- - Agent 2: npm run test:visual:run (visual regression)
52
+ - Agent 3: bash scripts/massu-security-scanner.sh
59
53
 
60
54
  Sequential:
61
- - ./scripts/validate-router-contracts.sh
62
- - VR-RENDER: verify ALL new components rendered in pages
55
+ - VR-TOOL-REG: verify ALL new tools registered in tools.ts
56
+ - VR-GENERIC: verify ALL files pass generalization scanner
63
57
  ```
64
58
 
65
59
  ## 5.4 Tier 3: Security & Compliance
@@ -67,35 +61,8 @@ Sequential:
67
61
  | Check | Command |
68
62
  |-------|---------|
69
63
  | npm audit | `npm audit --audit-level=high` |
70
- | Secrets scan | `npx tsx scripts/detect-secrets.ts` |
71
- | Accessibility | `./scripts/verify-accessibility.sh` |
72
- | DB sync | Verify schema match across all environments |
73
-
74
- ### VR-STORED-PROC (If migrations in push)
75
-
76
- ```sql
77
- SELECT proname, prosrc FROM pg_proc
78
- JOIN pg_namespace n ON n.oid = pronamespace
79
- WHERE n.nspname = 'public' AND prosrc LIKE '%old_table_name%';
80
- -- Run on all environments. Expected: 0 rows.
81
- ```
82
-
83
- ### VR-RLS-AUDIT (CR-33)
84
-
85
- ```sql
86
- SELECT c.relname FROM pg_class c
87
- JOIN pg_namespace n ON c.relnamespace = n.oid
88
- WHERE n.nspname = 'public' AND c.relkind = 'r' AND c.relrowsecurity = false;
89
- -- Run on all environments. Expected: 0 rows.
90
- ```
91
-
92
- ### VR-DATA (Config-Code Alignment)
93
-
94
- If push includes config-driven features, verify config keys match code expectations.
95
-
96
- ### Compliance Audit Trail
97
-
98
- Generate: `massu_audit_log`, `massu_audit_report`, `massu_validation_report`.
64
+ | Security scan | `bash scripts/massu-security-scanner.sh` |
65
+ | Config validation | Parse massu.config.yaml without errors |
99
66
 
100
67
  ## 5.5 Tier 4: Final Gate
101
68
 
@@ -113,4 +80,4 @@ All tiers must pass:
113
80
 
114
81
  See `approval-points.md` for the exact format.
115
82
 
116
- After approval: `git push origin [branch]`, then monitor CI with `./scripts/ci-status.sh --wait --max-wait 300`. If CI fails, auto-run `/massu-ci-fix` protocol.
83
+ After approval: `git push origin [branch]`, then verify with `gh run list --limit 3`.
@@ -14,14 +14,10 @@ SUMMARY:
14
14
  Phase 0: Requirements & Context D1-D10 resolved
15
15
  Phase 1: Plan Creation & Audit [N] items, [M] audit passes
16
16
  Phase 2: Implementation [N] audit loops, 3 reviewers passed
17
- Phase 2A.5: Sprint Contracts [N] contracts negotiated, [M] criteria total
18
- Phase 2C.2: QA Evaluator [N] sprints evaluated, [M] bugs caught / SKIPPED (no UI)
19
17
  Phase 2G: Browser Verification [N] pages tested, [M] issues fixed / SKIPPED
20
- Phase 2.5: Gap & Enhancement [N] iterations, [M] gaps fixed, [K] enhancements
21
18
  Phase 3: Simplification [N] findings fixed
22
- Phase 4: Pre-Commit Verification 13 gates passed
19
+ Phase 4: Pre-Commit Verification All gates passed
23
20
  Phase 5: Push Verification 3 tiers passed, 0 regressions
24
- Phase 5.5: Production Verification [N]/[M] immediate PASS, [K] deferred pending
25
21
  --------------------------------------------------------------------------
26
22
 
27
23
  DELIVERABLES:
@@ -29,7 +25,6 @@ DELIVERABLES:
29
25
  Commit: [hash]
30
26
  Branch: [branch]
31
27
  Pushed: YES
32
- Production: [VERIFIED / VERIFIED + DEFERRED / BLOCKED]
33
28
  Files changed: [N]
34
29
 
35
30
  ===============================================================================
@@ -43,10 +38,9 @@ Add to TOP of plan document:
43
38
  # IMPLEMENTATION STATUS
44
39
 
45
40
  **Plan**: [Name]
46
- **Status**: COMPLETE -- PRODUCTION VERIFIED / COMPLETE -- PENDING DEFERRED VERIFICATION
41
+ **Status**: COMPLETE -- PUSHED
47
42
  **Last Updated**: [YYYY-MM-DD HH:MM]
48
43
  **Push Commit**: [hash]
49
- **Production Verified**: [YYYY-MM-DD HH:MM] / PENDING (deferred items in session-state/deferred-verifications.md)
50
44
  **Completed By**: Claude Code (Massu Golden Path)
51
45
 
52
46
  ## Task Completion Summary
@@ -55,59 +49,15 @@ Add to TOP of plan document:
55
49
  | 1 | [description] | 100% COMPLETE | VR-BUILD: Pass | [date] |
56
50
  ```
57
51
 
58
- ## 6.2.1 Sprint Contract Results (if Phase 2A.5 was executed)
59
-
60
- Add after Task Completion Summary:
61
-
62
- ```markdown
63
- ## Sprint Contract Results
64
- | Item | Criteria Count | Met | Unmet | Renegotiated | Final Status |
65
- |------|---------------|-----|-------|--------------|--------------|
66
- | P-XXX | N | N | 0 | 0 | FULFILLED |
67
-
68
- **Contracts Fulfilled**: N/N (100%)
69
- **Criteria Met**: N/N total acceptance criteria
70
- **Renegotiations**: N (with reasons documented in tracking table)
71
- ```
72
-
73
- Skip this section if no sprint contracts were negotiated (Phase 2A.5 skipped).
74
-
75
- ## 6.2.2 QA Evaluator Summary (if Phase 2C.2 was executed)
76
-
77
- Add after Sprint Contract Results:
78
-
79
- ```markdown
80
- ## QA Evaluator Summary
81
- | Sprint | Product Depth | Functionality | Visual Design | Code Quality | Bugs Found | Verdict |
82
- |--------|--------------|---------------|---------------|-------------|------------|---------|
83
- | 1 | 4 | 3 | 4 | 4 | 2 | PASS |
84
-
85
- **Sprints Evaluated**: N
86
- **Total Bugs Caught by QA**: N (N fixed before merge)
87
- **Average Scores**: PD=X.X FN=X.X VD=X.X CQ=X.X
88
- **QA Gate Failures**: N (required re-implementation)
89
- ```
90
-
91
- Skip this section if the plan had no UI files (QA evaluator not triggered).
92
-
93
52
  ## 6.3 Auto-Learning Protocol (MANDATORY)
94
53
 
95
54
  1. Review ALL fixes: `git diff origin/main..HEAD`
96
- 2. For each fix: verify ingested into limn memory (`massu_memory_ingest`)
97
- 3. For each fix: verify MEMORY.md updated
98
- 4. For each new pattern: verify recorded
99
- 5. For each failed approach: verify recorded as `failed_attempt`
100
- 6. Record user corrections to `memory/corrections.md`
101
- 7. Consider new CR rule if a class of bug was found
102
-
103
- ## 6.4 Quality & Observability Report
104
-
105
- Generate: `massu_quality_score`, `massu_quality_trend`, `massu_quality_report`, `massu_prompt_effectiveness`, `massu_session_stats`, `massu_prompt_analysis`, `massu_tool_patterns`.
106
-
107
- ## 6.5 Feature Registration (CR-32)
108
-
109
- Call `massu_sentinel_register` with feature name, file list, domain, test status.
55
+ 2. For each fix: verify memory files updated
56
+ 3. For each new pattern: verify recorded
57
+ 4. For each failed approach: verify recorded
58
+ 5. Record user corrections to `memory/corrections.md`
59
+ 6. Consider new CR rule if a class of bug was found
110
60
 
111
- ## 6.6 Update Session State
61
+ ## 6.4 Update Session State
112
62
 
113
63
  Update `session-state/CURRENT.md` with completion status.
@@ -5,7 +5,7 @@ allowed-tools: Bash(*), Read(*), Write(*), Edit(*), Grep(*), Glob(*), Task(*), m
5
5
  ---
6
6
  name: massu-golden-path
7
7
 
8
- > **Shared rules apply.** Read `.claude/commands/_shared-preamble.md` before proceeding. CR-12, CR-9 enforced.
8
+ > **Shared rules apply.** Read `.claude/commands/_shared-preamble.md` before proceeding. CR-9 enforced.
9
9
 
10
10
  # Massu Golden Path: Requirements to Production Push
11
11
 
@@ -24,7 +24,7 @@ This command has FULL FEATURE PARITY with the individual commands it replaces:
24
24
  - **Complete workflow (CR-11)** -- ALL phases must execute, no skipping. 100% plan coverage required
25
25
  - **Zero failures** -- Each phase gate must pass before proceeding
26
26
  - **Proof required (CR-1)** -- VR-* output pasted, not summarized. "I verified" without output = invalid
27
- - **FIX ALL ISSUES ENCOUNTERED (CR-9)** -- Whether from current changes or pre-existing
27
+ - **FIX ALL ISSUES AT ALL SEVERITY LEVELS (CR-9 + CR-45)** -- Whether from current changes or pre-existing. CRITICAL, HIGH, MEDIUM, LOW — ALL get fixed. No severity is exempt. This applies to security findings, gap analysis, enhancement analysis, code review, simplification, and every other review phase
28
28
  - **MEMORY IS MANDATORY (CR-38)** -- Persist ALL learnings before session ends
29
29
  - **Stagnation bail-out (CR-37)** -- If same item fails 3+ times, replan instead of grinding
30
30
 
@@ -62,7 +62,6 @@ After receiving approval, immediately continue. Do NOT ask "shall I continue?" -
62
62
  | **Continue** | `/massu-golden-path "Continue [feature]"` | Resume from session state |
63
63
  | **Competitive** | `/massu-golden-path --competitive "task"` | Spawn 2-3 competing implementations with bias presets, score, select winner |
64
64
  | **Competitive (3 agents)** | `/massu-golden-path --competitive --agents 3 "task"` | 3 agents with quality/ux/robust biases (default: 2 agents = quality + robust) |
65
- | **External Loop** | `/massu-golden-path --external /path/to/plan.md` | Phase 2 uses `scripts/loop-external.sh` for context-fresh iterations |
66
65
 
67
66
  ---
68
67
 
@@ -77,8 +76,8 @@ After receiving approval, immediately continue. Do NOT ask "shall I continue?" -
77
76
  | 2.5 | Gap & Enhancement Analysis | Find+fix gaps, UX issues, security, pattern compliance; loop until zero | -- |
78
77
  | 3 | Simplification | Pattern scanner, parallel semantic review, apply findings | -- |
79
78
  | 4 | Pre-Commit Verification | Verification gates, quality scoring | COMMIT APPROVAL |
80
- | 5 | Push Verification | `scripts/push-verify.sh`, CI monitoring via `scripts/ci-status.sh` | PUSH APPROVAL |
81
- | 6 | Completion | Final report, plan update, auto-learning, feature registration | -- |
79
+ | 5 | Push Verification | Push verification checks, CI monitoring | PUSH APPROVAL |
80
+ | 6 | Completion | Final report, plan update, auto-learning | -- |
82
81
 
83
82
  ---
84
83
 
@@ -86,7 +85,7 @@ After receiving approval, immediately continue. Do NOT ask "shall I continue?" -
86
85
 
87
86
  Read `references/phase-0-requirements.md` for full details.
88
87
 
89
- **Summary**: Load session context via memory tools. Build a 10-dimension requirements coverage map (D1-D10). Run ambiguity detection (7 signals). If ambiguity score >= 2, enter interview loop. Fast-track to Phase 1 when D1, D2, D5 covered or user says "skip" / "just do it".
88
+ **Summary**: Load session context via memory files. Build a 10-dimension requirements coverage map (D1-D10). Run ambiguity detection (7 signals). If ambiguity score >= 2, enter interview loop. Fast-track to Phase 1 when D1, D2, D5 covered or user says "skip" / "just do it".
90
89
 
91
90
  ---
92
91
 
@@ -95,8 +94,8 @@ Read `references/phase-0-requirements.md` for full details.
95
94
  Read `references/phase-1-plan-creation.md` for full details.
96
95
 
97
96
  **Summary**: Three sub-phases:
98
- - **1A: Research & Reality Check** -- Feature understanding, codebase check, blast radius analysis (CR-25), pattern compliance, backend-frontend coupling (CR-12), question filtering, security pre-screen (6 dimensions).
99
- - **1B: Plan Generation** -- Write plan to `docs/plans/[YYYY-MM-DD]-[feature-name].md` with P-XXX numbered items across 6 phases.
97
+ - **1A: Research & Reality Check** -- Feature understanding, config/schema reality check, config-code alignment, codebase check, blast radius analysis (CR-25), pattern compliance, tool registration check, question filtering, security pre-screen (5 dimensions).
98
+ - **1B: Plan Generation** -- Write plan to `docs/plans/[YYYY-MM-DD]-[feature-name].md` with P-XXX numbered items across 5 phases.
100
99
  - **1C: Plan Audit Loop** -- Subagent architecture. Iterate until GAPS_DISCOVERED = 0. Max 10 iterations.
101
100
 
102
101
  **Gate**: APPROVAL POINT #1: PLAN
@@ -107,12 +106,11 @@ Read `references/phase-1-plan-creation.md` for full details.
107
106
 
108
107
  Read `references/phase-2-implementation.md` for full details.
109
108
 
110
- **Summary**: Nine sub-phases (or external loop via `--external` flag using `scripts/loop-external.sh` for context-fresh iterations):
109
+ **Summary**: Seven sub-phases:
111
110
  - **2A**: Extract plan items into tracking table, initialize session state
112
- - **2A.5**: Sprint contracts -- negotiate definition-of-done per plan item before implementation (scope boundary, acceptance criteria, VR-* mapping). See `references/sprint-contract-protocol.md`
113
111
  - **2B**: Implementation loop (pre-check, execute, guardrail, verify, update per item)
114
- - **2C**: Multi-perspective review (3 parallel agents: security, architecture, UX) + **QA evaluator** (conditional, UI plans only -- adversarial Playwright-based acceptance testing against sprint contracts). See `references/qa-evaluator-spec.md`
115
- - **2D**: Verification audit loop (subagent, circuit breaker CR-37, refine-or-pivot at 3+ iterations, sprint contract verification, max 10 iterations)
112
+ - **2C**: Multi-perspective review (3 parallel agents: security, architecture, quality)
113
+ - **2D**: Verification audit loop (subagent, circuit breaker CR-37, max 10 iterations)
116
114
  - **2E**: Post-build reflection + memory persist (CR-38)
117
115
  - **2F**: Documentation sync (if user-facing features)
118
116
  - **2G**: Browser verification & fix loop (auto-triggers if UI files changed, Playwright MCP)
@@ -125,7 +123,7 @@ Read `references/phase-2-implementation.md` for full details.
125
123
 
126
124
  Read `references/phase-2.5-gap-analyzer.md` for full details.
127
125
 
128
- **Summary**: After implementation completes, run a continuous gap and enhancement analysis loop. A subagent analyzes all changed files across 7 categories (functional gaps, UX gaps, data integrity, security, pattern compliance, enhancements, sprint contract compliance). VR-VISUAL uses weighted 4-dimension scoring (threshold >= 3.0). Every gap/enhancement found is fixed immediately. The loop re-runs until a full pass discovers ZERO gaps. Max 10 iterations. Skippable only for documentation-only changes or explicit user request.
126
+ **Summary**: After implementation completes, run a continuous gap and enhancement analysis loop. A subagent analyzes all changed files across 6 categories (functional gaps, UX gaps, data integrity, security, pattern compliance, enhancements). Every gap/enhancement found is fixed immediately. The loop re-runs until a full pass discovers ZERO gaps. Max 10 iterations. Skippable only for documentation-only changes or explicit user request.
129
127
 
130
128
  ---
131
129
 
@@ -141,7 +139,7 @@ Read `references/phase-3-simplify.md` for full details.
141
139
 
142
140
  Read `references/phase-4-commit.md` for full details.
143
141
 
144
- **Summary**: Verification gates (pattern scanner, tsc, build, lint, secrets, VR-RENDER, VR-COUPLING, plan coverage, plan status, dep security). Quality scoring gate. Auto-fix on failure.
142
+ **Summary**: Auto-verification gates (pattern scanner, tsc, build, tests, hooks, generalization, security, secrets, tool registration, plan coverage, plan status, dep security). Quality scoring gate. Auto-fix on failure.
145
143
 
146
144
  **Gate**: APPROVAL POINT #3: COMMIT
147
145
 
@@ -151,7 +149,7 @@ Read `references/phase-4-commit.md` for full details.
151
149
 
152
150
  Read `references/phase-5-push.md` for full details.
153
151
 
154
- **Summary**: Pre-flight (commits to push). Tier 1: quick re-verification. Tier 2: test suite with mandatory regression detection. Tier 3: security & compliance (npm audit, secrets scan). Tier 4: final gate.
152
+ **Summary**: Pre-flight (commits to push). Tier 1: quick re-verification. Tier 2: test suite with mandatory regression detection. Tier 3: security & compliance. Tier 4: final gate.
155
153
 
156
154
  **Gate**: APPROVAL POINT #4: PUSH
157
155
 
@@ -161,7 +159,7 @@ Read `references/phase-5-push.md` for full details.
161
159
 
162
160
  Read `references/phase-6-completion.md` for full details.
163
161
 
164
- **Summary**: Final report with phase-by-phase status. Plan document update (IMPLEMENTATION STATUS at top). Auto-learning protocol (memory ingest for all fixes/patterns). Quality & observability report. Feature registration. Session state update.
162
+ **Summary**: Final report with phase-by-phase status. Plan document update (IMPLEMENTATION STATUS at top). Auto-learning protocol (memory updates for all fixes/patterns). Session state update.
165
163
 
166
164
  ---
167
165
 
@@ -172,16 +170,13 @@ This skill is a folder. The following files are available for reference:
172
170
  | File | Purpose | Read When |
173
171
  |------|---------|-----------|
174
172
  | `references/phase-0-requirements.md` | Requirements interview, ambiguity detection, 10-dimension coverage map | Starting a new implementation from a task description |
175
- | `references/phase-1-plan-creation.md` | Blast radius analysis, plan generation, audit loop | Writing or auditing a plan |
176
- | `references/phase-2-implementation.md` | Item loop, sprint contracts, multi-perspective review, QA evaluator, verification audit, browser testing | Executing implementation; any Phase 2 sub-phase |
177
- | `references/sprint-contract-protocol.md` | Sprint contract template, quality bar, negotiation rules, skip conditions | Phase 2A.5 sprint contract negotiation |
178
- | `references/qa-evaluator-spec.md` | Adversarial QA evaluator: 4 dimensions, anti-leniency rules, known failure patterns | Phase 2C.2 QA evaluation (UI plans only) |
179
- | `references/vr-visual-calibration.md` | Score 5/3/1 calibration examples for VR-VISUAL weighted dimensions | Calibrating VR-VISUAL evaluator scoring |
180
- | `references/phase-2.5-gap-analyzer.md` | Gap/enhancement analysis loop, 7 categories (incl. sprint contract compliance), fix-and-repass until zero | After implementation, before simplification |
173
+ | `references/phase-1-plan-creation.md` | Config/schema reality check, blast radius analysis, plan generation, audit loop | Writing or auditing a plan |
174
+ | `references/phase-2-implementation.md` | Item loop, multi-perspective review, verification audit, browser testing | Executing implementation; any Phase 2 sub-phase |
175
+ | `references/phase-2.5-gap-analyzer.md` | Gap/enhancement analysis loop, 6 categories, fix-and-repass until zero | After implementation, before simplification |
181
176
  | `references/phase-3-simplify.md` | Pattern scanner fast gate, dead code detection, parallel semantic review agents | Running simplification after implementation |
182
- | `references/phase-4-commit.md` | Verification gates, quality scoring, commit format | Preparing a commit |
183
- | `references/phase-5-push.md` | Pre-flight, push verification, regression detection | Preparing to push to remote |
184
- | `references/phase-6-completion.md` | Final report, plan status update, auto-learning, feature registration | After all verification; completing the golden path |
177
+ | `references/phase-4-commit.md` | Auto-verification gates, quality scoring, commit format | Preparing a commit |
178
+ | `references/phase-5-push.md` | Pre-flight, 4-tier push verification, regression detection | Preparing to push to remote |
179
+ | `references/phase-6-completion.md` | Final report, plan status update, auto-learning | After push; completing the golden path |
185
180
  | `references/approval-points.md` | Exact format and options for all 4 approval points (5 with --competitive: Plan, New Pattern, Winner Selection, Commit, Push) | Presenting any approval gate to the user |
186
181
  | `references/competitive-mode.md` | Competitive mode protocol: agent spawning, scoring, winner selection | Using --competitive flag |
187
182
  | `references/error-handling.md` | Abort handling, non-recoverable errors, post-compaction re-verification, competitive mode errors | On user abort, blocker error, or after context compaction |
@@ -191,8 +186,8 @@ This skill is a folder. The following files are available for reference:
191
186
  ## Gotchas
192
187
 
193
188
  - **Compaction mid-loop loses plan state** -- if context compaction occurs during implementation, the plan file path and current item must be recoverable from session-state/CURRENT.md
194
- - **UI items need browser verification (CR-41)** -- any plan item touching UI files must be verified with Playwright before claiming done
195
- - **Approval points must not be skipped** -- there are 4 approval gates (5 with --competitive: Plan, New Pattern, Winner Selection, Commit, Push)
189
+ - **UI items need browser verification** -- any plan item touching UI files must be verified with Playwright before claiming done
190
+ - **Approval points must not be skipped** -- there are 4 approval gates (5 with --competitive: Plan, New Pattern, Winner Selection, Commit, Push). Skipping any gate is a violation
196
191
  - **Plan file must be re-read from disk, not memory (CR-5)** -- after compaction, always re-read the plan file. Memory of plan contents drifts from reality
197
192
  - **100% coverage required (CR-11)** -- never stop early. "Most items done" is not "all items done"
198
193
  - **--competitive increases token cost ~2-3x for Phase 2** -- use for high-stakes features only
@@ -209,8 +204,8 @@ This skill is a folder. The following files are available for reference:
209
204
  | Code Clarity | 1-5 | Naming, structure, comments |
210
205
  | Pattern Compliance | 1-5 | CLAUDE.md patterns followed |
211
206
  | Error Handling | 1-5 | Edge cases, validation, fallbacks |
212
- | UX Quality | 1-5 | Loading/error/empty states, accessibility |
213
207
  | Test Coverage | 1-5 | Test files exist for new code |
208
+ | Config-Driven Design | 1-5 | No hardcoded project-specific values |
214
209
 
215
210
  All >= 3: PASS. Any < 3: FAIL.
216
211
 
@@ -218,7 +213,7 @@ All >= 3: PASS. Any < 3: FAIL.
218
213
 
219
214
  ## START NOW
220
215
 
221
- **Step 0: Write AUTHORIZED_COMMAND to session state (CR-12)**
216
+ **Step 0: Write AUTHORIZED_COMMAND to session state (CR-35)**
222
217
 
223
218
  Update `session-state/CURRENT.md`:
224
219
  ```
@@ -233,7 +228,7 @@ AUTHORIZED_COMMAND: massu-golden-path
233
228
  5. **Phase 2.5**: Gap & enhancement analysis loop (until zero gaps)
234
229
  6. **Phase 3**: Simplification (efficiency, reuse, patterns)
235
230
  7. **Phase 4**: Pre-commit verification -> **PAUSE: Commit Approval**
236
- 8. **Phase 5**: Push verification via `scripts/push-verify.sh` -> **PAUSE: Push Approval**
231
+ 8. **Phase 5**: Push verification -> **PAUSE: Push Approval**
237
232
  9. **Phase 6**: Completion, learning, quality metrics
238
233
 
239
234
  **This command does NOT stop to ask "should I continue?" -- it runs straight through.**
@@ -7,24 +7,20 @@
7
7
  ```
8
8
  CHECKPOINT AUDIT FLOW:
9
9
  [1] READ plan section for this checkpoint
10
- [2] QUERY database to verify tables/columns/policies/grants (all envs)
11
- [3] GREP router files to verify procedures exist
12
- [4] LS component files to verify they exist
13
- [5] VR-RENDER: Verify UI components are RENDERED in pages (not just created)
14
- [6] VR-COUPLING: Run ./scripts/check-coupling.sh (backend features exposed in UI)
15
- [7] GREP for pattern violations (P-001 through P-008)
16
- [8] RUN build verification (npm run build)
17
- [9] RUN type verification (npx tsc --noEmit)
18
- [10] RUN lint verification (npm run lint)
19
- [11] RUN prisma validate (npx prisma validate)
20
- [12] RUN tests (npm test) - MANDATORY, NOT optional
21
- [13] RUN UI/UX verification (if UI changes)
22
- [14] RUN API/router verification (if API changes)
23
- [15] RUN security check (secrets staged)
24
- [16] COUNT gaps found
25
- [17] IF gaps > 0: FIX each gap, return to Step 1
26
- [18] IF gaps = 0: UPDATE session state
27
- [19] IF gaps = 0: Create checkpoint sign-off
10
+ [2] GREP source files to verify modules/tools exist
11
+ [3] LS files to verify they exist
12
+ [4] VR-TOOL-REG: Verify tools are WIRED in tools.ts (not just created)
13
+ [5] GREP for pattern violations
14
+ [6] RUN build verification (npm run build)
15
+ [7] RUN type verification (cd packages/core && npx tsc --noEmit)
16
+ [8] RUN tests (npm test) - MANDATORY, NOT optional
17
+ [9] RUN hook build (cd packages/core && npm run build:hooks)
18
+ [10] RUN pattern scanner (bash scripts/massu-pattern-scanner.sh)
19
+ [11] RUN security check (secrets staged)
20
+ [12] COUNT gaps found
21
+ [13] IF gaps > 0: FIX each gap, return to Step 1
22
+ [14] IF gaps = 0: UPDATE session state
23
+ [15] IF gaps = 0: Create checkpoint sign-off
28
24
  ```
29
25
 
30
26
  ---