@massu/core 0.6.1 → 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 (28) hide show
  1. package/commands/_shared-preamble.md +14 -0
  2. package/commands/_shared-references/verification-table.md +0 -3
  3. package/commands/massu-ci-fix.md +2 -2
  4. package/commands/massu-gap-enhancement-analyzer.md +85 -345
  5. package/commands/massu-golden-path/references/approval-points.md +9 -12
  6. package/commands/massu-golden-path/references/competitive-mode.md +9 -7
  7. package/commands/massu-golden-path/references/error-handling.md +4 -2
  8. package/commands/massu-golden-path/references/phase-0-requirements.md +3 -3
  9. package/commands/massu-golden-path/references/phase-1-plan-creation.md +41 -52
  10. package/commands/massu-golden-path/references/phase-2-implementation.md +50 -157
  11. package/commands/massu-golden-path/references/phase-2.5-gap-analyzer.md +14 -48
  12. package/commands/massu-golden-path/references/phase-3-simplify.md +5 -5
  13. package/commands/massu-golden-path/references/phase-4-commit.md +20 -46
  14. package/commands/massu-golden-path/references/phase-5-push.md +14 -47
  15. package/commands/massu-golden-path/references/phase-6-completion.md +8 -58
  16. package/commands/massu-golden-path.md +27 -43
  17. package/commands/massu-loop/references/checkpoint-audit.md +14 -18
  18. package/commands/massu-loop/references/guardrails.md +3 -3
  19. package/commands/massu-loop/references/iteration-structure.md +46 -14
  20. package/commands/massu-loop/references/loop-controller.md +72 -63
  21. package/commands/massu-loop/references/plan-extraction.md +19 -11
  22. package/commands/massu-loop/references/vr-plan-spec.md +20 -28
  23. package/commands/massu-loop.md +36 -56
  24. package/commands/massu-review.md +2 -2
  25. package/dist/cli.js +0 -0
  26. package/package.json +1 -1
  27. package/README.md +0 -40
  28. package/commands/massu-golden-path/references/phase-3.5-security-audit.md +0 -108
@@ -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,67 +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
- I. RUNTIME & BOOT VERIFICATION (CR-44, Incident 2026-03-29)
95
- - For EACH service that was created, modified, or registered in this session:
96
- 1. VR-DEPS: Verify .venv/bin/python3 exists (if plist references it)
97
- 2. VR-DEPS: Parse imports from main.py, verify each is installed in the venv
98
- 3. VR-COMPAT: Check for Python 3.10+ syntax (x | None, match/case) on Python 3.9 systems
99
- 4. VR-BOOT: Actually start the service (launchctl bootstrap or direct python), wait 5s, verify:
100
- - Process is still alive (pgrep)
101
- - Exit code is 0 (launchctl list | grep service)
102
- - stderr log has no import errors or crashes
103
- 5. If boot fails: read stderr log, diagnose (missing package? wrong path? syntax error?), fix, retry
104
- - Skip condition: plan has NO service/daemon/LaunchAgent items
105
- - This category exists because static verification (VR-SYNTAX, VR-GREP) cannot catch:
106
- missing venvs, missing pip packages, Python version incompatibilities, or runtime import errors
107
-
108
- H. SPRINT CONTRACT COMPLIANCE (if contracts exist from Phase 2A.5)
109
- - Read the sprint contracts from the Phase 2A tracking table
110
- - For EACH plan item with a sprint contract:
111
- 1. List all acceptance criteria from the contract
112
- 2. Verify EACH criterion with specific evidence (grep, screenshot, DOM state, network response)
113
- 3. Any unmet criterion = GAP (P1 severity minimum)
114
- - Contract criteria are IN ADDITION TO categories A-G — both must pass
115
- - Skip condition: items marked `Contract: N/A` in the tracking table
116
- - If no sprint contracts were negotiated (Phase 2A.5 skipped), skip this category
117
-
118
84
  FOR EACH FINDING:
119
85
  1. Classify: GAP (must fix) or ENHANCEMENT (should fix)
120
86
  2. Severity: P0 (broken) / P1 (incorrect) / P2 (polish)
@@ -129,14 +95,14 @@ WHILE iteration < MAX_ITERATIONS:
129
95
 
130
96
  | # | Type | Severity | Description | File | Fixed |
131
97
  |---|------|----------|-------------|------|-------|
132
- | 1 | GAP | P0 | Missing error boundary | src/app/.../page.tsx | YES |
98
+ | 1 | GAP | P0 | Missing error boundary | src/... | YES |
133
99
  ```
134
100
  ")
135
101
 
136
102
  gaps = parse GAPS_DISCOVERED from result
137
103
 
138
104
  IF gaps == 0:
139
- Output: "Gap analysis clean in iteration {iteration} zero gaps found"
105
+ Output: "Gap analysis clean in iteration {iteration} -- zero gaps found"
140
106
  BREAK
141
107
  ELSE:
142
108
  Output: "Iteration {iteration}: {gaps} gaps found and fixed, re-analyzing..."
@@ -156,7 +122,7 @@ IF iteration == MAX_ITERATIONS AND gaps > 0:
156
122
  | **Full re-pass required** | After fixes, a fresh pass must find ZERO to exit |
157
123
  | **P0 gaps block** | Any P0 gap that can't be fixed stops the golden path |
158
124
  | **Enhancements are mandatory** | Enhancements found MUST be applied (this is golden path, not quick fix) |
159
- | **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 |
160
126
  | **No new files without reason** | Don't create helper files that aren't needed |
161
127
 
162
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,17 +5,17 @@ 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
 
12
12
  ## Objective
13
13
 
14
14
  Execute the COMPLETE development workflow in one continuous run:
15
- **Requirements -> Plan Creation -> Plan Audit -> Implementation -> Gap Analysis -> Simplification -> Security Audit -> Commit -> Push**
15
+ **Requirements -> Plan Creation -> Plan Audit -> Implementation -> Gap Analysis -> Simplification -> Commit -> Push**
16
16
 
17
17
  This command has FULL FEATURE PARITY with the individual commands it replaces:
18
- `/massu-create-plan` -> `/massu-plan` -> `/massu-loop` -> `/massu-loop-playwright` -> `/massu-simplify` -> `/massu-security` -> `/massu-commit` -> `/massu-push`
18
+ `/massu-create-plan` -> `/massu-plan` -> `/massu-loop` -> `/massu-loop-playwright` -> `/massu-simplify` -> `/massu-commit` -> `/massu-push`
19
19
 
20
20
  ---
21
21
 
@@ -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
 
@@ -76,10 +75,9 @@ After receiving approval, immediately continue. Do NOT ask "shall I continue?" -
76
75
  | 2-COMP | Competitive Implementation | Spawn N agents with bias presets, score, select winner (`--competitive` only) | WINNER SELECTION |
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
- | 3.5 | Deep Security Audit | Full adversarial audit loop with parallel red-team agents, iterate to zero findings | -- |
80
78
  | 4 | Pre-Commit Verification | Verification gates, quality scoring | COMMIT APPROVAL |
81
- | 5 | Push Verification | `scripts/push-verify.sh`, CI monitoring via `scripts/ci-status.sh` | PUSH APPROVAL |
82
- | 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 | -- |
83
81
 
84
82
  ---
85
83
 
@@ -87,7 +85,7 @@ After receiving approval, immediately continue. Do NOT ask "shall I continue?" -
87
85
 
88
86
  Read `references/phase-0-requirements.md` for full details.
89
87
 
90
- **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".
91
89
 
92
90
  ---
93
91
 
@@ -96,8 +94,8 @@ Read `references/phase-0-requirements.md` for full details.
96
94
  Read `references/phase-1-plan-creation.md` for full details.
97
95
 
98
96
  **Summary**: Three sub-phases:
99
- - **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).
100
- - **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.
101
99
  - **1C: Plan Audit Loop** -- Subagent architecture. Iterate until GAPS_DISCOVERED = 0. Max 10 iterations.
102
100
 
103
101
  **Gate**: APPROVAL POINT #1: PLAN
@@ -108,12 +106,11 @@ Read `references/phase-1-plan-creation.md` for full details.
108
106
 
109
107
  Read `references/phase-2-implementation.md` for full details.
110
108
 
111
- **Summary**: Nine sub-phases (or external loop via `--external` flag using `scripts/loop-external.sh` for context-fresh iterations):
109
+ **Summary**: Seven sub-phases:
112
110
  - **2A**: Extract plan items into tracking table, initialize session state
113
- - **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`
114
111
  - **2B**: Implementation loop (pre-check, execute, guardrail, verify, update per item)
115
- - **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`
116
- - **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)
117
114
  - **2E**: Post-build reflection + memory persist (CR-38)
118
115
  - **2F**: Documentation sync (if user-facing features)
119
116
  - **2G**: Browser verification & fix loop (auto-triggers if UI files changed, Playwright MCP)
@@ -126,7 +123,7 @@ Read `references/phase-2-implementation.md` for full details.
126
123
 
127
124
  Read `references/phase-2.5-gap-analyzer.md` for full details.
128
125
 
129
- **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.
130
127
 
131
128
  ---
132
129
 
@@ -138,19 +135,11 @@ Read `references/phase-3-simplify.md` for full details.
138
135
 
139
136
  ---
140
137
 
141
- ## PHASE 3.5: DEEP SECURITY AUDIT
142
-
143
- Read `references/phase-3.5-security-audit.md` for full details.
144
-
145
- **Summary**: Run a full adversarial security audit loop against ALL changed files. Launches 2-4 parallel red-team agents (injection, network/leakage, DoS, bypass) per iteration. Every finding is fixed in-place. Loop iterates until zero findings remain (max 5 iterations). This phase is NEVER skipped -- security is non-negotiable. Security fixes flow into Phase 4's verification gates automatically.
146
-
147
- ---
148
-
149
138
  ## PHASE 4: PRE-COMMIT VERIFICATION
150
139
 
151
140
  Read `references/phase-4-commit.md` for full details.
152
141
 
153
- **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.
154
143
 
155
144
  **Gate**: APPROVAL POINT #3: COMMIT
156
145
 
@@ -160,7 +149,7 @@ Read `references/phase-4-commit.md` for full details.
160
149
 
161
150
  Read `references/phase-5-push.md` for full details.
162
151
 
163
- **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.
164
153
 
165
154
  **Gate**: APPROVAL POINT #4: PUSH
166
155
 
@@ -170,7 +159,7 @@ Read `references/phase-5-push.md` for full details.
170
159
 
171
160
  Read `references/phase-6-completion.md` for full details.
172
161
 
173
- **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.
174
163
 
175
164
  ---
176
165
 
@@ -181,17 +170,13 @@ This skill is a folder. The following files are available for reference:
181
170
  | File | Purpose | Read When |
182
171
  |------|---------|-----------|
183
172
  | `references/phase-0-requirements.md` | Requirements interview, ambiguity detection, 10-dimension coverage map | Starting a new implementation from a task description |
184
- | `references/phase-1-plan-creation.md` | Blast radius analysis, plan generation, audit loop | Writing or auditing a plan |
185
- | `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 |
186
- | `references/sprint-contract-protocol.md` | Sprint contract template, quality bar, negotiation rules, skip conditions | Phase 2A.5 sprint contract negotiation |
187
- | `references/qa-evaluator-spec.md` | Adversarial QA evaluator: 4 dimensions, anti-leniency rules, known failure patterns | Phase 2C.2 QA evaluation (UI plans only) |
188
- | `references/vr-visual-calibration.md` | Score 5/3/1 calibration examples for VR-VISUAL weighted dimensions | Calibrating VR-VISUAL evaluator scoring |
189
- | `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 |
190
176
  | `references/phase-3-simplify.md` | Pattern scanner fast gate, dead code detection, parallel semantic review agents | Running simplification after implementation |
191
- | `references/phase-3.5-security-audit.md` | Deep adversarial security audit loop with parallel red-team agents, iterate to zero findings | After simplification, before commit verification |
192
- | `references/phase-4-commit.md` | Verification gates, quality scoring, commit format | Preparing a commit |
193
- | `references/phase-5-push.md` | Pre-flight, push verification, regression detection | Preparing to push to remote |
194
- | `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 |
195
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 |
196
181
  | `references/competitive-mode.md` | Competitive mode protocol: agent spawning, scoring, winner selection | Using --competitive flag |
197
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 |
@@ -201,8 +186,8 @@ This skill is a folder. The following files are available for reference:
201
186
  ## Gotchas
202
187
 
203
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
204
- - **UI items need browser verification (CR-41)** -- any plan item touching UI files must be verified with Playwright before claiming done
205
- - **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
206
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
207
192
  - **100% coverage required (CR-11)** -- never stop early. "Most items done" is not "all items done"
208
193
  - **--competitive increases token cost ~2-3x for Phase 2** -- use for high-stakes features only
@@ -219,8 +204,8 @@ This skill is a folder. The following files are available for reference:
219
204
  | Code Clarity | 1-5 | Naming, structure, comments |
220
205
  | Pattern Compliance | 1-5 | CLAUDE.md patterns followed |
221
206
  | Error Handling | 1-5 | Edge cases, validation, fallbacks |
222
- | UX Quality | 1-5 | Loading/error/empty states, accessibility |
223
207
  | Test Coverage | 1-5 | Test files exist for new code |
208
+ | Config-Driven Design | 1-5 | No hardcoded project-specific values |
224
209
 
225
210
  All >= 3: PASS. Any < 3: FAIL.
226
211
 
@@ -228,7 +213,7 @@ All >= 3: PASS. Any < 3: FAIL.
228
213
 
229
214
  ## START NOW
230
215
 
231
- **Step 0: Write AUTHORIZED_COMMAND to session state (CR-12)**
216
+ **Step 0: Write AUTHORIZED_COMMAND to session state (CR-35)**
232
217
 
233
218
  Update `session-state/CURRENT.md`:
234
219
  ```
@@ -242,9 +227,8 @@ AUTHORIZED_COMMAND: massu-golden-path
242
227
  4a. **Phase 2-COMP**: Competitive implementation (if --competitive) -> **PAUSE: Winner Selection**
243
228
  5. **Phase 2.5**: Gap & enhancement analysis loop (until zero gaps)
244
229
  6. **Phase 3**: Simplification (efficiency, reuse, patterns)
245
- 6.5. **Phase 3.5**: Deep security audit (adversarial red-team loop to zero findings)
246
230
  7. **Phase 4**: Pre-commit verification -> **PAUSE: Commit Approval**
247
- 8. **Phase 5**: Push verification via `scripts/push-verify.sh` -> **PAUSE: Push Approval**
231
+ 8. **Phase 5**: Push verification -> **PAUSE: Push Approval**
248
232
  9. **Phase 6**: Completion, learning, quality metrics
249
233
 
250
234
  **This command does NOT stop to ask "should I continue?" -- it runs straight through.**