.agents/skills/ux-audit/SKILL.md
A repeatable, standards-based UX review of one surface at a time. The benchmark is two things together:
references/pattern-catalog.md.ux skill — LobeHub's execution checklists for how a flow
should behave.The audit answers: which patterns does the surface use (and how well), and where is
the experience weak (each gap tied to a checklist item). Recurring gaps feed back as new
ux checklist items; the audit itself becomes a worked-example reference.
Do one surface per run — a full-app sweep is too much for a single pass. Re-run per page as the product grows; that's the "continuous" part.
An audit is not one activity. A finding is only trustworthy from a layer that can actually see it. Each layer has its own procedure file; run the ones the surface needs.
| Layer | File | What it does | Catches | Cost |
|---|---|---|---|---|
| L1 Static | layer-1-static.md | Read the code | Missing states/branches (empty/error/retry), no draft persist, absent patterns, structural issues | cheap, offline, every audit |
| L2 Visual | layer-2-visual.md | Screenshots of the rendered surface | Real visual hierarchy & dominant control, spacing/contrast/alignment, truncation/overflow, how empty/loading/error actually look, responsive breakpoints, dark/light | medium; needs a render |
| L3 Dynamic | layer-3-dynamic.md | Drive the real user journey via agent-testing + instrument | In-progress/locked states, forced error/empty states, does step N lead to N+1, focus/keyboard, quantified CLS / LCP / INP / long-tasks | high; needs a running env + auth |
The core rule: a verdict must come from a layer that can see it. Don't tick a visual or runtime verdict off the code.
| Finding type | L1 | L2 | L3 |
|---|---|---|---|
| Missing empty/error branch, no retry, draft not persisted, absent pattern | ✅ | — | — |
| Real visual hierarchy / is the dominant control the primary action | ❌ misleads | ✅ | ✅ |
| Spacing / alignment / contrast / truncation / overflow / dark mode | ❌ | ✅ | — |
| Off-screen selection; what empty/loading/error actually render as | ❌ | ✅ | ✅ |
| Responsive breakpoints (narrow / mobile) | ❌ | ✅ | ✅ |
| In-progress / locked states; forced error / empty; capability-gated | ❌ | ❌ | ✅ |
| Journey stitching (forward momentum across steps) | weak | weak | ✅ |
| Focus order / keyboard reachability | ❌ | ❌ | ✅ |
| CLS / LCP / INP / long-task numbers | ❌ | qualitative only | ✅ |
| Which of two variants is better (A/B winner) | ❌ misleads | ❌ misleads | ✅ (+analytics) |
⚠️ The recurring trap this prevents: ticking "one primary button" or "empty is a real page" from a
variantprop in the code. Those are L2 verdicts — confirm them on the render, never from L1 alone.
--l1 / --l2 / --l3 scopes a run to one layer; default is L1 (+ L2 if screenshots are
supplied).
Every finding cites its evidence — file:line (L1), a screenshot you verified with the
Read tool (L2), or a captured value / snapshot (L3). Before asserting a load-bearing
claim, confirm it in the layer that owns it; a wrong "it's missing" is worse than no
finding.
Reading our code can only surface flaws in what we built — it is structurally blind to a
capability we never built at all, because an entirely-absent affordance leaves no
file:line, no dead branch, no half-wired button to grep for. The checklists guard the
quality of the states that exist; they do not tell you which states a surface of this
class is expected to have.
So before (or alongside) reading code, name the surface's class and its domain conventions: how do the mature, comparable products build this exact screen, and what do they offer that a first version forgets? An OAuth consent screen's class norms, for example (GitHub / Google / Okta): show which identity you're authorizing as and let the user switch account / re-authenticate, name the requesting app, list the scopes, allow deny, and point to later revocation. A file picker, a checkout, a share dialog each carry their own class norms. Write this expected-capability list first, then audit gaps against it — otherwise the audit only ever polishes the paths that already exist and silently blesses a missing one.
❌ The first pass of the OAuth audit measured consent against our internal state checklists only and reported button-hierarchy / retry gaps, while missing the biggest one: the consent screen locks the user into the current identity with no switch-account path (
OAuthConsent/Login.tsx) — a class norm every comparable OAuth provider ships. A competitor-norms pass catches this on minute one; a code-only pass never can.
When an audit compares two variants of the same surface ("is Agent or Classic onboarding better?"), the trap is judging which is better made (more polished, more patterns, more AI) when the real question is which better gets the user to their goal. For a gateway / interstitial surface — onboarding, consent, paywall, a loading gate — the two diverge hard: the best version is often the least version, because the surface stands between the user and what they came for. Craft is not outcome, and the richer artifact is routinely the worse one.
So a variant comparison must:
❌ This skill's own miss: an L1 read judged Agent onboarding "better" than Classic because it was more polished /conversational (richer completion panel, name suggestions, view transitions), citing 意义感 ≳ 自然 > 确定性. In production Agent's effective-guidance completion was not high, users found it too slow (they wanted the tool, not a chat), and the org rolled back to Classic. Every error above was present: craft mistaken for outcome, 意义感 scored backwards, cost footnoted, a winner declared from L1 on what is an L3/analytics metric, and the flag-gated /degrades-to-Classic/desktop-excluded signals explained away.
When L1 spots two controls that seem to do the same thing, the reflex is subtraction —
delete one, hide one, merge them, differentiate the copy. Resist it. Two controls that share
an intent often differ in scope, and the honest fix expresses that scope difference in
layout — promote the wider-scope one to a visible, titled sibling — not by removing
it. Subtraction is a behavior-layer move; the better answer usually lives in the
composition layer, which is precisely the half of the benchmark an audit drops when it
walks the ux checklists but never opens
references/pattern-catalog.md. The checklists speak states,
momentum, and draft-safety; they carry no vocabulary for Titled Sections / Grid of Equals /
Center Stage, so a checklist-only read reaches for "dedupe" every time. Walk the
pattern-catalog pass (L1 step 2) before writing a remedy for any "redundant / overlapping"
finding, and ask: same intent, different scope? → the fix is a sibling, not a delete.
❌ The CC AskUserQuestion audit flagged the per-question "write your own" box and the global "Or type directly" escape as redundant and proposed hiding / merging them — a subtraction. They aren't redundant: the per-question box is question-scoped, the escape is whole-form-scoped. The composition-layer answer is to hide the escape when there's one question and render it as a visible peer to the question block when there are several — a Titled Sections move a checklist-only read never surfaced. Skipping the catalog cost the better answer.
An audit that only lists what's broken has drifted into a bug report. The mandate is
patterns in use and how well — so the strengths are first-class findings, not table
decoration. A well-built state machine, a draft that survives a failed save, an
open-redirect guard, a smart default: these are the good cases. Name them, cite their
file:line, and mark the standouts ✅ 亮点, for three reasons:
ux checklist item cites, exactly as a gap becomes the ❌ one. An audit that
reports no good cases can only ever sharpen the ❌ side of the checklists.example/task-detail.md (the loading/not-found state
machine, comment-draft-preserved-on-failure, the run-all preview → confirm flow) and the ✅ 亮点
rows in example/home.md (empty-send → day's-hint fallback,
drawer-not-navigate surface contract) are exactly that list.❌ The drift this prevents: an audit whose "Patterns in use" ✅ rows are one-word ticks ("persistent", "strong", "textbook") while every gap gets a paragraph — the good cases demoted to checkboxes.
example/task-detail.mdis the model to match: each standout pattern carries itsfile:lineand a ✅ 亮点 call-out, so the strengths are as legible as the gaps.
See the worked example, references/example/home.md. Note
which layers ran, then:
file:line),
never a one-word tick.## … — Strengths / good cases), not a table footnote: bulleted ✅ 亮点 items, each naming the behavior
this surface gets right, its evidence (file:line), and why it's load-bearing — the
✅ half of the 回灌 loop and the "don't regress" list for the next refactor. Flag the ones
strong enough to land as ✅ examples in ux (annotate → landed as ux <ref> ✅, wired
to the Skill-feedback section). Every audit produces this section — if a surface is
genuinely weak throughout, say that explicitly rather than omit it. See
example/fleet.md §2 for the shape.ux checklist item / catalog
pattern it violates, the layer + evidence it came from, and a one-line remedy.ux, and good cases worth landing as ✅ examples (see 回灌 below).An audit is not finished when the findings are written — it is finished when they are landed. All three steps below are required to close a run:
ux (mandatory). Every run must close the loop back into
the ux skill: for each finding that generalizes beyond this surface, add / strengthen a
ux checklist item (rule + ✅/❌ example in the right module, and mirror a line into the
ux Quick review), citing the audited surface as the ❌ example. This is what makes the audit
continuous — each run leaves the checklists sharper than it found them. If a run genuinely
surfaces no generalizable gap, say so explicitly in the report's Skill-feedback section
(only validated-existing-rule instances) — silence is not an acceptable close.ux, refining the rule (not just decorating it). The 回灌
loop has two halves: a gap sharpens a checklist item's ❌ example, a good case sharpens its ✅
one. But a good case is only worth landing if it teaches the rule something — the ✅
example is the floor; the goal is to sharpen the rule text or extract a latent sub-rule /
checklist item the current rule doesn't yet state. So when an audit finds a pattern done
notably well, ask: what technique does this do that the rule doesn't already demand? and
fold that back — refine the prose, split a one-trigger rule into its real cases, add a
checklist line — citing the surface as the ✅ example. A good case that merely re-illustrates
an already-complete rule adds little; a good case that reveals a missing distinction is the
point. (e.g. Fleet's scroll-into-view extracted "the re-run trigger has two flavors — async
arrival vs. imperative-add-then-paint" and "the scroll axis follows the list direction" into
Read §1.3; its skeleton extracted "match the text's width proportion, not just height"
into Feedback §4.1 — neither was stated before.)references/example/<page>.md so the next run has a template.The audit and the
uxskill are a closed loop:uxis the benchmark the audit measures against, and the audit is the mechanism that keepsuxhonest. Skipping the 回灌 breaks the loop and reduces the audit to a one-off review.
ux dimension checks flows inside a code review; this skill audits a whole surface).