vercel-react-best-practices

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

Updated Sep 2, 2026
One-click install
npx skills add https://github.com/ZubairImtiaz3/Safar-E-Iman-Portal --skill vercel-react-best-practices-zubairimtiaz3
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/ZubairImtiaz3/Safar-E-Iman-Portal/tree/main/.agents/skills/vercel-react-best-practices
Command: npx skills add https://github.com/ZubairImtiaz3/Safar-E-Iman-Portal --skill vercel-react-best-practices-zubairimtiaz3

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 server-side bottlenecks that are hard to spot during development. This Skill provides a structured, impact-prioritized rule set from Vercel Engineering so AI agents and developers can consistently generate and refactor performant code. ## Core Features & Use Cases - 70 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 rules to convert them into parallel Promise.all() calls and add Suspense boundaries so the layout renders immediately while data streams in. ## Quick Start Ask the AI to review your React component or Next.js page against the Vercel React best practices rules 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 data fetching waterfalls in Next.js?

Start independent async operations immediately and await them together with Promise.all, or use better-all for partial dependency chains. In components, use Suspense boundaries so the layout renders while data streams in instead of blocking the entire page.

How to reduce bundle size from barrel file imports?

Avoid importing from barrel files like lucide-react or @mui/material entry points, which can load thousands of modules. In Next.js 13.5+, use optimizePackageImports in next.config.js; otherwise import directly from subpaths like @mui/material/Button.

Does this skill work with React Server Components?

Yes, it includes server-side rules for RSC such as minimizing serialization at RSC boundaries, per-request deduplication with React.cache, avoiding shared module state for request data, and authenticating Server Actions like public API routes.

When should I not use Suspense boundaries for data fetching?

Avoid Suspense when data drives layout decisions, when content is SEO-critical above the fold, when queries are small and fast, or when you want to prevent layout shift. The trade-off is faster initial paint versus potential content jumping.

Why do my React components re-render unnecessarily?

Common causes include defining components inside components, unstable callback references, and broad effect dependencies. The rules recommend extracting memoized components, using functional setState, narrowing effect dependencies, and using useEffectEvent or refs for stable handlers.