solid

Analyze and refactor PHP and TypeScript code for SOLID principle violations.

Updated Jun 19, 2023
One-click install
npx skills add https://github.com/JeroenJochems/modelwise --skill solid-jeroenjochems
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: solid
Source: https://github.com/JeroenJochems/modelwise/tree/main/.claude/skills/solid
Command: npx skills add https://github.com/JeroenJochems/modelwise --skill solid-jeroenjochems

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps developers write more maintainable, flexible, and robust object-oriented code by identifying and refactoring violations of the SOLID design principles.

Core Features & Use Cases

  • Violation Detection: Analyzes code for violations of Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion principles.
  • Refactoring Guidance: Provides specific refactoring patterns and actionable steps to fix identified issues.
  • Use Case: When reviewing a complex class that has grown over time, use this Skill to pinpoint which SOLID principles are being violated and get clear instructions on how to refactor it into smaller, more manageable components.

Quick Start

Analyze the provided code snippet for SOLID principle violations.

Frequently Asked Questions about solid

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

FAQPage Schema
How do I refactor code to fix SOLID principle violations?

To detect SOLID design principle violations, analyze your object-oriented code for classes that handle multiple responsibilities, resist extension without modification, or violate interface segregation and dependency inversion, providing specific refactoring patterns for each identified issue.

Why does my class violate the Single Responsibility Principle and how do I split it?

Your class violates the Single Responsibility Principle when it handles multiple unrelated tasks or changes for different reasons. You resolve this by refactoring the class into smaller, more manageable components, each responsible for a single specific behavior.

Can I use this to analyze TypeScript and PHP code for design pattern issues?

Yes, you can analyze TypeScript and PHP code for design pattern issues. The analysis targets developers in these languages to enhance code quality, maintainability, and extensibility by pinpointing SOLID infractions and providing actionable guidance.

What is the best way to identify Liskov Substitution and Interface Segregation violations?

The best way to identify Liskov Substitution and Interface Segregation violations is to analyze the code for subclasses that cannot replace their parents without breaking behavior, and for interfaces that force clients to depend on methods they do not use.

When do I need to refactor for object-oriented design maintainability?

You need to refactor for object-oriented design maintainability when a complex class has grown over time, becoming difficult to manage, inflexible to extension, or heavily coupled, requiring specific refactoring patterns to restore robust architectural boundaries.