vercel-react-best-practices

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

Updated Apr 7, 2026
One-click install
npx skills add https://github.com/NT-boop-star/BRMV-tract --skill vercel-react-best-practices-nt-boop-star
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/NT-boop-star/BRMV-tract/tree/main/antigravity/skills/react-best-practices
Command: npx skills add https://github.com/NT-boop-star/BRMV-tract --skill vercel-react-best-practices-nt-boop-star

SYSTEM DOCUMENTATION & REQUIREMENTS

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, impact-prioritized rule set from Vercel Engineering so AI agents and developers consistently apply proven optimization patterns instead of guessing. ## Core Features & Use Cases - 69 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. - Incorrect vs. Correct Examples: Every rule includes concrete code comparisons with impact metrics (e.g., 2-10x improvement from parallelizing fetches, 200-800ms savings from avoiding barrel imports). - 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 execution, cutting three round trips 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 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 operations immediately without awaiting them, then await the promises later. Use Promise.all() for independent operations and the better-all library for operations with partial dependencies, achieving 2-10x improvement.

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 config; otherwise import directly from subpaths like '@mui/material/Button'.

Does React.cache() work across multiple requests?

No, React.cache() only deduplicates within a single request. For cross-request caching, use an LRU cache like the lru-cache package, which is especially effective with Vercel Fluid Compute where function instances are shared.

When should I not use Suspense boundaries for data fetching?

Avoid Suspense when data is critical for layout decisions, needed for SEO-critical above-the-fold content, when queries are small and fast, or when you want to prevent layout shift between loading and loaded states.

Why should Server Actions have authentication checks inside them?

Server Actions are exposed as public endpoints just like API routes and can be invoked directly. Middleware or layout guards are insufficient, so always verify authentication and authorization inside each Server Action.

What are the limitations of useMemo for performance optimization?

Do not wrap simple expressions with primitive result types in useMemo, as the memoization overhead exceeds the benefit. Reserve useMemo for expensive computations, and prefer deriving state during rendering instead of using effects.