vercel-composition-patterns

Refactor React components with boolean props into compound components and explicit variants.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Eliminates brittle, hard-to-maintain React component APIs caused by boolean prop proliferation by guiding teams to use composition, compound components, and dependency-injected context.

Core Features & Use Cases

  • Avoid boolean prop proliferation: Replace sprawling prop combinations with explicit component variants that make rendered states unambiguous.
  • Use compound components with shared context: Build composable subcomponents that consume a provider-supplied interface (state/actions/meta) rather than relying on prop drilling.
  • Lift and decouple state management: Centralize state logic in provider components so UI pieces remain implementation-agnostic and reusable.
  • Prefer children over render props: Improve readability and composability by using children for structure while reserving render props for cases that require data passing.
  • React 19 API guidance: Apply React 19 conventions such as using use() instead of useContext() and treating ref as a regular prop.

Quick Start

Ask the AI to refactor a specific component that uses multiple boolean props into explicit variants that share a compound-component/context architecture, ensuring state is lifted into providers and React 19 conventions are followed.

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 to avoid boolean prop proliferation?

To refactor React components and avoid boolean prop proliferation, replace sprawling prop combinations with explicit component variants. This makes rendered states unambiguous and easier to maintain at scale.

When should I use compound components with context providers in React?

Use compound components with context providers when building composable subcomponents that need shared state. This architecture supplies a provider-injected interface for state, actions, and meta rather than relying on prop drilling.

What is the best way to lift and decouple state management in React component architecture?

The best way to decouple state is centralizing logic in provider components. This lifts state out of the UI, keeping individual pieces implementation-agnostic and highly reusable across different compound component structures.

Should I use children or render props for React component composition?

Prefer using children for structural composition to improve readability. Reserve render props for specific cases that require passing data directly, ensuring cleaner and more maintainable component APIs.

Does React 19 change how I use context and refs in component composition?

React 19 changes composition by introducing the use() hook to replace useContext() and treating ref as a regular prop. These conventions simplify dependency injection and component architecture.