SOLID Principles

Enforces the five SOLID design principles in Java Spring Boot code.

Updated May 12, 2026
One-click install
npx skills add https://github.com/ZzZueszZ/claude-kit --skill solid-principles-zzzueszz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: SOLID Principles
Source: https://github.com/ZzZueszZ/claude-kit/tree/main/.claude/skills/solid-principles
Command: npx skills add https://github.com/ZzZueszZ/claude-kit --skill solid-principles-zzzueszz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Java Spring Boot codebases often accumulate design violations such as god controllers, fat interfaces, and tightly coupled services, making them hard to maintain and extend. This Skill provides mandatory rules and concrete code examples to keep every class aligned with the five SOLID principles. ## Core Features & Use Cases - SRP Enforcement: Separates HTTP handling, business logic, and data access across Controller, Service, and Repository layers with correct and incorrect code examples. - OCP, LSP, ISP, DIP Guidance: Shows Strategy pattern usage, safe inheritance contracts, segregated interfaces, and interface-based dependency injection with Spring profiles. - Pre-commit Checklist: Provides a review checklist to verify each principle before committing code. - Use Case: When writing a new pricing feature, apply the Strategy pattern example to add a new pricing type without modifying existing service code. ## Quick Start Review my Spring Boot service and controller code against the SOLID principles and point out any violations.

Frequently Asked Questions about SOLID Principles

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

FAQPage Schema
How do I apply SOLID principles in a Spring Boot project?▼

Apply SOLID in Spring Boot by keeping controllers limited to HTTP handling, services to business logic, and repositories to data access. Use strategy interfaces for extensible behavior and inject interfaces rather than concrete classes via constructor injection.

How to avoid god controllers in Spring Boot?▼

Avoid god controllers by moving validation, business logic, and data access out of the controller layer. The controller should only map requests and responses, delegating work to a service that coordinates repositories and other components.

Should I inject interfaces or concrete classes in Spring?▼

Inject interfaces, not concrete classes, to follow the Dependency Inversion Principle. Spring selects the implementation through profiles or qualifiers, letting you swap implementations such as SMTP and mock email services without changing the consuming service.

When should I use the Strategy pattern instead of if-else chains?▼

Use the Strategy pattern when adding new behavior variants would require modifying existing code, such as pricing types. Each variant becomes a component implementing a shared interface, so new strategies are added without editing existing classes.

What are signs of violating the Interface Segregation Principle?▼

Violations appear when implementations throw UnsupportedOperationException for interface methods they do not need, such as a read-only storage forced to implement delete. Split fat interfaces into small, specialized ones so classes implement only what they use.