vercel-react-best-practices

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

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/sharad07072007/paras --skill vercel-react-best-practices-sharad07072007
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/sharad07072007/paras/tree/main/.agents/plugins/vercel/skills/react-best-practices/upstream
Command: npx skills add https://github.com/sharad07072007/paras --skill vercel-react-best-practices-sharad07072007

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. This Skill provides a structured, prioritized rule set from Vercel Engineering so AI agents and developers consistently apply proven performance patterns when writing, reviewing, or refactoring code. ## Core Features & Use Cases - 64 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 micro-optimizations, and advanced patterns, each tagged by impact level from CRITICAL to LOW. - Incorrect vs. Correct Code Examples: Every rule includes concrete TypeScript/TSX examples showing the wrong pattern and the optimized fix, with impact metrics like 2-10x improvements or 200-800ms import cost reductions. - Modular Rule Files: Individual rule files under rules/ can be read on demand, while AGENTS.md provides the full compiled guide. - Use Case: When refactoring a Next.js page that fetches data sequentially, apply the async-parallel and server-parallel-fetching rules to convert sequential awaits into Promise.all() calls and component composition, cutting response latency. ## Quick Start Ask the agent to review your React or Next.js component for performance issues using the Vercel 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 promises immediately and await them later, or use Promise.all() for operations with no interdependencies. For partial dependency chains, the better-all library starts each task at the earliest possible moment, 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, for example importing from lucide-react/dist/esm/icons/check rather than the package root. In Next.js 13.5+, the optimizePackageImports config option transforms barrel imports automatically at build time.

Does React.cache() work across multiple requests?

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

When should I use Suspense boundaries in React Server Components?

Use Suspense when non-critical data would otherwise block the entire layout from rendering, letting the wrapper UI paint immediately while data streams in. Avoid it for SEO-critical above-the-fold content or when layout shift would harm the user experience.

Why does my React component re-render unnecessarily?

Common causes include defining components inside components, inline object dependencies in effects, and subscribing to state only used in callbacks. The rules recommend functional setState updates, narrow effect dependencies, derived state during render, and useRef for transient values.

What are the limitations of these React performance rules?

Some rules involve trade-offs, such as Suspense boundaries causing layout shift, or module-level caching consuming memory for large assets. Rules are prioritized by impact, so low-impact JavaScript micro-optimizations should only be applied in hot paths after critical issues are fixed.