CommunityProgramación y desarrollogithub.com

webstack-frontend

Frontend and UI engineering rules for the webstack kit (checklist prefix FE). Covers rendering per route, responsive layout, Core Web Vitals budgets, WCAG 2.2 AA, component states, design-system choice, usability testing, CSP, state management, i18n and mobile clients. Used by webstack agents; not for direct use.

¿Qué es webstack-frontend?

webstack-frontend is a Claude Code agent skill that frontend and UI engineering rules for the webstack kit (checklist prefix FE). Covers rendering per route, responsive layout, Core Web Vitals budgets, WCAG 2.2 AA, component states, design-system choice, usability testing, CSP, state management, i18n and mobile clients. Used by webstack agents; not for direct use.

Compatible con✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/gujurialekha/webstack-blueprint/tree/HEAD/skills/webstack-frontend

Installed? Explore more Programación y desarrollo skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

Frontend

You own the FE checklist items. Detail: references/FE.md.

How to work

  1. Before designing, confirm the screen's audience, its main task, and the one thing it must make obvious.

  2. Plan the design tokens before writing UI code:

    • colours, as named roles;
    • type roles;
    • spacing;
    • a rough layout sketch.

    Choose the design system with the rule under "Choices".

  3. Give each screen one emphatic element and keep everything else quiet. Avoid generic template looks.

  4. Write tests first for behaviour (testing skill). Return the files changed and the evidence.

Floor, never skipped

  • Accessibility: WCAG 2.2 AA.

    • Keyboard access and visible focus.
    • Labels, contrast and target size.
    • Reduced motion.
    • Automated checks in CI, plus a manual keyboard and screen-reader pass for new patterns. Passing the scanner does not mean the screen conforms.
  • Responsive layout (FE-12).

    • Viewport meta width=device-width, initial-scale=1. Never disable zoom.
    • Content-first and mobile-first: one column as the base, then min-width breakpoints in rem only where the content breaks. Never name breakpoints after devices.
    • Media queries for page layout; container queries for components that sit in slots of different widths.
    • Body text in rem. Fluid clamp() sizes for display headings only, never vw alone (it breaks zoom). Keep text lines to about 70 characters.
    • No two-way scrolling at 320 CSS px wide or 400% zoom, and no loss of content with text at 200% (WCAG 1.4.10, 1.4.4). Wide tables and maps scroll inside their own container. Don't lock orientation (1.3.4).
    • Pointer targets at least 24×24 CSS px, or spaced as WCAG 2.5.8 allows. Aim for about 44–48 px on primary touch controls.
    • Nothing works on hover only. Gestures have tap and keyboard alternatives. Use pointer and hover media queries, and env(safe-area-inset-*) for full-bleed layouts.
    • Images: max-width: 100%, width and height attributes, and srcset/sizes or <picture>. Don't hide content just because it doesn't fit.
    • Logical properties (margin-inline, padding-block) so right-to-left layouts work.
    • Test at 320, 768 and 1280 px and at your widest supported width, 1 px either side of each breakpoint, at 400% zoom on a 1280 px window, and in phone landscape. Use the project's existing end-to-end or screenshot tool.
  • Every component handles all its states:

    • loading;
    • empty;
    • error;
    • partial data;
    • permission denied;
    • offline;
    • session expired mid-form.
  • Performance budgets per page type, enforced in CI. Core Web Vitals at the 75th percentile:

    • LCP ≤ 2.5 s;
    • INP ≤ 200 ms;
    • CLS ≤ 0.1.

    Watch hydration cost.

  • Security:

    • strict CSP with nonces or hashes;
    • frame-ancestors set;
    • no auth tokens in web storage (use the backend-for-frontend pattern with HttpOnly cookies);
    • escape all user content.
  • The server is authoritative. Client validation is for usability only. Keep server-cache state separate from UI state, and make optimistic updates roll back on failure.

  • Time and language.

    • Store UTC plus an IANA zone.
    • Format with locale-aware APIs.
    • Externalise strings when you support more than one locale.
  • Copy.

    • Name buttons after their outcome.
    • Use the same verb throughout a flow.
    • Error messages say what happened and how to fix it.

Choices

  • Design system. The first rule that fits wins:

    1. The repository or organisation already has one: use it.
    2. One is mandated (a government service standard, an enterprise brand): adopt it.
    3. Prototype or proof of concept: native HTML plus a few CSS custom properties. No design system.
    4. Many complex widgets and no mandate: adopt an open, accessible component library that fits the current framework. Use a headless one if you need a custom look. Theme it through tokens; don't fork it.
    5. Build your own only when open systems can't meet the need and a team will own it.

    Record the choice in an ADR covering: options considered, licence, framework coupling (one framework, Web Components or CSS only), the accessibility claims you checked yourself, theming and tokens, upgrade policy, the cost of leaving it, and the owner. Keep tokens as CSS custom properties. The DTCG token format is optional, for exchange between tools; it is a Community Group report, not a W3C standard.

  • Usability testing. For a new or changed core journey, prepare a test with references/usability-testing.md. You can prepare the test and do an expert review. Only real people produce user evidence.

  • Rendering: choose per route. Static for marketing pages. Server- or client-rendered for the app.

  • Browser support: follow Baseline.

  • Error monitoring: private source maps and release tags.

  • Mobile or desktop clients:

    • a forced-upgrade policy;
    • handling of version skew;
    • in-app account deletion where app stores require it.

Adapted from: anthropics/skills (frontend-design ideas), vercel-labs/agent-skills (web-design-guidelines, rewritten as plain HTML and CSS). Responsive rules follow WCAG 2.2, web.dev and MDN; usability testing follows the GOV.UK Service Manual and Nielsen Norman Group. See NOTICE.md and references.md.

Skills relacionados