react-composition-patterns
React composition patterns skill from Vercel that replaces boolean prop sprawl with scalable component APIs.
- CCM score
- 63 of 100
- version
- 3.12.0
- GitHub stars
- 254
Own this plugin? Claim it
What it does
- Adds a
react-composition-patternsskill that Claude loads when refactoring components or designing reusable APIs - Covers 7 rules across architecture, state management, and implementation patterns, ranked by priority
- Guides toward compound components, lifted state in providers, and explicit variants like ThreadComposer over isThread flags
- Designed for teams building component libraries or design systems that need composable, maintainable React APIs
React composition patterns from Vercel Engineering. Use when building scalable components, avoiding boolean prop proliferation, implementing compound components, or managing component state. Covers architecture, state management, and implementation patterns.
Add marketplace
/plugin marketplace add secondsky/claude-skillsRun it inside Claude Code once, then install the plugin below.
Install
/plugin install react-composition-patterns@claude-skillsRun it inside Claude Code after adding the marketplace.
Files
Discovered from sourceReact 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
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Component Architecture | HIGH | architecture- |
| 2 | State Management | MEDIUM | state- |
| 3 | Implementation Patterns | MEDIUM | patterns- |
Quick Reference
1. Component Architecture (HIGH)
architecture-avoid-boolean-props- Don't add boolean props to customize behavior; use compositionarchitecture-compound-components- Structure complex components with shared context
2. State Management (MEDIUM)
state-decouple-implementation- Provider is the only place that knows how state is managedstate-context-interface- Define generic interface with state, actions, meta for dependency injectionstate-lift-state- Move state into provider components for sibling access
3. Implementation Patterns (MEDIUM)
patterns-explicit-variants- Create explicit variant components instead of boolean modespatterns-children-over-render-props- Use children for composition instead of renderX props
How to Use
Read individual rule files for detailed explanations and code examples:
rules/architecture-avoid-boolean-props.md
rules/state-context-interface.md
Each rule file contains:
- Brief explanation of why it matters
- Incorrect code example with explanation
- Correct code example with explanation
- Additional context and references
Full Compiled Document
For the complete guide with all rules expanded: AGENTS.md
Readme
React Composition Patterns
Status: ✅ Production Ready Version: 1.0.0 (Vercel source) Last Updated: 2026-01-28
Comprehensive React composition patterns guide from Vercel Engineering, containing 7 rules across 3 categories focused on building scalable, maintainable components through composition.
What This Skill Provides
✅ Component Architecture (CRITICAL) - 2 rules for structural design ✅ State Management (HIGH) - 3 rules for provider patterns and state lifting ✅ Implementation Patterns (MEDIUM) - 2 rules for composition strategies
Total: 7 production-tested rules with incorrect vs correct examples
When to Use This Skill
Use this skill when:
- Building component libraries or design systems
- Refactoring components with excessive boolean props
- Implementing compound components with shared context
- Designing flexible, composable component APIs
- Managing component state with provider patterns
- Creating explicit component variants instead of prop-driven customization
Core Principles
- Composition over configuration — Let consumers compose instead of adding props
- Lift your state — State in providers, not trapped in components
- Compose your internals — Subcomponents access context, not props
- Explicit variants — Create ThreadComposer, EditComposer, not Composer with isThread
Structure
- SKILL.md - Concise overview with rule categories (~1,500 words)
- AGENTS.md - Full compiled guide with all rules expanded (~8,000 words)
- rules/ - 7 individual rule files for granular reference
- metadata.json - Version and attribution metadata
Attribution
This skill packages Vercel's React Composition Patterns guide for Claude Code.
Original Author: @nandorojo (Vercel Engineering) Source: https://github.com/vercel-labs/agent-skills/tree/main/skills/composition-patterns Packaging: Claude Skills Maintainers License: MIT
We are grateful to Vercel for creating and open-sourcing this comprehensive guide.
Installation
# Add the marketplace once (if not already added)
/plugin marketplace add https://github.com/secondsky/claude-skills
# Install this plugin
/plugin install react-composition-patterns@claude-skills
Usage Examples
Example 1: Avoid Boolean Props
Ask: "How can I refactor this component that has too many boolean props?"
Claude will:
- Reference SKILL.md architecture section
- Suggest compound component patterns
- Provide code examples from rules/architecture-avoid-boolean-props.md
Example 2: Implement Provider Pattern
Ask: "How should I structure state management in my component library?"
Claude will:
- Reference state management rules
- Show provider pattern with context
- Point to rules/state-lift-state.md and rules/state-context-interface.md
Example 3: Create Component Variants
Ask: "Should I add an isEditing prop or create separate components?"
Claude will:
- Reference explicit variants pattern
- Explain composition over configuration
- Show examples from rules/patterns-explicit-variants.md
Progressive Disclosure
SKILL.md (auto-loaded): Quick reference, rule categories, core principles AGENTS.md (on request): Full guide with all 7 rules expanded rules/ (on request): Individual rule files for specific topics
Ask Claude to "Load AGENTS.md" for the comprehensive guide.
Related Skills
react-best-practices- Performance optimization patternsnextjs- Next.js framework patternszustand-state-management- State managementreact-hook-form-zod- Form composition patternstailwind-v4-shadcn- UI component styling
Support
- Documentation: See SKILL.md and AGENTS.md in skills/react-composition-patterns/
- Issues: https://github.com/secondsky/claude-skills/issues
- Original Source: https://github.com/vercel-labs/agent-skills
Details
- Marketplace
- secondsky/claude-skills
- Source
- plugins/react-composition-patterns
- Category
- Frontend
- Keywords
- react-composition-patterns, react, composition, patterns, frontend, components, scalable, implementation
- Listed since
- Apr 7, 2026
Questions
What does the react-composition-patterns plugin add to Claude Code?
It packages Vercel's React composition patterns guide as a skill with 7 rules across three categories: component architecture, state management, and implementation patterns. Claude can use it to suggest compound components, provider patterns and explicit variants instead of boolean props.
How do I install react-composition-patterns?
Run /plugin marketplace add secondsky/claude-skills in Claude Code, then run /plugin install react-composition-patterns@claude-skills. The second command adds this plugin's skill, with its guide files, to your Claude Code setup.
Which frontend plugins lead the Frontend & UI Code category?
react-composition-patterns sits in the Frontend & UI Code category on Claude Marketplaces, alongside frontend-design, nextjs, taste-skill, storybook and front-end-checklist. It focuses on how to structure React components so they stay flexible and maintainable as they grow.
Who should use the react-composition-patterns plugin?
It suits developers building component libraries or design systems, and anyone refactoring components that have grown too many boolean props. It is also useful when you need to manage component state with provider patterns and shared context.
More from secondsky/claude-skills
All 122- react-hook-form-zodv3.12.0
- react-native-skillsv3.12.0
- recommendation-enginev3.12.0
- recommendation-systemv3.12.0
- responsive-web-designv3.12.0
- rest-api-designv3.12.0
- root-cause-tracingv3.12.0
- security-headers-configurationv3.12.0
- seo-keyword-cluster-builderv3.12.0
- seo-optimizerv3.12.0
- sequential-thinkingv3.12.0
- session-managementv3.12.0
- shadcn-vuev3.12.0
- systematic-debuggingv3.12.0
- tailwind-v4-shadcnv3.12.0
- tanstack-aiv3.12.0
- tanstack-queryv3.12.0
- tanstack-routerv3.12.0
- tanstack-startv3.12.0
- tanstack-tablev3.12.0
- tech-debtv3.12.0
- technical-specificationv3.12.0
- test-quality-analysisv3.12.0
- thesys-generative-uiv3.12.0
Similar to react-composition-patterns
More Frontend & UI Codereact-composition-patternsSkillsecondsky/claude-skills504 installsReact composition patterns that scale for refactoring boolean-prop components and designing flexible, reusable APIs.
vercel-composition-patternsSkillvercel-labs/agent-skills471.4K installsReact composition patterns that scale components and prevent boolean prop sprawl in React codebases.
react-best-practicesPluginsecondsky/claude-skills254 starsReact and Next.js performance optimization guidelines from Vercel Engineering. Use when writing/reviewing/refactoring React code for optimal performance. Covers
react-toolkitPluginarmanzeroeight/fastagent-plugins29 starsReact development toolkit for component architecture, state management, and performance optimization. Includes react architect agent for strategic React decisio
component-patterns-pluginPluginlaurigates/claude-plugins60 starsReusable UI component patterns - version badge, tooltips, and common UI elements for React, Vue, Svelte
vueuse-functionsPluginvueuse/skills409 starsA skill for using VueUse composables in Vue.js / Nuxt projects with references for 260+ functions.