vercel-composition-patterns

Provide React composition patterns for scalable component architecture.

5|2|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/s1366560/agi-demos --skill vercel-composition-patterns-s1366560
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/s1366560/agi-demos/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/s1366560/agi-demos --skill vercel-composition-patterns-s1366560

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides patterns to build flexible, maintainable React components, avoiding common pitfalls like boolean prop proliferation and making codebases easier for both humans and AI agents to manage.

Core Features & Use Cases

  • Component Architecture: Strategies to avoid excessive boolean props and leverage compound components for better composition.
  • State Management: Techniques for decoupling state logic from UI and lifting state into providers for easier sharing.
  • Implementation Patterns: Guidance on creating explicit component variants and preferring children composition over render props.
  • React 19 APIs: Updates on new APIs like use() and ref handling.
  • Use Case: Refactor a complex Card component that currently uses many boolean props (e.g., isHoverable, isDraggable, showIcon, showTitle) into a more composable structure using compound components and explicit variants.

Quick Start

Apply the React composition patterns skill to refactor the Composer component to avoid boolean prop proliferation.

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

Avoid boolean prop proliferation in React components by adopting compound components and explicit variants. This composition pattern decouples state logic, creating maintainable structures that scale easily for humans and AI agents.

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

Decouple React state management from UI by lifting state into providers and preferring children composition over render props. This separates logic from presentation, yielding a more flexible and maintainable component architecture.

How do compound components improve React component architecture?

Compound components improve React architecture by enabling flexible composition without complex boolean props. They allow explicit variants and internal state sharing, resulting in cleaner APIs and more maintainable component libraries.

Does this React composition pattern support React 19 API changes?

Yes, these React composition patterns include updates for React 19 APIs like the use() hook and ref handling. These guidelines ensure component architecture remains compatible with the latest React framework features.

When should I use explicit component variants over render props in React?

Use explicit component variants over render props in React when you need clearer API design and better maintainability. Preferring children composition simplifies component architecture and reduces complexity for library creation.