vercel-composition-patterns

Guide React component architecture with compound components and state providers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the complexity of building and maintaining React components by providing patterns to avoid prop proliferation and create more flexible, reusable code.

Core Features & Use Cases

  • Component Architecture: Patterns to avoid boolean prop proliferation and use compound components effectively.
  • State Management: Strategies for lifting state into providers and decoupling state implementation from UI.
  • Implementation Patterns: Guidance on preferring children over render props and creating explicit component variants.
  • Use Case: Refactor a large, monolithic Composer component with many conditional props into smaller, composable components like ThreadComposer and EditComposer that clearly define their purpose and state.

Quick Start

Apply the React composition patterns to refactor the Composer component by composing explicit variants and using compound components.

Frequently Asked Questions about vercel-composition-patterns

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

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

Refactor monolithic components into explicit variants like ThreadComposer and EditComposer to eliminate boolean prop proliferation, using compound components to compose smaller pieces and define their purpose clearly.

What is the compound components pattern in React?

The compound components pattern builds scalable React components by composing specialized sub-components together rather than passing conditional props, creating flexible and maintainable component architecture.

How do I decouple state management from UI in React?

Decouple state from UI by lifting state management into context providers, allowing state implementation to remain separate from component rendering logic to improve reusability.

Should I use render props or children for React composition?

Prefer children over render props for React composition patterns to create explicit component variants, avoiding complex conditional logic and simplifying component API design.

Can I use React 19 use() hook for component state management?

React 19 features like the use() hook and passing ref as a prop are supported patterns for building scalable components, offering modern ways to handle context within composition architectures.

When should I refactor a monolithic React component into smaller components?

Refactor monolithic React components when boolean prop proliferation makes code hard to maintain, splitting them into smaller composable components that explicitly define purpose and state boundaries.