vercel-composition-patterns

Refactor React components to replace boolean props with composition patterns.

1|Updated Feb 24, 2026
One-click install
npx skills add https://github.com/devsepnine/hibi_ai --skill vercel-composition-patterns-devsepnine
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/devsepnine/hibi_ai/tree/main/src/skills/composition-patterns
Command: npx skills add https://github.com/devsepnine/hibi_ai --skill vercel-composition-patterns-devsepnine

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React patterns and component libraries often accumulate boolean props that create branching logic and brittle UI. This skill provides a structured approach using composition, compound components, and context to replace boolean checks with explicit variants and reusable internals.

Core Features & Use Cases

  • Explicit component variants (e.g., ThreadComposer, EditMessageComposer, ForwardMessageComposer) to avoid boolean prop proliferation.
  • Use of compound components with a shared context to compose UI without prop drilling.
  • State lifting via providers to allow non-hierarchical components to access and mutate shared state across the app.
  • Clear guidance for React 19 APIs including use() over useContext and the Actions pattern.

Quick Start

Create a ThreadComposer variant that demonstrates the provider pattern and shared state in a sample dialog.

Frequently Asked Questions about vercel-composition-patterns

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

FAQPage Schema
How do I eliminate boolean prop proliferation in React components?

To eliminate boolean prop proliferation in React components, refactor branching logic into explicit component variants like ThreadComposer or EditMessageComposer, and utilize compound components with context providers for shared state management.

What are compound components and how do they manage state in React?

Compound components in React manage state by sharing a context provider, allowing UI pieces to compose together without prop drilling. This pattern lifts state so non-hierarchical components can access and mutate shared data across the application architecture.

Does React 19 provide a better way to consume context than useContext?

Yes, React 19 provides the use() API as a replacement for useContext. This skill enforces React 19 API guidance, recommending use() over useContext and incorporating the Actions pattern for more flexible component architecture.

What's the best way to build a reusable React component library API?

The best way to build a reusable React component library API is by applying composition patterns. Define explicit variants to avoid boolean checks, use compound components to prevent prop drilling, and leverage context providers for flexible state management.

When should I refactor my React UI architecture to use composition patterns?

You should refactor your React UI architecture to use composition patterns when components accumulate boolean props that create brittle UI, or when building scalable component libraries requiring non-hierarchical shared state access across your application.