react-best-practices

Enforce React and Next.js best practices for components, state, and performance.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/GolfNext/golfnext-tool-kiosk-support-page --skill react-best-practices-golfnext
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-best-practices
Source: https://github.com/GolfNext/golfnext-tool-kiosk-support-page/tree/main/.claude/plugins/mvp-dev-stack/skills/react-best-practices
Command: npx skills add https://github.com/GolfNext/golfnext-tool-kiosk-support-page --skill react-best-practices-golfnext

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces modern, efficient, and maintainable React and Next.js coding standards, preventing common pitfalls and improving code quality.

Core Features & Use Cases

  • Component Best Practices: Guides on functional components, props interfaces, and file structure.
  • State Management Guidance: Recommends appropriate state management solutions (useState, useReducer, React Query/SWR).
  • Performance Optimization: Critical rules for avoiding performance bottlenecks like barrel file imports and minimizing client components.
  • Use Case: When developing a new feature, use this skill to ensure all new React components adhere to established best practices for maintainability and performance.

Quick Start

Apply the react-best-practices skill to refactor the provided ProductCard component to follow functional component and props interface patterns.

Frequently Asked Questions about react-best-practices

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

FAQPage Schema
How do I enforce React and Next.js best practices for functional components?

To enforce React best practices, apply rules requiring functional components, explicit TypeScript props interfaces, and optimized data fetching patterns using React Query or SWR. This ensures modern, maintainable code quality and prevents common pitfalls during development and review.

What is the best way to optimize React performance and minimize client components?

The best way to optimize React performance is by minimizing client components and avoiding barrel file imports. Following these critical rules prevents performance bottlenecks and improves overall Next.js application rendering efficiency.

How do I structure React state management using useReducer or React Query?

React state management should use useState or useReducer for local state, while React Query or SWR handles optimized data fetching. Choosing the appropriate solution based on the state scope ensures efficient and maintainable component logic.

Does this approach work with TypeScript for React component props interfaces?

Yes, this approach works with TypeScript by requiring explicit props interfaces for functional components. Defining clear TypeScript interfaces ensures type safety and maintainable code structure across your React and Next.js projects.

When should I avoid barrel file imports in Next.js applications?

You should avoid barrel file imports in Next.js applications when optimizing performance. Barrel files create performance bottlenecks by forcing unnecessary module loading, so bypassing them is a critical rule for efficient React component development.

How do I refactor a React component to follow functional component patterns?

To refactor a React component to functional patterns, apply best practices by converting to a functional component, defining explicit props interfaces, and optimizing state or data fetching logic. This maintains code quality and performance.