vercel-composition-patterns
Provides architectural patterns like compound components and state lifting to build flexible, scalable React UIs.
Install
mkdir -p .claude/skills/vercel-composition-patterns && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/997" && unzip -o skill.zip -d .claude/skills/vercel-composition-patterns && rm skill.zipInstalls to .claude/skills/vercel-composition-patterns
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.
React composition patterns that scale. Use when refactoring components withKey capabilities
- →Implement compound component patterns
- →Structure shared context providers
- →Replace boolean props with component composition
- →Apply explicit variants for UI components
- →Organize architecture for React 19 APIs
How it works
Applies a set of structural refactoring rules to decouple state from implementation via provider components and explicit variant patterns.
Inputs & outputs
When to use vercel-composition-patterns
- →Refactor components with too many props
- →Build a reusable component library
- →Design flexible component APIs
- →Implement compound components
About this skill
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
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Component Architecture | HIGH | architecture- |
| 2 | State Management | MEDIUM | state- |
| 3 | Implementation Patterns | MEDIUM | patterns- |
| 4 | React 19 APIs | MEDIUM | react19- |
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
4. React 19 APIs (MEDIUM)
⚠️ React 19+ only. Skip this section if using React 18 or earlier.
react19-no-forwardref- Don't useforwardRef; useuse()instead ofuseContext()
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
When not to use it
- →Building simple, single-use utility components
- →Small codebases where architectural overhead is unnecessary
- →Projects not using React
Prerequisites
Limitations
- →Increases component file count
- →Requires team familiarity with composition patterns
How it compares
It moves from 'prop-driven' design to 'composition-driven' design, standardizing how complex UI components are built.
Compared to similar skills
vercel-composition-patterns side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| vercel-composition-patterns (this skill) | 3 | 6mo | No flags | Advanced |
| accessibility-compliance | 45 | 2mo | No flags | Intermediate |
| senior-fullstack | 35 | 7mo | Review | Intermediate |
| nextjs-best-practices | 31 | 6mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by vercel-labs
View all by vercel-labs →You might also like
accessibility-compliance
wshobson
Implement WCAG 2.2 compliant interfaces with mobile accessibility, inclusive design patterns, and assistive technology support. Use when auditing accessibility, implementing ARIA patterns, building for screen readers, or ensuring inclusive user experiences.
senior-fullstack
davila7
Comprehensive fullstack development skill for building complete web applications with React, Next.js, Node.js, GraphQL, and PostgreSQL. Includes project scaffolding, code quality analysis, architecture patterns, and complete tech stack guidance. Use when building new projects, analyzing code quality, implementing design patterns, or setting up development workflows.
nextjs-best-practices
davila7
Next.js App Router principles. Server Components, data fetching, routing patterns.
frontend-code-review
langgenius
Trigger when the user requests a review of frontend files (e.g., `.tsx`, `.ts`, `.js`). Support both pending-change reviews and focused file reviews while applying the checklist rules.
web-component-design
wshobson
Master React, Vue, and Svelte component patterns including CSS-in-JS, composition strategies, and reusable component architecture. Use when building UI component libraries, designing component APIs, or implementing frontend design systems.
feature-flags
Use when feature flag tests fail, flags need updating, understanding @gate pragmas, debugging channel-specific test failures, or adding new flags to React.