react-best-practices

Reviews React and Next.js code against 64 performance optimization rules.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React and Next.js codebases often suffer from performance issues like async waterfalls, bloated bundles, unnecessary re-renders, and unoptimized server-side data fetching that are hard to catch during manual code review. ## Core Features & Use Cases - 64 Prioritized Rules: Covers 8 categories ranked by impact, from eliminating waterfalls and reducing bundle size (CRITICAL) to advanced hook patterns (LOW). - Automated TSX Review: Triggers after editing TSX/JSX components to run a quality checklist covering component structure, hooks usage, accessibility, and TypeScript patterns. - Legacy Library Detection: Warns when CSS-in-JS libraries like styled-components, Emotion, MUI, or Chakra are detected, and chains to shadcn/ui + Tailwind guidance. - Use Case: After refactoring a Next.js page with multiple data fetches, apply the rules to convert sequential awaits into parallel Promise.all() calls and add Suspense boundaries for faster initial paint. ## Quick Start Review my React components in the components directory and apply the Vercel performance best practices to fix any waterfalls or bundle size issues.

Frequently Asked Questions about react-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I eliminate async waterfalls in React and Next.js?

Use Promise.all() for independent async operations, defer await into branches where results are actually used, and start promises early in API routes before awaiting them. For partial dependencies, the better-all library maximizes parallelism automatically.

How to reduce bundle size in a Next.js application?

Import directly from source files instead of barrel files like lucide-react or @mui/material entry points, use next/dynamic for heavy components, and defer analytics libraries until after hydration. Next.js 13.5+ also offers optimizePackageImports for automatic transformation.

Does this skill work with both React Server Components and client components?

Yes, the rules cover both server-side and client-side patterns. Server rules address RSC serialization, React.cache() deduplication, and parallel data fetching, while client rules cover SWR, event listeners, and re-render optimization.

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

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

Why should I avoid barrel file imports in React projects?

Barrel files from libraries like lucide-react or @mui/material can re-export thousands of modules, adding 200-800ms import cost on every cold start and slowing builds. Direct imports load only the modules you use, improving dev boot, build times, and HMR.