/react:react-best-practicesfrom react
Core React correctness and design rules, ordered by importance. Use when writing, refactoring or reviewing React components, hooks, state or effects (.jsx/.tsx), even when the user does not say "best practices". For Next.js/bundle performance tuning use vercel-react-best-practices; for React Native use react-native-best-practices.
Ships in react. 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.
None: SKILL.md is the whole skill.
Rules ranked by impact: bugs first, then maintainability, then performance. When writing code, apply them top-down. When reviewing, report violations with the rule number and stop nitpicking below rule 12 unless asked.
useX hooks. Never inside conditions, loops, callbacks or after an early
return.push, splice, sort or assign into state.
Make new objects/arrays ([...a, x], map, filter, {...o, k: v}).setState or random values in the render body.useEffect is only for syncing
with external systems (network, DOM, subscriptions, timers).react-hooks/exhaustive-deps; restructure instead (move the function
inside the effect, use functional updates, or hoist constants).AbortController or an ignore flag) to avoid leaks and
races.Math.random().setX(prev => ...).dangerouslySetInnerHTML with unsanitized input.{count && <X/>} renders 0. Use count > 0 &&
or a ternary.useEffect + useState. Context for rarely changing global values.children and composition
over boolean-prop explosion.useX. They share
logic, not state.button, label, nav),
keyboard support, ARIA only when HTML can't express it.memo/useMemo/useCallback only for measured problems or to keep
references stable for memoized children / effect deps.value objects, and split
Contexts by update frequency.eslint-plugin-react-hooks on, <StrictMode> in dev. Its double-render and
double-effect behavior is a feature: fix the code, don't remove StrictMode.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub gvannest/gautier-skills --plugin react