composition-over-inheritance
CommunityEmphasize composition over inheritance.
Authoryanko-belov
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Inheritance creates tight coupling and rigid hierarchies. This Skill promotes composition to build flexible, reusable components that can be mixed and matched.
Core Features & Use Cases
- Encourages defining capabilities as interfaces or small composable units and injecting them into classes instead of extending concrete parents.
- Helps restructure class relationships by extracting shared behavior into composable components.
- Use Case: convert an is-a inheritance hierarchy into a set of behaviors that can be combined to form diverse objects.
Quick Start
Define small, reusable capabilities as interfaces or simple objects; compose them into concrete classes by wiring the behaviors; and gradually refactor existing inheritance-heavy code to rely on composition.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: composition-over-inheritance Download link: https://github.com/yanko-belov/code-craft/archive/main.zip#composition-over-inheritance Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.