vercel-react-best-practices

Applies 64 prioritized performance optimization rules to React and Next.js code.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? React and Next.js applications often suffer from slow load times, unnecessary re-renders, bloated bundles, and server-side waterfalls that degrade user experience. This Skill provides a structured, impact-prioritized rule set from Vercel Engineering so AI agents and developers can systematically identify and fix performance issues when writing, reviewing, or refactoring code. ## Core Features & Use Cases - 64 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. - Incorrect vs. Correct Examples: Each rule file shows a concrete bad implementation alongside the optimized version, with impact ratings from CRITICAL to LOW. - Quick Reference Index: The SKILL.md maps rule prefixes (e.g., async-parallel, bundle-barrel-imports) to individual rule files for targeted lookups, plus a full compiled AGENTS.md document. - Use Case: When refactoring a Next.js page that fetches user, posts, and comments sequentially, apply the async-parallel rule to convert the awaits into a single Promise.all() call, cutting three network round trips down to one. ## Quick Start Ask the AI 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 operations immediately by creating promises before awaiting them, then use Promise.all() to await them together. For partial dependencies, use the better-all library or chain promises so each task starts at the earliest possible moment.

How to reduce React bundle size from barrel file imports?

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+, configure optimizePackageImports in next.config.js to transform barrel imports automatically at build time.

When should I use React Suspense boundaries for data fetching?

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

Does React.cache() work across multiple requests?

No, React.cache() only deduplicates calls 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 concurrent requests share a function instance.

Why does my React component re-render unnecessarily?

Common causes include defining components inside other components, missing memoization of expensive computations, broad effect dependencies, and subscribing to raw state instead of derived values. The re-render rules cover functional setState, lazy initialization, useDeferredValue, and splitting combined hooks.

What are the limitations of these React performance rules?

The rules target React and Next.js specifically and assume modern browser features like toSorted() and the Activity component. Some patterns involve trade-offs, such as Suspense causing layout shift, and micro-optimizations only matter in genuinely hot code paths.