This is a practical reference for applying SOLID principles during code reviews and refactoring sessions. It gives you concrete Java examples of each principle with before/after code, so you can spot violations like classes doing too much or switch statements that keep growing. The quick reference table and "how to detect" sections make it easy to use when you're actually reviewing pull requests or explaining why a 500-line service class needs to be broken up. The examples are clear enough that you could point a junior developer to specific sections when teaching design patterns. It won't make architectural decisions for you, but it's a solid checklist when you need to justify refactoring work or catch design smells before they ship.

skills.sh installs
384
GitHub stars
771
last updated
Feb 8, 2026

Install

$ npx -y skills add decebals/claude-code-java --skill solid-principles --agent claude-code

Installs into .claude/skills of the current project.

Files

SOLID Principles Skill

Review and apply SOLID principles in Java code.

When to Use

  • User says "check SOLID" / "SOLID review" / "is this class doing too much?"
  • Reviewing class design
  • Refactoring large classes
  • Code review focusing on design

Quick Reference

LetterPrincipleOne-liner
SSingle ResponsibilityOne class = one reason to change
OOpen/ClosedOpen for extension, closed for modification
LLiskov SubstitutionSubtypes must be substitutable for base types
IInterface SegregationMany specific interfaces > one general interface
DDependency InversionDepend on abstractions, not concretions

S - Single Responsibility Principle (SRP)

"A class should have only one reason to change."

Violation

// ❌ BAD: UserService does too much
public class UserService {

    public User createUser(String name, String email) {
        // validation logic
        if (email == null || !email.contains("@")) {
            throw new IllegalArgumentException("Invalid email");
        }

Sponsors

Details

Repository
github.com/decebals/claude-code-java
Categories
Code Review & Quality, Java & JVM
License
MIT
First seen
Jun 11, 2026

More from decebals/claude-code-java

All 18
1levnikolaevich avatarln-301-task-creatorlevnikolaevich/claude-code-skillsCreates implementation, refactoring, and test tasks from templates. Use when an approved task plan needs tasks created via the configured tracker provider and r383skills.sh installs
2jwynia avatarresearchjwynia/agent-skillsDiagnose research quality and guide systematic query expansion. Use when starting research on any topic, when stuck in research, or when unsure if research is c382skills.sh installs
3davila7 avatarpydicomdavila7/claude-code-templatesPython library for working with DICOM (Digital Imaging and Communications in Medicine) files. Use this skill when reading, writing, or modifying medical imaging381skills.sh installs
4heygen-com avatarheygen-skillsheygen-com/skillsCreate HeyGen avatar videos via the v3 Video Agent pipeline — handles avatar resolution, aspect ratio correction, prompt engineering, and voice selection automa381skills.sh installs
5inertia-rails avataralba-inertiainertia-rails/skillsAlba serializers + Typelizer for type-safe Inertia Rails props with auto-generated TypeScript types. Use when serializing models for Inertia responses, setting 381skills.sh installs
6reviewstage avatarstage-chaptersreviewstage/stage-cliGenerate Stage chapters for the current local git branch and open them in a browser for review.381skills.sh installs