frontend
Frontend
This file is a router over references/; the rules live there. The flow is ground -> brief -> build -> subtract -> verify. The bar is restraint with a visible hierarchy: one primary action, the important thing first, nothing on the screen without a job. A quiet, correct screen that holds its hierarchy at 390 and 1440 in both themes is a finish. Atmosphere, motion, and award-grade surface work are opt-in: build them when the brief asks (a named brand, "premium", "make it stunning", a marketing page), never by default for an internal tool, dashboard, admin screen, report, or figure. An inline page shown beside a reply (a chart, table, or diagram for the host's inline-page or HTML-preview tool, such as show_html_page) follows the visualize skill when it is available; either way it is exempt from the DESIGN.md gate, the Lighthouse audit, and the research lanes, and keeps the build rules, the Draft guard, and the lint.
Route: name the references, read exactly those
Before the first edit, name the references the request routes to and one reason for each, then read them. Rows stack: take every row the request matches, so a small change that also reshapes a region takes the layout row too, and any code change takes the perfection row and, on a React project, the React tooling row. A small change on an existing surface still reads only a few; only greenfield fans out. A reference you never named is one you decided to skip; one you named but never opened is a gap you still owe.
| Request | Read |
|---|---|
| Small change on an existing surface: a fix, a new control, a restyled component, a copy or spacing change | The project's DESIGN.md (or the nearest styled sibling when there is none) plus at most ONE design reference: the Layer A style skill the project follows, or references/design/redesign-skill.md when the ask is "this looks bad" / "improve this". No DESIGN.md and no styled sibling either: README Phase 0 (it asks). |
| A new screen or flow in an existing project | ALSO references/design/README.md Phase 0 (the DESIGN.md gate and its branches) and the Layer A skill in use. |
| A new screen or flow, a redesign ("this looks bad", "make it better"), or design-system creation or rework | ALSO references/design/grounding.md (step 0 below). |
| Greenfield with no concrete reference | references/design/README.md in full: the gate, the greenfield research lanes (_INDEX.md shortlist, lazyweb.md, stylegallery.md, imagen drafts), and the style routing. One Layer A + one Layer B, read in full. |
| A concrete visual reference: screenshot, mockup, Figma export, Stitch or imagen output | references/design/image-to-code-skill.md; a live site or URL to clone: references/design/clone-from-url.md. The reference is the contract and /visual-qa runs in reference-fidelity mode. |
| Any layout or structure change: a new or reshaped region, shell, panel, split, list or grid, sticky bar, or scroll container; "what goes where"; "this layout breaks at X" | references/design/layout-skill.md for the mechanics, then references/design/stylegallery.md for the pattern contract. Write the Layout: line (Brief, below) before the code; /visual-qa A12 checks the build against it. |
| Paged output: a PDF report, print stylesheet, headless-Chrome print pipeline, a deck printed to paper, "why is this page half empty" | references/design/print-paged-media.md: page box, fragmentation properties, the atomic-block set, the keep-together side effect that strands a block. |
| Interaction or motion: micro-interactions, transitions, gestures, hover/press/state feedback | references/design/interaction-skill.md. The beui.dev catalog is the reference: read the nearest pattern's real source through its curl recipe, adapt the mechanism to DESIGN.md motion tokens. |
| Ambience, only when the brief asks: an animated, shader, particle, or grid background; a typographic reveal; scroll storytelling; spotlight, tilt, or glowing-border cards | references/design/ambience-skill.md. The react-bits catalog is the reference: nearest pattern, real source, its retrofit checklist (reduced motion, off-screen pause, compositor-only, tokens, budget); never vendor its code. |
| Tone outside both anchors: AI-agent UI, charts, landing sections, a brutalist or Tailwind-only build, or no nearest pattern | references/design/component-catalogs.md: which catalog per tone, the exploration procedure, the licence gate. |
| Writing or modifying frontend code; auditing performance, SEO, accessibility, quality | references/perfection/README.md, references/perfection/craft-floor.md, and references/perfection/detect.md (+ react-perf-tooling.md before any React audit). Lighthouse 100 in every category on real Playwright Chromium, won in the architecture. Design and perfection load together for implementation work. |
| On request, or a greenfield palette, type, chart, or landing-structure question | references/ui-ux-db/README.md and its search CLI (library, below). A lookup tool, never the posture. |
| Creating or updating DESIGN.md; personas, critique, debt, handoff, synthetic user testing | references/designpowers/README.md + lane-c-review.md (lane-c is the Phase Final critique reviewer and fills the accessibility-constraint and accepted-debt sections). |
| Any code change in a React project | references/design/README.md Phase 0.5: the react-grab / react-scan / react-doctor check (a grep), the install when one is missing, and the dev-only gate; react-dev-tooling-skill.md for per-framework snippets. |
| "What do shipped apps in this spa
