RE

react-patterns

Apply best practices and design patterns to React components and state.

Install

mkdir -p .claude/skills/react-patterns-lewislpz && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/12657" && unzip -o skill.zip -d .claude/skills/react-patterns-lewislpz && rm skill.zip

Installs to .claude/skills/react-patterns-lewislpz

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Use when implementing or reviewing React components, hooks, composition, state placement, rendering, or React performance.
122 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Detect React version and environment
  • Identify ownership of state, effects, async data, and errors
  • Prefer composition and colocated state
  • Keep effects synchronized with external systems
  • Profile before performance optimization

How it works

The skill analyzes the React environment, identifies ownership of various concerns, and applies React principles to guide composition, state management, and performance optimization.

Inputs & outputs

You give it
A React component, hook, or architecture to review or implement
You get back
Guidance or recommendations for React patterns, state management, or performance

When to use react-patterns

  • Refactoring a complex component
  • Deciding where to place state
  • Optimizing React performance
  • Reviewing component architecture

About this skill

React Patterns

Boundaries

Use only after React is confirmed. Use frontend guidance for broader UX and TypeScript guidance for advanced type or tooling problems.

Operating Loop

  1. Detect React version, rendering environment, compiler use, framework conventions, state libraries, and test setup.
  2. Identify ownership of state, effects, async data, and errors.
  3. Prefer composition and colocated state; extract only when reuse or complexity justifies it.
  4. Keep effects synchronized with external systems rather than using them for derived state.
  5. Profile before performance optimization and verify user-visible behavior.

Decision Rules

  • Follow the Rules of Hooks and preserve stable ownership boundaries.
  • Choose local, lifted, contextual, server, or global state from actual scope.
  • Treat memoization as a targeted optimization, especially when a compiler is active.
  • Provide error recovery and preserve user input where practical.
  • Test behavior and accessibility rather than component internals.

Optional Reference

Load legacy-guide.md for a compact pattern catalog after confirming its assumptions match the repository.

When not to use it

  • When the project does not use React
  • When the problem is a broader UX issue
  • When the problem is an advanced type or tooling problem

Limitations

  • Use only after React is confirmed
  • Use frontend guidance for broader UX
  • Use TypeScript guidance for advanced type or tooling problems

How it compares

This skill provides structured guidance based on React patterns and principles, offering a systematic approach to component design and optimization compared to ad-hoc development.

Compared to similar skills

react-patterns side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
react-patterns (this skill)02moNo flagsIntermediate
frontend-code-review112moNo flagsAdvanced
next-best-practices03moNo flagsIntermediate
frontend-developer04moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry