agentleFS
wedabrowedabro/bro-skills/.agents/skills/speckit.frontend/SKILL.md

speckit.frontend

Skill3 starsChanged 3 months agoMITView on GitHub

Frontend Developer - Build production UI components, typed data flows, accessible interactions, responsive states, and performant interfaces without generic styling.

The file

Show its rules and text

We split this skill into the rules it gives an agent

22 rules. About 0 are common, 14 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈14

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use speckit.uiux for new design-system decisions, speckit.backend for API contract changes, speckit.security for security review, and …

    line 20
  2. Distinctive:

    Before writing code, inspect the current page family, shared layout, components, design tokens, theme, feature structure, rendering …

    line 28
  3. Distinctive:

    If a change affects multiple screens, modify the shared primitive, variant, or token.

    line 34
  4. Distinctive:

    Before creating a component, search for an existing primitive to reuse, extend with typed props/variants, or compose.

    line 42
  5. Distinctive:

    Keep feature-only components, hooks, schemas, and API adapters within the feature.

    line 45
  6. Very specific:

    Use 100dvh rather than 100vh for viewport-sized mobile layouts.

    line 51
  7. Very specific:

    Follow design-system spacing, typography, color, radius, shadow, sizing, z-index, and motion tokens.

    line 56
  8. Very specific:

    Do not use arbitrary fixed-pixel utilities when a token exists.

    line 60
  9. Distinctive:

    Use shared FormField/control, dialog/drawer, toast, confirmation, and data-table primitives.

    line 63
  10. Very specific:

    Use shared empty and error states with a recovery action when recovery is possible.

    line 67
  11. Very specific:

    Put API calls behind typed feature adapters.

    line 75
  12. Distinctive:

    Keep local state local and derive values instead of duplicating them.

    line 81
  13. Very specific:

    Use form schemas and shared controls.

    line 84
  14. Distinctive:

    Use real buttons/links for their native behavior.

    line 94
  15. Very specific:

    Keep desktop button labels short (maximum three words) and non-wrapping.

    line 99
  16. Distinctive:

    Avoid unnecessary client components, waterfalls, duplicate fetches, large client dependencies, layout shift, and eager non-critical media.

    line 108
  17. Distinctive:

    Test render and interaction behavior for permission, loading, empty, error, success, keyboard/focus, form, mutation, and recovery paths …

    line 116
  18. Distinctive:

    Test API adapters and state transitions.

    line 118
  19. Distinctive:

    Run the project formatter, type-check, lint, tests, and production build in Docker where available.

    line 121
  20. Distinctive:

    Do not hard-code endpoint, credential, token, color, or reusable copy.

    line 127
  21. Distinctive:

    Do not bypass accessibility, permission states, error recovery, or responsive verification to make a happy-path screen look complete.

    line 129
  22. Distinctive:

    Use the language configured by the project or requested by the user.

    line 131

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Mission

Turn approved UI requirements and API contracts into cohesive production UI. Honor .agents/knowledge_base/ui_ux_standards.md as the visual source of truth, preserve shared primitives, and keep data, accessibility, and performance behavior reliable across supported viewports.

Required Inputs

  • .agents/specs/[feature]/spec.md, plan.md, and tasks.md
  • .agents/knowledge_base/ui_ux_standards.md, current shell, tokens, and shared UI
  • API contract, auth/session behavior, and existing data/cache conventions
  • .agents/memory/constitution.md for ENV and Docker policy

Use speckit.uiux for new design-system decisions, speckit.backend for API contract changes, speckit.security for security review, and speckit.tester for broader test planning. Do not replace their ownership.

Protocol

0. Mandatory Preflight

  • Before writing code, inspect the current page family, shared layout, components, design tokens, theme, feature structure, rendering boundary, and API/data-cache conventions.
  • Report reusable components, upstream source of truth, data ownership, states, and files to create or update. Resolve missing content, permission, empty, error, loading, and success behavior before implementation.
  • If a change affects multiple screens, modify the shared primitive, variant, or token. Do not patch the same visual property page by page.

1. Layout and Component Architecture

  • Compose pages from the shared application shell, container, breadcrumb, page header, and content primitives. Same-type pages use the same structure, width, horizontal padding, and title placement.
  • Before creating a component, search for an existing primitive to reuse, extend with typed props/variants, or compose. When two components overlap by roughly 70% or more, prefer one shared component with variants.
  • Keep feature-only components, hooks, schemas, and API adapters within the feature. Promote a component only when multiple features use it; keep page files focused on composition and page-level data flow.
  • At roughly 250–300 lines, review a file and extract independent UI or logic. At the second repeated JSX, form, modal, state view, formatter, or API-error pattern, evaluate a component, hook, utility, config, schema, or service.
  • Use 100dvh rather than 100vh for viewport-sized mobile layouts. Use semantic HTML before ARIA and typed variants rather than style-only forks.

2. Visual System and Shared States

  • Follow design-system spacing, typography, color, radius, shadow, sizing, z-index, and motion tokens. Prefer existing p-4, text-lg, gap-4, and rounded-md utilities; gap-4 is the primary rhythm, gap-2 is for tight controls, and gap-6/gap-8 signal hierarchy boundaries.
  • Do not use arbitrary fixed-pixel utilities when a token exists. Limit fixed pixels to hairlines (border-[1px]), shadow/blur tuning, and tiny precision radii; promote repeated exceptions to a named token or reusable class.
  • Use shared FormField/control, dialog/drawer, toast, confirmation, and data-table primitives. Support all applicable default, hover, focus, disabled, read-only, loading, empty, error, and success states.
  • Match skeleton loading to final layout; do not substitute generic spinners. Use shared empty and error states with a recovery action when recovery is possible. Never use native alert or confirm for product interactions.

3. Rendering, Data, and State

  • Choose server/static/client rendering based on data sensitivity, freshness, interactivity, bundle cost, and SEO needs. Keep secrets and privileged data server-side; expose only approved NEXT_PUBLIC_* client configuration.
  • Put API calls behind typed feature adapters. Parse/validate external data at the boundary, model loading/error/success states explicitly, and do not leak transport shapes throughout UI.
  • Define cache key, freshness, invalidation, optimistic-update rollback, and post-mutation refresh behavior. Cancel stale requests and prevent race conditions when filters, navigation, or identity changes.
  • Keep local state local and derive values instead of duplicating them. Put repeated labels, variants, navigation, and display mappings in typed config; type props, models, view models, events, and variant unions explicitly.
  • Use form schemas and shared controls; preserve accessible labels and errors, disable duplicate submits, surface field/server errors safely, and retain user input after recoverable failures. Avoid any except at isolated, justified external boundaries.

4. Accessibility and Responsive Behavior

  • Make keyboard operation, visible focus, logical focus order, labels, error announcements, modal focus management, and target-size behavior part of the component contract. Verify WCAG AA contrast, including CTA text.
  • Use real buttons/links for their native behavior; provide meaningful names for icon-only controls and text alternatives for non-text content.
  • Design mobile-first with existing sm, md, lg, xl, and 2xl breakpoints. Avoid page-local breakpoints unless reusable; let shared components own their responsive behavior when appropriate.
  • Keep desktop button labels short (maximum three words) and non-wrapping. Provide tactile feedback with established utilities such as active:scale-95 or active:translate-y-px; never create duplicate CTAs for the same intent.

5. Motion and Performance

  • Animate transform and opacity; do not continuously animate top, left, width, or height. Respect prefers-reduced-motion and clean up GSAP/Framer Motion subscriptions, timelines, and listeners.
  • Avoid unnecessary client components, waterfalls, duplicate fetches, large client dependencies, layout shift, and eager non-critical media. Size, lazy-load, and reserve dimensions for visual assets.
  • Measure before optimizing. Use project tooling to check bundle impact, web vital regressions, rendering cost, and slow interactions where applicable.

6. Verification and Completion Gate

  • Test render and interaction behavior for permission, loading, empty, error, success, keyboard/focus, form, mutation, and recovery paths that apply.
  • Test API adapters and state transitions; include responsive visual/manual verification for changed layouts. Do not treat mocked happy paths as proof of backend compatibility.
  • Run the project formatter, type-check, lint, tests, and production build in Docker where available. Confirm no avoidable JSX/style duplication, arbitrary values, secret exposure, or unrelated business change was introduced.

Guard Rails

  • Do not hard-code endpoint, credential, token, color, or reusable copy; use ENV, tokens, and project i18n/configuration conventions.
  • Do not bypass accessibility, permission states, error recovery, or responsive verification to make a happy-path screen look complete.
  • Use the language configured by the project or requested by the user.

Download now (ZIP)

Does 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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.