vercel-composition-patterns

Refactors React components to use compound patterns and explicit variants.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps teams eliminate boolean prop proliferation and tangled component logic by moving to compound components, lifted state, and explicit variants that stay maintainable as features grow.

Core Features & Use Cases

  • Compound component architecture: Build reusable component “pieces” that share state via context instead of prop drilling, making composition predictable for both humans and agents.
  • State lifting & provider boundaries: Move state management into provider components so UI pieces consume a stable context interface while sibling or external UI can still read actions and state.
  • Explicit variants over boolean modes: Replace ambiguous combinations of boolean flags (e.g., isThread, isEditing) with self-documenting variant components like ThreadComposer and EditComposer.
  • React 19 API guidance: Applies React 19+ conventions using use() for context consumption and treating ref as a regular prop instead of relying on forwardRef.

Quick Start

Use this skill when refactoring a React UI that currently uses many boolean props or render-prop conditionals, and ask an AI to redesign it into explicit compound components with lifted provider state following the included React 19 guidance.

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 to reduce boolean prop proliferation?

Refactor React components by adopting compound component architecture and explicit variant components to eliminate boolean prop proliferation. Replace ambiguous boolean flags with self-documenting variants like ThreadComposer, lifting shared state into context providers.

What is the best way to manage state lifting and context providers in React 19?

State lifting in React 19 involves moving management into provider components so UI pieces consume a stable context interface. Sibling and external UI can read actions and state directly using the new use() hook for context consumption.

How do I remove render props and conditional component complexity in React?

Remove render props by refactoring tangled conditional logic into composition-based architectures. Build reusable component pieces that share state via context instead of prop drilling, making composition predictable for both humans and AI agents.

Can I use the ref as a prop convention without forwardRef in React 19?

Yes, React 19+ conventions treat ref as a regular prop instead of relying on forwardRef. This ref-as-prop pattern simplifies component architecture when building dependency-injectable context interfaces for state, actions, and meta.

When should I replace boolean flags with explicit component variants?

Replace boolean flags like isThread or isEditing with explicit component variants when ambiguous combinations create tangled logic. Self-documenting variants such as EditComposer maintain predictability as features grow in complex React component architectures.