/react-best-practices:react-best-practicesfrom react-best-practices
Applies Vercel's React and Next.js performance rules ranked by impact. Use when writing or refactoring React components, reviewing code for performance, fixing data-fetching waterfalls, shrinking bundles, hunting re-renders, choosing Next.js caching patterns, or fixing hydration mismatches.
Ships in react-best-practices. 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.
Vercel's React and Next.js performance rules, one file per rule in rules/, ranked by impact.
local-notes.md holds local overrides that win over any rule they contradict.
Check package.json and next.config.* for:
react and next versions in usereactCompiler in next.config.*, or babel-plugin-react-compiler in a build configcacheComponents: true in next.config.*When React Compiler is on, or the project uses Next.js, read local-notes.md before
step 2 - it says which memoisation rules the compiler makes redundant and how Next.js 16 caching
changes the server- and async- rules.
Done when you can state the React version, whether Next.js is present, and whether React Compiler and Cache Components are each on or off.
Pick the categories the task touches from the index below. For a review or audit, take all eight in
priority order. Open rules/<rule-id>.md for each rule you apply or check - the index line is a
summary, and the file carries the incorrect and correct code and the conditions for applying it.
Done when every rule file in the chosen categories has been read.
When writing code, apply the rules as you go. When reviewing, report each finding as: rule id, file and line, impact level, and the fix. Work from CRITICAL down, so waterfalls and bundle size come before re-render and micro-optimisations.
Done when every finding names a rule id, and every chosen category has been checked against the code.
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Eliminating waterfalls | CRITICAL | async- |
| 2 | Bundle size | CRITICAL | bundle- |
| 3 | Server-side performance | HIGH | server- |
| 4 | Client-side data fetching | MEDIUM-HIGH | client- |
| 5 | Re-render optimisation | MEDIUM | rerender- |
| 6 | Rendering performance | MEDIUM | rendering- |
| 7 | JavaScript performance | LOW-MEDIUM | js- |
| 8 | Advanced patterns | LOW | advanced- |
async-cheap-condition-before-await - Check cheap sync conditions before awaiting flags or remote valuesasync-defer-await - Move await into branches where actually usedasync-parallel - Use Promise.all() for independent operationsasync-dependencies - Use better-all for partial dependenciesasync-api-routes - Start promises early, await late in API routesasync-suspense-boundaries - Use Suspense to stream contentbundle-barrel-imports - Import directly, avoid barrel filesbundle-analyzable-paths - Prefer statically analysable import and file-system pathsbundle-dynamic-imports - Use next/dynamic for heavy componentsbundle-defer-third-party - Load analytics and logging after hydrationbundle-conditional - Load modules only when the feature is activatedbundle-preload - Preload on hover or focus for perceived speedserver-auth-actions - Authenticate server actions like API routesserver-cache-react - Use React.cache() for per-request deduplicationserver-cache-lru - Use an LRU cache for cross-request cachingserver-dedup-props - Avoid duplicate serialisation in RSC propsserver-hoist-static-io - Hoist static I/O (fonts, logos) to module levelserver-no-shared-module-state - Avoid module-level mutable request state in RSC/SSRserver-serialization - Minimise data passed to client componentsserver-parallel-fetching - Restructure components to parallelise fetchesserver-parallel-nested-fetching - Chain nested fetches per item in Promise.allserver-after-nonblocking - Use after() for non-blocking operationsclient-swr-dedup - Use SWR for automatic request deduplicationclient-event-listeners - Deduplicate global event listenersclient-passive-event-listeners - Use passive listeners for scrollclient-localstorage-schema - Version and minimise localStorage datarerender-defer-reads - Skip subscribing to state used only in callbacksrerender-memo - Extract expensive work into memoised componentsrerender-memo-with-default-value - Hoist default non-primitive propsrerender-dependencies - Use primitive dependencies in effectsrerender-derived-state - Subscribe to derived booleans, not raw valuesrerender-derived-state-no-effect - Derive state during render, not in effectsrerender-functional-setstate - Use functional setState for stable callbacksrerender-lazy-state-init - Pass a function to useState for expensive valuesrerender-simple-expression-in-memo - Leave simple primitive expressions out of useMemorerender-split-combined-hooks - Split hooks with independent dependenciesrerender-move-effect-to-event - Put interaction logic in event handlersrerender-transitions - Use startTransition for non-urgent updatesrerender-use-deferred-value - Defer expensive renders to keep input responsivererender-use-ref-transient-values - Use refs for transient, frequently changing valuesrerender-no-inline-components - Define components at module level, not inside other componentsrendering-animate-svg-wrapper - Animate a div wrapper, not the SVG elementrendering-content-visibility - Use content-visibility for long listsrendering-hoist-jsx - Extract static JSX outside componentsrendering-svg-precision - Reduce SVG coordinate precisionrendering-hydration-no-flicker - Use an inline script for client-only datarendering-hydration-suppress-warning - Suppress expected mismatchesrendering-activity - Use the Activity component for show/hiderendering-conditional-render - Use a ternary, not &&, for conditionalsrendering-usetransition-loading - Prefer useTransition for loading staterendering-resource-hints - Use React DOM resource hints for preloadingrendering-script-defer-async - Use defer or async on script tagsjs-batch-dom-css - Group CSS changes via classes or cssTextjs-index-maps - Build a Map for repeated lookupsjs-cache-property-access - Cache object properties in loopsjs-cache-function-results - Cache function results in a module-level Mapjs-cache-storage - Cache localStorage/sessionStorage readsjs-combine-iterations - Combine multiple filter/map passes into one loopjs-length-check-first - Check array length before an expensive comparisonjs-early-exit - Return early from functionsjs-hoist-regexp - Hoist RegExp creation outside loopsjs-min-max-loop - Use a loop for min/max instead of sortjs-set-map-lookups - Use Set/Map for O(1) lookupsjs-tosorted-immutable - Use toSorted() for immutabilityjs-flatmap-filter - Use flatMap to map and filter in one passjs-request-idle-callback - Defer non-critical work to browser idle timeadvanced-effect-event-deps - Keep useEffectEvent results out of effect depsadvanced-event-handler-refs - Store event handlers in refsadvanced-init-once - Initialise the app once per app loadadvanced-use-latest - useLatest for stable callback refsLICENSE.txt (opens in a new tab)local-notes.md (opens in a new tab)rules/_sections.md (opens in a new tab)rules/_template.md (opens in a new tab)rules/advanced-effect-event-deps.md (opens in a new tab)rules/advanced-event-handler-refs.md (opens in a new tab)rules/advanced-init-once.md (opens in a new tab)rules/advanced-use-latest.md (opens in a new tab)rules/async-api-routes.md (opens in a new tab)rules/async-cheap-condition-before-await.md (opens in a new tab)rules/async-defer-await.md (opens in a new tab)rules/async-dependencies.md (opens in a new tab)rules/async-parallel.md (opens in a new tab)rules/async-suspense-boundaries.md (opens in a new tab)rules/bundle-analyzable-paths.md (opens in a new tab)rules/bundle-barrel-imports.md (opens in a new tab)rules/bundle-conditional.md (opens in a new tab)rules/bundle-defer-third-party.md (opens in a new tab)rules/bundle-dynamic-imports.md (opens in a new tab)rules/bundle-preload.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub henkisdabro/wookstar-claude-plugins --plugin react-best-practicesOther plugins' skills for the same job