vercel-react-best-practices

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

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/kaitoartz/dotfiles --skill vercel-react-best-practices-kaitoartz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/kaitoartz/dotfiles/tree/main/dot_gemini/config/skills/vercel-react-best-practices%20-%20Copy
Command: npx skills add https://github.com/kaitoartz/dotfiles --skill vercel-react-best-practices-kaitoartz

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, bloated bundles, and server-side waterfalls that are hard to spot during development. This Skill gives AI agents and developers a prioritized, rule-based checklist from Vercel Engineering to catch and fix these performance issues during code generation, review, and refactoring. ## Core Features & Use Cases - 57 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 performance, and advanced patterns, each tagged by impact level from CRITICAL to LOW. - Incorrect vs. Correct Code Examples: Every rule file shows a concrete anti-pattern alongside the optimized implementation, with impact metrics such as 2-10x improvements from parallelizing fetches or 200-800ms savings from avoiding barrel imports. - Use Case: When asked to review a Next.js page that fetches user, posts, and comments sequentially, the Skill directs the agent to apply the async-parallel rule using Promise.all(), restructure components for parallel server-side fetching, and add strategic Suspense boundaries. ## Quick Start Ask the agent to review your React or Next.js component for performance issues using the Vercel best practices guidelines.

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 promises immediately without awaiting them, then await Promise.all() at the end. For partial dependencies, use the better-all library or chain promises so dependent fetches start as early as possible, yielding 2-10x improvements.

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

Import directly from source files instead of barrel entry points, such as importing from lucide-react/dist/esm/icons/check rather than lucide-react. In Next.js 13.5+, enable optimizePackageImports in next.config.js to transform barrel imports automatically at build time.

When should I use React.cache() versus an LRU cache in Next.js?▼

React.cache() deduplicates async work like database queries within a single request only. For data shared across sequential requests, use an LRU cache with a TTL, which works especially well with Vercel Fluid Compute where function instances persist.

Does this guide work with the React Compiler enabled?▼

Yes, but some manual optimizations become unnecessary. For example, the React Compiler automatically hoists static JSX elements and optimizes re-renders, so rules like manual JSX hoisting are only needed in projects without the compiler.

Why does my React component render 0 when using && for conditional rendering?▼

The && operator renders falsy values like 0 or NaN as text. Use an explicit ternary such as count > 0 ? <Badge /> : null so nothing renders when the condition fails.

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.