vercel-react-best-practices

Applies Vercel performance optimization rules when writing or refactoring React and Next.js code.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/alecanche04-cyber/examenprograma --skill vercel-react-best-practices-alecanche04-cyber
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/alecanche04-cyber/examenprograma/tree/main/EXAMEN_PROGRA_2-master/.agents/skills/vercel-react-best-practices
Command: npx skills add https://github.com/alecanche04-cyber/examenprograma --skill vercel-react-best-practices-alecanche04-cyber

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? React and Next.js codebases often suffer from performance issues like async waterfalls, bloated bundles, unnecessary re-renders, and inefficient data fetching. This Skill provides 64 prioritized, actionable rules from Vercel Engineering so AI agents and developers consistently apply proven optimization patterns when writing, reviewing, or refactoring code. ## Core Features & Use Cases - Waterfall Elimination: Rules for parallelizing async operations with Promise.all(), dependency-based parallelization, and strategic Suspense boundaries. - Bundle Size Optimization: Guidance on avoiding barrel file imports, dynamic imports for heavy components, and deferring non-critical third-party libraries. - Server & Client Performance: Covers React.cache() deduplication, LRU caching, RSC serialization minimization, SWR usage, and re-render optimization patterns. - Use Case: When refactoring a Next.js page that fetches data sequentially, apply the async rules to parallelize requests and add Suspense boundaries, cutting load time from multiple round trips to one. ## Quick Start Ask the AI to review your React component or Next.js page against the Vercel React best practices and suggest performance improvements.

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 eliminate async waterfalls in Next.js API routes?

Start independent operations immediately without awaiting them, then use Promise.all() to await results together. For partial dependencies, use the better-all library or chain promises so dependent fetches start as early as possible.

How to reduce bundle size from barrel file imports in React?

Import directly from source files instead of barrel entry points, such as importing from 'lucide-react/dist/esm/icons/check' rather than 'lucide-react'. In Next.js 13.5+, use the optimizePackageImports config option to transform barrel imports automatically at build time.

When should I use React.cache() versus an LRU cache?

React.cache() deduplicates calls within a single request only, ideal for authentication and database queries in one render pass. Use an LRU cache like lru-cache for data shared across sequential requests, especially with Vercel Fluid Compute where instances persist.

Does this guide work with React Server Components?

Yes, several rules specifically address RSC patterns, including minimizing serialization at server-client boundaries, avoiding duplicate serialization in props, and parallel data fetching through component composition. These apply to Next.js App Router projects.

Why does my React component re-render too often?

Common causes include defining components inside components, missing memoization of expensive computations, and broad effect dependencies. The re-render rules recommend extracting memoized components, using functional setState, narrowing effect dependencies, and using useDeferredValue for expensive derived renders.

When should I not use Suspense boundaries for data fetching?

Avoid Suspense when data is critical for layout decisions, when content is SEO-critical above the fold, or when queries are small and fast. The trade-off is faster initial paint versus potential layout shift when content loads.