vercel-react-best-practices

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

2|Updated Feb 15, 2026
One-click install
npx skills add https://github.com/SkinnnyJay/simpill-utils --skill vercel-react-best-practices-skinnnyjay
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/SkinnnyJay/simpill-utils/tree/main/.agents/skills/vercel-react-best-practices
Command: npx skills add https://github.com/SkinnnyJay/simpill-utils --skill vercel-react-best-practices-skinnnyjay

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 data-fetching waterfalls that are hard to spot during development. This Skill gives AI agents and developers a prioritized, rule-based checklist from Vercel Engineering to catch and fix these issues automatically. ## Core Features & Use Cases - 57 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, each tagged by impact level. - Incorrect vs. Correct Code Examples: Every rule includes concrete TypeScript/TSX examples showing the anti-pattern and the optimized fix, making it directly actionable for code generation and review. - Use Case: When refactoring a Next.js page that fetches user, posts, and comments sequentially, the Skill directs you to parallelize with Promise.all(), add Suspense boundaries for streaming, and avoid barrel file imports to cut cold-start time. ## Quick Start Review my Next.js page component using the vercel-react-best-practices skill and fix any data-fetching waterfalls or bundle size issues.

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?▼

Use Promise.all() for independent async operations and start promises early in API routes before awaiting them. 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 in React and Next.js apps?▼

Import directly from source files instead of barrel files like lucide-react or @mui/material entry points, which can load thousands of unused modules. Use next/dynamic for heavy components and Next.js 13.5+ optimizePackageImports for automatic transformation.

Does React.cache() work across multiple requests in Next.js?▼

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, when content is SEO-critical above the fold, or when queries are small and fast. The trade-off is faster initial paint versus potential layout shift when content loads.

Why does my React component re-render too often?▼

Common causes include subscribing to state only used in callbacks, missing memoization of expensive computations, and broad effect dependencies. Use functional setState updates, narrow effect dependencies to primitives, and extract expensive work into memoized components.

How do I prevent hydration mismatch with localStorage in React?▼

Inject a synchronous inline script via dangerouslySetInnerHTML that reads localStorage and updates the DOM before React hydrates. This avoids both SSR errors from undefined localStorage and the visible flicker caused by useEffect-based updates.