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.
npx claudepluginhub ducpm2303/claude-java-plugins --plugin java-coreThis skill is limited to using the following tools:
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.
SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion) for object-oriented design.
Reviews object-oriented code for SOLID principles, DRY violations, composition vs inheritance choices, and Gang of Four design pattern applicability. Use when evaluating new or modified OO designs.
Analyzes PHP codebases for SOLID violations: God classes (SRP), type switches (OCP), LSP contract breaks, fat interfaces (ISP), concrete dependencies (DIP). Outputs severity-rated reports with remediation steps.
Share bugs, ideas, or general feedback.
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 classes