Agent skill

composition-over-inheritance

Prefer composition (has-a) over inheritance (is-a) Use when designing system architecture. Architecture category skill.

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/composition-over-inheritance

Metadata

Additional technical details for this skill

category
Architecture
priority
medium
is built in
YES
session guardian id
builtin_composition_over_inheritance

SKILL.md

Composition Over Inheritance

Prefer composition (has-a) over inheritance (is-a). Inheritance creates tight coupling and fragile base class problems. Compose objects from smaller, focused pieces. Use interfaces to define contracts. JavaScript/TypeScript mixins or object composition enable flexible code reuse without deep hierarchies. Reserve inheritance for true "is-a" relationships with shared behavior.

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results