composition-over-inheritance

Installation
SKILL.md

Composition Over Inheritance

Overview

Favor object composition over class inheritance.

Inheritance creates tight coupling and rigid hierarchies. Composition creates flexible, reusable components that can be mixed and matched.

When to Use

  • Designing relationships between classes
  • Tempted to use extends
  • Class needs behavior from multiple sources
  • Creating "is-a" relationships
  • Building class hierarchies

The Iron Rule

Related skills
Installs
29
GitHub Stars
10
First Seen
Jan 22, 2026