vercel-react-best-practices

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

Updated Jul 9, 2026
One-click install
npx skills add https://github.com/octanutri-clin/octaclin --skill vercel-react-best-practices-octanutri-clin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/octanutri-clin/octaclin/tree/main/.agents/skills/vercel-react-best-practices
Command: npx skills add https://github.com/octanutri-clin/octaclin --skill vercel-react-best-practices-octanutri-clin

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, oversized bundles, and sequential data-fetching waterfalls. This Skill provides a structured, impact-prioritized rule set from Vercel Engineering so AI agents and developers consistently apply proven performance patterns instead of guessing. ## Core Features & Use Cases - 70 Prioritized Rules Across 8 Categories: Covers eliminating 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 Code Examples: Each rule includes concrete TypeScript/TSX examples showing the wrong pattern, the fixed pattern, and the measured impact (e.g., 2-10x improvement from parallelizing fetches). - Use Case: When refactoring a Next.js page that sequentially awaits user, posts, and comments, the Skill directs you to use Promise.all() or better-all, cutting multiple network round trips down to one. ## Quick Start Ask the agent to review your React component or Next.js page 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, or use better-all for partial dependency chains. In components, use Suspense boundaries so the layout renders while data streams in instead of blocking the whole page.

How to reduce bundle size from barrel file imports?

Avoid importing from barrel files like lucide-react or @mui/material entry points, which can load thousands of modules. In Next.js 13.5+, use optimizePackageImports; otherwise import directly from subpaths like @mui/material/Button.

Does this guide work with Next.js Server Actions?

Yes, it includes a dedicated rule for Server Actions: treat them like public API routes by verifying authentication and authorization inside each action, validating inputs, and never relying solely on middleware or layout guards.

When should I use SWR for client-side data fetching?

Use SWR when multiple component instances need the same data, since it provides automatic request deduplication, caching, and revalidation. It replaces manual useEffect fetch patterns that cause duplicate network requests.

Why do React components re-render unnecessarily?

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

When should I not use Suspense boundaries for data fetching?

Avoid Suspense when the data drives layout decisions, when content is SEO-critical above the fold, when queries are small and fast, or when you want to prevent layout shift between loading and loaded states.