← ClaudeAtlas

solid-principleslisted

Apply and review SOLID in this repo's Java — the detection heuristics per principle, the refactoring that fixes each one, and the real examples in data, adopt, context and mcp-common. Use when reviewing class design, refactoring a large class, or when the user says "check SOLID", "is this class doing too much?", or names one of the five principles.
adamw7/tools · ★ 11 · DevOps & Infrastructure · score 74
Install: claude install-skill adamw7/tools
# SOLID Principles Skill Review and apply SOLID in the `tools` reactor. The heuristics below are the fast path; long before/after code lives in **`examples.md`** next to this file — load it only when a worked example would actually help. ## 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 beat one general one | | **D** | Dependency Inversion | Depend on abstractions, not concretions | --- ## S — Single Responsibility > One reason to change. **Detect**: imports from unrelated domains · a name containing "And", "Manager" or "Handler" · methods that use none of the fields · you cannot describe the class in one sentence without "and". **Fix**: Extract Class / Move Method. **Here**: an `AdoptionStep` is one stage of the adoption and nothing else; `ClaudeCodeEnforcerRule.report(...)` is the one exit point every enforcer rule funnels its violations through; the uniqueness core knows nothing about its MCP adapter (ArchUnit fails the build if it learns). --- ## O — Open/Closed > New behaviour arrives as a new class, not an edit to an old one. **Detect**: an `if/else` or `switch` on a type or status that keeps growing · adding a feature means editing a core class.