Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/supabase-vercel-composition-patterns/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 27% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 19% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 24% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 10% | 0% |
| case-15 | ✓→✗ | ▼ Worse | 52% | 0% |
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.
Reference these guidelines when:
| 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- |
architecture-avoid-boolean-props - Don't add boolean props to customizebehavior; use composition
architecture-compound-components - Structure complex components with sharedcontext
state-decouple-implementation - Provider is the only place that knows howstate is managed
state-context-interface - Define generic interface with state, actions, metafor dependency injection
state-lift-state - Move state into provider components for sibling accesspatterns-explicit-variants - Create explicit variant components instead ofboolean modes
patterns-children-over-render-props - Use children for composition insteadof renderX props
> ⚠️ React 19+ only. Skip these patterns if you're on React 18 or earlier.
react19-no-forwardref - Don't use forwardRef; use use() instead of useContext()Read individual rule files for detailed explanations and code examples:
rules/architecture-avoid-boolean-props.md
rules/state-context-interface.mdEach rule file contains:
For the complete guide with all rules expanded, read the files under rules/
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 17,796 | 15,553 | -13% | 1 | 1 | 0% | 3,322 | 3,464 | +4% | 0 | 0 | — |
case-02 | fail→pass | 21,004 | 22,004 | +5% | 1 | 1 | 0% | 4,198 | 5,318 | +27% | 0 | 0 | — |
case-03 | fail→fail | 20,099 | 37,640 | +87% | 1 | 1 | 0% | 3,632 | 3,334 | -8% | 0 | 0 | — |
case-04 | pass→pass | 13,056 | 11,263 | -14% | 1 | 1 | 0% | 2,236 | 2,545 | +14% | 0 | 0 | — |
case-05 | pass→pass | 7,558 | 7,626 | +1% | 1 | 1 | 0% | 1,248 | 1,690 | +35% | 0 | 0 | — |
case-06 | pass→pass | 11,015 | 10,596 | -4% | 1 | 1 | 0% | 1,875 | 2,414 | +29% | 0 | 0 | — |
case-07 | fail→fail | 19,552 | 12,971 | -34% | 1 | 1 | 0% | 3,553 | 2,835 | -20% | 0 | 0 | — |
case-08 | pass→pass | 20,983 | 17,932 | -15% | 1 | 1 | 0% | 3,849 | 4,183 | +9% | 0 | 0 | — |
case-09 | fail→pass | 13,348 | 13,195 | -1% | 1 | 1 | 0% | 2,368 | 2,821 | +19% | 0 | 0 | — |
case-10 | fail→fail | 19,607 | 15,211 | -22% | 1 | 1 | 0% | 3,903 | 3,476 | -11% | 0 | 0 | — |
case-11 | fail→pass | 14,913 | 16,235 | +9% | 1 | 1 | 0% | 2,868 | 3,555 | +24% | 0 | 0 | — |
case-12 | pass→pass | 23,684 | 15,969 | -33% | 1 | 1 | 0% | 4,316 | 3,823 | -11% | 0 | 0 | — |
case-13 | pass→pass | 20,457 | 11,565 | -43% | 1 | 1 | 0% | 1,870 | 2,874 | +54% | 0 | 0 | — |
case-14 | pass→pass | 13,135 | 11,675 | -11% | 1 | 1 | 0% | 2,460 | 2,809 | +14% | 0 | 0 | — |
case-15 | pass→fail | 21,833 | 18,433 | -16% | 1 | 1 | 0% | 2,587 | 3,930 | +52% | 0 | 0 | — |
case-16 | pass→pass | 17,898 | 27,338 | +53% | 1 | 1 | 0% | 3,109 | 4,247 | +37% | 0 | 0 | — |
case-17 | pass→pass | 17,581 | 14,796 | -16% | 1 | 1 | 0% | 3,173 | 3,400 | +7% | 0 | 0 | — |
case-18 | fail→pass | 16,680 | 14,471 | -13% | 1 | 1 | 0% | 2,842 | 3,115 | +10% | 0 | 0 | — |
case-19 | pass→pass | 27,690 | 14,913 | -46% | 1 | 1 | 0% | 3,217 | 3,364 | +5% | 0 | 0 | — |
case-20 | pass→pass | 9,761 | 8,598 | -12% | 1 | 1 | 0% | 1,579 | 1,803 | +14% | 0 | 0 | — |
case-21 | pass→pass | 18,103 | 36,143 | +100% | 1 | 1 | 0% | 3,284 | 4,050 | +23% | 0 | 0 | — |
case-22 | pass→pass | 17,690 | 17,966 | +2% | 1 | 1 | 0% | 3,280 | 3,881 | +18% | 0 | 0 | — |
case-23 | pass→pass | 15,397 | 29,859 | +94% | 1 | 1 | 0% | 3,173 | 3,658 | +15% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +13 percentage points is the difference between those two pass rates over the 23 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.