Skip to content
alyn
Vercel Official

Vercel Composition Patterns skill

React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.

$npx skills add vercel-labs/agent-skills --skill vercel-composition-patterns
GitHub stars
33,847
Pack installs
3.2M
Alyn Score
78/99
Updated
13 days ago

Vercel

Vercel Composition Patterns

Install Vercel Composition Patterns

Pick your agent. Every command is ready to paste.

$npx skills add vercel-labs/agent-skills --skill vercel-composition-patterns

The open skills CLI detects your agents (Claude Code, Cursor, Codex and 70+ more) and installs to the right folder. Add -g to install globally.

01

Install it

Run the command above, or upload the folder in Claude.

02

Ask naturally

Describe the task. Your agent loads vercel-composition-patterns when the request matches its description.

03

Name it if needed

If it does not trigger, say “use the vercel-composition-patterns skill”. In Codex, type $vercel-composition-patterns.

The skill itself

SKILL.md

GitHub

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 Apply

Reference these guidelines when:

  • Refactoring components with many boolean props
  • Building reusable component libraries
  • Designing flexible component APIs
  • Reviewing component architecture
  • Working with compound components or context providers

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)

  • architecture-avoid-boolean-props - Don't add boolean props to customize behavior; use composition
  • architecture-compound-components - Structure complex components with shared context

2. State Management (MEDIUM)

  • state-decouple-implementation - Provider is the only place that knows how state is managed
  • state-context-interface - Define generic interface with state, actions, meta for dependency injection
  • state-lift-state - Move state into provider components for sibling access

3. Implementation Patterns (MEDIUM)

  • patterns-explicit-variants - Create explicit variant components instead of boolean modes
  • patterns-children-over-render-props - Use children for composition instead of renderX props

4. React 19 APIs (MEDIUM)

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

  • react19-no-forwardref - Don't use forwardRef; use use() instead of useContext()

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:

  • Brief explanation of why it matters
  • Incorrect code example with explanation
  • Correct code example with explanation
  • Additional context and references

Full Compiled Document

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

Tips for Vercel Composition Patterns

  • • Start a fresh session after installing so your agent picks up the new skill.
  • • It is part of a pack with 9 skills. Install only the ones you need with --skill to keep triggers precise.
  • • If two skills overlap, mention the one you want by name.

Questions about Vercel Composition Patterns

What does the Vercel Composition Patterns skill do?

React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.

How do I install Vercel Composition Patterns?

Run "npx skills add vercel-labs/agent-skills --skill vercel-composition-patterns" in your project. The skills CLI installs it for Claude Code, Cursor, Codex and 70+ other agents. In Claude on the web, upload the skill folder as a ZIP under Customize > Skills.

Does Vercel Composition Patterns work in Cursor and Codex?

Yes. Vercel Composition Patterns uses the open SKILL.md format, so it works in Claude Code, Claude, Cursor, OpenAI Codex, Gemini CLI, GitHub Copilot and other agents that support agent skills.

Is Vercel Composition Patterns free?

Vercel Composition Patterns is open source on GitHub. It is free to install; check the license before commercial use.

Who made Vercel Composition Patterns?

Vercel Composition Patterns is published by Vercel in the vercel-labs/agent-skills repository, together with 8 other skills.

Similar skills. From other creators.