vercel-react-best-practices

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

Updated Jan 9, 2026
One-click install
npx skills add https://github.com/amitpo23/cfo --skill vercel-react-best-practices-amitpo23
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/amitpo23/cfo/tree/main/.cursor/skills/vercel-react-best-practices
Command: npx skills add https://github.com/amitpo23/cfo --skill vercel-react-best-practices-amitpo23

SYSTEM DOCUMENTATION & REQUIREMENTS

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 of 57 performance patterns so generated and refactored code follows proven optimization practices from the start. ## Core Features & Use Cases - Prioritized Rule Catalog: 57 rules across 8 categories ranked by impact, from critical waterfall elimination and bundle size reduction to advanced hook patterns. - Incorrect vs. Correct Examples: Every rule includes side-by-side code comparisons with explanations, making it easy to apply during code review or refactoring. - Granular Rule Files: Individual rule documents under rules/ let you load only the guidance relevant to the current task, plus a full compiled reference in AGENTS.md. - Use Case: While building a Next.js dashboard, an agent consults the skill to parallelize data fetching with Promise.all(), replace barrel imports from icon libraries with direct imports, and wrap slow sections in Suspense boundaries. ## Quick Start Review my React component and Next.js page 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 data fetching waterfalls in Next.js?▼

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

How to reduce bundle size from icon and component libraries?▼

Import directly from source files instead of barrel files, for example lucide-react/dist/esm/icons/check instead of the package root. In Next.js 13.5+, optimizePackageImports in next.config.js transforms barrel imports automatically at build time.

When should I use React.cache() versus an LRU cache?▼

React.cache() deduplicates calls within a single request, ideal for auth checks and database queries in one render pass. Use an LRU cache like lru-cache when data must persist across sequential requests, such as repeated user actions hitting multiple endpoints.

Does this guidance apply to React apps without Next.js?▼

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, next/dynamic, after(), and RSC serialization boundaries.

Why does my conditional render display 0 in React?▼

Using && with a numeric condition renders the falsy value 0 or NaN as text. Use an explicit ternary like count > 0 ? <Badge/> : null so falsy numbers render nothing instead.