vercel-composition-patterns

Refactors React components with excessive boolean props into explicit composition patterns.

12|3|Updated Feb 17, 2026
One-click install
npx skills add https://github.com/RodrigoTomeES/getmcp --skill vercel-composition-patterns-rodrigotomees
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/RodrigoTomeES/getmcp/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/RodrigoTomeES/getmcp --skill vercel-composition-patterns-rodrigotomees

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams replace rigid React components with flexible composition patterns, reducing boolean prop proliferation, hidden conditional logic, and duplicated state handling. It is useful when a component has too many modes or when sibling UI needs access to shared state without prop drilling.

Core Features & Use Cases

  • Compound components that share state through context instead of props.
  • Provider-based state management so UI can be reused with different implementations.
  • Explicit variants such as thread, edit, or forward composers that make behavior obvious.
  • Children-first composition instead of render props for clearer component structure.
  • React 19 guidance for using ref as a normal prop and using use for context access.
  • Use case: refactor a monolithic composer into explicit, reusable variants with shared internals.

Quick Start

Ask the skill to refactor a React component with too many boolean props into explicit compound components backed by a provider and context.

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 a React component with too many boolean props?

Refactor React components with excessive boolean props by breaking them into explicit composition patterns like compound components backed by a provider and context. This replaces rigid conditional logic with flexible, reusable variants.

What is the best way to manage shared state in React without prop drilling?

Manage shared state without prop drilling by using provider-based state management with React context. Sibling UI components can access shared state directly through context providers instead of passing props down the tree.

How do compound components work in React for reusable UI libraries?

Compound components in React share state through context instead of props. They allow sibling UI elements to coordinate internally, making reusable UI libraries more flexible and avoiding rigid, tightly-coupled parent-child structures.

Does this React composition approach work with React 19 context and refs?

Yes, this approach supports React 19 by treating ref as a normal prop and using the use hook for context access. It provides specific guidance for modern context handling and dependency-injected state contracts.

When should I use children-based composition instead of render props in React?

Use children-based composition instead of render props to achieve clearer component structure. This pattern simplifies variant design for components like dialog and thread composers, making their behavior explicit and easier to maintain.

Why does my monolithic React composer have duplicated state handling?

Monolithic React composers duplicate state handling because they rely on excessive boolean props and hidden conditional logic. Refactoring them into explicit, reusable variants with shared internals via context providers eliminates this duplication.