solid-principles

A guide to the five SOLID principles, which are rules for organizing object-oriented code so parts can change and be tested with fewer side effects. It adapts those principles to TypeScript, including interfaces, union types, and plain functions.

In plain words
What is it for?
Use it when designing or refactoring classes and modules, reviewing design problems, splitting responsibilities, adding abstractions, or evaluating object-oriented TypeScript design.
Why use it?
It helps identify rigid, fragile, or tightly connected code and suggests smaller changes that reduce the cost of future modifications.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/opagani/cassini-workshop/solid-principles
Any agent
npx skills add opagani/cassini-workshop --skill solid-principles
Clone the repo
git clone --depth 1 https://github.com/opagani/cassini-workshop

Made for: Claude Code, Codex.

Per session 97 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 991 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00097 $0.00991
Opus 5 $0.00048 $0.00495
Sonnet 5 $0.00019 $0.00198
Haiku 4.5 $0.00010 $0.00099

Measured yesterday against content hash 8d5f21c036da, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

solid-principles scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to solid-principles — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/skills/solid-principles/SKILL.md · 83 lines

How it starts

The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SOLID Principles in TypeScript

Five principles of object-oriented design (Robert C. Martin) that keep code flexible, testable, and resistant to rot — adapted to idiomatic TypeScript, where interfaces, structural typing, union types, and plain functions often satisfy a principle without ceremony.

🎯 Why: Design for Change

The goal of writing software is to be able to change it safely. SOLID is the OO toolkit for that goal: SRP limits what changes when a reason to change appears, OCP lets you extend without editing tested code, LSP keeps substitutions safe, ISP keeps consumers from breaking on unrelated changes, DIP lets you swap implementations without rewriting policy. Every rule below earns its keep only if it shrinks the next diff.

How to use this skill

  1. Match the symptom in the decision guide below to a principle.
  2. Open references/principles.md for the full before/after TypeScript example and the "when this is over-engineering" note for that principle.
  3. Apply the smallest change that removes the actual pain. SOLID is a response to demonstrated change pressure, not a checklist to apply preemptively. A 30-line app does not need an interface per class.

Reference file

  • references/principles.md — all five principles (SRP, OCP, LSP, ISP, DIP) with motivation, a bad example, a refactor, TypeScript-specific notes, and when not to apply each.

The five principles

Letter Principle One-line intent
S Single Responsibility A class/module should have one reason to change.
O Open/Closed Open for extension, closed for modification.
L Liskov Substitution Subtypes must be usable wherever their base type is expected.
I Interface Segregation Many small client-specific interfaces beat one fat one.
D Dependency Inversion Depend on abstractions, not concretions.

Decision guide — symptom → principle

You notice… Apply Letter
A class changes for unrelated reasons (DB + formatting + business rules) Single Responsibility S
Adding a new "type" means editing a growing switch/if-else Open/Closed O
A subclass throws on, no-ops, or weakens a method it inherited Liskov Substitution L
Implementers are forced to stub methods they don't use Interface Segregation I
Business logic imports a concrete DB/HTTP/SDK client directly Dependency Inversion D
Unit tests need a real database, network, or clock Dependency Inversion D
One change ripples across many unrelated files Single Responsibility S
instanceof chains decide behavior Open/Closed (often Strategy/polymorphism) O

Read the full file on GitHub · 83 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 83 lines · 97 tokens per session scan A 8d5f21c036da

Subscribe to this mod's changes

solid-principles is a skill published in the GitHub repository opagani/cassini-workshop (0 stars, last pushed 2mo ago), licensed MIT. It adds 97 tokens to every session and 991 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to solid-principles, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

MisakaNet

Skill "MisakaNet" from Ikalus1988/MisakaNet, covering misakanet-failure-memory, when to use this skill, recovery flow, tools and search for lessons.

Ikalus1988/MisakaNet · 0 tokens

hono-cloudflare

Hono on Cloudflare Workers - bindings, KV, D1, R2, Durable Objects, and edge deployment patterns.

bobmatnyc/claude-mpm-skills · 29 tokens

changelog-writer

This skill should be used when the user asks to "add a changelog entry", "write changelog", "audit changelog", "review changelog", "check changelog entries", or is editing docs-mintlify/changelog.mdx. Enforces a consistent, reader-facing voice and cuts implementation trivia.

pdugan20/rewind · 68 tokens

add-media

This skill should be used when the user asks to "add a movie", "add a vinyl", "add to my collection", "add physical media", "add a Blu-ray", "add a CD", or "bought these records". It handles both movies (via TMDb/Trakt) and music (via Discogs).

pdugan20/rewind · 71 tokens

media-search

This skill should be used when the user asks to "search for a movie", "find a record on Discogs", "look up a film", "search TMDb", "search Discogs", "what's the TMDb ID for", "what's the Discogs ID for", or wants to look up media metadata before adding it to the collection.

pdugan20/rewind · 75 tokens

senado-br

Pesquisa de dados abertos do Senado Federal do Brasil via o MCP senado-br (67 ferramentas): senadores, matérias e projetos de lei, votações nominais, comissões, plenário, discursos, blocos e lideranças, legislação federal, vetos, e o portal e-Cidadania (consultas públicas, ideias legislativas, eventos), além de dados…

SidneyBissoli/senado-br-mcp-cloudflare · 197 tokens