vercel-composition-patterns

Refactor React components by replacing boolean props with explicit variant components and shared context providers.

1|Updated Feb 23, 2026
One-click install
npx skills add https://github.com/NotWrench/event-management-sc-2026 --skill vercel-composition-patterns-notwrench
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/NotWrench/event-management-sc-2026/tree/main/.agent/skills/vercel-composition-patterns
Command: npx skills add https://github.com/NotWrench/event-management-sc-2026 --skill vercel-composition-patterns-notwrench

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Refactor large React codebases by replacing boolean props with explicit, composable patterns, reducing complexity and maintenance costs.

Core Features & Use Cases

  • Explicit component variants (ThreadComposer, EditMessageComposer, ForwardMessageComposer) to replace multi-flag components.
  • Shared context providers and generic state/interfaces to decouple UI from state management.
  • Guidance on React 19 API changes and practical patterns for scalable component libraries.

Quick Start

Start by identifying a component with boolean props, replace it with explicit variant components (ThreadComposer, EditMessageComposer, ForwardMessageComposer), and wire them to a shared 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 refactor React components with too many boolean props?

Refactor React components with boolean props by replacing them with explicit variant components like ThreadComposer or EditMessageComposer. This reduces configuration complexity and maintenance costs by promoting composition over multiple conditional flags.

What is the best way to share state across compound components in React?

The best way to share state across compound components is using a shared context provider with generic interfaces. This approach decouples UI from state management by enabling dependency injection for state, actions, and meta across the component tree.

How do React 19 API changes affect component composition patterns?

React 19 API changes impact component composition patterns by providing updated guidance for scalable component libraries. The Skill offers practical patterns to modernize architecture using render props and context providers while maintaining compatibility with React 18+.

Can I use render props and context providers to decouple React UI from state?

Yes, you can use render props and context providers to decouple React UI from state management. This pattern utilizes generic context interfaces for state, actions, and meta to enable cross-component sharing without tight coupling.

When should I replace a large React component with explicit variant components?

You should replace a large React component with explicit variant components when boolean prop proliferation causes rendering complexity. Identifying multi-flag components and splitting them into distinct variants reduces maintenance costs and simplifies the reusable API.

Does the vercel-composition-patterns Skill require specific dependencies to refactor component libraries?

The Skill requires no external dependencies to refactor component libraries. It provides architectural guidance using built-in React features like context providers and composition patterns to modernize large codebases across React 18+ and React 19.