apply-solid
/apply-solid
Use when a class or module violates SOLID — an edit forces unrelated edits, a dependency needs a mock everywhere, an abstraction leaks — and you must apply the five principles at the class level.
- Author
- velimirmueller ↗
- Repository
- ai-development-skills ↗
- Licence
- MIT
- Last repository change
- 23.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 23.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Use when a class or module violates SOLID — an edit forces unrelated edits, a dependency needs a mock everywhere, an abstraction leaks — and you must apply the five principles at the class level.
Original author description
Use when a class or module violates SOLID — an edit forces unrelated edits, a dependency needs a mock everywhere, an abstraction leaks — and you must apply the five principles at the class level.
How it works
- The five
- 1. Audit (change nothing)
- 2. Apply the smallest fix
- 3. State the exception
- Verify
- When to deviate
SKILL.md preview
--- name: apply-solid description: Use when a class or module violates SOLID — an edit forces unrelated edits, a dependency needs a mock everywhere, an abstraction leaks — and you must apply the five principles at the class level. --- # Apply SOLID The five principles applied at the class and module level (Clean Architecture). The layer-level rules — dependencies point inward, boundaries at axes of change — are in [enforce-dependency-rule](../enforce-dependency-rule/SKILL.md). Object-design rules in [apply-design-principles](../apply-design-principles/SKILL.md). ## The five 1. **Single Responsibility** — a module has one reason to change, which means one *actor* it serves. Two actors (e.g. the billing team and the ops team) that share a class will fight over it. 2. **Open/Closed** — open for extension, closed for modification. Protect the high-level, stable components by pointing dependencies away from them; add behaviour by adding code, not editing the core. 3. **Liskov Substitution** — a subtype must be usable wherever its base type is, including the base's contract (preconditions not stronger, postconditions not weaker). LSP is about *behaviour*, not shape: a Square that breaks Rectangle's setters fails LSP even though it inherits. 4. **Interface Segregation** — depend only on what you use. A fat interface forces every client to recompile and re-mock for methods it never calls; split by client. 5. **Dependency Inversion** — depend on abstractions, not concretions. The abstraction is owned by the high-level policy; the detail (DB, web, framework) implements it and points inward. ## 1. Audit (change nothing) ```bash cat .claude/stack-profile.md 2>/dev/null | head -20 grep -rn "mock\|Mock\|stub" --include="*.ts" --include="*.rs" --include="*.go" --include="*.py" . 2>/dev/null | head -20 ``` Find the violation, not the abstraction: a class that changed for two unrelated tickets (SRP), a change that forced edits to a stable core (OCP), a subtype that throws "not supported" (LSP), an interface with methods most clients leave empty (ISP), a policy module importing a vendor SDK directly (DIP). ## 2. Apply the smallest fix - SRP: extract the second actor's responsibility into its own class/module. - OCP: add a seam (a function parameter, a registry, an interface) so the new case is an addition. - LSP: fix the contract, or drop the inheritance and use composition (see [apply-design-principles](../apply-design-principles/SKILL.md)). - ISP: split the interface by client; a client depends only on the slice it uses. - DIP: move the abstraction up into the policy and have the detail import it. ## 3. State the exception SOLID is a means to a maintainable boundary, not a purity test. If a principle's ceremony outweighs the churn it prevents in this codebase, say which and why. ## Verify The edit that used to touch two unrelated places now touches one; a new case landed as an addition, not a modification; the mock that was needed everywhere now appears once at the seam. State the principle violated and the fix in the note. ## When to deviate - Small, single-actor modules where a full abstraction is premature. - Framework or library code whose contract is fixed by the vendor.
Versions
The database has no other skills named apply-solid.
Database snapshot: 13.11.2026 · package version 7a77c843cab1 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 95solid-principles
SOLID principles checklist with Java examples. Use when a class has too many responsibilities, an abstraction leaks, or a dependency points the wrong way, and when the user asks about Single Responsibility, Open/Closed, Liskov, Interface Segregation or Dependency Inversion. For… - 100solid-principles
Audits code for adherence to the five SOLID principles and reports violations with concrete fixes. Use when reviewing class design, dependency structure, or object-oriented quality. - 90solid-principles
Apply the SOLID principles as design diagnostics, detecting god classes, fragile hierarchies, fat interfaces, and hard-wired dependencies, and prescribing the smallest structural fix rather than imposing ceremony. Use when designing a new module or class, reviewing… - 100solid-principles-code-review-compliance
Use this skill when review object-oriented architectures for compliance with SOLID software design principles. - 100solid-principles
This skill should be used when the user asks to "check SOLID violations", "audit class design", "review code quality", "find design smells", or "improve object-oriented architecture". Also triggers when the user mentions a principle by name (e.g., "check SRP", "is this violating… - 100engineering-principles
Use whenever writing, designing, refactoring, or judging code quality — applies the 10 good coding principles (coding standards, documentation, robustness, SOLID, testability, moderate abstraction, design patterns, fewer global dependencies, continuous refactoring, security)…