Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Apply React composition patterns to build flexible, maintainable components without boolean prop sprawl
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
README.md
1# React Composition Patterns23A structured repository for React composition patterns that scale. These4patterns help avoid boolean prop proliferation by using compound components,5lifting state, and composing internals.67## Structure89- `rules/` - Individual rule files (one per rule)10- `_sections.md` - Section metadata (titles, impacts, descriptions)11- `_template.md` - Template for creating new rules12- `area-description.md` - Individual rule files13- `metadata.json` - Document metadata (version, organization, abstract)14- **`AGENTS.md`** - Compiled output (generated)1516## Rules1718### Component Architecture (CRITICAL)1920- `architecture-avoid-boolean-props.md` - Don't add boolean props to customize21behavior22- `architecture-compound-components.md` - Structure as compound components with23shared context2425### State Management (HIGH)2627- `state-lift-state.md` - Lift state into provider components28- `state-context-interface.md` - Define clear context interfaces29(state/actions/meta)30- `state-decouple-implementation.md` - Decouple state management from UI3132### Implementation Patterns (MEDIUM)3334- `patterns-children-over-render-props.md` - Prefer children over renderX props35- `patterns-explicit-variants.md` - Create explicit component variants3637## Core Principles38391. **Composition over configuration** — Instead of adding props, let consumers40compose412. **Lift your state** — State in providers, not trapped in components423. **Compose your internals** — Subcomponents access context, not props434. **Explicit variants** — Create ThreadComposer, EditComposer, not Composer44with isThread4546## Creating a New Rule47481. Copy `rules/_template.md` to `rules/area-description.md`492. Choose the appropriate area prefix:50- `architecture-` for Component Architecture51- `state-` for State Management52- `patterns-` for Implementation Patterns533. Fill in the frontmatter and content544. Ensure you have clear examples with explanations5556## Impact Levels5758- `CRITICAL` - Foundational patterns, prevents unmaintainable code59- `HIGH` - Significant maintainability improvements60- `MEDIUM` - Good practices for cleaner code61