vercel-react-best-practices

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

Updated Aug 26, 2026
One-click install
npx skills add https://github.com/MohamadJoumaa/Direct --skill vercel-react-best-practices-mohamadjoumaa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/MohamadJoumaa/Direct/tree/main/.cursor/skills/vercel-react-best-practices
Command: npx skills add https://github.com/MohamadJoumaa/Direct --skill vercel-react-best-practices-mohamadjoumaa

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 data-fetching waterfalls 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 write, review, and refactor performant React 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 micro-optimizations, and advanced patterns, each ranked from CRITICAL to LOW impact. - 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 fetches user, posts, and comments sequentially, the Skill directs you to use Promise.all() for parallel fetching, wrap slow sections in Suspense boundaries, and avoid barrel file imports to cut bundle size. ## Quick Start Ask the AI 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?

Use Promise.all() to run independent async operations concurrently instead of awaiting them sequentially. For partial dependencies, start promises early and await late, or use the better-all library to maximize parallelism automatically.

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

Avoid barrel file imports from libraries like lucide-react or @mui/material, use next/dynamic to lazy-load heavy components, and defer non-critical third-party scripts like analytics until after hydration. Next.js 13.5+ can optimize package imports automatically.

Does this guide cover React Server Components and Server Actions?

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

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 my React components re-render unnecessarily?

Common causes include defining components inside other components, missing memoization of expensive work, broad effect dependencies, and subscribing to raw state instead of derived values. The re-render optimization rules address each pattern with fixes.