vercel-composition-patterns

Provide React composition patterns for compound components and context providers.

Updated Feb 23, 2026
One-click install
npx skills add https://github.com/masakinihirota/vns-masakinihirota-better-old --skill vercel-composition-patterns-masakinihirota
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/masakinihirota/vns-masakinihirota-better-old/tree/main/.agent/skills/vercel-composition-patterns
Command: npx skills add https://github.com/masakinihirota/vns-masakinihirota-better-old --skill vercel-composition-patterns-masakinihirota

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 enable flexible composition.

Core Features & Use Cases

  • Component Architecture: Patterns to avoid boolean prop proliferation and use compound components effectively.
  • State Management: Strategies for decoupling state from UI, defining generic context interfaces, and lifting state into providers.
  • Implementation Patterns: Guidance on creating explicit component variants and preferring children over render props.
  • React 19 APIs: Covers new API changes like use() and ref handling.
  • Use Case: Refactoring a large component with many conditional rendering paths into a more maintainable and composable structure using compound components and context.

Quick Start

Apply the vercel-composition-patterns skill to refactor the Composer component to use compound components instead of boolean props.

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?

Avoid boolean prop proliferation by applying the compound components pattern to refactor large React components into smaller composable pieces. This replaces multiple conditional rendering flags with explicit component variants, enhancing code organization and reusability.

What is the best way to decouple state management from UI in React?

Decouple state management from UI by lifting state into context providers and defining generic context interfaces. This strategy separates state logic from rendering, allowing components to remain flexible and maintainable without tightly coupling state to specific UI elements.

How do you refactor a React component to use compound components and context?

Refactor by replacing boolean props with compound components and lifting shared state into context providers. Define generic context interfaces to handle state, preferring children over render props to build a maintainable and composable component architecture.

Does this React composition pattern work with React 19 API changes?

Yes, the composition patterns accommodate React 19 API changes, specifically addressing the new use() hook and ref handling. These implementation strategies ensure your component architecture remains compatible and maintainable with the latest React updates.

When should I prefer children over render props in component architecture?

Prefer children over render props when building explicit component variants to enhance code organization. This implementation pattern reduces complexity, making React components more intuitive to compose and reuse while avoiding deeply nested render functions.