SOLID and core design heuristics — single responsibility, open/closed, Liskov substitution, interface segregation, dependency inversion; cohesion and coupling, composition over inheritance, recognizing code smells. Use in design and review of classes and modules (SOLID, code smells, cohesion, coupling, design principles).
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Solid Principles?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vectora-os-solid-principles)
---
name: solid-principles
description: SOLID and core design heuristics — single responsibility, open/closed, Liskov substitution, interface segregation, dependency inversion; cohesion and coupling, composition over inheritance, recognizing code smells. Use in design and review of classes and modules (SOLID, code smells, cohesion, coupling, design principles).
metadata:
category: design-patterns
---
# SOLID principles
## Purpose
Produce modules that are cohesive, loosely coupled and easy to change.
**Use when:** designing or reviewing classes, modules and interfaces.
**Not for:** justifying abstraction without a real variation.
## Inputs
- Code or design.
## Outputs
- Findings tied to principles with concrete refactorings.
## Read first
- [Project Brain](../../../project-brain/README.md) — `npm run brain -- query "solid principles"` for prior decisions, patterns and anti-patterns.
## Steps
1. **Responsibilities.** Name each module's reason to change.
Done when more than one reason is flagged.
2. **Dependencies.** Check that high-level code depends on abstractions it owns.
Done when inversions are identified.
3. **Interfaces.** Check interfaces are small and client-specific; subtypes honor contracts.
Done when LSP/ISP violations listed.
4. **Refactor.** Propose the smallest refactoring fixing each finding.
Done when each finding has a refactoring.
## Best practices
- Abstract on the second or third variation, not the first.
- Prefer composition.
## Common mistakes
- Interface for every class.
- Citing SOLID without a failure scenario.
## Example
`ReportService` formats, queries and emails → split into query, formatter, sender; email behind a port.
## Reusable prompt
```text
Apply the SOLID principles skill (.agents/skills/solid-principles/SKILL.md).
Context: {{task card or question; links to PRD, ADRs, code paths}}
Constraints: {{approved thresholds, deadlines, allowed files}}
Review the code against SOLID with concrete failure scenarios and propose minimal refactorings.
Return: Findings tied to principles with concrete refactorings..
Cite evidence (file:line, command output, source) for every claim; list open questions separately.
```