vercel-composition-patterns

Refactor React UI components with boolean props into explicit variant and compound components.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React codebases often suffer from boolean prop proliferation and tangled render logic. This Skill offers a structured approach to refactor UI into explicit variants, compound components, and context-driven state, reducing complexity and improving maintainability.

Core Features & Use Cases

  • Explicit variant components (e.g., ThreadComposer, EditMessageComposer) to replace boolean props.
  • Compound components with shared context to avoid prop drilling and enable flexible composition.
  • Lifted state into providers and generic context interfaces to swap UI and state implementations easily.
  • Guidelines for implementing patterns across architecture, state management, and rendering strategies.

Quick Start

Refactor a UI component that uses boolean props into explicit variant components with a shared Context provider.

Frequently Asked Questions about vercel-composition-patterns

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

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

To reduce boolean prop proliferation in React components, refactor tangled render logic into explicit variant components like ThreadComposer and EditMessageComposer. This structured approach improves maintainability by replacing complex conditional rendering with dedicated, purpose-built UI elements.

What is the best way to avoid prop drilling in scalable React architecture?

The best way to avoid prop drilling in scalable React architecture is implementing compound components with shared context. Lifting state into context providers enables flexible composition and allows you to swap UI and state implementations easily without passing props down multiple levels.

How do compound components work with React context providers?

Compound components work with React context providers by sharing state implicitly through a generic context interface. This allows individual sub-components to access necessary state without prop drilling, enabling flexible composition and making it easier to swap UI implementations within the shared provider.

Can I use React 19 API features for state management and render props?

Yes, you can use React 19 API features for state management and render props. The Skill provides guidelines for implementing rendering strategies and state management patterns across your architecture, ensuring compatibility with modern React APIs for context providers and component composition.

When should I refactor UI components into explicit variants?

You should refactor UI components into explicit variants when boolean props create tangled render logic and reduce maintainability. If your component library requires scalable architecture with multiple distinct UI states, replacing boolean flags with explicit variant components restores code clarity.

Does this React composition approach support automated tooling and discovery?

Yes, this React composition approach supports automated tooling and discovery by defining a frontmatter schema, optional resource directories, and a consistent metadata format. This structure ensures refactored component libraries remain maintainable and easily discoverable by automated development tools.