@massu/core 0.5.0 → 0.6.1

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 (119) hide show
  1. package/README.md +40 -0
  2. package/agents/massu-architecture-reviewer.md +104 -0
  3. package/agents/massu-blast-radius-analyzer.md +84 -0
  4. package/agents/massu-competitive-scorer.md +126 -0
  5. package/agents/massu-help-sync.md +73 -0
  6. package/agents/massu-migration-writer.md +94 -0
  7. package/agents/massu-output-scorer.md +87 -0
  8. package/agents/massu-pattern-reviewer.md +84 -0
  9. package/agents/massu-plan-auditor.md +170 -0
  10. package/agents/massu-schema-sync-verifier.md +70 -0
  11. package/agents/massu-security-reviewer.md +98 -0
  12. package/agents/massu-ux-reviewer.md +106 -0
  13. package/commands/_shared-preamble.md +53 -23
  14. package/commands/_shared-references/auto-learning-protocol.md +71 -0
  15. package/commands/_shared-references/blast-radius-protocol.md +76 -0
  16. package/commands/_shared-references/security-pre-screen.md +64 -0
  17. package/commands/_shared-references/test-first-protocol.md +87 -0
  18. package/commands/_shared-references/verification-table.md +55 -0
  19. package/commands/massu-article-review.md +343 -0
  20. package/commands/massu-autoresearch/references/eval-runner.md +84 -0
  21. package/commands/massu-autoresearch/references/safety-rails.md +125 -0
  22. package/commands/massu-autoresearch/references/scoring-protocol.md +151 -0
  23. package/commands/massu-autoresearch.md +258 -0
  24. package/commands/massu-batch.md +44 -12
  25. package/commands/massu-bearings.md +42 -8
  26. package/commands/massu-checkpoint.md +588 -0
  27. package/commands/massu-ci-fix.md +2 -2
  28. package/commands/massu-command-health.md +132 -0
  29. package/commands/massu-command-improve.md +232 -0
  30. package/commands/massu-commit.md +205 -44
  31. package/commands/massu-create-plan.md +239 -57
  32. package/commands/massu-data/references/common-queries.md +79 -0
  33. package/commands/massu-data/references/table-guide.md +50 -0
  34. package/commands/massu-data.md +66 -0
  35. package/commands/massu-dead-code.md +29 -34
  36. package/commands/massu-debug/references/auto-learning.md +61 -0
  37. package/commands/massu-debug/references/codegraph-tracing.md +80 -0
  38. package/commands/massu-debug/references/common-shortcuts.md +98 -0
  39. package/commands/massu-debug/references/investigation-phases.md +294 -0
  40. package/commands/massu-debug/references/report-format.md +107 -0
  41. package/commands/massu-debug.md +105 -386
  42. package/commands/massu-docs.md +1 -1
  43. package/commands/massu-full-audit.md +61 -0
  44. package/commands/massu-gap-enhancement-analyzer.md +276 -16
  45. package/commands/massu-golden-path/references/approval-points.md +216 -0
  46. package/commands/massu-golden-path/references/competitive-mode.md +273 -0
  47. package/commands/massu-golden-path/references/error-handling.md +121 -0
  48. package/commands/massu-golden-path/references/phase-0-requirements.md +53 -0
  49. package/commands/massu-golden-path/references/phase-1-plan-creation.md +168 -0
  50. package/commands/massu-golden-path/references/phase-2-implementation.md +403 -0
  51. package/commands/massu-golden-path/references/phase-2.5-gap-analyzer.md +170 -0
  52. package/commands/massu-golden-path/references/phase-3-simplify.md +40 -0
  53. package/commands/massu-golden-path/references/phase-3.5-security-audit.md +108 -0
  54. package/commands/massu-golden-path/references/phase-4-commit.md +94 -0
  55. package/commands/massu-golden-path/references/phase-5-push.md +116 -0
  56. package/commands/massu-golden-path/references/phase-5.5-production-verify.md +170 -0
  57. package/commands/massu-golden-path/references/phase-6-completion.md +113 -0
  58. package/commands/massu-golden-path/references/qa-evaluator-spec.md +137 -0
  59. package/commands/massu-golden-path/references/sprint-contract-protocol.md +117 -0
  60. package/commands/massu-golden-path/references/vr-visual-calibration.md +73 -0
  61. package/commands/massu-golden-path.md +121 -844
  62. package/commands/massu-guide.md +72 -69
  63. package/commands/massu-hooks.md +27 -12
  64. package/commands/massu-hotfix.md +221 -144
  65. package/commands/massu-incident.md +49 -20
  66. package/commands/massu-infra-audit.md +187 -0
  67. package/commands/massu-learning-audit.md +211 -0
  68. package/commands/massu-loop/references/auto-learning.md +49 -0
  69. package/commands/massu-loop/references/checkpoint-audit.md +40 -0
  70. package/commands/massu-loop/references/guardrails.md +17 -0
  71. package/commands/massu-loop/references/iteration-structure.md +115 -0
  72. package/commands/massu-loop/references/loop-controller.md +188 -0
  73. package/commands/massu-loop/references/plan-extraction.md +78 -0
  74. package/commands/massu-loop/references/vr-plan-spec.md +140 -0
  75. package/commands/massu-loop-playwright.md +9 -9
  76. package/commands/massu-loop.md +115 -670
  77. package/commands/massu-new-pattern.md +423 -0
  78. package/commands/massu-perf.md +422 -0
  79. package/commands/massu-plan-audit.md +1 -1
  80. package/commands/massu-plan.md +389 -122
  81. package/commands/massu-production-verify.md +433 -0
  82. package/commands/massu-push.md +62 -378
  83. package/commands/massu-recap.md +29 -3
  84. package/commands/massu-rollback.md +613 -0
  85. package/commands/massu-scaffold-hook.md +2 -4
  86. package/commands/massu-scaffold-page.md +2 -3
  87. package/commands/massu-scaffold-router.md +1 -2
  88. package/commands/massu-security.md +619 -0
  89. package/commands/massu-simplify.md +115 -85
  90. package/commands/massu-squirrels.md +2 -2
  91. package/commands/massu-tdd.md +38 -22
  92. package/commands/massu-test.md +3 -3
  93. package/commands/massu-type-mismatch-audit.md +469 -0
  94. package/commands/massu-ui-audit.md +587 -0
  95. package/commands/massu-verify-playwright.md +287 -32
  96. package/commands/massu-verify.md +150 -46
  97. package/dist/cli.js +146 -95
  98. package/package.json +6 -2
  99. package/patterns/build-patterns.md +302 -0
  100. package/patterns/component-patterns.md +246 -0
  101. package/patterns/display-patterns.md +185 -0
  102. package/patterns/form-patterns.md +890 -0
  103. package/patterns/integration-testing-checklist.md +445 -0
  104. package/patterns/security-patterns.md +219 -0
  105. package/patterns/testing-patterns.md +569 -0
  106. package/patterns/tool-routing.md +81 -0
  107. package/patterns/ui-patterns.md +371 -0
  108. package/protocols/plan-implementation.md +267 -0
  109. package/protocols/recovery.md +225 -0
  110. package/protocols/verification.md +404 -0
  111. package/reference/command-taxonomy.md +178 -0
  112. package/reference/cr-rules-reference.md +76 -0
  113. package/reference/hook-execution-order.md +148 -0
  114. package/reference/lessons-learned.md +175 -0
  115. package/reference/patterns-quickref.md +208 -0
  116. package/reference/standards.md +135 -0
  117. package/reference/subagents-reference.md +17 -0
  118. package/reference/vr-verification-reference.md +867 -0
  119. package/src/commands/install-commands.ts +149 -53
@@ -0,0 +1,867 @@
1
+ # VR-* Verification Reference
2
+
3
+ **Purpose**: Master reference for ALL verification types used across massu commands. Every verification prevents a specific class of bugs from reaching production.
4
+
5
+ **When to Read**: Before claiming ANY work is complete. During massu command execution. After any audit failure.
6
+
7
+ ---
8
+
9
+ ## Sections
10
+ | Section | Description |
11
+ |---------|-------------|
12
+ | Quick Reference Matrix | All VR-* types: command, expected output, use case, what it catches |
13
+ | Core Verification Types | VR-FILE, VR-GREP, VR-NEGATIVE, VR-BUILD, VR-TYPE, VR-TEST, VR-DEPLOY, VR-SCHEMA |
14
+ | UI-Specific Verification Types | VR-RENDER, VR-ROUTE, VR-LINK, VR-HANDLER, VR-PROPS, VR-STATE, VR-FORM |
15
+ | Security Verification Types | VR-AUTH, VR-RLS, VR-SECRETS, VR-PATTERN, VR-SCAN |
16
+ | Quality Verification Types | VR-A11Y, VR-MOBILE, VR-PERF, VR-LINT, VR-COUPLING |
17
+ | End-to-End Verification Types | VR-E2E, VR-VISUAL, VR-FLOW, VR-REGRESSION |
18
+ | Database Verification Types | VR-SCHEMA-PRE, VR-DATA, VR-MIGRATION, VR-BLAST-RADIUS, VR-SCHEMA-SYNC |
19
+ | Plan Verification Types | VR-PLAN-STATUS, VR-PLAN-TABS, VR-PLAN-SPEC, VR-PLAN-COVERAGE, VR-COUNT, VR-FEATURE-REG, VR-SPEC-MATCH, VR-PIPELINE |
20
+ | Verification Checklists by Task Type | Per-task checklists: new feature, bug fix, refactor, migration, security |
21
+ | Verification Output Format | Standard format for reporting verification results |
22
+
23
+ ## Quick Reference Matrix
24
+
25
+ | Type | Command | Expected | Use When | Catches |
26
+ |------|---------|----------|----------|---------|
27
+ | VR-FILE | `ls -la [path]` | File exists | Claiming file created | Missing files |
28
+ | VR-GREP | `grep "[pattern]" [file]` | Match found | Claiming code added | Missing code |
29
+ | VR-NEGATIVE | `grep -rn "[old]" src/` | 0 matches | Claiming removal | Leftover code |
30
+ | VR-BUILD | `npm run build` | Exit 0 | Claiming production ready | Build failures |
31
+ | VR-TYPE | `npx tsc --noEmit` | 0 errors | Claiming type safety | Type errors |
32
+ | VR-TEST | `npm test` | All pass | Claiming tested | Test failures |
33
+ | VR-DEPLOY | `./scripts/pre-deploy-check.sh` | All pass | Claiming deployable | Deploy blockers |
34
+ | VR-SCHEMA | `SELECT ... FROM information_schema` | Matches | Before DB operations | Schema mismatches |
35
+ | VR-SCHEMA-PRE | `SELECT column_name...` | Columns exist | BEFORE writing ANY query | Wrong column names |
36
+ | VR-COUNT | `grep -c "[pattern]" [file]` | Expected count | Verifying all instances | Missed instances |
37
+ | VR-RENDER | `grep "<Component" src/app/**/page.tsx` | Match in page | Claiming UI integrated | Orphan components |
38
+ | VR-INTEGRATION | grep + build | Component used AND builds | Claiming feature complete | Unused features |
39
+ | VR-ROUTE | `grep "path:" src/app/` | Route defined | Claiming route works | Broken routes |
40
+ | VR-LINK | `grep "href=" [file]` + route check | Link target exists | Claiming navigation | Dead links |
41
+ | VR-HANDLER | `grep "onClick\|onSubmit" [file]` | Handler exists | Claiming interactivity | Dead buttons |
42
+ | VR-PROPS | TypeScript + grep | Props passed correctly | Claiming component works | Missing props |
43
+ | VR-STATE | grep + useEffect check | State managed correctly | Claiming data flows | State bugs |
44
+ | VR-FORM | grep for validation + submit | Form validates/submits | Claiming form works | Broken forms |
45
+ | VR-A11Y | Accessibility check | WCAG compliance | Claiming accessible | A11y violations |
46
+ | VR-MOBILE | Viewport + touch check | Mobile responsive | Claiming mobile support | Mobile breakage |
47
+ | VR-AUTH | Role/permission check | Auth enforced | Claiming protected | Auth bypass |
48
+ | VR-E2E | `npm run test:e2e` | All pass | Claiming user flow works | Flow breakage |
49
+ | VR-RLS | Policy + grant check | RLS configured | Claiming DB secure | Data exposure |
50
+ | VR-PATTERN | `./scripts/pattern-scanner.sh` | Exit 0 | Claiming pattern compliance | Pattern violations |
51
+ | VR-PLAN-STATUS | `grep "IMPLEMENTATION STATUS" [plan]` | Completion table exists | After checkpoint/commit | Missing completion tracking |
52
+ | VR-PLAN-TABS | `grep -c "<TabsTrigger" [file]` | Count matches plan | Plan specifies tabs | Wrong tab count |
53
+ | VR-PLAN-SPEC | Multiple greps per spec | All UI elements exist | Plan specifies UI structure | Missing UI elements |
54
+ | VR-FEATURE-REG | Feature registry validation | 0 orphaned features | After any feature implementation | Lost features |
55
+ | VR-SPEC-MATCH | Grep for EXACT CSS classes/structure from plan | All specified strings found | UI plan items with specific specs | Spec drift from plan |
56
+ | VR-PIPELINE | Trigger pipeline, verify non-empty output | Data returned | Data pipeline features | Empty/broken pipelines |
57
+
58
+ ---
59
+
60
+ ## Core Verification Types
61
+
62
+ ### VR-FILE: File Existence
63
+
64
+ **Purpose**: Verify a file was actually created where claimed.
65
+
66
+ ```bash
67
+ # Basic file check
68
+ ls -la src/components/feature/MyComponent.tsx
69
+
70
+ # Multiple files
71
+ ls -la src/components/feature/{MyComponent,MyForm,MyList}.tsx
72
+
73
+ # Directory exists
74
+ ls -la src/components/feature/
75
+ ```
76
+
77
+ **Expected Output**: File listed with permissions, size, date
78
+ **Failure Mode**: "No such file or directory"
79
+
80
+ ---
81
+
82
+ ### VR-GREP: Code Presence
83
+
84
+ **Purpose**: Verify specific code was added to a file.
85
+
86
+ ```bash
87
+ # Function exists
88
+ grep -n "export function myFunction" src/lib/utils.ts
89
+
90
+ # Import present
91
+ grep -n "import.*MyComponent" src/app/feature/page.tsx
92
+
93
+ # Pattern in multiple files
94
+ grep -rn "useMyHook" src/components/
95
+ ```
96
+
97
+ **Expected Output**: Line number and matching content
98
+ **Failure Mode**: No output (empty result)
99
+
100
+ ---
101
+
102
+ ### VR-NEGATIVE: Removal Verification
103
+
104
+ **Purpose**: Verify code was COMPLETELY removed. **CRITICAL for refactoring.**
105
+
106
+ ```bash
107
+ # Verify old pattern removed
108
+ grep -rn "oldFunction" src/
109
+ # Expected: 0 matches
110
+
111
+ # Verify deprecated import gone
112
+ grep -rn "from 'deprecated-lib'" src/
113
+ # Expected: 0 matches
114
+
115
+ # Count remaining (should be 0)
116
+ grep -rn "legacyPattern" src/ | wc -l
117
+ # Expected: 0
118
+ ```
119
+
120
+ **Expected Output**: Empty (no matches)
121
+ **Failure Mode**: Any output means removal incomplete
122
+
123
+ ---
124
+
125
+ ### VR-BUILD: Production Build
126
+
127
+ **Purpose**: Verify code compiles for production deployment.
128
+
129
+ ```bash
130
+ npm run build
131
+ # Expected: Exit 0, "Compiled successfully"
132
+ ```
133
+
134
+ **Expected Output**: Build completes without errors
135
+ **Failure Mode**: Non-zero exit code, error messages
136
+
137
+ **Note**: Build passing does NOT mean feature works - components must also be RENDERED.
138
+
139
+ ---
140
+
141
+ ### VR-TYPE: TypeScript Check
142
+
143
+ **Purpose**: Verify zero TypeScript errors.
144
+
145
+ ```bash
146
+ NODE_OPTIONS="--max-old-space-size=8192" npx tsc --noEmit
147
+ # Expected: 0 errors (no output)
148
+ ```
149
+
150
+ **Expected Output**: No output (clean)
151
+ **Failure Mode**: TypeScript error messages
152
+
153
+ ---
154
+
155
+ ### VR-TEST: Test Suite
156
+
157
+ **Purpose**: Verify tests pass.
158
+
159
+ ```bash
160
+ # Unit tests
161
+ npm run test:run
162
+
163
+ # E2E tests
164
+ npm run test:e2e
165
+
166
+ # Specific test file
167
+ npm test -- src/components/feature/__tests__/MyComponent.test.tsx
168
+ ```
169
+
170
+ **Expected Output**: All tests pass
171
+ **Failure Mode**: Test failures reported
172
+
173
+ ---
174
+
175
+ ### VR-DEPLOY: Pre-Deploy Check
176
+
177
+ **Purpose**: Full deployment readiness verification.
178
+
179
+ ```bash
180
+ ./scripts/pre-deploy-check.sh
181
+ # Runs: pattern scanner, type check, build, lint, security
182
+ ```
183
+
184
+ **Expected Output**: Exit 0, all checks pass
185
+ **Failure Mode**: Any check failure
186
+
187
+ ---
188
+
189
+ ### VR-SCHEMA: Database Schema
190
+
191
+ **Purpose**: Verify database schema matches expectations.
192
+
193
+ ```sql
194
+ -- Check table structure
195
+ SELECT column_name, data_type FROM information_schema.columns
196
+ WHERE table_name = 'my_table';
197
+
198
+ -- Check specific column
199
+ SELECT column_name FROM information_schema.columns
200
+ WHERE table_name = 'my_table' AND column_name = 'my_column';
201
+ ```
202
+
203
+ **Expected Output**: Column definitions returned
204
+ **Failure Mode**: Empty result or wrong columns
205
+
206
+ ---
207
+
208
+ ### VR-SCHEMA-PRE: Pre-Query Schema Check
209
+
210
+ **Purpose**: Verify column names BEFORE writing ANY query. **MANDATORY before database operations.**
211
+
212
+ ```sql
213
+ -- BEFORE using ANY column, verify it exists
214
+ SELECT column_name FROM information_schema.columns
215
+ WHERE table_name = 'documents' AND column_name IN ('design_project_id', 'entity_type');
216
+ -- Expected: Only columns that actually exist are returned
217
+ ```
218
+
219
+ **Expected Output**: Only valid columns returned
220
+ **Failure Mode**: Missing expected columns = wrong assumption
221
+
222
+ ---
223
+
224
+ ### VR-COUNT: Instance Count
225
+
226
+ **Purpose**: Verify expected number of occurrences.
227
+
228
+ ```bash
229
+ # Verify pattern appears in all expected locations
230
+ grep -c "MyComponent" src/app/*/page.tsx
231
+
232
+ # Should match expected count (e.g., 5 pages)
233
+ grep -rn "useMyHook" src/components/ | wc -l
234
+ ```
235
+
236
+ **Expected Output**: Count matches expected number
237
+ **Failure Mode**: Count mismatch
238
+
239
+ ---
240
+
241
+ ## UI-Specific Verification Types
242
+
243
+ ### VR-RENDER: Component Render (CRITICAL)
244
+
245
+ **Purpose**: Verify UI components are actually RENDERED in pages, not just created.
246
+
247
+ **Why This Exists**: Build passing + Type check passing does NOT mean a component is used. Components must be imported AND rendered in a page to be visible to users.
248
+
249
+ ```bash
250
+ # Step 1: Verify component file exists
251
+ ls -la src/components/feature/MyComponent.tsx
252
+
253
+ # Step 2: Verify component is exported
254
+ grep "export.*MyComponent" src/components/feature/index.ts
255
+
256
+ # Step 3: CRITICAL - Verify component is RENDERED in a page
257
+ grep "<MyComponent" src/app/**/page.tsx
258
+
259
+ # If Step 3 returns 0 matches, THE FEATURE IS NOT IMPLEMENTED
260
+ ```
261
+
262
+ **Expected Output**: Match found in at least one page.tsx file
263
+ **Failure Mode**: 0 matches = component created but NOT implemented
264
+
265
+ **Verification Matrix for UI Components**:
266
+ | Check | Command | Expected |
267
+ |-------|---------|----------|
268
+ | File exists | `ls -la [component].tsx` | File listed |
269
+ | Exported | `grep "export" index.ts` | Match found |
270
+ | **RENDERED** | `grep "<Name" src/app/**/page.tsx` | **Match found** |
271
+
272
+ ---
273
+
274
+ ### VR-INTEGRATION: Full Feature Integration
275
+
276
+ **Purpose**: Verify component is imported, rendered, AND the build still passes.
277
+
278
+ ```bash
279
+ # Combined check
280
+ grep "<MyComponent" src/app/feature/page.tsx && npm run build
281
+
282
+ # Full integration verification
283
+ grep "import.*MyComponent" src/app/feature/page.tsx && \
284
+ grep "<MyComponent" src/app/feature/page.tsx && \
285
+ npm run build
286
+ ```
287
+
288
+ **Expected Output**: All checks pass
289
+ **Failure Mode**: Missing import, missing render, or build failure
290
+
291
+ ---
292
+
293
+ ### VR-ROUTE: Route Definition
294
+
295
+ **Purpose**: Verify routes are properly defined and accessible.
296
+
297
+ ```bash
298
+ # App Router - verify page.tsx exists
299
+ ls -la src/app/feature/page.tsx
300
+
301
+ # Verify dynamic routes
302
+ ls -la src/app/feature/[id]/page.tsx
303
+
304
+ # Check route in navigation
305
+ grep "href=\"/feature\"" src/components/nav/
306
+ ```
307
+
308
+ **Expected Output**: Route files exist, navigation points to them
309
+ **Failure Mode**: Missing route file, broken navigation
310
+
311
+ ---
312
+
313
+ ### VR-LINK: Link Verification
314
+
315
+ **Purpose**: Verify links point to existing routes.
316
+
317
+ ```bash
318
+ # Find all links in component
319
+ grep -n "href=" src/components/feature/MyComponent.tsx
320
+
321
+ # For EACH href, verify target exists
322
+ # href="/feature" -> verify src/app/feature/page.tsx exists
323
+ ```
324
+
325
+ **Expected Output**: All link targets exist
326
+ **Failure Mode**: Link to non-existent route
327
+
328
+ ---
329
+
330
+ ### VR-HANDLER: Event Handler Verification
331
+
332
+ **Purpose**: Verify interactive elements have working handlers.
333
+
334
+ ```bash
335
+ # Find buttons/forms
336
+ grep -n "onClick\|onSubmit\|onPress" src/components/feature/MyComponent.tsx
337
+
338
+ # Verify handler functions exist
339
+ grep -n "const handleClick\|function handleSubmit" src/components/feature/MyComponent.tsx
340
+
341
+ # Verify handlers do something (not empty)
342
+ grep -A5 "const handleClick" src/components/feature/MyComponent.tsx
343
+ ```
344
+
345
+ **Expected Output**: Handlers defined and have implementation
346
+ **Failure Mode**: Missing handler, empty handler, undefined handler
347
+
348
+ ---
349
+
350
+ ### VR-PROPS: Props Verification
351
+
352
+ **Purpose**: Verify components receive required props.
353
+
354
+ ```bash
355
+ # Check component interface
356
+ grep -A10 "interface.*Props" src/components/feature/MyComponent.tsx
357
+
358
+ # Check prop usage where component is rendered
359
+ grep -B2 -A5 "<MyComponent" src/app/feature/page.tsx
360
+
361
+ # Verify required props are passed
362
+ grep "<MyComponent.*requiredProp=" src/app/feature/page.tsx
363
+ ```
364
+
365
+ **Expected Output**: All required props passed
366
+ **Failure Mode**: TypeScript errors or runtime errors from missing props
367
+
368
+ ---
369
+
370
+ ### VR-STATE: State Management Verification
371
+
372
+ **Purpose**: Verify state flows correctly through the application.
373
+
374
+ ```bash
375
+ # Find state declarations
376
+ grep -n "useState\|useReducer\|useContext" src/components/feature/MyComponent.tsx
377
+
378
+ # Verify state is used
379
+ grep -n "setMyState\|dispatch" src/components/feature/MyComponent.tsx
380
+
381
+ # Check for proper useEffect dependencies
382
+ grep -A5 "useEffect" src/components/feature/MyComponent.tsx
383
+ ```
384
+
385
+ **Expected Output**: State declared, modified, and properly synchronized
386
+ **Failure Mode**: Unused state, missing updates, stale closures
387
+
388
+ ---
389
+
390
+ ### VR-FORM: Form Verification
391
+
392
+ **Purpose**: Verify forms validate and submit correctly.
393
+
394
+ ```bash
395
+ # Check form structure
396
+ grep -n "<form\|<Form" src/components/feature/MyForm.tsx
397
+
398
+ # Verify validation
399
+ grep -n "zodResolver\|yupResolver\|validate" src/components/feature/MyForm.tsx
400
+
401
+ # Verify submit handler
402
+ grep -n "onSubmit\|handleSubmit" src/components/feature/MyForm.tsx
403
+
404
+ # Verify form fields
405
+ grep -n "register\|Controller\|Field" src/components/feature/MyForm.tsx
406
+ ```
407
+
408
+ **Expected Output**: Form has validation, submit handler, proper fields
409
+ **Failure Mode**: Missing validation, broken submission, uncontrolled fields
410
+
411
+ ---
412
+
413
+ ## Security Verification Types
414
+
415
+ ### VR-AUTH: Authentication/Authorization
416
+
417
+ **Purpose**: Verify protected routes and mutations are properly secured.
418
+
419
+ ```bash
420
+ # Verify protected procedure usage
421
+ grep "protectedProcedure" src/server/api/routers/feature.ts
422
+
423
+ # Check for publicProcedure on mutations (BAD)
424
+ grep "publicProcedure.mutation" src/server/api/routers/
425
+ # Expected: 0 matches
426
+
427
+ # Verify role checks
428
+ grep "ctx.user.role\|hasPermission" src/server/api/routers/feature.ts
429
+ ```
430
+
431
+ **Expected Output**: All mutations use protectedProcedure, role checks where needed
432
+ **Failure Mode**: Unprotected mutations, missing role checks
433
+
434
+ ---
435
+
436
+ ### VR-RLS: Row Level Security
437
+
438
+ **Purpose**: Verify database tables have proper RLS configuration.
439
+
440
+ ```sql
441
+ -- Check RLS enabled
442
+ SELECT tablename, rowsecurity FROM pg_tables
443
+ WHERE schemaname = 'public' AND tablename = 'my_table';
444
+
445
+ -- Check policies exist
446
+ SELECT policyname FROM pg_policies WHERE tablename = 'my_table';
447
+
448
+ -- Check grants exist (often forgotten!)
449
+ SELECT grantee, privilege_type FROM information_schema.table_privileges
450
+ WHERE table_name = 'my_table';
451
+ ```
452
+
453
+ **Expected Output**: RLS enabled, policies defined, grants exist
454
+ **Failure Mode**: RLS disabled, missing policies, missing grants
455
+
456
+ ---
457
+
458
+ ### VR-SECRETS: Secret Detection
459
+
460
+ **Purpose**: Verify no secrets in code.
461
+
462
+ ```bash
463
+ # Check staged files for secrets
464
+ git diff --cached --name-only | grep -E '\.(env|pem|key|secret)'
465
+ # Expected: 0 matches
466
+
467
+ # Manual check for common patterns
468
+ grep -rn "sk-\|api_key\|password\|secret" src/ --include="*.ts" --include="*.tsx"
469
+ ```
470
+
471
+ **Expected Output**: No secrets found
472
+ **Failure Mode**: Secrets detected
473
+
474
+ ---
475
+
476
+ ## Quality Verification Types
477
+
478
+ ### VR-TOKEN: Design Token Compliance
479
+
480
+ **Purpose**: Verify CSS files use design tokens (CSS variables) instead of hardcoded colors.
481
+
482
+ ```bash
483
+ # Full scan
484
+ bash scripts/audit-design-tokens.sh
485
+ # Expected: Exit 0 (zero errors)
486
+
487
+ # Single file (fast, for hooks)
488
+ bash scripts/audit-design-tokens.sh --single-file src/styles/component.css
489
+
490
+ # CI mode (JSON output)
491
+ bash scripts/audit-design-tokens.sh --ci
492
+ ```
493
+
494
+ **Expected Output**: Exit 0, zero hardcoded hex/rgb/rgba colors outside variable definitions
495
+ **Failure Mode**: Hardcoded color values found
496
+
497
+ ---
498
+
499
+ ### VR-A11Y: Accessibility
500
+
501
+ **Purpose**: Verify WCAG compliance.
502
+
503
+ ```bash
504
+ # Check for aria labels
505
+ grep -n "aria-label\|aria-labelledby" src/components/feature/MyComponent.tsx
506
+
507
+ # Check for alt text on images
508
+ grep -n "<img" src/components/ | grep -v "alt="
509
+ # Expected: 0 matches (all images have alt)
510
+
511
+ # Check for proper heading hierarchy
512
+ grep -n "<h1\|<h2\|<h3" src/app/feature/page.tsx
513
+ ```
514
+
515
+ **Expected Output**: Proper ARIA attributes, alt text, heading hierarchy
516
+ **Failure Mode**: Missing accessibility attributes
517
+
518
+ ---
519
+
520
+ ### VR-MOBILE: Mobile Responsiveness
521
+
522
+ **Purpose**: Verify mobile/tablet compatibility.
523
+
524
+ ```bash
525
+ # Check for responsive classes
526
+ grep -n "sm:\|md:\|lg:" src/components/feature/MyComponent.tsx
527
+
528
+ # Check for touch handlers
529
+ grep -n "onTouchStart\|onPointerDown" src/components/feature/MyComponent.tsx
530
+ ```
531
+
532
+ **Expected Output**: Responsive design patterns present
533
+ **Failure Mode**: Fixed widths, no mobile breakpoints
534
+
535
+ ---
536
+
537
+ ### VR-PATTERN: Pattern Compliance
538
+
539
+ **Purpose**: Verify code follows established patterns.
540
+
541
+ ```bash
542
+ ./scripts/pattern-scanner.sh
543
+ # Expected: Exit 0
544
+
545
+ # Specific pattern checks
546
+ grep -rn "ctx.prisma" src/
547
+ # Expected: 0 matches (use ctx.db)
548
+
549
+ grep -rn "include:" src/server/
550
+ # Expected: 0 matches (use 3-step pattern)
551
+ ```
552
+
553
+ **Expected Output**: Pattern scanner passes
554
+ **Failure Mode**: Pattern violations detected
555
+
556
+ ---
557
+
558
+ ## End-to-End Verification Types
559
+
560
+ ### VR-ROUNDTRIP: Full Write->Store->Read->Display Verification
561
+
562
+ **Purpose**: Verify a feature works end-to-end: data can be written, persists in the database, can be read back, and displays correctly in UI. Catches "half-built" features where code compiles but doesn't function in production.
563
+
564
+ **When to use**: ANY plan item that creates or modifies a data flow.
565
+
566
+ ```
567
+ For each data flow in the feature, prove ALL 4 steps:
568
+
569
+ STEP 1: WRITE -- Trigger the action (UI button, cron, API call)
570
+ Proof: Show the tRPC mutation/API call exists AND is reachable from UI or cron
571
+ Command: grep -n "useMutation\|mutateAsync\|useQuery" src/app/**/[feature-page].tsx
572
+ Also: grep -n "[procedureName]" src/server/api/routers/[router].ts
573
+
574
+ STEP 2: STORE -- Verify data persists in database
575
+ Proof: The service function writes to a real table with real columns
576
+ Command: VR-SCHEMA-PRE on the target table (columns exist)
577
+ Also: grep -n "ctx.db\.[table]\.(create\|update\|upsert)" src/lib/services/[service].ts
578
+
579
+ STEP 3: READ -- Verify data can be queried back
580
+ Proof: A tRPC query or server component reads from the same table
581
+ Command: grep -n "ctx.db\.[table]\.(findMany\|findFirst\|findUnique)" src/server/api/routers/[router].ts
582
+ Also: Verify query is called from UI: grep -n "useQuery\|useSuspenseQuery" src/app/**/[page].tsx
583
+
584
+ STEP 4: DISPLAY -- Verify data renders in UI
585
+ Proof: Component renders query data (not hardcoded/mock)
586
+ Command: VR-RENDER -- grep for component in page
587
+ Also: VR-BROWSER -- Playwright navigate + snapshot shows real data
588
+ ```
589
+
590
+ **Compact format for plan item verification:**
591
+ ```
592
+ VR-ROUNDTRIP: [feature-name]
593
+ WRITE: [mutation/action] in [file:line] -- PASS
594
+ STORE: [table.column] -- columns exist (VR-SCHEMA-PRE) -- PASS
595
+ READ: [query] in [router:line] -- PASS
596
+ DISPLAY: [component] in [page:line] -- PASS
597
+ ```
598
+
599
+ **Expected Output**: All 4 steps verified with file:line proof
600
+ **Failure Mode**: Any step missing = feature is not functional.
601
+
602
+ **Exceptions**:
603
+ - Background-only features (cron jobs, webhooks) may skip DISPLAY if there's no user-facing output. Must still prove WRITE+STORE+READ.
604
+ - Query-only features (read-only dashboards) may skip WRITE+STORE if they read existing data.
605
+
606
+ ---
607
+
608
+ ### VR-E2E: End-to-End Tests
609
+
610
+ **Purpose**: Verify complete user flows work.
611
+
612
+ ```bash
613
+ # Run all E2E tests
614
+ npm run test:e2e
615
+
616
+ # Run specific test
617
+ npx playwright test tests/e2e/feature.spec.ts
618
+ ```
619
+
620
+ **Expected Output**: All E2E tests pass
621
+ **Failure Mode**: Test failures
622
+
623
+ ---
624
+
625
+ ### VR-VISUAL: LLM-as-Judge Visual Quality Review
626
+
627
+ **Purpose**: Automated visual quality assessment using screenshot + LLM vision evaluation. Scores UI quality across 4 weighted dimensions with calibrated criteria.
628
+
629
+ ```bash
630
+ # Run visual review for a specific route
631
+ bash scripts/ui-review.sh /dashboard/contacts
632
+
633
+ # Run with a component spec for targeted evaluation
634
+ bash scripts/ui-review.sh /dashboard/contacts specs/components/data-table.md
635
+
636
+ # Run with spec drift audit
637
+ bash scripts/ui-review.sh /dashboard/contacts --drift
638
+ ```
639
+
640
+ **Scoring Dimensions** (weighted average, threshold >= 3.0 = PASS):
641
+
642
+ | Dimension | Weight | What It Measures |
643
+ |-----------|--------|------------------|
644
+ | Design Quality (DQ) | 2x | Coherent visual identity, deliberate design choices |
645
+ | Functionality (FN) | 2x | Usable hierarchy, findable actions, clear navigation |
646
+ | Craft (CR) | 1x | Spacing, typography, color consistency |
647
+ | Completeness (CO) | 1x | All states handled, no broken elements |
648
+
649
+ **Formula**: `weighted_score = (DQ*2 + FN*2 + CR*1 + CO*1) / 6`
650
+
651
+ **Expected Output**:
652
+ ```
653
+ VR_VISUAL_STATUS: PASS
654
+ VR_VISUAL_ROUTE: /dashboard/contacts
655
+ VR_VISUAL_WEIGHTED_SCORE: 4.2/5.0
656
+ VR_VISUAL_SCORES: DQ=4 FN=5 CR=4 CO=3
657
+ ```
658
+
659
+ **Failure Mode**: `VR_VISUAL_STATUS: FAIL` (weighted score < 3.0) with per-dimension findings
660
+
661
+ **When to use**: After ANY UI change. Complements VR-BROWSER (functional) with quality assessment.
662
+ **NOT a replacement for**: VR-BROWSER (functional testing), VR-TOKEN (CSS variable audit), VR-SPEC-MATCH (exact class verification)
663
+
664
+ ---
665
+
666
+ ## Database Verification Types
667
+
668
+ ### VR-SYNC / VR-SCHEMA-SYNC: Multi-Database Schema Sync
669
+
670
+ **Purpose**: Verify all database environments have identical schema for affected tables. **MANDATORY after ANY database migration.**
671
+
672
+ ```sql
673
+ -- For EACH table affected by migration, run on ALL environments:
674
+
675
+ -- Step 1: Column count comparison (quick check)
676
+ SELECT COUNT(*) FROM information_schema.columns
677
+ WHERE table_schema = 'public' AND table_name = '[TABLE]';
678
+
679
+ -- Step 2: Detailed column comparison (if counts differ)
680
+ SELECT column_name, data_type, is_nullable FROM information_schema.columns
681
+ WHERE table_schema = 'public' AND table_name = '[TABLE]' ORDER BY ordinal_position;
682
+ ```
683
+
684
+ **Expected Output**: Column counts AND names match across all environments
685
+ **Failure Mode**: Schema drift - columns exist in one environment but not others
686
+ **Blocking**: YES - migration is NOT complete until all environments match
687
+
688
+ **Migration Application Protocol**:
689
+ 1. Apply to each environment -> verify
690
+ 2. Run VR-SCHEMA-SYNC on all environments -> column counts MUST match
691
+
692
+ ---
693
+
694
+ ### VR-MIGRATION: Migration Verification
695
+
696
+ **Purpose**: Verify migrations applied successfully.
697
+
698
+ ```sql
699
+ -- Check specific migration effect
700
+ SELECT * FROM information_schema.columns WHERE table_name = 'new_table';
701
+ ```
702
+
703
+ **Expected Output**: Migration applied, expected schema changes present
704
+ **Failure Mode**: Migration not applied or failed
705
+
706
+ ---
707
+
708
+ ## Plan Verification Types
709
+
710
+ ### VR-PLAN-STATUS: Plan Completion Tracking
711
+
712
+ **Purpose**: Verify plan documents are updated with completion status after checkpoints/commits.
713
+
714
+ ```bash
715
+ # Check plan has completion table
716
+ grep "IMPLEMENTATION STATUS" [plan_file]
717
+ # Expected: Match found
718
+
719
+ # Check phases are marked
720
+ grep "100% COMPLETE\|DONE\|\*\*DONE\*\*" [plan_file] | wc -l
721
+ # Expected: Count matches completed phases
722
+ ```
723
+
724
+ **Expected Output**: Plan has completion section, completed phases marked
725
+ **Failure Mode**: Missing completion table, phases completed but not marked
726
+
727
+ **When to Run**: After EVERY checkpoint, BEFORE claiming phase complete
728
+
729
+ ---
730
+
731
+ ### VR-PLAN-TABS: Tab Count Verification
732
+
733
+ **Purpose**: Verify tab implementations match plan specifications.
734
+
735
+ ```bash
736
+ # Count tabs in page
737
+ grep -c "<TabsTrigger" src/app/[path]/page.tsx
738
+ # Expected: Matches plan specification
739
+ ```
740
+
741
+ **Expected Output**: Count equals plan specification
742
+ **Failure Mode**: Wrong number of tabs implemented
743
+
744
+ ---
745
+
746
+ ### VR-PLAN-SPEC: UI Specification Verification
747
+
748
+ **Purpose**: Verify UI structure matches plan specifications.
749
+
750
+ ```bash
751
+ # For each UI element specified in plan:
752
+ grep "<ComponentName" [file] # Component exists
753
+ grep "TabsTrigger.*\"tab-name\"" [file] # Specific tab exists
754
+ grep "MoreMenu\|DropdownMenu" [file] # Menu exists
755
+ grep "ViewSwitcher\|Select" [file] # Switcher exists
756
+ ```
757
+
758
+ **Expected Output**: All specified UI elements found
759
+ **Failure Mode**: Missing UI elements from plan
760
+
761
+ ---
762
+
763
+ ### VR-SPEC-MATCH: Literal Spec Match
764
+
765
+ **Purpose**: Verify that EVERY CSS class, component attribute, or layout instruction specified in a plan item exists EXACTLY in the implementation. Prevents spec drift.
766
+
767
+ ```bash
768
+ # For each plan item with specific CSS classes/structure:
769
+ # Example: Plan says "indented with ml-6 border-l-2 border-muted pl-4"
770
+ grep "ml-6" src/components/feature/Component.tsx # Must match
771
+ grep "border-l-2" src/components/feature/Component.tsx # Must match
772
+ grep "border-muted" src/components/feature/Component.tsx # Must match
773
+ grep "pl-4" src/components/feature/Component.tsx # Must match
774
+ ```
775
+
776
+ **Expected Output**: ALL plan-specified literal strings found in implementation
777
+ **Failure Mode**: Plan says `ml-6 border-l-2` but implementation uses `ml-4 border-l` -- spec drift
778
+
779
+ ---
780
+
781
+ ### VR-PIPELINE: Data Pipeline End-to-End
782
+
783
+ **Purpose**: For features that generate or process data (AI, cron, generation, ETL), verify the pipeline produces non-empty output when triggered.
784
+
785
+ ```bash
786
+ # Example: AI pipeline
787
+ # Trigger the procedure and check output
788
+ # Expected: Non-empty response with actual data
789
+
790
+ # Example: Cron job
791
+ curl -X POST http://localhost:3000/api/cron/digest -H "Authorization: Bearer $CRON_SECRET"
792
+ # Expected: Response body contains data, not empty arrays
793
+ ```
794
+
795
+ **Expected Output**: Pipeline produces non-empty, meaningful data
796
+ **Failure Mode**: Pipeline runs without error but returns empty results -- silent failure
797
+
798
+ ---
799
+
800
+ ## Verification Checklists by Task Type
801
+
802
+ ### New Feature Checklist
803
+ - [ ] VR-FILE: All component files exist
804
+ - [ ] VR-RENDER: Components rendered in pages
805
+ - [ ] VR-ROUTE: Routes defined
806
+ - [ ] VR-LINK: Navigation works
807
+ - [ ] VR-HANDLER: Events handled
808
+ - [ ] VR-PROPS: Props passed correctly
809
+ - [ ] VR-AUTH: Protected appropriately
810
+ - [ ] VR-SPEC-MATCH: Plan CSS classes/structure exist in implementation
811
+ - [ ] VR-PIPELINE: Data pipelines produce non-empty output (if applicable)
812
+ - [ ] VR-TYPE: Zero type errors
813
+ - [ ] VR-BUILD: Build passes
814
+ - [ ] VR-PATTERN: Pattern compliant
815
+
816
+ ### Refactoring Checklist
817
+ - [ ] VR-NEGATIVE: Old code removed
818
+ - [ ] VR-COUNT: All instances updated
819
+ - [ ] VR-TEST: Tests pass
820
+ - [ ] VR-TYPE: Zero type errors
821
+ - [ ] VR-BUILD: Build passes
822
+ - [ ] VR-E2E: User flows work
823
+
824
+ ### Database Change Checklist
825
+ - [ ] VR-SCHEMA-PRE: Column names verified
826
+ - [ ] VR-SCHEMA: Schema correct
827
+ - [ ] VR-RLS: RLS + grants configured
828
+ - [ ] VR-SYNC: All environments in sync
829
+ - [ ] VR-MIGRATION: Migration applied
830
+
831
+ ### Security Change Checklist
832
+ - [ ] VR-AUTH: Protected procedures
833
+ - [ ] VR-RLS: Row level security
834
+ - [ ] VR-SECRETS: No exposed secrets
835
+ - [ ] VR-PATTERN: Security patterns followed
836
+
837
+ ---
838
+
839
+ ## Verification Output Format
840
+
841
+ When running verifications, document results in this format:
842
+
843
+ ```markdown
844
+ ### Verification Results
845
+
846
+ | VR Type | Command | Expected | Actual | Status |
847
+ |---------|---------|----------|--------|--------|
848
+ | VR-FILE | `ls -la component.tsx` | File exists | File exists | PASS |
849
+ | VR-RENDER | `grep "<Component" page.tsx` | Match found | Match line 42 | PASS |
850
+ | VR-BUILD | `npm run build` | Exit 0 | Exit 0 | PASS |
851
+ | VR-NEGATIVE | `grep "oldCode" src/` | 0 matches | 3 matches | **FAIL** |
852
+
853
+ **Overall Status**: FAIL (VR-NEGATIVE failed)
854
+ ```
855
+
856
+ ---
857
+
858
+ ## Related Files
859
+
860
+ - [CLAUDE.md](../CLAUDE.md) - Prime directive with VR-* summary table
861
+ - [protocols/verification.md](../protocols/verification.md) - Full verification protocol
862
+ - [patterns-quickref.md](patterns-quickref.md) - Pattern quick reference
863
+
864
+ ---
865
+
866
+ **Document Status**: VR-* Verification Master Reference
867
+ **Authority**: Used by ALL massu commands