/fe:reactfrom Frontend Skills
React 19 components, hooks and state — the Rules of React, hydration safety, deriving instead of syncing, effects only for external systems, `useEffectEvent`, the React Compiler instead of hand memoisation, forms with Actions, `useActionState`, `useFormStatus` and `useOptimistic`, `use`, ref as a prop, `<ViewTransition>`, drawer, dialog and tab state in the URL, one `data-*` handler for a list, `<Activity>`, error boundaries, and keys. Use when writing or reviewing React components, hooks or client state.
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.
Idiomatic React 19 (19.3 is current), with the React Compiler on. Components and hooks are pure functions of their props, state and context; state lives in one place; effects reach outside React and nothing else. Designing a component or hook for reuse is reusables'; the server and client boundary, data fetching and caching are nextjs'.
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.
<Profile />, never call Profile(); never pass a hook around as a value.use*, named by naming).eslint-plugin-react-hooks is on with its recommended preset, which includes the compiler's rules (purity, refs, set-state-in-effect, immutability). A violation makes the compiler skip that component, so the lint is how you know.typeof window branches or Date.now() in render; a value only the browser knows comes from useSyncExternalStore with a getServerSnapshot, and suppressHydrationWarning is only for a known, harmless difference (a timestamp, the theme script's attribute).key, not an effect, when a component should start fresh for a new id.useState for a value, useReducer for related transitions, useRef for a value that doesn't render, useId for ids, useSyncExternalStore to read an external store.useEffect synchronises with something outside React — a subscription, a browser API, a non-React widget, a timer — and always cleans up. Not for: transforming data for render (compute it), responding to a click (do it in the handler), fetching (nextjs).useEffectEvent for logic inside an effect that reads the latest props or state without re-running the effect (a notification that uses the current theme). It's called only from effects.setState straight in an effect body, which renders twice for nothing; derive the value instead.useLayoutEffect only to measure before paint (position a popover, keep a scroll); it blocks paint.{ passive: true }) for scroll and touch handlers that never call preventDefault.nextjs, or babel-plugin-react-compiler elsewhere). New code has no useMemo, useCallback or memo by reflex.incompatible-library lint marks a library the compiler can't memoise around (some form and table libraries); the component using it is skipped. "use no memo" opts one component out while a compiler problem is fixed — temporary, with a comment.action takes a function — a Server Action or a client function — and React calls it with the form's FormData. Fields are read by name, uncontrolled, and React resets them when the action completes — on an error result too, since actions answer rather than throw.useActionState calls the action with (previousState, formData) and gives its last result and its pending state. The result carries fieldErrors and values — the submitted fields — which go back into each input as its defaultValue, so a failed submit doesn't empty the form (the shape is nextjs's). requestFormReset resets a form on purpose outside a submit.useFormStatus reads the pending state from a child of the form — a submit button that disables itself.useOptimistic shows the expected result while the action runs, and falls back when it fails.useTransition for any other non-urgent update; useDeferredValue when an expensive render (a filtered list) should lag behind fast input.use(promise) reads a promise passed down from the server, inside <Suspense>; use(context) reads context, conditionally if needed.ref is a prop. No forwardRef in new code. A ref callback may return a cleanup, called when the element leaves.<Activity mode="hidden"> keeps a tab or a panel's state while it's out of view, and pre-renders the one likely next, instead of unmounting and remounting it. Hiding destroys its Effects, so every effect inside cleans up.<Context value> is the provider; .Provider is legacy. In 19.3 a <Context> also renders in Server Components.<ViewTransition> (stable in 19.3) animates an element entering, leaving or moving with the browser's View Transitions; addTransitionType names the kind of change, so a forward and a back navigation can animate differently. Motion follows prefers-reduced-motion (accessibility).<Fragment> (19.3) reaches its children as a group — to focus the first one or observe them — without a wrapper element.nextjs).State someone would want to share, refresh or go Back to lives in the search params:
?panel=edit, ?item=<id>). Opening pushes a history entry, so Back closes it; closing a panel the reader arrived on through a shared link replaces, so Back still leaves the page.window.history.pushState or replaceState, which Next.js syncs with useSearchParams, so nothing goes back to the server.<Suspense> (nextjs).data-*: each item carries data-item-id, and one handler reads event.currentTarget.dataset.itemId — not a new closure per item, and not a curried onSelect(id).event.currentTarget, the element the handler is on, not event.target, which may be a child.<Suspense> boundary has an error boundary around or above it. A rejected promise read by use() throws to the nearest one; with none, React removes the whole app's UI. In Next.js that's error.tsx for a segment and catchError for a smaller part, which lets redirect() and notFound() through — a generic boundary such as react-error-boundary would swallow them (nextjs). Outside Next, react-error-boundary or a small class component — the one place a class remains.onCaughtError and onUncaughtError; in Next.js, which owns the root, instrumentation-client.ts and the error.tsx boundaries (nextjs).key from the data — a real id, never the index when items can be added, removed or reordered.children and slot props, not a large options object. Small components, each one job; logic in hooks or lib, markup in .tsx (code-structure).content-visibility: auto lets the browser skip off-screen rows.key; clean up every effect; let the compiler memoise; use Actions with uncontrolled fields; keep panels and tabs in the URL; use one data-* handler per list; pair Suspense with an error boundary; key lists by id.setState in an effect body; hand-memoise by reflex; use forwardRef or class components (outside an error boundary); call a component as a function; mutate props or state; key a dynamic list by index; keep shareable UI state only in memory.Designing a reusable component or hook reusables · server and client boundary, data, caching, Server Actions and the compiler setting nextjs · form schemas and field errors schemas-and-contracts · markup semantic-html · keyboard and focus accessibility · types typescript · names naming · component tests testing · the audit frontend-audit.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
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./cookie-consentCookie and tracking consent for a web app — what needs consent (any storage or read on the device), equal-weight accept and reject on the first layer, granular categories off by default, nothing non-essential before consent, withdrawal as easy as giving it, a minimal record of each choice, re-asking on a revision, Global Privacy Control, Google Consent Mode in basic mode, accessibility, and the vanilla-cookieconsent v3 mechanics in a reference. Use when adding a banner, an analytics or marketing script, or a consent category./copywritingWriting and reviewing every piece of a product's copy — the website, help articles, the app and its admin panel — in the project's own voice, word list and banned words: voice and tone by moment and reader, writing for the web, marketing pages, buttons and links, forms and errors, empty, success and loading states, mechanics, accessible words, copy that survives translation, and a review process. Use when writing, reviewing or updating any user-facing text./design-systemGovernance of a product's shared UI — the tiers (foundations, assets, icons, base, components, blocks, layouts, pages), a base library installed as source with local edits tracked, consumer count deciding placement, one component configured by props over variant families, fixed size, radius and tone vocabularies, skeletons, status colours apart from accents, visual identity as tokens and assets, and adding, retiring and spotting drift. Use when adding or placing a component, token or variant, or when screens stop matching.