vercel-composition-patterns

Refactor React component APIs to replace boolean props with compound components and providers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams redesign React components that have become brittle from boolean props, render props, and tightly coupled state. It turns monolithic APIs into clearer, composable structures that are easier to maintain, extend, and reuse.

Core Features & Use Cases

  • Compound components: Split complex widgets into explicit parts that share context.
  • Provider-based state lifting: Move state into providers so sibling UI can read and update it without prop drilling.
  • Explicit variants: Create separate components for thread, edit, and forward flows instead of stacking booleans.
  • React 19 patterns: Use modern ref and context conventions when updating newer codebases.
  • Use case: Refactor a chat composer, settings panel, or form toolkit into reusable pieces with clearer behavior.

Quick Start

Ask for a refactor plan that replaces boolean props with compound components and provider-driven state for the React component you are working on.

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

Refactor React components to eliminate boolean prop proliferation by replacing stacked booleans with explicit compound components and provider-driven state. This technique splits monolithic APIs into composable structures, preserving state ownership while removing brittle render props and tightly coupled state.

What is the best way to manage shared state in compound React components?

The best way to manage shared state in compound React components is provider-based state lifting. Moving state into context providers allows sibling UI components to read and update data without prop drilling, creating clearer and more reusable component structures.

How do I create explicit variants instead of stacking boolean props in React?

Create explicit variants in React by building separate components for distinct flows like thread, edit, and forward, instead of stacking boolean props. This refactoring approach turns tightly coupled, monolithic component APIs into clearer, composable structures.

Can I use React 19 ref and context conventions when refactoring component APIs?

Yes, you can apply React 19-compatible ref and context conventions when refactoring component APIs. This approach requires preserved state ownership and dependency-injected context contracts to ensure modern ref and context usage works correctly in updated codebases.

When should I use children-based composition in reusable React UI libraries?

Use children-based composition in reusable React UI libraries when splitting complex widgets into explicit parts that share context. This pattern prevents brittle boolean props and render props, turning monolithic structures into maintainable, extensible components.

Why does prop drilling make React components brittle and hard to maintain?

Prop drilling makes React components brittle and hard to maintain because it creates tightly coupled state and monolithic APIs. Refactoring these components to use shared context providers and compound components eliminates boolean prop proliferation and improves reusability.