vercel-react-best-practices

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

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

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 data-fetching waterfalls, bloated bundles, unnecessary re-renders, and serialization overhead. 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: Parallelize async operations with Promise.all(), better-all, strategic Suspense boundaries, and deferred awaits for 2-10x improvements. - Bundle Size Optimization: Avoid barrel file imports, use dynamic imports for heavy components, and defer non-critical third-party libraries to improve TTI and LCP. - Server & Client Performance: Covers React.cache() deduplication, LRU caching, RSC serialization minimization, SWR usage, re-render optimization, and JavaScript micro-optimizations. - Use Case: When refactoring a Next.js page that fetches user data sequentially, the Skill guides restructuring with component composition and parallel fetching to eliminate server-side waterfalls. ## Quick Start Review my Next.js page component using the vercel-react-best-practices skill and fix any data-fetching waterfalls or bundle size issues.

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 data fetching waterfalls in Next.js?▼

Start independent async operations immediately and await them together with Promise.all(), or use better-all for partial dependencies. Restructure Server Components with composition so sibling components fetch in parallel instead of sequentially.

How to reduce bundle size in React and Next.js apps?▼

Import directly from source files instead of barrel files like lucide-react or @mui/material entry points, use next/dynamic for heavy components, and defer analytics or logging libraries until after hydration. Next.js 13.5+ offers optimizePackageImports for automatic transformation.

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

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

Does this skill work with React Server Components?▼

Yes, it includes dedicated rules for RSC boundaries: minimize serialization by passing only used fields to client components, avoid duplicate serialization from transformations like .toSorted(), and parallelize fetching through component composition.

Why do barrel file imports slow down my Next.js app?▼

Barrel files re-export thousands of modules, costing 200-800ms per import on cold starts and slowing builds since tree-shaking cannot optimize external packages. Direct imports load only the modules you use, improving dev boot by 15-70%.

When should I not use Suspense boundaries for data fetching?▼

Avoid Suspense when data drives layout decisions, for SEO-critical above-the-fold content, for small fast queries where overhead is not worth it, or when you want to prevent layout shift between loading and loaded states.