react-best-practices

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

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

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 async waterfalls, bloated bundles, unnecessary re-renders, and inefficient data fetching that are hard to catch during manual review. This Skill provides a structured, impact-prioritized checklist of 64 rules across 8 categories so AI agents and developers can systematically identify and fix these issues. ## Core Features & Use Cases - Impact-Prioritized Rule Set: 64 rules organized into 8 categories from CRITICAL (eliminating waterfalls, bundle size) to LOW (advanced patterns), each with incorrect vs. correct code examples. - Automated Triggering: Activates when editing TSX/JSX component files or when React imports are detected, with path and import pattern matching. - Migration Guidance: Detects legacy CSS-in-JS libraries (styled-components, Emotion, MUI, Chakra) and chains to shadcn/ui + Tailwind recommendations. - Use Case: After refactoring several components in a Next.js app, run this review to catch sequential await waterfalls in server components, barrel file imports inflating the bundle, and missing memoization on expensive renders. ## Quick Start Review my React components in the components directory for performance issues and suggest fixes based on the best practices checklist.

Frequently Asked Questions about react-best-practices

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

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

Start independent promises immediately and await them together with Promise.all, or use better-all for partial dependency chains. In API routes, fire auth and config fetches before awaiting either, cutting sequential round trips from several to one.

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, which can load thousands of unused modules. Use next/dynamic for heavy components and defer analytics libraries until after hydration.

What React performance rules does this checklist cover?

It covers 64 rules in 8 categories: eliminating waterfalls, bundle size, server-side performance, client-side data fetching, re-render optimization, rendering performance, JavaScript micro-optimizations, and advanced patterns like useEffectEvent.

Does this work with styled-components or MUI codebases?

Yes, it detects legacy CSS-in-JS imports from styled-components, Emotion, MUI, and Chakra, then warns and suggests migrating to shadcn/ui with Tailwind CSS for better SSR performance. Files already using shadcn or Tailwind are skipped.

When should I not use React.memo or useMemo?

Avoid wrapping simple expressions with primitive results in useMemo, since the memoization overhead exceeds the savings. Reserve memoization for expensive computations and components with stable non-primitive props.