Home / Market / composition patterns

composition patterns

Use when working with composition-patterns tasks or workflows

skill★ 507890 dlgithubCC-BY-4.0 content; MIT code; upstream exceptions applyInstall in CosmosUpstream Source

Documentation & Preview

--- name: composition-patterns description: "Use when working with composition-patterns tasks or workflows" risk: safe source: "https://github.com/vercel-labs/agent-skills" date_added: "2026-06-02"

---

React Composition Patterns

Composition patterns for building flexible, maintainable React components. Avoid boolean prop proliferation by using compound components, lifting state, and composing internals. These patterns make codebases easier for both humans and AI agents to work with as they scale.

When to Use

Reference these guidelines when:

Rule Categories by Priority

| Priority | Category | Impact | Prefix | | -------- | ----------------------- | ------ | --------------- | | 1 | Component Architecture | HIGH | architecture- | | 2 | State Management | MEDIUM | state- | | 3 | Implementation Patterns | MEDIUM | patterns- | | 4 | React 19 APIs | MEDIUM | react19- |

Quick Reference

1. Component Architecture (HIGH)

behavior; use composition

context

2. State Management (MEDIUM)

state is managed

for dependency injection

3. Implementation Patterns (MEDIUM)

boolean modes

of renderX props

4. React 19 APIs (MEDIUM)

> ⚠️ React 19+ only. Skip this section if using React 18 or earlier.

How to Use

Read individual rule files for detailed explanations and code examples:

rules/architecture-avoid-boolean-props.md
rules/state-context-interface.md

Each rule file contains:

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

Limitations