majiayu000/react-best-practices
React and Next.js performance playbook distilled from Vercel Engineering guidance. Use when building, reviewing, or refactoring React/Next.js code for waterfalls, bundle size, rendering cost, and client/server data flow.
npx skills add https://github.com/majiayu000/spellbook --skill react-best-practices
Practical React and Next.js guidance for performance-sensitive product work.
This skill is a self-contained distillation of the Vercel React performance guidance so it can be installed and used directly inside Spellbook.
Use this skill when the user asks to:
Always check higher-priority categories first.
| Priority | Category | Focus |
|----------|----------|-------|
| 1 | Waterfalls | start async work early, await late, parallelize independent fetches |
| 2 | Bundle size | avoid barrel imports, defer heavy code, split by feature |
| 3 | Server-side performance | dedupe work, minimize serialization, prefer server execution |
| 4 | Client data fetching | dedupe requests, avoid redundant listeners and client churn |
| 5 | Rerenders | reduce subscriptions, stabilize dependencies, move expensive work |
| 6 | Rendering | avoid hydration flicker, reduce DOM/SVG cost, optimize long lists |
| 7 | JavaScript hot paths | cache repeated lookups, combine iterations, exit early |
| 8 | Advanced patterns | stable refs and callback patterns for edge cases |
setState when it removes unstable dependencies.startTransition for non-urgent UI updates.content-visibility for long lists when appropriate.&& branches when rendering conditions matter.Map or Set for repeated membership checks.filter / map passes when the path is performance-sensitive.When reviewing React or Next.js code, check for:
Map or Set would helpWhen using this skill, the output should:
react.devnextjs.orgswr.vercel.appTake majiayu000/react-best-practices from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.