fundamentals/oop-pillars

Evaluate class designs for abstraction, encapsulation, inheritance, and polymorphism.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/johnnystefan/test-saas-business --skill fundamentals-oop-pillars
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fundamentals/oop-pillars
Source: https://github.com/johnnystefan/test-saas-business/tree/main/skills/fundamentals/oop-pillars
Command: npx skills add https://github.com/johnnystefan/test-saas-business --skill fundamentals-oop-pillars

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about fundamentals/oop-pillars

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I evaluate class designs to fix brittle object-oriented hierarchies?

Yes, replacing type switches with polymorphic logic eliminates brittle conditional code by enforcing context-specific abstraction and polymorphic interfaces. This allows your TypeScript or other OO codebases to route behavior through object structures rather than sprawling switch statements.

What is the best way to enforce encapsulation when auditing TypeScript class designs?

The best way to enforce encapsulation when auditing TypeScript class designs is to recommend private or protected members alongside getters and setters. This protects internal state and promotes safe interactions through strict interface contracts.

How do I check if my inheritance expresses a true is-a relationship?

To check if your inheritance expresses a true is-a relationship, evaluate your class hierarchies to confirm that derived classes genuinely represent subtypes. This prevents poor class designs and ensures your object-oriented abstraction remains logically valid.

Can I use this OOP review approach for a reservation system with customer and payment entities?

Yes, you can use this OOP review approach for a reservation system to ensure customer, booking, and payment entities are structured with appropriate abstractions. It validates that these classes use polymorphic behavior instead of sprawling switch statements.