vercel-composition-patterns

Refactor React component architectures into compound components with provider-driven state.

Updated Mar 22, 2018
One-click install
npx skills add https://github.com/tnunamak/dotfiles --skill vercel-composition-patterns-tnunamak
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/tnunamak/dotfiles/tree/main/ai/skills/local/vercel-composition-patterns
Command: npx skills add https://github.com/tnunamak/dotfiles --skill vercel-composition-patterns-tnunamak

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It solves brittle React component APIs caused by boolean prop proliferation and tangled state management, which create hard-to-reason behavior and frequent refactoring churn.

Core Features & Use Cases

  • Avoid boolean prop proliferation by replacing conditional rendering modes with explicit component variants.
  • Use compound components with a shared context so consumers compose only the pieces they need.
  • Lift and decouple state so providers own state management while UI reads from a generic context contract (state, actions, meta).
  • Apply React 19 guidance by using use() for context consumption and treating ref as a regular prop.

Use it when refactoring a form/composer-like UI, building a reusable component library, reviewing architecture for maintainability, or standardizing patterns for teams and AI-assisted code generation.

Quick Start

Ask your AI to refactor your current React component by removing boolean props, introducing compound components with a provider, and applying the React 19 use()/ref 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 eliminate boolean prop complexity?▼

Refactor React components by replacing conditional rendering modes with explicit component variants and applying compound components with a shared context. This eliminates boolean prop proliferation and creates maintainable, composable component architectures.

What's the best way to manage state in a React component library without prop drilling?▼

Lift and decouple state so context providers own state management while UI reads from a generic context contract. This provider-driven state management approach prevents prop drilling and standardizes how components access state, actions, and metadata.

How does React 19 context consumption work with the use hook?▼

React 19 context consumption uses the use() hook for reading context and treats ref as a regular prop. This modern API approach simplifies context provider patterns and ref forwarding in compound component architectures.

When should I not use compound components for React state management?▼

Avoid compound components when a simple component hierarchy suffices without shared context complexity. If your UI lacks varying composition needs or provider-driven state management requirements, introducing these scalable patterns adds unnecessary architectural overhead.