solid-principles

Apply SOLID principles when designing classes, interfaces, and dependencies in object-oriented code.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/vnovakovits/claude-skills --skill solid-principles-vnovakovits
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: solid-principles
Source: https://github.com/vnovakovits/claude-skills/tree/main/plugins/engineering-practices/skills/solid-principles
Command: npx skills add https://github.com/vnovakovits/claude-skills --skill solid-principles-vnovakovits

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Object-oriented codebases accumulate design debt: god classes, fragile inheritance hierarchies, fat interfaces, and business logic welded to infrastructure. This Skill gives Claude a shared vocabulary and decision framework for applying the five SOLID principles, so class design and code reviews follow consistent, change-friendly heuristics. ## Core Features & Use Cases - Principle-by-principle guidance: Intent, bad/good C# examples, common pitfalls, and explicit "when to relax" criteria for SRP, OCP, LSP, ISP, and DIP. - Smell detection catalog: Maps concrete code smells (switch-on-type, NotSupportedException overrides, new in business logic) to the specific principle being violated. - Review checklist: A quick per-class questionnaire covering actors, substitutability, interface usage, dependency direction, and testability. - Use Case: Ask Claude to "review this class against SOLID" and it will identify violations such as an Employee class serving three actors (SRP) or an OrderService instantiating a concrete SqlOrderRepository (DIP), then suggest concrete refactorings. ## Quick Start Ask Claude to review this class against the SOLID principles and suggest refactorings for any violations it finds.

Frequently Asked Questions about solid-principles

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

FAQPage Schema
How do I apply SOLID principles when reviewing object-oriented code?▼

Review each class against five checks: one actor per class (SRP), extension without modification (OCP), substitutable subtypes (LSP), client-specific interfaces (ISP), and high-level policy depending on abstractions (DIP). The Skill provides a checklist and smell catalog for this.

What is the difference between Dependency Inversion and Dependency Injection?▼

Dependency Inversion is a design principle about which direction dependencies point: both high-level and low-level modules depend on abstractions. Dependency Injection is a technique for supplying dependencies, such as constructor injection. You can have DI without DIP.

When should I not apply the SOLID principles?▼

Relax SOLID when the design tension it addresses is not real: stable code with one actor, variations that never materialize, internal classes with a single client, value objects, and throwaway scripts. Premature abstraction creates more pain than it prevents.

Why does the Rectangle/Square inheritance violate Liskov Substitution?▼

Square changes Rectangle's invariant that width and height are independent, so a caller mutating a Rectangle breaks when given a Square. Subtypes must preserve parent invariants and postconditions; model them as separate types or immutable shapes instead.

What code smells indicate a SOLID violation?▼

Common signals include god classes (SRP), switch statements on type (OCP), type-checks in polymorphic code or NotSupportedException overrides (LSP), fat interfaces with unused methods (ISP), and `new` for infrastructure inside business logic (DIP).