What problem does it solve?
Inconsistent component design, fragile hooks, scattered state placement, and ad-hoc performance work make React codebases hard to maintain and scale; this Skill provides structured principles and patterns to standardize implementation and improve long-term maintainability.
Core Features & Use Cases
- Component Design: Guidelines for server, client, presentational, and container components to enforce single responsibility and predictable state flow.
- Hook Patterns & Composition: When to extract custom hooks, top-level rules, and composition strategies including compound components and render-prop alternatives.
- State, Performance & TypeScript: Advice for selecting state management (useState, Context, React Query, Zustand), profiling optimizations, and TypeScript prop/ref typing for robust components.
- Testing & Error Handling: Priorities across unit, integration, and E2E tests and recommended placement of error boundaries and recovery UX.
Quick Start
Use the react-patterns skill to review a React component and recommend refactors for hooks, state placement, TypeScript typings, and performance improvements.