All skills
vercel-labs avatar

/composition-patterns

@a5343bd official
by Vercel Labsvercel-labs/agent-skills32k stars
2,784

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.

Use this Skill: https://skilld.dev/gh/vercel-labs/agent-skills/composition-patterns

This session only. Nothing lands on disk.

rules_sections.md

≈208 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Sections

This file defines all sections, their ordering, impact levels, and descriptions. The section ID (in parentheses) is the filename prefix used to group rules.


1. Component Architecture (architecture)

Impact: HIGH
Description: Fundamental patterns for structuring components to avoid prop proliferation and enable flexible composition.

2. State Management (state)

Impact: MEDIUM
Description: Patterns for lifting state and managing shared context across composed components.

3. Implementation Patterns (patterns)

Impact: MEDIUM
Description: Specific techniques for implementing compound components and context providers.

4. React 19 APIs (react19)

Impact: MEDIUM
Description: React 19+ only. Don't use forwardRef; use use() instead of useContext().

Source: SKILL.md on GitHub

No alerts27d3 checks · Risk SAFE
  • Gen Agent Trust Hub27d

    This skill provides React composition patterns and architectural guidelines for frontend development. No security considerations were identified as the skill consists entirely of instructional documentation.

  • Socket27d

    No alerts

  • Snyk27d

    Risk: LOW · No issues

Signed by skilld at a5343bd. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 8 months ago
metadata
{
  "author": "vercel",
  "version": "1.0.0"
}
  • React
  • Refactoring
  • composition
  • component-architecture
  • state-management
  • compound-components
  • react19
  • component-library

README badge

README badge for vercel-labs/agent-skills/composition-patterns

Teaches React composition patterns to avoid boolean prop proliferation and build flexible component libraries using compound components, context providers, and state lifting. Includes guidelines for refactoring component architecture and references React 19 API changes like removing forwardRef in favor of use().

Generated from the current SKILL.md.

Does this skill cover React 19 changes?
Yes. The skill includes a React 19 APIs section covering changes like removing forwardRef in favor of use() and useContext() updates, but those rules only apply if you're using React 19 or later.
What specific composition patterns does this skill teach?
The skill covers compound components, render props, context providers, state lifting, and explicit variants. It prioritizes avoiding boolean prop proliferation by composing components instead.
Is this skill for building my own components or refactoring existing ones?
Both. Use it when refactoring components with too many boolean props, designing new component libraries, or reviewing component architecture decisions.
Does this skill include code examples?
Yes. Individual rule files contain incorrect and correct code examples with explanations for each pattern.

Generated from the current SKILL.md. These answers refresh after source changes.