Skip to content
secondsky avatar

React Composition Patterns

React composition patterns that scale for refactoring boolean-prop components and designing flexible, reusable APIs.

CCM score
63 of 100
skills.sh installs
505
GitHub stars
257
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers component architecture, state management, and implementation patterns, ordered by priority from HIGH to MEDIUM impact
  • Includes 8 rules on avoiding boolean props, compound components, decoupled providers, lifted state, explicit variants, and children over render props
  • Provides a quick reference with rule prefixes and per-rule file paths, plus an AGENTS.md compiled guide with all rules expanded
  • Designed for refactoring component libraries and reviewing component architecture, including work with compound components and context providers

Install

$ npx -y skills add secondsky/claude-skills --skill react-composition-patterns -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

React Composition Patterns

Composition patterns for building flexible, maintainable React components. Avoid boolean prop proliferation by using compound components, lifting state, and composing internals. These patterns make codebases easier for both humans and AI agents to work with as they scale.

When to Apply

Reference these guidelines when:

  • Refactoring components with many boolean props
  • Building reusable component libraries
  • Designing flexible component APIs
  • Reviewing component architecture
  • Working with compound components or context providers

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Component ArchitectureHIGHarchitecture-
2State ManagementMEDIUMstate-
3Implementation PatternsMEDIUMpatterns-

Quick Reference

1. Component Architecture (HIGH)

  • architecture-avoid-boolean-props - Don't add boolean props to customize behavior; use composition
  • architecture-compound-components - Structure complex components with shared context

Details

Repository
github.com/secondsky/claude-skills
Categories
Frontend & UI Code, Code Review & Quality
First seen
Jun 3, 2026

Questions

What does the react-composition-patterns skill help with?

The react-composition-patterns skill guides refactoring React components that have too many boolean props, and designing flexible component libraries and reusable APIs. It covers compound components, render props, context providers, and component architecture. It also helps agents write and review component code that scales.

Which skills lead the Frontend and UI Code category alongside react-composition-patterns?

Other skills in the Frontend and UI Code category include vercel-react-best-practices, web-design-guidelines, design-taste-frontend, vercel-composition-patterns, and lark-apps. The react-composition-patterns skill focuses specifically on composition patterns that avoid boolean prop proliferation. Its rules cover component architecture, state management, and implementation patterns.

How do I install the react-composition-patterns skill?

Run npx -y skills add secondsky/claude-skills --skill react-composition-patterns -y inside your project. After installing, your agent can apply the skill's guidance on compound components, lifted state, and explicit variant components. The skill then helps it refactor React components toward children-based composition.

Does react-composition-patterns cover render props and context providers?

Yes, the skill's triggers include render props, context providers, and compound components. Its state rules explain that the provider is the only place that knows how state is managed. It also recommends defining a generic context interface with state, actions, and meta for dependency injection.

More from secondsky/claude-skills

All 116

Similar to React Composition Patterns

More Frontend & UI Code