--- name: better-coding-frontend description: "Build or audit user interfaces to a quality floor: accessibility (WCAG 2.2 AA), UX states (loading/empty/error), design-system consistency, responsive layout, internationalization, frontend testing, and GDPR/privacy hygiene. MUST be used whenever UI is built, reshaped, or reviewed in any stack (React, Angular + Material, Vue, Svelte, Web Components, plain HTML/CSS) — even if the user does not say accessibility or frontend. Stack-neutral anti-generic-AI-look principles; build mode sets the quality floor while coding, audit mode reports read-only. Visual/aesthetic direction belongs to a design skill, not this one. Trigger: /better-coding-frontend" metadata: version: "2.12.0" license: Apache-2.0 --- # Better Coding Frontend The layer between "it renders" and "it's good to use." Aesthetics (palette, typography, signature) belong to the `frontend-design` skill; this skill owns whether the interface is **usable, accessible, robust, internationalized, and compliant** — the parts that decide whether a real person, on a real device, with real needs, can actually use it. **Primary objective:** every interface is operable by keyboard and screen reader, readable at real contrast and zoom, honest about its states (loading/empty/error), responsive down to mobile, internationalizable, and free of privacy/compliance traps. Looking good is necessary but not sufficient. --- ## Activation Begin the first response after loading with exactly this line: ▸ better-coding-frontend active — accessibility, usability & compliance layer Emit it once, then proceed. Do not repeat it later. --- ## Two modes The same principles apply whether you are **building** new UI or **auditing** existing UI — only the output differs. * **Build mode** — the checklists below are a *quality floor* to hit as you write. Design for the states and the keyboard user from the start; retrofitting accessibility is far more expensive than building it in. Where tooling allows, screenshot the rendered result and self-critique against these checklists — a picture catches what reading the code misses. * **Audit mode** — walk the checklists against existing UI and report findings read-only, in the format at the end. State which files/components you reviewed. Do not silently rewrite; report, then fix only if asked. If the request is ambiguous, ask which mode. When building, if visual/aesthetic direction is also needed, defer those decisions to `frontend-design` and focus here on the quality layer. --- ## Stack-neutral by default The rules are expressed against the platform (HTML semantics, CSS, ARIA, the DOM) so they hold across React/TS, Angular + Material 3, Vue, Svelte, Web Components, and plain HTML/CSS. Where a stack matters, note it inline: * **Angular + Material 3 (MDC)** — Material components ship accessible defaults; the common failures are *overriding* them (removing focus rings via CSS, custom `mat-*` theming that breaks contrast tokens, custom controls that drop the built-in ARIA). Verify overrides don't regress what the component gave you. * **React/TS** — native elements first (`