vercel-react-best-practices

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

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/RavitejaKarra24/dotfiles --skill vercel-react-best-practices-ravitejakarra24
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/RavitejaKarra24/dotfiles/tree/main/agents/.agents/skills/vercel-react-best-practices
Command: npx skills add https://github.com/RavitejaKarra24/dotfiles --skill vercel-react-best-practices-ravitejakarra24

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, oversized bundles, and sequential data-fetching waterfalls. This Skill provides a structured, impact-prioritized rule set from Vercel Engineering so AI agents and developers consistently apply proven performance patterns instead of rediscovering them. ## 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 micro-optimizations, and advanced patterns. - Incorrect vs. Correct Code Examples: Every rule includes concrete TypeScript/TSX examples showing the anti-pattern and the optimized implementation, with impact metrics like "2-10x improvement" or "200-800ms import cost". - Use Case: When refactoring a Next.js page that fetches user, posts, and comments sequentially, the Skill directs you to wrap independent calls in Promise.all(), add Suspense boundaries for streaming, and avoid barrel imports from libraries like lucide-react. ## Quick Start Ask the agent to review your React component or Next.js page for performance issues using the Vercel React best practices rules.

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 instead of sequential awaits. For partial dependencies, start promises early and chain dependent fetches, or use the better-all library to maximize parallelism automatically.

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

Avoid barrel file imports from libraries like lucide-react or @mui/material, use next/dynamic for heavy components like Monaco, and defer analytics until after hydration. Next.js 13.5+ optimizePackageImports transforms barrel imports automatically.

Does this guide work with React Server Components?

Yes, it includes dedicated server-side rules covering RSC serialization minimization, React.cache() per-request deduplication, avoiding shared module state, 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, content is SEO-critical above the fold, queries are small and fast, or you want to prevent layout shift. The trade-off is faster initial paint versus potential content jumping.

Why do barrel file imports slow down React builds?

Barrel files re-export thousands of modules, costing 200-800ms per import and slowing dev boot by seconds. Tree-shaking fails when libraries are external, so direct imports or Next.js optimizePackageImports are required.