build-frontend
Skill0 starsChanged 13 days agoMITView on GitHub
Build or change frontend UI to production standard (components, state ownership, data fetching, forms, accessibility, Core Web Vitals, XSS-safe rendering, token storage, Testing Library tests, i18n). Use when building or changing components, pages, routes, forms, client-side state or data fetching. Not for design tokens (use `build-design-system`) or UX audits (use `review-ui-ux`).
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Phelan164/codex-howtotheir own version, first seen Aug 17, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Phelan164/codex-howto★ 15same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository33 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- global/CLAUDE.mdCLAUDE.md
- build-backendSkill
- build-commitsSkill
- build-containersSkill
- build-databaseSkill
- build-design-systemSkill
- build-iacSkill
- build-project-setupSkill
- core-documentationSkill
- core-prompt-engineeringSkill
- core-token-efficiencySkill
- create-marketing-copySkill
- create-seo-contentSkill
- operate-incidentSkill
- operate-observabilitySkill
- plan-architectureSkill
- plan-campaignSkill
- plan-codebase-analysisSkill
- plan-test-strategySkill
- plan-threat-modelSkill
- review-pull-requestSkill
- review-seoSkill
- review-ui-uxSkill
- secure-code-reviewSkill
- secure-repo-governanceSkill
- secure-supply-chainSkill
- ship-ci-cdSkill
- ship-github-actionsSkill
- ship-readinessSkill
- ship-releaseSkill
- test-performanceSkill
- test-validationSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 18
Performance check: avoid new heavy dependencies, lazy-load below-the-fold and route-level code, size images, avoid layout shift.
- Very specific: line 40
Read references/framework-notes.md when working in React/Next.js, Vue/Nuxt, Angular or Svelte and the framework idiom is unclear.
- Distinctive: line 43
Ask before adding a dependency (state its gzipped size and why the existing stack cannot do it), changing global styles/tokens, changing …
- Very specific: line 44
Do not change API contracts from the frontend side.
- Distinctive: line 45
Never commit real user data, API keys or tokens in fixtures, mocks or stories.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Frontend Development
Deliver UI that matches the codebase's patterns, works for keyboard and screen-reader users, stays fast, and is safe with untrusted data.
Procedure
- Identify the stack from manifests and existing code: framework and version, rendering mode (SPA, SSR, SSG, server components), router, styling (CSS modules, utility classes, CSS-in-JS), component library, state and data-fetching libraries, form library, i18n library, test tools.
- Find the closest existing page or component and follow its file layout, naming, props style, styling and test placement. Reuse existing components and design tokens before creating new ones.
- Pin down the contract: API endpoint and response shape (from types, OpenAPI or the backend), loading/empty/error/success states, permissions, and which component owns each piece of state. Never invent endpoints; stub only behind a clearly marked mock if asked.
- Choose state placement with the Rules table. Keep server data in the data-fetching cache, not duplicated into global state.
- Build the component: semantic HTML first, then styling, then interaction. Split when a component has more than one reason to change; keep presentational pieces free of fetching.
- Implement every state: loading (skeleton or spinner without layout shift), empty (with next action), error (message plus retry), success, partially loaded, disabled, and long/overflowing content. Read
references/accessibility.mdwhen building interactive widgets, forms, modals, menus or custom controls. - Forms: label every field, validate on submit and on blur (not every keystroke), show errors next to fields and in a summary, move focus to the first error, disable double submit, keep user input on failure, and mirror server validation (the server is authoritative).
- Performance check: avoid new heavy dependencies, lazy-load below-the-fold and route-level code, size images, avoid layout shift. Read
references/performance-security.mdwhen adding dependencies, images, fonts, third-party scripts, or rendering user-supplied content. - Test with Testing Library-style tests: query by role and accessible name (
getByRole('button', { name: /save/i })), then label, then text;getByTestIdlast. UseuserEventoverfireEvent;findBy*for async; mock the network at the HTTP layer (MSW or equivalent), not the hook. Cover states, keyboard interaction and error paths. E2E only for critical journeys. - Verify: typecheck, lint (including a11y lint rules), unit tests, and view the page in a browser at mobile and desktop widths with keyboard only. Inspect the diff; do not reformat unrelated files.
Rules
- State placement:
State Put it in Server data (lists, entities) data-fetching cache (query library, framework loader, server component) Shareable or bookmarkable UI (filters, tab, page, search) URL query params Form input form library or local component state Local UI (open, hover, draft) component state, lifted only as far as needed Truly app-wide client state (theme, session, feature flags) context or a small store Derive values instead of storing them; never sync state with effects when it can be computed. - Data fetching: one cache key per resource and params; set sensible stale times; invalidate or update the cache after mutations; cancel or ignore stale responses (race conditions); handle 401 by re-auth flow, not silent loops; no fetch waterfalls (parallelise or fetch at route level).
- Optimistic updates only with rollback on error and when the action rarely fails.
- Accessibility minimums: native elements before ARIA (
<button>not clickable<div>); every input has a programmatic label; visible focus indicator; logical tab order with no positivetabindex; dialogs trap and restore focus and close on Escape; text contrast 4.5:1 (3:1 for large text and UI boundaries); targets at least 24x24 CSS px; never convey meaning by colour alone; announce async results with a live region; respectprefers-reduced-motion; images have meaningfulaltoralt=""if decorative. - Security: never inject unsanitised HTML (
dangerouslySetInnerHTML,v-html,innerHTML,[innerHTML]); if unavoidable, sanitise with a vetted sanitiser (DOMPurify) at render time. Validate URLs before using them inhref/src(blockjavascript:). Do not store long-lived tokens inlocalStorage; preferHttpOnly,Secure,SameSitecookies set by the server. Never put secrets in client code or public env vars (NEXT_PUBLIC_,VITE_, etc. ship to the browser). Client-side checks are UX, not authorisation. - Responsive: mobile-first, layouts with flex/grid, no fixed heights on text containers, test at 320 px width and 200% zoom.
- i18n: no hard-coded user-facing strings if the project uses an i18n library; use ICU plurals and placeholders, never string concatenation; format dates, numbers and currency with
Intl/library; allow 30-50% text expansion; support RTL with logical CSS properties (margin-inline-start) where RTL locales exist. - Effects: only for syncing with external systems; always clean up subscriptions, timers and listeners; include all dependencies.
- Keys for lists are stable IDs, never array indexes for reorderable or filterable lists.
- Read
references/framework-notes.mdwhen working in React/Next.js, Vue/Nuxt, Angular or Svelte and the framework idiom is unclear.
Safety gates
- Ask before adding a dependency (state its gzipped size and why the existing stack cannot do it), changing global styles/tokens, changing routing or auth flows, or removing a component used elsewhere (search usages first).
- Do not change API contracts from the frontend side; coordinate with
build-backend. - Never commit real user data, API keys or tokens in fixtures, mocks or stories.
Output
## Change
<components/pages and behaviour>
## States covered
loading | empty | error | success | disabled | overflow (note any not applicable)
## Accessibility
<keyboard path, labels, focus management, contrast checks done>
## Performance
<bundle impact, lazy loading, images>
## Tests
<test files, commands run, results; manual browser check at widths>
## Follow-ups / risksDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

