solid-interface-segregation

A design guide for the Interface Segregation Principle, which says that software interfaces should contain only closely related operations. An interface is a contract describing what a component can do.

In plain words
What is it for?
It helps find oversized interfaces, group operations by the clients that need them, and split them into smaller role-specific contracts.
Why use it?
It prevents components from depending on methods they never use, reducing unnecessary changes, empty implementations and test work.

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/helmedeiros/clean-code-skills/solid-interface-segregation
Any agent
npx skills add helmedeiros/clean-code-skills --skill solid-interface-segregation
Clone the repo
git clone --depth 1 https://github.com/helmedeiros/clean-code-skills

Made for: Claude Code, Codex.

Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 676 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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.00048 $0.00676
Opus 5 $0.00024 $0.00338
Sonnet 5 $0.00010 $0.00135
Haiku 4.5 $0.00005 $0.00068

Measured 2d ago against content hash 436d7ec5a39a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

solid-interface-segregation 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 2d ago.

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.

skills/solid-interface-segregation/SKILL.md · 76 lines

How it starts

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

SOLID: Interface Segregation Principle

Design small, focused interfaces so that clients depend only on the methods they actually use, avoiding forced dependencies on irrelevant functionality.

When This Skill Applies

  • An interface has methods that some implementors leave empty or throw NotImplementedException
  • Clients import an interface but only call a subset of its methods
  • The user mentions ISP, interface segregation, or fat interfaces
  • Changing one interface method forces recompilation or retesting of unrelated clients
  • Mock objects in tests implement many methods just to satisfy the interface

Core Principle

No client should be forced to depend on methods it does not use. Large, general-purpose interfaces create coupling between unrelated clients. When one client needs a change to the interface, other clients are affected even though they do not use the changed method. Split fat interfaces into smaller, role-specific ones.

Workflow

Step 1: Identify the Fat Interface

Find interfaces with many methods where different clients use different subsets. Look for implementors that leave methods empty or throw exceptions.

Step 2: Group Methods by Client

Identify which clients call which methods. Group methods that are always used together. Each group becomes a candidate for a separate interface.

Step 3: Define Role Interfaces

Create a focused interface for each group. Name each interface after the role it represents: Readable, Writable, Closeable instead of one FileOperations.

Step 4: Update Implementors

Classes that previously implemented the fat interface now implement the specific role interfaces they support. A class can implement multiple interfaces.

Step 5: Update Clients

Each client depends on the smallest interface that covers its needs. Update parameter types and dependency declarations.

Detection / Indicators

  • Interface with more than 5-7 methods
  • Implementors with empty method bodies or throw new NotImplementedException()
  • Tests that mock many methods but only exercise one
  • Clients that import an interface but call only 1-2 methods
  • Interface changes that cause unrelated code to recompile

Read the full file on GitHub · 76 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. 2d ago First seen · 76 lines · 48 tokens per session scan A 436d7ec5a39a

Subscribe to this mod's changes

solid-interface-segregation is a skill published in the GitHub repository helmedeiros/clean-code-skills (2 stars, last pushed 6mo ago), licensed MIT. It adds 48 tokens to every session and 676 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

modelchk

Size a task's run before spending it: the cheapest sufficient capability tier (fast, standard, frontier) and the reasoning effort within it, on a neutral scale that binds to whatever levels the model exposes. Use when work seems over- or under-powered, costly, ambiguous, or high-risk, or asks which model class and how…

LilMGenius/paperthin · 74 tokens

re0-loop

Run repeated build -> QA -> re0-memo -> re0-work cycles while preserving learning and letting code die. Use for long agentic projects where progress must be measured by quality-cleared templates, reusable modules, and eliminated anti-patterns rather than hours spent or features accumulated.

LilMGenius/paperthin · 60 tokens

autobahn

Carve guardrail-adjacent items out of scope with safe alternatives before risk-adjacent work starts, then run the safe remainder at full strength in a fresh subagent that only ever sees the carved prompt, never the risky input. Use when a task includes stealth, scraping, privacy, IP, policy, licensing, security, or…

LilMGenius/paperthin · 129 tokens

re0-release

Walk a pending change through this repo's shipping and releasing checklist end to end, then tag and publish once confirmed. User-invoked: run it when you've decided to ship.

LilMGenius/paperthin · 40 tokens

ssotize

Audit and consolidate a fact that's scattered across places into one canonical source, after approval, and replace the rest with references. Use when asked to find duplication, check consistency, locate the source of truth, deduplicate, consolidate, unify, or establish SSOT across artifacts or platforms. Starts…

LilMGenius/paperthin · 78 tokens

re0-plan

Open a paperthin iteration's casebook before re0-loop's first turn — seeded with real content the moment the folder exists, never an empty directory. User-invoked, paperthin-only: assumes the full skill package installed. Run when opening a new build cycle in this repo.

LilMGenius/paperthin · 62 tokens