
Solid Principles
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-codeInstalls 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
| Letter | Principle | One-liner |
|---|---|---|
| S | Single Responsibility | One class = one reason to change |
| O | Open/Closed | Open for extension, closed for modification |
| L | Liskov Substitution | Subtypes must be substitutable for base types |
| I | Interface Segregation | Many specific interfaces > one general interface |
| D | Dependency Inversion | Depend 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- Architecture Review374
- Design Patterns372
- Spring Boot Patterns358
- Java Migration357
- Security Audit347
- Performance Smell Detection341
- Test Quality336
- Api Contract Review315
- Maven Dependency Audit308
- Logging Patterns300
- Jpa Patterns297
- Changelog Generator251
- Git Commit249
- Issue Triage240
- Java Code Review1.1K
- Clean Code427
- Concurrency Review384