vercel-react-best-practices

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

Updated Aug 3, 2026
One-click install
npx skills add https://github.com/Mark-Atef/Nebu --skill vercel-react-best-practices-mark-atef
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/Mark-Atef/Nebu/tree/main/.agents/skills/vercel-react-best-practices
Command: npx skills add https://github.com/Mark-Atef/Nebu --skill vercel-react-best-practices-mark-atef

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 async waterfalls, bloated bundles, unnecessary re-renders, and inefficient data fetching. 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 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 improvement" or "200-800ms import cost". - Individual Rule Files for On-Demand Lookup: Rules live in rules/ as standalone Markdown files (e.g., async-parallel.md, bundle-barrel-imports.md) so only relevant guidance is loaded, with a compiled AGENTS.md for the full document. - Use Case: When refactoring a Next.js page that sequentially awaits fetchUser(), fetchPosts(), and fetchComments(), apply the async-parallel rule to rewrite it with Promise.all() and cut 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 React 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 eliminate async waterfalls in Next.js API routes?

Start independent operations immediately without awaiting them, then await the promises later. For example, call auth() and fetchConfig() first, then use Promise.all() to await results together, reducing sequential round trips.

How to reduce bundle size from barrel file imports in React?

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, or import directly from subpaths like @mui/material/Button.

When should I use Promise.all versus better-all for parallel fetching?

Use Promise.all() when async operations are fully independent. Use better-all when operations have partial dependencies, since it automatically starts each task at the earliest possible moment based on its dependency chain.

Does this skill work with React Server Components and Server Actions?

Yes, it includes server-side rules covering Server Action authentication, React.cache() per-request deduplication, avoiding shared module state in RSC, minimizing serialization at RSC boundaries, and using after() for non-blocking operations.

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 React components re-render unnecessarily and how do I fix it?

Common causes include defining components inside components, unstable callback references, and broad effect dependencies. Fixes include extracting memoized components, using functional setState, narrowing effect dependencies, and using useEffectEvent for stable callbacks.