agentleFS
jgamaraalvjgamaraalv/delivery-loop/.claude/skills/components-composition-patterns/SKILL.md

components-composition-patterns

Skill0 starsChanged 4 months agoMITView on GitHub

React composition patterns that scale — compound components, render props, context providers, lifting state. Use when refactoring boolean-prop-heavy components or designing flexible, reusable component APIs (incl. React 19)

The file

Files
SKILL.md

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.

Rule Categories by Priority

PriorityCategoryImpactPrefixReference
1Component ArchitectureHIGHarchitecture-references/component-architecture.md
2State ManagementMEDIUMstate-references/state-management.md
3Implementation PatternsMEDIUMpatterns-references/implementation-patterns.md
4React 19 APIsMEDIUMreact19-references/react19-apis.md

References

Each file is loaded on demand — read one only when the task needs that depth (progressive disclosure).

  • references/component-architecture.md — avoiding boolean-prop proliferation and structuring compound components with shared context · read when a component has accumulated boolean modes or you're designing a flexible multi-part component API.
  • references/state-management.md — lifting state into providers, generic context interfaces for dependency injection, decoupling state from UI · read when sibling components need shared state, or you want the same UI to work across different state implementations.
  • references/implementation-patterns.md — explicit variant components over boolean modes, and children over render props · read when choosing between variant components vs. props, or between children and renderX callbacks.
  • references/react19-apis.md — ref as a regular prop (no forwardRef) and use() instead of useContext() · read when targeting React 19+ and refactoring refs or context usage.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.