Compose the structure
Replace overlapping boolean modes with named variants and compound components. Use children to show exactly what each interface contains.
Flexible component APIs
Turn a component full of mode flags into explicit pieces you can read, share and compose.
8 GUIDELINESORIGINAL SOURCEMITEXPLICIT PARTS / SHARED CONTRACT
Different interfaces.
One shared state contract.
What changes
Replace overlapping boolean modes with named variants and compound components. Use children to show exactly what each interface contains.
Separate state management from the UI. A provider exposes state, actions and metadata so the same pieces can work with different implementations.
Bring
React version, existing code, required variants, state ownership, keyboard behavior and a list of behavior that must stay the same.
Receive
Source changes, explicit variants, shared pieces and a reasoned provider boundary. A capable coding assistant applies the guidance; this package is not an automatic refactoring executable.
Evidence in context

Read SKILL.md, then the relevant rules or the full compiled AGENTS.md. The package contains instructions and examples, with no required package install or vendor API key of its own. A compatible assistant, source access and model access are still required; model usage may have separate costs.
use() and ref as a prop. Skip those examples for older React. useContext() remains a supported React API. Examples contain app-specific components and hooks that you must supply.Source: vercel-labs/agent-skills · composition-patterns
Commit: 1a2c79d4e6c4a2283dc2c614b6538cbe1ed5ca62. The upstream Skill and repository README declare MIT. All original attribution is retained; the pinned upstream does not contain a standalone LICENSE file.