clean-code-ch10-classes

Detect class design defects like SRP violations and low cohesion.

4|Updated Mar 28, 2026
One-click install
npx skills add https://github.com/hatlesswizard/clean-code-skills --skill clean-code-ch10-classes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code-ch10-classes
Source: https://github.com/hatlesswizard/clean-code-skills/tree/main/ch10-classes
Command: npx skills add https://github.com/hatlesswizard/clean-code-skills --skill clean-code-ch10-classes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams enforce clean, maintainable class design by detecting violations of Single Responsibility Principle, cohesion, encapsulation, and the Open/Closed Principle.

Core Features & Use Cases

  • Detects violations such as God Class, multiple reasons to change, and low cohesion.
  • Guides refactoring to create small, cohesive, single-responsibility classes and to improve dependency management via DIP when needed.
  • Useful for code reviews, architecture audits, and training teams on solid object-oriented design.

Quick Start

Run the skill against your codebase to generate a report of design violations and suggested refactorings.

Frequently Asked Questions about clean-code-ch10-classes

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

FAQPage Schema
How do I detect God Class and Single Responsibility Principle violations in my codebase?

Run this skill against your codebase to scan for God Class and Single Responsibility Principle (SRP) violations. It identifies classes with multiple reasons to change and low cohesion, providing concrete refactoring guidance to split them into cohesive, single-responsibility modules.

What is the best way to refactor a class with low cohesion and weak encapsulation?

The best way to refactor classes with low cohesion and weak encapsulation is to use targeted refactoring guidance that breaks them into small, cohesive modules. This skill analyzes your design defects and suggests structural changes to enforce stronger encapsulation and single responsibilities.

Can I use this class design analysis on medium and large-scale codebases?

Yes, this class design analysis is applicable to medium- and large-scale codebases where refactoring is needed. It evaluates structural design to identify dependency inversion concerns and wrong abstraction levels, outputting actionable refactoring guidance for complex projects.

When do I need to check for Open/Closed Principle and dependency inversion concerns?

You need to check for Open/Closed Principle and dependency inversion concerns during code reviews and architecture audits. This skill helps enforce maintainable object-oriented design by detecting these structural flaws and guiding dependency management improvements via DIP.

Why does my class have multiple reasons to change during code reviews?

Your class has multiple reasons to change because it violates the Single Responsibility Principle by handling too many concerns. This skill detects these design defects and provides refactoring guidance to split the class into smaller, single-responsibility modules.