Vercel React Best Practices
Developmentvercel-react-best-practicesVercel React Best Practices is an Agent Skill for development published in the QuantumNous/new-api repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
React and Next.js performance optimization guidelines from Vercel Engineering. Use when writing, reviewing, or refactoring React/Next.js code involving components, Next.js pages, Server Components, Server Actions, data fetching, bundle size, rendering behavior, or performance improvements.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/QuantumNous/new-api/blob/HEAD/.agents/skills/vercel-react-best-practices/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/vercel-react-best-practices, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Vercel React Best Practices
Use this skill for React and Next.js performance work. The full Vercel guide is stored in references/full-guide.md; do not read the whole file by default.
Workflow
- Identify the relevant performance area from the task or code under review.
- Search
references/full-guide.mdfor the matching section or rule heading. - Read only the relevant section before changing or reviewing code.
- Prioritize higher-impact categories before lower-impact micro-optimizations.
Priority Order
- Eliminating waterfalls: sequential async work, API route chains, missing
Promise.all, Suspense boundaries. - Bundle size optimization: barrel imports, heavy client modules, dynamic imports, deferred third-party libraries.
- Server-side performance: Server Actions auth, RSC serialization, per-request deduplication, cross-request caching,
after(). - Client-side data fetching: SWR deduplication, global listeners, passive scroll listeners, localStorage schema.
- Re-render optimization: derived state, effect dependencies, memo boundaries, functional state updates, transitions, refs.
- Rendering performance: hydration mismatches, long lists, static JSX, SVG precision, resource hints, script loading.
- JavaScript performance: repeated lookups, array passes, storage reads, layout thrashing, sort/min-max choices.
- Advanced patterns: one-time initialization, stable callback refs, effect events.
Reference
- Full compiled guide:
references/full-guide.md - Original project: https://github.com/vercel-labs/agent-skills/tree/main/skills/react-best-practices