vercel-react-best-practices

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

Updated May 12, 2026
One-click install
npx skills add https://github.com/ahemdatef/Gradution-Project-iLMS-Software --skill vercel-react-best-practices-ahemdatef
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/ahemdatef/Gradution-Project-iLMS-Software/tree/main/frontend/.agents/skills/vercel-react-best-practices
Command: npx skills add https://github.com/ahemdatef/Gradution-Project-iLMS-Software --skill vercel-react-best-practices-ahemdatef

SYSTEM DOCUMENTATION & REQUIREMENTS

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 inefficient server-side serialization. This Skill provides 62 prioritized, actionable rules from Vercel Engineering so AI agents and developers consistently apply proven optimization patterns during code generation, review, and refactoring. ## Core Features & Use Cases - 62 Prioritized Rules Across 8 Categories: Covers eliminating waterfalls, bundle size optimization, server-side performance, client-side data fetching, re-render optimization, rendering performance, JavaScript performance, and advanced patterns, each tagged with an impact level from CRITICAL to LOW. - Incorrect vs. Correct Code Examples: Every rule includes concrete TypeScript/TSX examples showing the anti-pattern and the optimized implementation, plus impact metrics like 2-10x improvements from parallelization. - Use Case: When refactoring a Next.js page that sequentially awaits multiple fetches, apply the async-parallel and async-suspense-boundaries rules to parallelize requests with Promise.all() and stream content through Suspense boundaries for faster initial paint. ## Quick Start Ask the AI to review your React component or Next.js page against the Vercel performance rules and refactor any waterfalls, barrel imports, or unnecessary re-renders it finds.

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?

Use Promise.all() for independent async operations and start promises early before awaiting them in API routes. For partial dependencies, use the better-all library or chain promises so dependent fetches start as early as possible.

How to reduce bundle size in a React Next.js app?

Import directly from source files instead of barrel files like lucide-react or @mui/material entry points, which can load thousands of unused modules. Use next/dynamic for heavy components and defer analytics libraries until after hydration.

Does React.cache() work across multiple requests?

No, React.cache() only deduplicates calls within a single request. For cross-request caching, use an LRU cache like the lru-cache package, which is especially effective with Vercel Fluid Compute where instances are shared.

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, when queries are small and fast, or when you want to prevent layout shift between loading and loaded states.

Why do Server Actions need authentication checks inside them?

Server Actions are exposed as public endpoints just like API routes, so middleware or layout guards alone are insufficient. Always verify the session and authorization inside each action, and validate inputs with a schema like zod.

What causes unnecessary re-renders in React components?

Common causes include defining components inside other components, subscribing to state only used in callbacks, missing memoization for expensive work, and broad effect dependencies. The rerender rules cover functional setState, lazy initialization, and transitions.