Skip to content
Back to skills

Solid Principles

ASecurity

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).

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentsgorefactoring

Works with

  • cli

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add vectora-os/kit --skill solid-principles --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Solid Principles?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Solid Principles
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectora-os-solid-principles/badge)](https://www.skillsdirectory.com/skills/vectora-os-solid-principles)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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.
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.