secondsky avatar

React Composition Patterns

This codifies the composition patterns that prevent your component APIs from turning into boolean prop soup. It guides you toward compound components, context providers, and explicit variants instead of cramming everything into a single component with fifteen true/false flags. The rules are prioritized by impact and organized around architecture, state management, and implementation patterns. Most valuable when you're building a component library or refactoring something that's already accumulated too many conditional branches. From Vercel, which makes sense given they deal with this at scale in their UI libraries.

skills.sh installs
494
GitHub stars
248
last updated
Aug 21, 2026

Install

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

Installs into .claude/skills of the current project.

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

Sponsors

Details

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

More from secondsky/claude-skills

All 146
1lobehub avatarvercel-react-best-practiceslobehub/lobehubReact and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js c489skills.sh installs
2aj-geddes avatarvue-application-structureaj-geddes/useful-ai-promptsStructure Vue 3 applications using Composition API, component organization, and TypeScript. Use when building scalable Vue applications with proper separation o447skills.sh installs
3gocallum avatarclerk-nextjs-skillsgocallum/nextjs16-agent-skillsClerk authentication for Next.js 16 (App Router only) with proxy.ts setup, migration from middleware.ts, environment configuration, and MCP server integration.438skills.sh installs
4pproenca avatarreact-testing-librarypproenca/dot-skillsReact Testing Library best practices for writing maintainable, user-centric tests. Use when writing, reviewing, or refactoring RTL tests. Triggers on test files418skills.sh installs
5vercel-labs avatarvercel-react-best-practicesvercel-labs/agent-evalReact and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js c408skills.sh installs
6ofershap avatartailwind-best-practicesofershap/tailwind-best-practicesStop your AI agent from generating Tailwind CSS v3 code. Rules for v4 syntax, CSS-first config, modern utility patterns, and common anti-patterns.405skills.sh installs