vercel-react-best-practices

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

3|Updated Nov 8, 2014
One-click install
npx skills add https://github.com/mintuz/.dotfiles --skill vercel-react-best-practices-mintuz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/mintuz/.dotfiles/tree/main/agents/.agents/skills/vercel-react-best-practices
Command: npx skills add https://github.com/mintuz/.dotfiles --skill vercel-react-best-practices-mintuz

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, and unnecessary re-renders that are hard to spot during development and code review. ## Core Features & Use Cases - 70 Prioritized Performance Rules: Covers 8 categories from eliminating async waterfalls and reducing bundle size to re-render optimization and advanced hook patterns, each ranked by impact. - Incorrect vs. Correct Examples: Every rule includes concrete code comparisons showing the wrong pattern and the optimized fix, with impact metrics like 2-10x improvements. - Use Case: When refactoring a Next.js page that fetches user, posts, and comments sequentially, apply the Promise.all() parallelization rule to collapse three round trips into one. ## Quick Start Review my Next.js page component for performance issues using the Vercel React best practices rules.

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() instead of awaiting sequentially. 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 that re-export thousands of modules. In Next.js 13.5+, use the optimizePackageImports config option to automatically transform barrel imports while preserving TypeScript support.

Does this guide cover Next.js Server Actions security?

Yes, it requires authenticating Server Actions like public API routes, since they are exposed endpoints. Always verify session and authorization inside each action rather than relying on middleware or layout guards.

When should I use React.cache versus an LRU cache?

Use React.cache() for per-request deduplication so the same fetch runs once per render pass. Use a cross-request LRU cache for data that can be shared across multiple requests, such as configuration or static content.

What are the limitations of using Suspense boundaries for data fetching?

Avoid Suspense streaming for critical layout-determining data, SEO-critical above-the-fold content, and very fast queries where the overhead is not worthwhile. The trade-off is faster initial paint versus potential layout shift.