vercel-react-best-practices

Applies Vercel's React and Next.js performance optimization rules to code generation and refactoring.

Updated Mar 17, 2026
One-click install
npx skills add https://github.com/AveryRen/WarpTalk-TestPayment --skill vercel-react-best-practices-averyren
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/AveryRen/WarpTalk-TestPayment/tree/main/agent/.agents/skills/vercel-react-best-practices
Command: npx skills add https://github.com/AveryRen/WarpTalk-TestPayment --skill vercel-react-best-practices-averyren

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 data-fetching waterfalls, bloated bundles, unnecessary re-renders, and inefficient server-side patterns. This Skill provides 62 prioritized, actionable rules from Vercel Engineering so AI agents and developers consistently write performant React code. ## Core Features & Use Cases - 62 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: Every rule includes concrete TypeScript/TSX examples showing the wrong pattern and the optimized fix, with impact metrics like "2-10x improvement" or "200-800ms import cost". - Use Case: When refactoring a Next.js page that sequentially awaits multiple fetches, apply the async-parallel and server-parallel-fetching rules to restructure with Promise.all() and component composition, cutting response latency dramatically. ## Quick Start Ask the AI to review your React component or Next.js page against the Vercel performance rules and refactor any violations it finds.

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 data fetching waterfalls in Next.js?

Start independent async operations immediately and await them together with Promise.all(), or use better-all for partial dependency chains. Restructure server components with composition so sibling components fetch in parallel instead of sequentially.

How to reduce React bundle size from barrel file imports?

Import directly from source files instead of barrel entry points, which can load thousands of unused modules costing 200-800ms. 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?

React.cache() deduplicates fetches within a single request, ideal for auth and database queries called multiple times per render. Use an LRU cache like lru-cache for data shared across sequential requests, especially with Vercel Fluid Compute.

Does this guide cover Next.js Server Actions security?

Yes, the server-auth-actions rule requires authenticating and authorizing inside every Server Action, since they are publicly exposed endpoints like API routes. It also recommends validating inputs with schemas such as zod before performing mutations.

Why does my React component re-render unnecessarily?

Common causes include defining components inside components, missing memoization of expensive work, broad effect dependencies, and subscribing to raw state instead of derived values. The re-render rules cover functional setState, lazy initialization, transitions, and extracting memoized components.

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 layout shift from loading states harms UX. The trade-off is faster initial paint versus potential content jumping.