What problem does it solve?
This skill prevents brittle object-oriented code by guiding you to apply abstraction, enforce encapsulation, and replace conditional logic with polymorphism when designing class hierarchies.
Core Features & Use Cases
- Guided Abstraction: Focus each class on relevant data and behavior for its context so responsibilities remain clear and cohesive.
- Encapsulation Enforcement: Recommend private or protected members, getters/setters, and interface contracts to protect internal state and promote safe interactions.
- Inheritance & Polymorphism Checks: Confirm that inheritance expresses true is-a relationships and that conditional switches are replaced with polymorphic implementations.
- Use Case: When auditing a reservation system, use this Skill to ensure customer, booking, and payment entities are structured with appropriate abstractions and polymorphic behavior instead of sprawling switch statements.
Quick Start
Evaluate the reservation handler to ensure abstraction, encapsulation, inheritance, and polymorphism are properly applied.