solid-principles

Detect and resolve SOLID violations in TypeScript codebases with refactor patterns.

Updated Feb 5, 2026
One-click install
npx skills add https://github.com/benaor/Virtus --skill solid-principles-benaor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: solid-principles
Source: https://github.com/benaor/Virtus/tree/main/.claude/skills/design-principles/SOLID
Command: npx skills add https://github.com/benaor/Virtus --skill solid-principles-benaor

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

SOLID principles guide TypeScript code reviews and refactoring to reduce coupling, improve maintainability, and strengthen architecture.

Core Features & Use Cases

  • Enforce Single Responsibility across modules to limit changes and increase readability.
  • Detect Open/Closed and Liskov Substitution violations and provide concrete before/after patterns.
  • Address Interface Segregation and Dependency Inversion with targeted refactors shown in the references.

Quick Start

Review a TypeScript codebase against SOLID principles and follow the references to perform focused refactors.

Frequently Asked Questions about solid-principles

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

FAQPage Schema
How do I identify SOLID principle violations in a TypeScript codebase?

To identify SOLID violations in a TypeScript codebase, review your modules, classes, and hooks against SRP, OCP, LSP, ISP, and DIP guidelines. This process uses a structured checklist and concrete examples to detect coupling and architectural issues.

What is the best way to refactor TypeScript code to fix Interface Segregation violations?

The best way to refactor for Interface Segregation violations is to apply targeted refactors that split bloated interfaces into smaller, specific ones. Using concrete before and after patterns ensures classes only implement the methods they actually need.

How does Liskov Substitution apply to TypeScript class design?

Liskov Substitution in TypeScript class design ensures subtypes can replace their base types without altering program correctness. Detecting LSP violations involves checking inheritance structures and applying concrete fix patterns to maintain behavioral compatibility.

Can I use this SOLID review workflow for React hooks?

Yes, you can use this SOLID review workflow for React hooks. The violation detection and fix patterns explicitly target modules, classes, and hooks, allowing you to enforce Single Responsibility and Dependency Inversion in your custom hooks.

When should I enforce Single Responsibility Principle during a code review?

You should enforce the Single Responsibility Principle during a code review when modules have multiple reasons to change. Applying SRP guidelines limits modification scope, reduces coupling, and increases overall code readability.

What are common Dependency Inversion violations in TypeScript architecture?

Common Dependency Inversion violations in TypeScript architecture occur when high-level modules directly depend on low-level modules rather than abstractions. Detecting these issues involves analyzing module coupling and applying targeted refactors to inject dependencies.