vercel-composition-patterns

Refactor React components into explicit compound components with lifted state.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams refactor React components that have grown brittle from boolean prop proliferation, hidden modes, and tangled conditional rendering. It replaces one-off configuration flags with explicit, reusable composition patterns that are easier to reason about and maintain.

Core Features & Use Cases

  • Compound components: Split complex UI into clear subcomponents that share state through context instead of prop drilling.
  • Lifted state providers: Move state management into providers so sibling components, dialogs, and custom controls can access the same actions and data.
  • Explicit variants: Build separate components such as thread, edit, and forward variants instead of one overloaded component with many booleans.
  • React 19 guidance: Apply modern API patterns such as using ref as a regular prop and use for context access.
  • Use case: Ideal for redesigning chat composers, form builders, dashboards, and reusable design-system components that need flexible structure without configuration sprawl.

Quick Start

Ask the assistant to rewrite your React component into explicit compound components with lifted state, shared context, and modern React 19-friendly patterns.

Frequently Asked Questions about vercel-composition-patterns

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

FAQPage Schema
How do I remove boolean prop sprawl from my React components?

Refactor React component architecture to replace boolean prop proliferation with explicit variants, lifted state providers, and shared context contracts to achieve maintainable, dependency-injectable UI.

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

Manage shared state in compound components by lifting it into context providers, allowing sibling components and custom controls to access identical actions and data without prop drilling.

How does React 19 change context access and ref forwarding in composition patterns?

React 19 composition workflows use ref as a regular prop and the use API for context access, creating ref-safe reusable components without requiring forwardRef wrappers.

Can I replace render props with modern React composition patterns?

Yes, render-prop replacements utilize shared context contracts and explicit variant components instead of function props, reducing configuration complexity while maintaining flexible UI rendering.

When should I build explicit React component variants instead of using conditional flags?

Build explicit variants when components grow brittle from hidden modes and tangled conditional rendering, such as separating thread, edit, and forward variants rather than overloading one component with booleans.

Does this React refactoring approach work for design system components?

Yes, this approach applies directly to reusable design-system components, chat composers, form builders, and dashboards requiring flexible structure without configuration sprawl or hidden state modes.