refactoring/generalization
CommunityTidy class hierarchies for maintainable design
Software Engineering#refactoring#interfaces#inheritance#delegation#code-deduplication#template-method#class-hierarchies
Authorjohnnystefan
Version1.0.0
Installs0
System Documentation
What problem does it solve?
It rescues tangled inheritance trees and duplicated logic by prescribing how to realign behaviors, fields, and contracts between superclasses and subclasses for clearer architecture and easier maintenance.
Core Features & Use Cases
- Optimize hierarchies: Pull up shared fields, methods, and constructor code when subclasses repeat logic, or push down behaviors that only belong to specific descendants.
- Structure shared interfaces: Extract interfaces, superclasses, or template methods to codify common algorithms and ensure clients depend on the right abstraction.
- Switch relationships intelligently: Replace inheritance with delegation when a subclass uses only part of a parent API, or embrace inheritance when delegation merely duplicates every method, using the membership service or booking system as practical examples.
Quick Start
Ask to refactor the membership service by pulling shared validation into a superclass and defining a billing interface.
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: refactoring/generalization Download link: https://github.com/johnnystefan/test-saas-business/archive/main.zip#refactoring-generalization 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 471,000+ vetted skills library on demand.