Frontend Craft
Use this for frontend and product-experience work across web apps, SaaS
interfaces, dashboards, marketing surfaces, and AI-assisted UI.
Project Fit Check
Before designing or changing UI:
- Scan the existing product surface, routes, components, tokens, styles,
localization files, tests, and design docs.
- Detect the framework and styling system before importing libraries or
inventing primitives.
- Follow local component, icon, copy, accessibility, motion, and responsive
conventions. Improve them only when the task requires it.
- If design-system docs are missing, infer patterns from the existing UI and
state the inference when it affects the result.
- If the repo has its own UX review checklist, merge it with this skill instead
of replacing it.
Core Stance
- Design flows before screens.
- Build the actual usable experience, not a decorative landing shell.
- Solve the happy path and the state path: loading, empty, error, success, and
recovery.
- Use visual taste in service of clarity, trust, speed, and action.
- Mobile is not a small desktop. Touch, reach, network, battery, and distraction
matter.
- UI copy is product behavior. Buttons, errors, empty states, and confirmations
must help the user proceed or recover.
- State each page's one purpose in one sentence. If the object of that
purpose is not in the first screenful, the layout is wrong; everything else
steps back.
- Every action ends on a surface that shows its result and the next step worth
taking. No blank page, no silent return, no dead end.
- No control needs instructions to be found or operated. If it does, fix the
label, placement, or affordance. Domain consequences may still be explained
next to the action, never the control itself.
Read First
- Repo agent instructions (
AGENTS.md, CLAUDE.md, etc.)
- Domain glossary (
GLOSSARY.md) and current product/design docs
- Existing components, tokens, message catalogs, routes, and tests
- Package manifest before importing any dependency
- Accessibility, i18n, and design-system conventions already present
Pair with coding-discipline for implementation and completion-gate before
claiming done when those Skills are available. This Skill remains usable on its
own.
Thin UI, full product behavior
- Keep domain policy, authorization decisions, durable workflow state, and
persistence semantics out of UI components and framework glue.
- Keep presentation, input handling, accessibility, immediate feedback,
latency masking, and genuinely local interaction state in the UI.
- Consume task-shaped read models and send intent-shaped mutations or commands
when they make the user's job and the system contract clearer than generic
CRUD forms over persistence records.
- Build and test vertical behavior through the real public boundary. Do not
split ownership into frontend and backend handoffs when one end-to-end slice
gives faster evidence.
- Choose rendering, state, caching, and component patterns for this product and
its measured constraints. Framework patterns are tools, not the design.
- Challenge the surface with slow networks, large or awkward data, repeated
actions, multiple clients or tabs, partial failure, and narrow or low-power
devices where those conditions are plausible.
Experience Contract
Every flow needs:
- Entry point
- User intent and known context
- Primary action
- Immediate feedback
- Outcome
- Natural next step or exit
Use:
- hub-and-spoke for dashboards and detail views
- linear flow for onboarding, forms, checkout, and setup
- tabs only for 3 to 5 stable top-level areas
- progressive disclosure when complexity would otherwise overload the screen
Visual Direction
Default SaaS/product surfaces should be calm, utilitarian, and high craft:
- crisp hierarchy
- restrained color
- semantic tokens
- strong contrast
- stable layout dimensions
- clear affordances
- no decoration without function
Avoid:
- generic centered hero sections when a real product surface is needed
- generic purple or blue gradients used only to signal "AI"
- nested cards
- three equal feature cards as the default layout
- stock-like visuals that hide the actual product
- the rest of the generic-look tells (Inter or system font alone with no
display voice, uniform radius and padding, left-edge accent bars on
rounded panels, unreasoned glassmorphism, emoji or generic icons as
feature bullets, fade-in on everything, happy-path-only screens,
placeholder names, slogan copy); the full list and review gate are
design-core/references/generic-tells.md when the design skills are
installed
- unthemed library defaults: set type, radius scale, color semantics, and
motion before shipping any component library
- text that describes how to use obvious UI controls
Frontend Defaults
- Prefer existing framework patterns and primitives.
- Use server-rendered/static components by default; isolate client components or
islands only where interactivity requires them.
- Check
package.json before importing libraries.
- Use CSS variables or design tokens for colors, spacing, radius, and motion.
- Hold every text-on-surface pair to WCAG 2.2 AA (4.5:1; 3:1 for large text
and UI components, SC 1.4.3 and 1.4.11) in light and dark, and enforce it
with an automated test, not review: list every text token on every surface
it is drawn on (translucent tints composited over their base), compute the
ratio for both schemes, and fail the build below AA. Disabled controls are
exempt. Text without an explicit color must inherit a theme token from the
root, not a framework default. 7:1 (SC 1.4.6) is an optional stretch for
body text, not a gate.
- Cheap AAA extras worth keeping: reduced motion for interaction-triggered
animation (2.3.3), line height 1.5 and lines of at most 80 characters with
no justified text (1.4.8), and a focus indicator of at least 2px with 3:1
against its neighbors (2.4.13).
- Layout and type defaults, applied when building or touching a screen,
because each one is a finding the design loop reports afterwards
(
design-web/references/baseline-css.md for Baseline status):
- a row of repeated cards uses CSS subgrid, so matching parts (title,
value, tags, footer) share rows however many lines one of them takes;
- headings
text-wrap: balance, running copy text-wrap: pretty;
- no visible text under 12 px, also in print views (12 px is 9 pt);
- no fixed height on a box that holds text; let the grid size it;
- chip and tag text lines up with the text above it (optical alignment:
pull the chip out by its border plus padding);
- one accent color for emphasis, one primary action per view.
- Before push, run the quality sweep (
quality-sweep) on every page the
change reaches, and fix what it finds in the same change.
- Use icons from the installed icon system instead of emojis for UI controls.
- Use stable dimensions for buttons, toolbars, rows, grids, counters, and
dynamic labels.
- Do not animate layout properties; use transform and opacity.
- Web fonts: at most two families, WOFF2, subset, preload only the LCP-text
font,
font-display: swap with a metric-matched fallback (rules in
design-web/references/performance.md).
- Respect
prefers-reduced-motion.
- Motion guides focus: check every context change for a missing transition,
animate at most one element for attention at a time, and move keyboard
focus and the screen-reader announcement to the element the motion points
to (
design-core/references/motion.md).
Attention and Disabled Controls
- No toast or badge for FYI events; show them in the product, quietly. Group
and deduplicate, respect OS focus modes, and make a notification link
straight to the decision, not to a list.
- An action that cannot run yet stays reachable and, on activation, says what
is missing and marks the places that need attention. In review, a disabled
button without a visible reason is a finding; the narrow submit-button
exception is in
design-forms.
State Discipline
Every async or data-dependent surface needs:
- Loading: skeletons that match the final layout; avoid generic full-page
spinners.
- Empty: friendly observation, useful context, and a next action.
- Error: plain-language problem plus recovery; localize partial failures to
the affected region.
- Success: lightweight confirmation; undo for reversible destructive
actions.
Do not ship a polished happy path with broken silence everywhere else.
Copy Rules
- Name the action: "Review changes", "Create workspace", "Retry import".
- Avoid generic labels like "Submit", "OK", and "Continue" when the action can
be named.
- Use plain product language from the domain glossary.
- Do not expose raw internal errors, job names, provider stack traces, or agent
jargon in user-facing copy.
- If the repo is localized, update all required locales in the established
message system.
- Blame the system, not the user, when recovery is possible.
Mobile Rules
- Touch targets: at least 24x24 CSS px or spaced so a 24px circle around
each does not hit another target (2.5.8 AA, the hard floor); aim for 44px on
primary and mobile controls (2.5.5 AAA, the design target).
- Primary actions should be reachable in normal thumb zones.
- No hover-only affordances for critical actions.
- Avoid horizontal overflow at 320-375px.
- Check phone UI at the target device width and again at an OS text scale of
about 1.3. Scale with page zoom; a root
font-size change
misses px-sized layouts. Assert that visible control
boxes do not overlap (clip to scroll containers), targets stay at 24px or
more (fail below; warn below 44px on primary controls), and the page does
not scroll horizontally.
- Reserve space for async content to prevent layout jumps.
- Keep forms short; use progressive disclosure for advanced inputs.
- Safe areas matter for sticky bottom actions.
AI Interface Rules
- Make uncertainty visible.
- Keep provenance, review, undo, or restore available for AI-generated changes
that affect user trust.
- Do not fake AI results, citations, progress, or confidence.
- Prefer concrete progress labels over generic spinners.
- Do not let AI chrome compete with the user's primary object of work.
- Preserve user agency: suggestions should be easy to accept, reject, edit, or
ignore.
Guiding Screens
When a screen tells someone what to do next (task, status, approval, or review
flows), read GUIDING-SCREENS.md: three first-viewport
answers, server-computed acts, links to where a person checks, two registers,
and suggestions that name the act of their button.
Review Checklist
references/vocabulary.md lists the field's terms for authors and check
scripts; a review does not load it.
- Does the screen answer one primary question, and does the entry point
promise that question?
- Does each primary action land on a surface that shows its result and the
next step?
- Which control needs instructions to be found or operated, and what label,
placement, or affordance removes that need?
- Is the primary action obvious, reachable, and accurately labeled?
- Does the flow have an exit and a recovery path?
- Are loading, empty, error, and success states present?
- Does mobile collapse cleanly without hidden actions or horizontal scroll?
- Are focus, labels, roles, contrast, keyboard access, and reduced motion
handled to WCAG 2.2 AA?
- Does the implementation follow existing tokens and component patterns?
- Is every new dependency justified?
- Did the design loop run on every changed page or screen and come back with
no failing finding, or with each one fixed or recorded with its reason?
design-review/scripts/design-loop.mjs takes the screenshots and runs the
cheap checks first, so the agent sees what a reviewer would before it
says done.
Red Flags
Stop and revise when you see:
- happy-path-only UI
- hidden or generic error handling
- a disabled control with no visible reason
- hover-only mobile-critical actions
- hardcoded colors where tokens exist
- icons or emojis used inconsistently
- UI copy added outside the repo's localization system
- AI surfaces with no review, provenance, or recovery
- animation that delays the user's work
- an action that ends on a blank page or a silent return
- a tooltip or tour that explains how to find or operate a control