vercel-react-best-practices

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

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

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, impact-prioritized rule set from Vercel Engineering so AI agents and developers can consistently generate and refactor performant 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 performance, and advanced patterns. - Incorrect vs. Correct Code Examples: Each rule includes concrete TypeScript/TSX examples showing the wrong pattern and the optimized fix, with impact metrics like 2-10x improvements. - Use Case: When refactoring a Next.js page that sequentially awaits multiple fetches, apply the async rules to parallelize with Promise.all() and add Suspense boundaries so the layout renders immediately while data streams in. ## Quick Start Review my Next.js page component using the vercel-react-best-practices skill and fix any performance issues you find.

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 use Promise.all() to await results together. For partial dependencies, use the better-all library or chain promises so each task starts at the earliest possible moment.

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

Import directly from source files instead of barrel entry points that re-export thousands of modules. In Next.js 13.5+, use the optimizePackageImports config option to automatically transform barrel imports while preserving TypeScript types.

When should I use Suspense boundaries in React Server Components?▼

Use Suspense when only part of the page needs async data, so the layout renders immediately while data streams in. Avoid it for SEO-critical above-the-fold content, layout-determining data, or very fast queries where overhead is not worth it.

Does this skill work with React projects not using Next.js?▼

Yes, most rules apply to any React codebase, including re-render optimization, JavaScript performance, and client-side fetching patterns. Next.js-specific rules cover Server Actions, RSC serialization, and next/dynamic imports.

Why should Server Actions be authenticated like API routes?▼

Server Actions are exposed as public endpoints and can be invoked directly, bypassing middleware or layout guards. Always verify authentication and authorization inside each action, and validate inputs with a schema library like zod.

What are the limitations of using useMemo for performance optimization?▼

useMemo should not wrap simple expressions with primitive results, as the memoization overhead exceeds the computation cost. Reserve it for expensive derived renders, and prefer deriving state during rendering instead of using effects.