vercel-composition-patterns

Refactors React components using compound components, context providers, and composition patterns.

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/MSC72m/DevForge --skill vercel-composition-patterns-msc72m
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/MSC72m/DevForge/tree/main/skills/vercel-composition-patterns
Command: npx skills add https://github.com/MSC72m/DevForge --skill vercel-composition-patterns-msc72m

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? React components often accumulate boolean props like isThread or isEditing, creating exponential state combinations and unmaintainable conditional logic. This Skill provides structured rules for replacing prop proliferation with composition, making component libraries easier to maintain and extend. ## Core Features & Use Cases - Boolean Prop Elimination: Replace conditional props with explicit variant components and compound component structures backed by shared context. - State Lifting & Dependency Injection: Define generic context interfaces (state, actions, meta) so UI components work with any provider implementation, from local useState to global synced stores. - React 19 API Guidance: Apply modern patterns such as ref as a regular prop and use() instead of useContext(). - Use Case: When refactoring a message composer that has grown to accept isThread, isEditing, and isDMThread props, apply these rules to split it into ThreadComposer, EditComposer, and ChannelComposer variants sharing compound internals. ## Quick Start Ask the agent to refactor a React component with many boolean props into compound components using the vercel-composition-patterns rules.

Frequently Asked Questions about vercel-composition-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor React components with too many boolean props?▼

Replace boolean props with explicit variant components that compose shared internals. Each variant like ThreadComposer or EditComposer declares exactly what it renders, eliminating hidden conditionals and impossible states.

What are compound components in React?▼

Compound components are subcomponents sharing a common context, exported as a group such as Composer.Frame, Composer.Input, and Composer.Submit. Consumers compose only the pieces they need without prop drilling or render props.

When should I use children instead of render props in React?▼

Use children when composing static structure because they are more readable and compose naturally. Reserve render props for cases where the parent must pass data back to the child, such as list item rendering.

Does React 19 still require forwardRef?▼

No. In React 19, ref is a regular prop, so function components can accept ref directly without the forwardRef wrapper. The use() hook also replaces useContext() and can be called conditionally.

How do I share React state with components outside the main UI?▼

Lift state into a provider component that wraps the UI tree. Any component inside the provider boundary, even siblings outside the visual component, can access state and actions through context without prop drilling or refs.