@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,587 @@
1
+ ---
2
+ name: massu-ui-audit
3
+ description: "When user says 'UI audit', 'UX review', 'accessibility check', 'check responsiveness', or needs a deep review of UI consistency, accessibility, and user flows"
4
+ allowed-tools: Bash(*), Read(*), Write(*), Edit(*), Grep(*), Glob(*), Task(*)
5
+ disable-model-invocation: true
6
+ ---
7
+ name: massu-ui-audit
8
+
9
+ > **Shared rules apply.** Read `.claude/commands/_shared-preamble.md` before proceeding. CR-14, CR-5, CR-12 enforced.
10
+
11
+ # Massu UI Audit: Comprehensive UI/UX Review
12
+
13
+ ## MANDATORY LOOP CONTROLLER (EXECUTE THIS - DO NOT SKIP)
14
+
15
+ **This section is the EXECUTION ENTRY POINT. You MUST follow these steps exactly.**
16
+
17
+ ### How This Command Works
18
+
19
+ This command is a **loop controller** for UI/UX verification. Your job is to:
20
+ 1. Spawn a `massu-plan-auditor` subagent for ONE complete UI audit pass
21
+ 2. Parse the structured result (`GAPS_FOUND: N`)
22
+ 3. If gaps > 0: fix UI issues, then spawn ANOTHER audit pass
23
+ 4. If gaps == 0: UI audit passes
24
+
25
+ **The UI audit runs inside Task subagents. This prevents early termination.**
26
+
27
+ ### Execution Protocol
28
+
29
+ ```
30
+ iteration = 0
31
+
32
+ WHILE true:
33
+ iteration += 1
34
+
35
+ # Spawn auditor subagent for ONE complete UI audit pass
36
+ result = Task(subagent_type="massu-plan-auditor", model="opus", prompt="
37
+ UI Audit iteration {iteration}.
38
+ Execute ONE complete UI/UX audit covering all 10 sections.
39
+ Check: pages, navigation, buttons, forms, states, responsiveness,
40
+ accessibility, component consistency, user flows, UX quality.
41
+ Fix any issues you can. Return the structured result block.
42
+ ")
43
+
44
+ # Parse structured result
45
+ gaps = parse GAPS_FOUND from result
46
+
47
+ # Report iteration to user
48
+ Output: "UI Audit iteration {iteration}: {gaps} issues found"
49
+
50
+ IF gaps == 0:
51
+ Output: "UI AUDIT PASSED - Zero issues in iteration {iteration}"
52
+ BREAK
53
+ ELSE:
54
+ # Fix UI issues, then continue loop
55
+ CONTINUE
56
+ END WHILE
57
+ ```
58
+
59
+ ### Rules for the Loop Controller
60
+
61
+ | Rule | Meaning |
62
+ |------|---------|
63
+ | **NEVER pass audit while issues > 0** | Only zero-issue iteration passes |
64
+ | **NEVER ask user "should I continue?"** | The loop is mandatory |
65
+ | **ALWAYS use Task tool for audit passes** | Subagents keep context clean |
66
+ | **Maximum 10 iterations** | If still failing after 10, report to user |
67
+
68
+ ---
69
+
70
+ ## Objective
71
+
72
+ Execute a thorough UI/UX audit covering accessibility, responsiveness, component consistency, state management, and user flow completeness.
73
+
74
+ ---
75
+
76
+ ## NON-NEGOTIABLE RULES
77
+
78
+ - **Every button has a handler** - No dead buttons
79
+ - **Every form has validation** - Zod schemas required
80
+ - **Every async operation has loading state** - User must see feedback
81
+ - **Every list has empty state** - No blank screens
82
+ - **Every action has error handling** - Graceful failures
83
+ - **Mobile-first responsive** - Proper responsive layout classes
84
+ - **Accessibility basics** - Alt text, aria labels, keyboard nav
85
+ - **FIX ALL ISSUES ENCOUNTERED (CR-9)** - If ANY issue is discovered during UI audit - whether from current changes OR pre-existing - fix it immediately. "Not in scope" and "pre-existing" are NEVER valid reasons to skip a fix. When fixing a bug, search entire codebase for same pattern and fix ALL instances.
86
+
87
+ ---
88
+
89
+ ## ZERO-GAP AUDIT LOOP - ENFORCED BY LOOP CONTROLLER
90
+
91
+ **This loop is now STRUCTURALLY ENFORCED by the Loop Controller at the top of this file.**
92
+
93
+ The Loop Controller spawns `massu-plan-auditor` subagents per iteration and continues until `GAPS_FOUND: 0`. Each iteration is a fresh subagent doing a FULL UI audit across all 10 sections.
94
+
95
+ ### Loop Mechanics (Reference)
96
+
97
+ ```
98
+ ITERATION 1: Spawn auditor -> Find N issues -> Fix -> Spawn again
99
+ ITERATION 2: Spawn auditor -> Find M issues -> Fix -> Spawn again
100
+ ITERATION 3: Spawn auditor -> Find 0 issues -> UI AUDIT PASSED
101
+ ```
102
+
103
+ **Partial re-checks are NOT valid. The ENTIRE UI audit must pass in a SINGLE run.**
104
+
105
+ ---
106
+
107
+ ## DOMAIN-SPECIFIC PATTERN LOADING
108
+
109
+ | Domain | Pattern File | Load When |
110
+ |--------|--------------|-----------|
111
+ | UI components | `.claude/patterns/ui-patterns.md` | Always for UI audit |
112
+ | Auth UI | `.claude/patterns/auth-patterns.md` | Auditing auth screens |
113
+ | Build issues | `.claude/patterns/build-patterns.md` | Component build errors |
114
+
115
+ ---
116
+
117
+ ## MANDATORY PATTERN ALIGNMENT CHECK
118
+
119
+ **EVERY UI audit MUST verify compliance with ALL patterns from ui-patterns.md.**
120
+
121
+ ### Step 1: Read ui-patterns.md First
122
+
123
+ BEFORE running any audit checks, read and extract ALL patterns from:
124
+ - `.claude/patterns/ui-patterns.md`
125
+ - `.claude/reference/patterns-quickref.md` (UI section)
126
+
127
+ ### Step 2: Mandatory UI Pattern Verification Matrix
128
+
129
+ ```markdown
130
+ ### MANDATORY UI PATTERN VERIFICATION
131
+
132
+ | Pattern ID | Pattern | Check Command | Expected | Actual | Status |
133
+ |------------|---------|---------------|----------|--------|--------|
134
+ | UI-001 | DataTable for lists | `grep -rn "<Table" src/ \| grep -v DataTable` | 0 violations | | |
135
+ | UI-002 | sonner toast() | `grep -rn "useToast" src/ \| wc -l` | 0 matches | | |
136
+ | UI-003 | Dark mode contrast | `grep -rn "text-white\|text-black" src/ \| grep "bg-"` | Review | | |
137
+ | UI-004 | Select __none__ | `grep -rn 'value=""' src/ \| grep -i select` | 0 matches | | |
138
+ | UI-005 | Responsive layout | `grep -rn "page-container" src/` | Proper usage | | |
139
+ | UI-006 | Loading states | `grep -rn "isPending\|isLoading" src/components/` | Present | | |
140
+ | UI-007 | Empty states | `grep -rn "length === 0" src/components/` | Present | | |
141
+ | UI-008 | Error states | `grep -rn "isError\|toast.error" src/components/` | Present | | |
142
+ | UI-009 | Form validation | `grep -rn "zodResolver" src/components/` | Present | | |
143
+ ```
144
+
145
+ ### Pattern Alignment Gate
146
+
147
+ ```markdown
148
+ ### UI PATTERN ALIGNMENT GATE
149
+
150
+ | Pattern | Verified | Status |
151
+ |---------|----------|--------|
152
+ | DataTable for all lists | YES/NO | PASS/FAIL |
153
+ | sonner toast (no useToast) | YES/NO | PASS/FAIL |
154
+ | Dark mode contrast (WCAG AA) | YES/NO | PASS/FAIL |
155
+ | Select __none__ (no value="") | YES/NO | PASS/FAIL |
156
+ | Responsive layout | YES/NO | PASS/FAIL |
157
+ | Loading states present | YES/NO | PASS/FAIL |
158
+ | Empty states present | YES/NO | PASS/FAIL |
159
+ | Error states present | YES/NO | PASS/FAIL |
160
+ | Form validation with Zod | YES/NO | PASS/FAIL |
161
+
162
+ **UI PATTERN ALIGNMENT GATE: PASS / FAIL**
163
+
164
+ If ANY pattern fails, audit cannot pass until fixed.
165
+ ```
166
+
167
+ ---
168
+
169
+ ## COMPONENT REUSE REQUIREMENTS
170
+
171
+ **Audit MUST check for component duplication and missed reuse opportunities.**
172
+
173
+ ### Reuse Audit Checks
174
+ ```bash
175
+ # Find duplicate component patterns
176
+ find src/components -name "*.tsx" | xargs basename -a | sort | uniq -d
177
+
178
+ # Find similar component names
179
+ find src/components -name "*Button*" -o -name "*Card*" -o -name "*List*" | sort
180
+
181
+ # Check if custom components duplicate UI primitives
182
+ grep -rln "className.*rounded.*border.*p-" src/components/ | head -20
183
+
184
+ # Find components not using design system
185
+ grep -rL "@/components/ui" src/components/*.tsx 2>/dev/null | head -10
186
+ ```
187
+
188
+ ### Required UI Primitives (should be used, not recreated)
189
+ - Button, Input, Select, Checkbox, Switch
190
+ - Dialog, Sheet, Popover, Dropdown
191
+ - Card, Table, Skeleton, Badge
192
+ - Form components (with react-hook-form)
193
+
194
+ ---
195
+
196
+ ## AUDIT SECTION 1: PAGE INVENTORY
197
+
198
+ ### 1.1 List All Pages
199
+ ```bash
200
+ # Find all pages
201
+ find src/app -name "page.tsx" -o -name "page.ts" 2>/dev/null | sort
202
+
203
+ # Find all layouts
204
+ find src/app -name "layout.tsx" -o -name "layout.ts" 2>/dev/null | sort
205
+
206
+ # Find error boundaries
207
+ find src/app -name "error.tsx" -o -name "error.ts" 2>/dev/null | sort
208
+
209
+ # Find loading states
210
+ find src/app -name "loading.tsx" -o -name "loading.ts" 2>/dev/null | sort
211
+ ```
212
+
213
+ ### 1.2 Page Audit Matrix
214
+ ```markdown
215
+ ### Page Inventory
216
+
217
+ | Page | Path | Auth Required | Has Layout | Has Error | Has Loading |
218
+ |------|------|---------------|------------|-----------|-------------|
219
+ | Dashboard | /dashboard | YES | YES | YES/NO | YES/NO |
220
+ ```
221
+
222
+ ### 1.3 VR-RENDER: Component Render Verification (CRITICAL)
223
+
224
+ **Every component created MUST be rendered in at least one page.**
225
+
226
+ ```bash
227
+ # Find orphaned components (created but never used)
228
+ for comp in $(find src/components -name "*.tsx" -type f | grep -v index | xargs basename -a | sed 's/.tsx//'); do
229
+ count=$(grep -rn "<$comp" src/ | grep -v "node_modules" | wc -l)
230
+ if [ "$count" -eq 0 ]; then
231
+ echo "ORPHANED COMPONENT: $comp (never rendered)"
232
+ fi
233
+ done
234
+ ```
235
+
236
+ ---
237
+
238
+ ## AUDIT SECTION 2: NAVIGATION
239
+
240
+ ### 2.1 Navigation Analysis
241
+ ```bash
242
+ # Find navigation components
243
+ find src/components -name "*Nav*" -o -name "*Sidebar*" -o -name "*Menu*" -o -name "*Header*" 2>/dev/null
244
+
245
+ # Extract all href values
246
+ grep -rn "href=" src/components/ | grep -v node_modules | sort -u
247
+
248
+ # Find all Link components
249
+ grep -rn "<Link" src/ | grep -v node_modules | wc -l
250
+
251
+ # Find router.push/replace calls
252
+ grep -rn "router\.push\|router\.replace" src/ | grep -v node_modules | head -20
253
+ ```
254
+
255
+ ---
256
+
257
+ ## AUDIT SECTION 3: BUTTONS & ACTIONS
258
+
259
+ ### 3.1 Button Inventory
260
+ ```bash
261
+ # Count all buttons
262
+ grep -rn "<button\|<Button" src/components/ src/app/ | grep -v node_modules | wc -l
263
+
264
+ # Find buttons WITHOUT onClick (potential issues)
265
+ grep -rn "<button\|<Button" src/ | grep -v node_modules | grep -v "onClick\|type=\"submit\"\|disabled\|asChild"
266
+
267
+ # Find buttons without type (should have type="button" or type="submit")
268
+ grep -rn "<button" src/ | grep -v node_modules | grep -v "type="
269
+ ```
270
+
271
+ ---
272
+
273
+ ## AUDIT SECTION 4: FORMS
274
+
275
+ ### 4.1 Form Inventory
276
+ ```bash
277
+ # Find all forms
278
+ grep -rn "<form\|<Form" src/ | grep -v node_modules | wc -l
279
+
280
+ # Find forms WITHOUT onSubmit (issues)
281
+ grep -rn "<form\|<Form" src/ | grep -v node_modules | grep -v "onSubmit"
282
+
283
+ # Find react-hook-form usage
284
+ grep -rn "useForm\|Controller\|register" src/ | grep -v node_modules | wc -l
285
+
286
+ # Find Zod validation
287
+ grep -rn "zodResolver\|z\.object" src/ | grep -v node_modules | wc -l
288
+ ```
289
+
290
+ ---
291
+
292
+ ## AUDIT SECTION 5: STATE MANAGEMENT
293
+
294
+ ### 5.1 Loading States
295
+ ```bash
296
+ # Find loading indicators
297
+ grep -rn "isLoading\|isPending\|isFetching" src/ | grep -v node_modules | wc -l
298
+
299
+ # Find Skeleton components
300
+ grep -rn "Skeleton\|skeleton" src/components/ | grep -v node_modules
301
+
302
+ # Find suspense usage
303
+ grep -rn "<Suspense\|React.Suspense" src/ | grep -v node_modules
304
+ ```
305
+
306
+ ### 5.2 Empty States
307
+ ```bash
308
+ grep -rn "length === 0\|\.length === 0\|isEmpty\|!data\|no.*found" src/components/ | grep -v node_modules | head -30
309
+ ```
310
+
311
+ ### 5.3 Error States
312
+ ```bash
313
+ grep -rn "isError\|\.error\|onError" src/ | grep -v node_modules | head -30
314
+ grep -rn "toast\.error\|toast\.warning" src/ | grep -v node_modules
315
+ ```
316
+
317
+ ---
318
+
319
+ ## AUDIT SECTION 6: RESPONSIVENESS
320
+
321
+ ### 6.1 Mobile Checks
322
+ ```bash
323
+ # Find responsive classes
324
+ grep -rn "sm:\|md:\|lg:\|xl:" src/components/ | grep -v node_modules | wc -l
325
+
326
+ # Find mobile-specific code
327
+ grep -rn "mobile\|Mobile\|useMediaQuery\|useBreakpoint" src/ | grep -v node_modules
328
+ ```
329
+
330
+ ---
331
+
332
+ ## AUDIT SECTION 7: ACCESSIBILITY
333
+
334
+ ### 7.1 Image Alt Text
335
+ ```bash
336
+ # Images without alt
337
+ grep -rn "<img\|<Image" src/ | grep -v node_modules | grep -v "alt=" | head -20
338
+ # Expected: 0 matches
339
+ ```
340
+
341
+ ### 7.2 ARIA Labels
342
+ ```bash
343
+ grep -rn "aria-label\|aria-labelledby\|aria-describedby" src/ | grep -v node_modules | wc -l
344
+ ```
345
+
346
+ ### 7.3 Keyboard Navigation
347
+ ```bash
348
+ grep -rn "onKeyDown\|onKeyPress\|onKeyUp" src/ | grep -v node_modules | wc -l
349
+ grep -rn "tabIndex" src/ | grep -v node_modules
350
+ ```
351
+
352
+ ---
353
+
354
+ ## AUDIT SECTION 8: COMPONENT CONSISTENCY
355
+
356
+ ### 8.1 Design System Check
357
+ ```bash
358
+ # Find button variants
359
+ grep -rn "variant=" src/components/ | grep -v node_modules | sort | uniq -c
360
+
361
+ # Find custom colors (should use design tokens)
362
+ grep -rn "bg-\[#\|text-\[#\|border-\[#" src/ | grep -v node_modules | wc -l
363
+ # Expected: 0 (use Tailwind colors)
364
+ ```
365
+
366
+ ---
367
+
368
+ ## AUDIT SECTION 9: USER FLOWS
369
+
370
+ ### 9.1 Identify Critical Flows
371
+ ```markdown
372
+ ### Critical User Flows
373
+
374
+ | Flow | Entry Point | Steps | Priority |
375
+ |------|-------------|-------|----------|
376
+ | Login | /login | 3 | P0 |
377
+ | Create Item | /items/new | 5 | P0 |
378
+ ```
379
+
380
+ ### 9.2 Flow Verification Template
381
+ ```markdown
382
+ ### User Flow: [FLOW_NAME]
383
+
384
+ | Step | Action | Element | Expected | Actual | Status |
385
+ |------|--------|---------|----------|--------|--------|
386
+ | 1 | Navigate | Link | Page loads | | |
387
+ | 2 | Fill form | Inputs | Values captured | | |
388
+ | 3 | Submit | Button | Loading shown | | |
389
+ | 4 | Complete | Redirect | Success page | | |
390
+
391
+ **Flow Status: PASS/FAIL**
392
+ ```
393
+
394
+ ---
395
+
396
+ ## AUDIT SECTION 10: UX QUALITY
397
+
398
+ ### 10.1 Focus Ring Visibility (VR-FOCUS)
399
+
400
+ ```bash
401
+ # Check for focus indicators
402
+ grep -rn "focus:ring\|focus-visible:" src/ | wc -l
403
+
404
+ # Find focus:outline-none without replacement (a11y issue)
405
+ grep -rn "focus:outline-none" src/components/ | grep -v "focus:ring"
406
+ # Expected: 0
407
+ ```
408
+
409
+ ### 10.2 Touch Target Sizes (VR-TOUCH)
410
+
411
+ ```bash
412
+ # Find potentially undersized buttons
413
+ grep -rn 'size="sm"\|size="xs"' src/components/ | grep -i button
414
+ # Review: Verify these have >= 44x44px touch area
415
+ ```
416
+
417
+ ### 10.3 Motion Preferences (VR-MOTION)
418
+
419
+ ```bash
420
+ # Check for prefers-reduced-motion support
421
+ grep -rn "prefers-reduced-motion\|motion-reduce\|motion-safe" src/ | wc -l
422
+
423
+ # Count animations
424
+ grep -rn "animate-\|transition-\|@keyframes" src/ | wc -l
425
+ ```
426
+
427
+ ### 10.4 Error Recovery Flows (VR-RECOVERY)
428
+
429
+ ```bash
430
+ # Check for error boundaries
431
+ find src/app -name "error.tsx" | wc -l
432
+
433
+ # Check for retry mechanisms
434
+ grep -rn "retry\|refetch\|try again" src/components/ | wc -l
435
+ ```
436
+
437
+ ### 10.5 UX Quality Audit Matrix
438
+
439
+ ```markdown
440
+ ### UX Quality Verification
441
+
442
+ | Check | Command | Expected | Actual | Status |
443
+ |-------|---------|----------|--------|--------|
444
+ | Focus indicators | grep focus:ring | > 0 | | PASS/FAIL |
445
+ | Touch targets | No undersized | 0 violations | | PASS/FAIL |
446
+ | Motion preferences | If animations, has support | Present | | PASS/FAIL |
447
+ | Error recovery | error.tsx + retry buttons | Present | | PASS/FAIL |
448
+ | Keyboard nav | Handlers + Escape | Present | | PASS/FAIL |
449
+ | Contrast | WCAG AA | Compliant | | PASS/FAIL |
450
+
451
+ **UX QUALITY GATE: PASS / FAIL**
452
+ ```
453
+
454
+ ---
455
+
456
+ ## UI AUDIT REPORT FORMAT
457
+
458
+ ```markdown
459
+ ## MASSU UI AUDIT REPORT
460
+
461
+ ### Audit Summary
462
+ - **Date**: [timestamp]
463
+ - **Scope**: Full UI/UX audit
464
+ - **Pages Audited**: [N]
465
+ - **Components Audited**: [N]
466
+
467
+ ---
468
+
469
+ ### Section 1: Page Infrastructure
470
+ | Check | Count | Issues | Status |
471
+ |-------|-------|--------|--------|
472
+ | Total pages | N | - | - |
473
+ | With error.tsx | N | [missing] | PASS/FAIL |
474
+ | With loading.tsx | N | [missing] | PASS/FAIL |
475
+
476
+ ### Section 2: Navigation
477
+ | Check | Result | Status |
478
+ |-------|--------|--------|
479
+ | Dead links | 0 | PASS |
480
+
481
+ ### Section 3: Buttons
482
+ | Check | Result | Status |
483
+ |-------|--------|--------|
484
+ | Buttons with handlers | N/N | PASS |
485
+
486
+ ### Section 4: Forms
487
+ | Check | Result | Status |
488
+ |-------|--------|--------|
489
+ | Forms with validation | N/N | PASS |
490
+
491
+ ### Section 5: State Management
492
+ | State Type | Coverage | Status |
493
+ |------------|----------|--------|
494
+ | Loading states | N components | PASS |
495
+ | Empty states | N components | PASS |
496
+ | Error states | N components | PASS |
497
+
498
+ ### Section 6: Responsiveness
499
+ | Check | Result | Status |
500
+ |-------|--------|--------|
501
+ | Mobile layouts | Present | PASS |
502
+
503
+ ### Section 7: Accessibility
504
+ | Check | Result | Status |
505
+ |-------|--------|--------|
506
+ | Images without alt | 0 | PASS |
507
+ | aria-labels | Present | PASS |
508
+
509
+ ### Section 8: Consistency
510
+ | Check | Result | Status |
511
+ |-------|--------|--------|
512
+ | Custom colors | 0 | PASS |
513
+ | Design tokens | Used | PASS |
514
+
515
+ ### Section 9: User Flows
516
+ | Flow | Steps Verified | Status |
517
+ |------|----------------|--------|
518
+ | [Flow 1] | N/N | PASS |
519
+
520
+ ### Section 10: UX Quality
521
+ | Check | Result | Status |
522
+ |-------|--------|--------|
523
+ | Focus rings | Present | PASS |
524
+ | Touch targets | Adequate | PASS |
525
+
526
+ ---
527
+
528
+ ### Issues Found
529
+
530
+ #### HIGH Priority
531
+ [List or "None"]
532
+
533
+ #### MEDIUM Priority
534
+ [List or "None"]
535
+
536
+ #### LOW Priority
537
+ [List or "None"]
538
+
539
+ ---
540
+
541
+ **UI AUDIT: PASSED / FAILED**
542
+ ```
543
+
544
+ ---
545
+
546
+ ## SESSION STATE UPDATE
547
+
548
+ After audit, update `session-state/CURRENT.md`:
549
+
550
+ ```markdown
551
+ ## UI AUDIT SESSION
552
+
553
+ ### Audit
554
+ - **Date**: [timestamp]
555
+ - **Scope**: Full UI/UX audit
556
+ - **Result**: PASSED / FAILED
557
+
558
+ ### Findings Summary
559
+ - Pages: [N] audited, [N] issues
560
+ - Forms: [N] audited, [N] issues
561
+ - Accessibility: [N] issues
562
+ - Responsiveness: [N] issues
563
+
564
+ ### Fixes Required
565
+ [List or "None"]
566
+ ```
567
+
568
+ ---
569
+
570
+ ## AUTO-LEARNING PROTOCOL (MANDATORY after every fix/finding)
571
+
572
+ Read '.claude/commands/_shared-references/auto-learning-protocol.md' for the full auto-learning protocol. Execute after EVERY fix or finding during the audit.
573
+
574
+ ---
575
+
576
+ ## START NOW
577
+
578
+ **Execute the LOOP CONTROLLER at the top of this file.**
579
+
580
+ 1. Spawn `massu-plan-auditor` subagent (via Task tool) for UI audit iteration 1
581
+ - The auditor runs all 10 sections
582
+ 2. Parse `GAPS_FOUND` from the subagent result
583
+ 3. If gaps > 0: fix UI issues, spawn another iteration
584
+ 4. If gaps == 0: UI audit passes - output final report
585
+ 5. Update session state
586
+
587
+ **Remember: Every interaction must have feedback. No dead ends. World-class UX is the standard.**