vercel-react-best-practices

Diagnose and fix React and Next.js performance problems using 45 prioritized optimization rules.

Updated Aug 2, 2026
One-click install
npx skills add https://github.com/leonardoacosta/skills --skill vercel-react-best-practices-leonardoacosta
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/leonardoacosta/skills/tree/main/web-frontend-kit/skills/vercel-react-best-practices
Command: npx skills add https://github.com/leonardoacosta/skills --skill vercel-react-best-practices-leonardoacosta

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React and Next.js applications often suffer from slow first paint, laggy interactions, excessive re-renders, and bloated JavaScript bundles, and developers struggle to identify which optimization to apply. This Skill provides a structured triage workflow that maps symptoms to specific, impact-ranked performance rules from Vercel Engineering. ## Core Features & Use Cases - Performance Triage Tree: Maps symptoms (slow first paint, laggy clicks, heavy DOM updates) to the exact rule category to read, so you never optimize speculatively. - 45 Impact-Ranked Rules: Covers waterfall elimination, bundle size, server-side performance, client data fetching, re-render optimization, rendering performance, and advanced patterns, each with incorrect vs. correct code examples. - Top 5 Always-Apply Rules: Inline guidance for Promise.all parallelization, direct imports over barrel files, derived state without effects, React.cache() deduplication, and Suspense streaming. - Use Case: When a Next.js page loads slowly, follow the triage tree to identify a server-side waterfall, then load the async rules to restructure fetches with Promise.all and Suspense boundaries. ## Quick Start Ask the agent to review your React or Next.js page for performance problems and apply the matching optimization rules.

Frequently Asked Questions about vercel-react-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix a slow Next.js page load?

First profile with React DevTools or Chrome DevTools to identify the bottleneck. For slow first paint, check for large bundles (barrel file imports) or sequential server fetches, then apply direct imports, dynamic imports, Promise.all parallelization, or Suspense boundaries.

How to eliminate async waterfalls in React Server Components?

Start independent operations immediately without awaiting, then combine with Promise.all, or restructure components so sibling Server Components fetch in parallel. For partial dependencies, use the better-all library or chain promises before awaiting.

When should I use React.memo and useMemo?

Only memo components that receive complex object props, re-render frequently from parent state, and cost over 5ms in the profiler. Avoid useMemo for simple primitive expressions, since memoization itself adds comparison and memory overhead.

Why do barrel file imports slow down Next.js builds?

Barrel files re-export thousands of modules, forcing the bundler to load the entire module graph even when you import one item. Libraries like lucide-react or @mui/material can add 200-800ms per cold start; import directly from source files or use optimizePackageImports.

Does React.cache() replace fetch memoization in Next.js?

No. Next.js automatically deduplicates fetch calls within a request, but React.cache() is still needed for database queries, authentication checks, heavy computations, and file system operations that run multiple times in one render tree.

When should I not use Suspense boundaries for streaming?

Avoid Suspense for critical data needed for layout decisions, SEO-critical above-the-fold content, and small fast queries where the overhead is not worth it. The trade-off is faster initial paint versus potential layout shift.