/fe:reusablesfrom Frontend Skills
Designing one reusable React component, hook or helper — agnostic and pure where shared, owning its own animation, focus and lifecycle, the native element's props passed through with `ref`, controlled or uncontrolled inputs, variant, size and radius from the design scales, copy through a `labels` prop, `data-state` and `data-slot` hooks, compound parts as named exports, empty regions rendering nothing, a skeleton on the same shell, and promotion on the second consumer. Use when building or refactoring a shared component, hook or helper.
Ships in Frontend Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A reusable component, hook or helper drops in anywhere and is controlled entirely from outside. It never depends on a particular parent, data source, route or hidden global, never hard-codes a value a caller might reasonably change, and owns the behaviour its callers shouldn't have to wire up. Where it lives and which tier it belongs to are design-system's and code-structure's; React practice inside it is react's.
Before applying this skill, read the project's root AGENTS.md, the AGENTS.md closest to the files in question, and any doc they link for this skill's topic. Names, values and choices — budgets, tiers, tokens, voice, paths — come from those files, never from this skill.
src/ui/; when a second app needs it, to the shared package (design-system). Each move strips local data and hooks and turns what differs into props. Never paste a second variant.open and listens to onOpenChange, nothing more. Overlays build on the native <dialog> (showModal()) and the popover attribute, which put them in the top layer — no portal, no z-index fight — and handle Escape and, for a modal, the inert page (semantic-html, accessibility). A dialog stays mounted through its exit transition (@starting-style and transition-behavior: allow-discrete animate the native one). Behaviour two components share becomes a hook (useMountTransition, useDismiss).ComponentPropsWithRef<"button">) and spread onto it, so every attribute, handler, aria-* and ref reaches the element; className is merged last with cn(), so the caller's classes win (tailwind). A component that also needs the element itself (to move focus) merges its own ref with the caller's in a ref callback.asChild (or a render prop): the component's styling and behaviour land on the child the caller passes — a <Link> — instead of rendering a second element. Never a button wrapping a link.variant, size, radius, tone, using the scale's words — as plain class maps applied with cn(). A difference the system already names is a prop value, never a second component (design-system).value with onChange when the caller owns the state; defaultValue with a name when a form Action reads it from FormData, which React resets after the action succeeds (react). One hook manages both, so neither path is second-class.labels object where there are several (labels={{ close, next, previous }}) — so the component works in any product and language. The app defines its common labels once and passes them.useId), limits and links come from props or the project's constants, never literals inside the component.data-state="open", data-disabled, data-slot="header", so a caller can style them without a new prop.<CardSkeleton> renders the card's own frame at the same size with placeholders inside, so loading never shifts the layout (design-system).semantic-html, accessibility).Accordion, AccordionItem, AccordionTrigger), never static properties (Accordion.Item): a Server Component can't reach a property of a client module, and statics defeat tree-shaking through barrels. A part reads its parent through a context whose value is a small interface — state, actions, and meta such as ids.children over render props, unless the caller genuinely needs values from inside.<Select<TItem>> with getLabel and getValue), so it takes the caller's records without a cast.<Accordion items={…} />) and the parts for everything else.data-* handler for a list of items, not a closure per item (react).A component in a shared package, used by more than one app:
onX handlers — never whole domain records or raw enums it would have to interpret.storybook).Components inside one app may use that app's hooks and data; only the shared layer must be pure.
"use client" is the first line of a component that needs it, before a short JSDoc @description that tells it apart from its siblings ("Badge is static; Tag can be removed").<name>-types.ts, <name>-defaults.ts and <name>-shared.tsx, with one file per version, so they can't drift.useSyncExternalStore with a server snapshot, never an effect that sets state (react). It returns a named object once it has more than two values; a pair matching React's own ([value, setValue]) is fine.pending, error, and reset where there's a result to clear.lib/utils file and is reused, never rewritten inline.naming: use* hooks, on* callback props, booleans that read as assertions.ref or className fail to reach the element?Tiers, tokens and drift design-system · where files live code-structure · cn() and tokens tailwind · React practice react · markup semantic-html · keyboard, focus and names accessibility · stories storybook · names naming · types typescript · the audits frontend-audit, storybook-audit.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub timonwa/engineering-skills --plugin fe20 skills in this plugin
/accessibilityBuilding UI that meets WCAG 2.2 AA beyond the markup — text alternatives, contrast checked on the tokens in both themes, reflow and zoom, keyboard and focus (order, visibility, dialogs, skip link, not obscured), target size, pointer and motion, labels, errors people see, accessible sign-in, ARIA states and live regions, and the gates that verify it: lint, Storybook axe at error, keyboard stories and screen-reader passes. Use when building or reviewing any interactive UI, a form, a dialog or a colour token./accessibility-auditManually invoked. Red-team accessibility audit of an app or a diff against WCAG 2.2 AA, organised by POUR with each check citing its success criterion — structure and landmarks, contrast on the tokens in both themes, reflow and zoom, keyboard, focus and dialogs, pointer and target size, forms and errors that are seen, status messages, and the lint, Storybook and end-to-end gates. Verifies each finding and writes a prioritized report./content-auditManually invoked. Copy audit of an app, its emails or a diff, against the project's own voice, word list and banned words and the plain-language standards (GOV.UK, NN/g, WCAG) — point-first writing, marketing claims and calls to action, buttons and links, form labels and errors, empty, success and loading states, sentence case and mechanics, accessible words and alt text, translation-safe strings, and each transactional email's sender, subject, preheader and body. Verifies each finding and writes a prioritized report.Other plugins' skills for the same job