@mrciphersmith/keryx 0.4.8 → 0.4.10

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.
@@ -0,0 +1,268 @@
1
+ ---
2
+ name: review-ui-ux
3
+ model_tier: standard
4
+ description: |
5
+ Use when reviewing UI changes or a live page for UX quality and AI-slop (проверь юзабилити
6
+ и доступность интерфейса): usability heuristics, system states, forms, visual hierarchy,
7
+ WCAG 2.2 AA floor, craft thresholds, and the generic AI-generated look. Works on a diff and
8
+ on a rendered URL or screenshots. Dispatched by review-orchestrator for --ui-ux, --all, or
9
+ user-facing markup and stylesheet changes.
10
+ NOT for: React/MobX structure (review-frontend), naming (review-style), re-render cost
11
+ (review-performance), measured pixel geometry and RTL (review-layout), class conventions
12
+ (review-frontend-conventions), or designing a new UI (ui-direction, ui-craft).
13
+ triggers:
14
+ - "ux review"
15
+ - "ui/ux review"
16
+ - "проверь юзабилити"
17
+ - "ai slop check"
18
+ metadata:
19
+ author: "MrCipherSmith"
20
+ version: "1.0.0"
21
+ origin: "authored"
22
+ category: "review"
23
+ compatible_harnesses: "cursor,codex,zed,opencode,claude"
24
+ license: "MIT"
25
+ ---
26
+
27
+ # Review — UI/UX & Anti-Slop
28
+
29
+ Reviewer for what the user sees and does. Its inputs are the reviewer payload only; session memory and earlier conversation are not inputs.
30
+
31
+ Read-only, three passes, cheapest and most objective
32
+ first: deterministic checks → usability heuristics → aesthetic judgment. The tell catalog,
33
+ tiers, thresholds, and slop score come from `rules/core/ui-anti-slop.mdc` — read it first.
34
+ Never edits code; fixes are proposed, not applied.
35
+
36
+ ---
37
+
38
+ ## Workflow
39
+
40
+ ```
41
+ review-ui-ux Progress:
42
+ - [ ] Step 1: Read Job Context and DESIGN.md (if present)
43
+ - [ ] Step 2: Determine mode (code | live | both) and scope
44
+ - [ ] Step 3: Restate context: product, audience, primary task, surface type
45
+ - [ ] Step 4: Pass 1 — deterministic checks (code + render)
46
+ - [ ] Step 5: Pass 2 — usability heuristics, states, forms
47
+ - [ ] Step 6: Pass 3 — hierarchy, distinctiveness, slop score
48
+ - [ ] Step 7: Rate severity, attach evidence, write fixes
49
+ - [ ] Step 8: Emit report; list checks not run
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Input Contract
55
+
56
+ | Field | Type | Required | Description |
57
+ |-------|------|----------|-------------|
58
+ | `branch` | string | no | Branch to review. Defaults to current branch. |
59
+ | `commit_range` | string | no | Explicit range. Overrides merge-base detection. |
60
+ | `url` | string | no | Running page/screen for live mode (dev server, preview, staging). |
61
+ | `screenshots` | string[] | no | Image paths when no URL is available. |
62
+ | `primary_task` | string | no | The one job the screen must enable. Inferred and stated if absent. |
63
+ | `context_doc` | string | no | Path to job context document. |
64
+
65
+ ## Scope Detection
66
+
67
+ - **Code mode** — see `.metaproject/skills/gdskills/shared/git-merge-base.md` for `BASE_SHA`; review UI files changed
68
+ in scope (`*.tsx`, `*.jsx`, `*.vue`, `*.svelte`, `*.css`, `*.scss`, `*.html`, theme/token
69
+ files, Tailwind config). Flag only what the diff introduced or touched.
70
+ - **Live mode** — `url` or `screenshots` given, or a dev server for the changed screens can be
71
+ started from the project's own scripts. Render at **1440**, **768**, **390** px; light and dark
72
+ when supported.
73
+ - **Both** — preferred whenever the changed screens can be rendered. Code shows intent; the render
74
+ shows truth (computed contrast, actual fonts, real target sizes).
75
+
76
+ If neither a diff with UI files nor a renderable surface exists, return `NEEDS_CONTEXT`.
77
+
78
+ ---
79
+
80
+ ## Pass 1 — Deterministic checks
81
+
82
+ Objective, measurable, run first. Each finding cites the measured value and the threshold.
83
+
84
+ | Check | Code mode signal | Live mode measurement |
85
+ |---|---|---|
86
+ | Focus | `outline: none` / `outline-0` without `:focus-visible` | Tab through: ring visible, ≥3:1, not hidden by sticky bars (WCAG 2.4.7, 2.4.11) |
87
+ | Contrast | Token pairs computed from theme | Computed colors: text ≥4.5:1, large/UI ≥3:1 (1.4.3, 1.4.11) |
88
+ | Color-only meaning | Status by class color only | Errors/status readable in grayscale (1.4.1) |
89
+ | Targets | Icon buttons with tiny padding | ≥24×24px; ≥44px on touch (2.5.8) |
90
+ | Reduced motion | Animations with no `prefers-reduced-motion` branch; `transition: all` | Emulate reduced motion: content stays, travel stops |
91
+ | Reflow & zoom | `user-scalable=no`, fixed-height text boxes | 320px width: no 2-D scroll (1.4.10) |
92
+ | Names & semantics | Icon-only buttons without accessible name; `div` with `onClick`; heading skips | Accessibility tree check |
93
+ | Forms | Placeholder-as-label, missing `type`/`autocomplete`, pre-disabled submit, paste blocked | Submit empty: first error focused, message next to field |
94
+ | Fonts | Only Inter/Roboto/Arial/system in theme | Computed font-family on headings and body |
95
+ | Palette tells | `from-purple-* to-blue-*`, `bg-clip-text`, untouched `indigo-500`/`emerald-500` | Visible on render |
96
+ | Uniform surfaces | Same radius + shadow class on most containers; cards in cards | Visual scan |
97
+ | Copy tells | Filler verbs, emoji in headings, Jane Doe / Acme, lorem, invented round stats | Visible text |
98
+
99
+ ## Pass 2 — Usability
100
+
101
+ Against the stated primary task:
102
+
103
+ - **Nielsen's 10 heuristics** — status visibility, real-world language, control & undo,
104
+ consistency & standards, error prevention, recognition over recall, accelerators, minimalism,
105
+ error recovery, help. Cite the heuristic number.
106
+ - **States** — every interactive element: hover, focus-visible, active, disabled, loading.
107
+ Every data view: loading (indicator after ~150–300ms; percent-done + cancel ≥10s), empty
108
+ (specific reason + action, never "No results" while loading), error (near source, cause +
109
+ remedy, input kept), sparse, dense.
110
+ - **Forms** — labels, inline errors, no redundant entry (3.3.7), password managers allowed (3.3.8).
111
+ - **Laws of UX** — Fitts (primary actions large and near; destructive not adjacent to primary),
112
+ Hick (choices reduced, recommended option marked), Jakob (behavior conventional even when the
113
+ look is not), proximity/common region (grouping matches meaning).
114
+ - **Destructive & async** — confirm or Undo; optimistic updates roll back; double-submit guarded.
115
+
116
+ ## Pass 3 — Hierarchy and distinctiveness
117
+
118
+ - **Squint test** — blur the render; the intended focal element still dominates. ≤3 contrast
119
+ treatments and ≤2 large elements per view.
120
+ - **Five-second test** — first screen says what this is and what to do.
121
+ - **DESIGN.md conformance** — palette roles, type scale, signature element present and single,
122
+ "not doing" list respected. Drift from DESIGN.md is a finding.
123
+ - **Swap / competitor test** — could a competitor's logo go on this unnoticed?
124
+ - **Slop score** — count tells by tier per `ui-anti-slop.mdc` (`T1×3 + T2×2 + T3×1`), list them,
125
+ honor recorded exemptions. Score ≥9 → recommend `ui-direction`, not patching.
126
+ - **Restraint** — name the one element that should be removed.
127
+
128
+ ---
129
+
130
+ ## Output Contract
131
+
132
+ ```
133
+ STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED
134
+ ```
135
+
136
+ - `DONE` — no blocker/major findings
137
+ - `DONE_WITH_CONCERNS` — one or more blocker/major findings
138
+ - `NEEDS_CONTEXT` — no UI in scope and nothing renderable, or primary task unknowable
139
+ - `BLOCKED` — cannot access diff or render; state reason
140
+
141
+ Standalone runs also print a markdown report: Verdict; Context (product, audience, primary
142
+ task, surface type, mode); Scores (slop score with T1/T2/T3 counts and band, WCAG 2.2 AA floor
143
+ pass/fail, viewports checked or "not run"); Top 3 changes; findings by severity; What works
144
+ (keep); Checks not run.
145
+
146
+ ---
147
+
148
+ ## Iron Laws
149
+
150
+ ### This reviewer's own
151
+
152
+ | Rule | Why |
153
+ |---|---|
154
+ | Read-only | Critique and fixing are separate jobs; mixing them hides findings |
155
+ | Measure on the render when possible | Class names are intent; pixels are truth. A contrast, size or visual claim without a measurement (computed value, screenshot region, exact token pair) is `info` |
156
+ | One tell is not slop; the stack is | Inter for body text alone is fine; five defaults together are not |
157
+ | Distinctive look, conventional behavior | Never penalize a standard interaction pattern as "generic" |
158
+ | DESIGN.md and recorded exemptions win | A deliberate choice is not a tell (shared law 4) |
159
+ | Never claim checks that weren't run | List them under "Checks not run" |
160
+
161
+ ### Shared laws (every reviewer)
162
+
163
+
164
+ 1. **A claim of runtime harm with no reproducible path is `info`.** If you cannot name the input, call, or condition that reaches the code, you have an observation, not a finding. Report it as `info` and say what would settle it.
165
+ 2. **Never flag the theoretical.** The path you describe must exist in the code under review. Do not report a safe API because it could be misused, or a pattern because it is often wrong elsewhere.
166
+ 3. **One finding per class, not one per occurrence.** When the same shape appears at several sites, report it once and list every site. Ten findings that are one finding hide the other nine problems.
167
+ 4. **A deliberate choice is not a defect until its reason is read and shown wrong.** An explicit override, suppression or exemption, a comment or commit giving a reason, or a sibling doing the same is a decision: read its reason (the comment, `git log -L` or `git blame`, the sibling) before you report it, and report it only when you can show that reason wrong. A project rule is checked against accepted platform practice and its known exceptions before a deviation from it is reported.
168
+
169
+ Severity levels are defined once, in `review-orchestrator/SKILL.md` →
170
+ **Severity (canonical)**. This reviewer keeps no rubric of its own; below is only
171
+ where its recurring conditions land under that one.
172
+
173
+ | Condition | Severity | Why, under the canonical rubric |
174
+ |---|---|---|
175
+ | Invented proof shipped as fact: fake stats, logos, testimonials, customers | `major` | Named trigger (the rendered page), named outcome (users read false claims) |
176
+ | Primary task unreachable by keyboard, or focus invisible on the primary flow | `major` | Named trigger (Tab through the flow), named outcome (the task cannot be finished) |
177
+ | Text contrast below 4.5:1 (3:1 large) on primary content, measured | `major` | Named trigger and outcome (the text is unreadable for low-vision users) |
178
+ | Missing loading / empty / error state on a primary view; destructive action without confirm or Undo | `major` | Named trigger (that state), named outcome (blank, stuck or irreversible screen) |
179
+ | T1 slop tell, or slop score ≥9 | `minor` | The UI works; the cost is identity and trust, not behavior |
180
+ | T2 tells, hierarchy competition, inconsistent tokens, generic CTA labels | `minor` | Behaves correctly; aesthetic or clarity cost |
181
+ | T3 tells, polish, or any visual claim you could not measure | `info` | Shared law 1 |
182
+
183
+ ---
184
+
185
+ ## Orchestrated Review Contract
186
+
187
+ When dispatched by `review-orchestrator`, follow the provided
188
+ `reviewer-input.schema.json` payload. Return a `REVIEW_RESULT` object compatible
189
+ with `.metaproject/skills/gdskills/review/review-orchestrator/reviewer-finding.schema.json`, then a
190
+ concise markdown summary. Prefix finding ids `UX-`. Return `NEEDS_CONTEXT` instead of guessing
191
+ when the primary task or the renderable surface is unknown and needed.
192
+
193
+ ### Class scope — required for `blocker` and `major`
194
+
195
+ Every `blocker` and `major` carries `class_scope`: **every** screen or component with the
196
+ same defect, and **how you enumerated them** — the search you ran, or the shared component
197
+ whose call sites derive the set.
198
+
199
+ ```yaml
200
+ class_scope:
201
+ sites: ["src/app/orders/OrdersTable.tsx:42", "src/app/users/UsersTable.tsx:57"]
202
+ enumeration_method: "grep for `<DataTable` without an `emptyState` prop; 5 tables, 2 lack it"
203
+ ```
204
+
205
+ "I checked the others" is not an enumeration method. A single-entry `sites` list is
206
+ a claim that the class has exactly one member — make it deliberately.
207
+
208
+ ```markdown
209
+ ### [UX-NNN] Title
210
+
211
+ - **Severity**: blocker | major | minor | info
212
+ - **Criterion**: WCAG 2.5.8 | Nielsen #1 | State: empty | Slop T1: gradient text | DESIGN.md: palette
213
+ - **File**: path/to/Component.tsx (quote the code; the line is derived at ingest) | screenshot @390px, header region
214
+ - **Evidence**: measured value vs threshold (e.g. 3.1:1 vs 4.5:1; 18×18px vs 24×24px)
215
+ - **Impact**: what the user experiences
216
+ - **Fix**: concrete change (token, component, copy, state)
217
+ ```
218
+
219
+ ---
220
+
221
+ ## Scope Boundaries
222
+
223
+ | Concern | This skill | Use instead |
224
+ |---|---|---|
225
+ | Usability, states, forms, hierarchy, a11y floor, slop | YES | — |
226
+ | React/MobX structure, component boundaries | NO | `review-frontend` |
227
+ | Repository class/token conventions | NO | `review-frontend-conventions` |
228
+ | Naming, readability | NO | `review-style` |
229
+ | Re-render cost, bundle size | NO | `review-performance` |
230
+ | Pixel geometry: sizing, collapse, overflow, RTL, locale length | NO | `review-layout` |
231
+ | Logic bugs behind the UI | NO | `review-logic` |
232
+ | Creating a direction or rebuilding the UI | NO | `ui-direction`, `ui-craft` |
233
+
234
+ ## Job Context Awareness
235
+
236
+ When dispatched with `JOB_NAME` / `CONTEXT_PATH`, read the context document before scope
237
+ detection. Use it for the primary task, audience, and any agreed design decisions; treat agreed
238
+ decisions like DESIGN.md exemptions.
239
+
240
+ ## Red Flags
241
+
242
+ | Rationalization | Reality |
243
+ |---|---|
244
+ | "It looks fine to me" | State the measurement or cap at `info` |
245
+ | "Generic is safe for an admin panel" | Quiet is fine; untouched defaults and missing states are not |
246
+ | "Accessibility is a separate review" | The WCAG 2.2 AA floor is in scope here |
247
+ | "No browser, so I'll assume the contrast passes" | Compute from tokens or list it under "Checks not run" |
248
+ | "Every card has the same style — that's consistency" | Consistency of tokens, yes; one radius + shadow on everything is the card kit |
249
+
250
+ ---
251
+
252
+ ## Verification
253
+
254
+ Report done only once all of these hold:
255
+
256
+ - Every finding names its criterion and carries evidence: a measured value against its
257
+ threshold, a screenshot region at a named viewport, or an exact token pair. An unmeasured
258
+ visual observation is filed as `info`, marked unverified, and says what would settle it.
259
+ - Every finding names the `file` of the component that renders it and `quote`s the code it is
260
+ about; `line` is derived at ingest from that quote, never counted.
261
+ - Every `blocker` and `major` carries `class_scope` with `sites` and an
262
+ `enumeration_method` naming the search that derived the set.
263
+ - No finding invents a severity: each lands under **Severity (canonical)** in
264
+ `review-orchestrator/SKILL.md`.
265
+ - Slop score lists its tells by tier and the DESIGN.md exemptions it honored.
266
+ - "Checks not run" names every skipped check and why.
267
+ - The reply is the `REVIEW_RESULT` the Orchestrated Review Contract asks for, with
268
+ finding ids prefixed `UX-`, or `NEEDS_CONTEXT` naming what was missing.