vercel-react-best-practices

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

Updated Jul 26, 2026
One-click install
npx skills add https://github.com/Dhruv-Ghanchi/Portfolio-Webiste --skill vercel-react-best-practices-dhruv-ghanchi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/Dhruv-Ghanchi/Portfolio-Webiste/tree/main/.agents/skills/vercel-react-best-practices
Command: npx skills add https://github.com/Dhruv-Ghanchi/Portfolio-Webiste --skill vercel-react-best-practices-dhruv-ghanchi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? React and Next.js codebases often suffer from slow load times, unnecessary re-renders, and bloated bundles because developers miss subtle performance pitfalls. This Skill provides a structured, prioritized rule set from Vercel Engineering so AI agents and developers consistently apply proven optimization patterns during code generation, review, and refactoring. ## Core Features & Use Cases - 70 Prioritized Rules Across 8 Categories: Covers eliminating async waterfalls, bundle size optimization, server-side performance, client-side data fetching, re-render optimization, rendering performance, JavaScript micro-optimizations, and advanced patterns, each tagged by impact level from CRITICAL to LOW. - Incorrect vs. Correct Code Examples: Every rule includes concrete before/after TypeScript and TSX examples with explanations and impact metrics, making it directly actionable for automated refactoring. - Use Case: When reviewing a Next.js page that fetches user, posts, and comments sequentially, apply the async-parallel rule to rewrite the fetches with Promise.all(), cutting three network round trips down to one. ## Quick Start Ask the AI to review your React component or Next.js page for performance issues using the Vercel best practices rules and suggest concrete fixes.

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 optimize React and Next.js performance?

Apply the prioritized rules in this guide, starting with CRITICAL categories: eliminate async waterfalls with Promise.all() and Suspense boundaries, then reduce bundle size with dynamic imports and direct imports instead of barrel files. Each rule includes incorrect and correct code examples.

How to prevent waterfalls in Next.js API routes?

Start independent async operations immediately without awaiting them, then await the promises later. For example, call auth() and fetchConfig() before awaiting either, then use Promise.all() for remaining dependent fetches, yielding 2-10x improvement.

Does this guide work with Next.js App Router and Server Components?

Yes, the rules specifically target Next.js App Router patterns including React Server Components, Server Actions, Suspense streaming, and RSC serialization. It covers server-specific concerns like React.cache() deduplication and avoiding shared module state across requests.

When should I avoid barrel file imports in React?

Avoid barrel imports from libraries like lucide-react or @mui/material, which can re-export thousands of modules costing 200-800ms per cold start. In Next.js 13.5+, use optimizePackageImports; otherwise import directly from subpaths.

What are the limitations of these performance rules?

Rules are prioritized by impact, so LOW-impact patterns like advanced hook techniques offer only incremental gains. Some patterns involve trade-offs, such as Suspense boundaries improving initial paint at the cost of potential layout shift.