solid-single-responsibility

solid-single-responsibility is a skill for Claude Code, Codex from helmedeiros/clean-code-skills. It costs 50 tokens per session (667 once invoked), scanned A, original, MIT.

A guide to the Single Responsibility Principle, which says that a class, module, or function should have one main reason to change. It is part of SOLID, a set of object-oriented design principles.

In plain words
What is it for?
Use it to identify classes or modules doing too much, group related responsibilities, and separate unrelated concerns.
Why use it?
It helps prevent code units from handling unrelated jobs, which can make changes risky and tests difficult to maintain.

Skill for Claude CodeCodex

Part of the clean-code-skills plugin — 21 skills, 2 commands shipped together

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

Made for: Claude Code, Codex.

Or install clean-code-skills, the plugin that ships this one along with the rest of its 21 skills, 2 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for solid-single-responsibility

README.md
[![agentmods](https://agentmods.dev/badge/skills/helmedeiros/clean-code-skills/solid-single-responsibility.svg)](https://agentmods.dev/skills/helmedeiros/clean-code-skills/solid-single-responsibility)
Your own site
<a href="https://agentmods.dev/skills/helmedeiros/clean-code-skills/solid-single-responsibility"><img src="https://agentmods.dev/badge/skills/helmedeiros/clean-code-skills/solid-single-responsibility.svg" alt="Measured on agentmods" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 667 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.00050 $0.00667
Opus 5 $0.00025 $0.00333
Sonnet 5 $0.00010 $0.00133
Haiku 4.5 $0.00005 $0.00067

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

Security

Grade A, and why

solid-single-responsibility 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 3d 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-single-responsibility/SKILL.md · 70 lines

How it starts

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

SOLID: Single Responsibility Principle

Ensure each class, module, or function has one and only one reason to change by encapsulating a single cohesive responsibility.

When This Skill Applies

  • A class or module seems to do "too many things"
  • Changes to one feature require modifying unrelated code
  • The user mentions SRP, single responsibility, or separation of concerns
  • A class has methods that serve different stakeholders
  • Test setup is complex because the class has many dependencies

Core Principle

A class should have one, and only one, reason to change. A "reason to change" corresponds to a stakeholder or business capability. When a class serves multiple stakeholders, changes requested by one stakeholder risk breaking functionality for another. Separate responsibilities into distinct classes to isolate change.

Workflow

Step 1: Identify Responsibilities

List everything the class does. Group methods by the stakeholder or capability they serve. If you find more than one group, the class has multiple responsibilities.

Step 2: Name Each Responsibility

Give each group a clear name. If you cannot name a responsibility in domain terms, it may be an infrastructure concern (logging, persistence, formatting) mixed with business logic.

Step 3: Extract into Separate Classes

Move each responsibility into its own class. The original class delegates to the new classes or is replaced entirely. Each new class should have a focused, cohesive API.

Step 4: Verify Independence

Change one responsibility and confirm that no other class needs to change. Run the test suite. If a change in one class forces changes in another, the split was not clean.

Detection / Indicators

  • A class with more than 5-7 public methods serving different purposes
  • Methods that do not use the same instance variables
  • The class name contains "And" or is a generic noun: UserManagerAndValidator
  • Tests require unrelated setup: testing email logic requires setting up the database
  • Multiple developers frequently edit the same class for different reasons
  • The class imports from many unrelated modules

Read the full file on GitHub · 70 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. 3d ago First seen · 70 lines · 50 tokens per session scan A 2f1868bd8cc7

Subscribe to this mod's changes

solid-single-responsibility is a skill published in the GitHub repository helmedeiros/clean-code-skills (2 stars, last pushed 6mo ago), licensed MIT. It adds 50 tokens to every session and 667 once invoked, about $0.0003 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

codex-setup

Initialize sd0x-dev-flow infrastructure for Codex CLI and other non-Claude agents. Generates AGENTS.md, installs the commit-msg hook, copies runner scripts. The pre-push gate is opt-in via --with-push-gate. Use when setting up a new project or after updating skills.

sd0xdev/sd0x-harness · 65 tokens

re0-merge

Review and land an external contribution the way this suite does: gate it against the thesis, land it with the author's credit intact, complete a new skill rather than merging it raw, then approve, credit, and explain before closing. Use when reviewing a pull request, as any collaborator or maintainer, not only the…

LilMGenius/paperthin · 70 tokens

re0-git

Rewrite a finished commit's message into a clean, handoff-ready form in your own log style, so git log alone tells the story. User-invoked: run it after a commit.

LilMGenius/paperthin · 46 tokens

debloat

Compress an artifact that has accreted into bloat — padding, over-qualification, fused sentences, walls of enumeration, adjacent restatement — down to its load-bearing density, meaning preserved. Use when prose is correct and current but has grown verbose or patched-over and you want it tight without a full rewrite.

LilMGenius/paperthin · 66 tokens

debug

Interactive debugging workflow with hypothesis-driven probe loop. Use when: unknown bugs, script errors, silent failures, troubleshooting. Not for: known bugs (use bug-fix), GitHub issue analysis (use issue-analyze), code understanding (use code-explore). Output: debug report with probe journal + root cause + fix.

sd0xdev/sd0x-harness · 67 tokens

feature-dev

Feature development workflow. Use when: implementing features, writing code, running dev loop. Not for: understanding code (use code-explore), reviewing code (use codex-code-review). Output: implemented feature + tests + review gate.

sd0xdev/sd0x-harness · 50 tokens