From java-core
Checks Java code for SOLID principles violations using patterns like multi-duty managers, if/else type chains, concrete dependencies, and empty interface methods. Suggests refactors.
How this skill is triggered — by the user, by Claude, or both
Slash command
/java-core:java-solidThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Review the provided Java code for SOLID principles violations. For each principle, check for violations and suggest targeted improvements. Tailor suggestions to the detected Java version.
Review the provided Java code for SOLID principles violations. For each principle, check for violations and suggest targeted improvements. Tailor suggestions to the detected Java version.
A class should have one reason to change.
Violations to flag:
*Manager, *Helper, *Utils with more than 3 unrelated methodsFix pattern: Extract each responsibility into its own class. Show the split.
Open for extension, closed for modification.
Violations to flag:
if/else or switch chains on type/status that would require modification to add new typesFix pattern: Introduce Strategy, Template Method, or polymorphism. Show the refactoring.
Subtypes must be substitutable for their base types.
Violations to flag:
UnsupportedOperationExceptionFix pattern: Use composition over inheritance, or restructure the hierarchy.
Clients should not depend on interfaces they don't use.
Violations to flag:
implements classes that leave methods empty or throw UnsupportedOperationExceptionFix pattern: Split the fat interface into focused role interfaces.
Depend on abstractions, not concretions.
Violations to flag:
new UserServiceImpl) instead of an interface (UserService)new ConcreteClass() inside business logic instead of dependency injection@Autowired on a concrete class field instead of an interfaceFix pattern: Introduce interface + constructor injection. Show the change.
For each violation:
End with: SOLID Score — how many of the 5 principles are cleanly satisfied (e.g., "3/5 — S, I, D pass; O and L need attention").
/java-design-pattern to find the right pattern/java-refactor to extract interfaces/java-refactor to split classesnpx claudepluginhub ducpm2303/claude-java-plugins --plugin java-coreSOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion) for object-oriented design.
Applies SOLID principles to OOP code to reduce coupling, improve testability, and make change safe. Use when classes accumulate unrelated responsibilities or changes ripple unexpectedly.
Reviews and refactors object-oriented code for SOLID compliance across PHP, Java, Python, TypeScript, and C++. Detects violations, suggests fixes, and explains trade-offs.