solid-principles
Skill5 starsChanged 4 months agoMITView on GitHub
Apply the SOLID principles as design diagnostics, detecting god classes, fragile hierarchies, fat interfaces, and hard-wired dependencies, and prescribing the smallest structural fix rather than imposing ceremony. Use when designing a new module or class, reviewing object-oriented code, or untangling a class that keeps changing for unrelated reasons.
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Before judging any structure, learn what actually changes here:
- Distinctive: line 27
O - Open/closed: Add behaviour by adding code, not by editing a growing conditional.
- Distinctive: line 52
When writing new code rather than reviewing: start concrete, and let the second variant or second consumer trigger the abstraction.
“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Use SOLID to diagnose, not to decorate. Each principle names a specific way designs rot under change; the skill is recognizing the rot early and making the smallest cut that stops it. The failure mode of SOLID is applying it as ceremony - an interface for every class, a factory for every constructor - which produces the same unmaintainability it was meant to prevent, with more files. Every abstraction this skill recommends must be justified by a change pressure that actually exists in this codebase, not one imagined.
Step 1: Find the change pressure
Before judging any structure, learn what actually changes here:
git log --oneline --followon the files in question: what has forced edits, and do unrelated reasons keep touching the same file?- Where have bugs clustered? A class that breaks every time a neighbour changes is telling you where the coupling is.
- What does the team add regularly (new payment providers, new report types, new integrations)? That axis deserves an extension point; axes that never vary do not.
SOLID violations only matter along axes that change. A "god class" that has been stable for two years is a lower priority than a small class edited weekly by three features.
Step 2: Diagnose against each principle
For each, the smell, the test, and the minimal fix - in the codebase's own idiom (modules and functions count; none of this requires classes).
S - Single responsibility. A unit should have one reason to change.
- Smell: commits touch the same file for unrelated features; the class name contains "Manager", "Handler", "Util"; you describe it with "and".
- Test: list the actors/features that force edits to it. More than one - it is doing more than one job.
- Fix: split along the reasons-to-change, not along method count. Ten cohesive methods are fine; three methods serving three features are not.
O - Open/closed. Add behaviour by adding code, not by editing a growing conditional.
- Smell: a switch/if-else chain over a type tag that grows a branch with every new variant, duplicated in several places.
- Test: "when the next variant arrives, how many existing files change?" More than one is the smell; zero or one (plus the new variant file) is the goal.
- Fix: one extension point - a strategy map, a handler registry, polymorphism - introduced at the second or third variant, not speculatively at the first.
L - Liskov substitution. A subtype must be usable wherever its base is expected, without surprises.
- Smell: overrides that throw
NotImplemented, no-op overrides,instanceofchecks on the subtype after receiving the base, subclasses that tighten what inputs they accept. - Test: can every caller of the base run unmodified against each subtype and stay correct?
- Fix: usually the hierarchy is wrong - replace inheritance with composition, or split the base into what all subtypes truly share. (A
Square extends Rectangleproblem is never fixed insideSquare.)
I - Interface segregation. Depend on the methods you use, not on a fat contract.
- Smell: implementations stubbing methods they do not need; a change to one client's method recompiling/breaking every other client; mocks that stub fifteen methods to test one.
- Test: group the interface's methods by which clients call them. More than one group - the interface is a bundle.
- Fix: split by client need (
Reader/Writer, notStorage), or in structurally-typed languages, accept the narrow shape the function actually uses.
D - Dependency inversion. Policy should not import mechanism.
- Smell: business logic constructing its own database client or HTTP client inline; tests that cannot run without real infrastructure; a domain module importing a vendor SDK.
- Test: can the core logic be exercised in a test with in-memory fakes, without patching module internals?
- Fix: pass the dependency in (constructor, parameter, factory) behind the narrowest interface the logic needs. Plain function parameters count as injection; a DI framework is not the point.
Step 3: Prescribe proportionately
- Order findings by cost of leaving them: violations on hot, frequently-edited paths first; stable code last or not at all.
- Each finding names the principle, the concrete evidence (file, the commits or branches that show the pressure), and the smallest refactor - shown as the target structure in the project's own style, not a pattern name.
- Say what you would not change. Explicitly bless the simple code that hypothetically "violates" a principle but sits on an axis with no change pressure. Recommending restraint is part of the review.
- When writing new code rather than reviewing: start concrete, and let the second variant or second consumer trigger the abstraction. Note in the design where that extension point will go when it is earned.
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- decebals/claude-code-java★ 763same name
- TheBeardedBearSAS/claude-craft★ 108same name
- JeremyMorgan/code-review-skills★ 15same name
- robconery/kolea★ 7same name
- nek1987/auto-agent-harness★ 4same name
- kayaman/skills★ 3same name
- kimtth/agent-skill-100-lines-or-less★ 2same name
- lucsedirae/agent_skill_library★ 2same name
- andr-ca/agentharness★ 1same name
- iCesofT/awesome-ai★ 1same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use design-patterns.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
ffsshhttiikkSkilldesign-patterns
Practical application and coding skills for Design Patterns
Also in 5 projects that use this
In this repository89 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- site/llms-full.txtllms.txt
- site/llms.txtllms.txt
- improveSkill
- academic-writingSkill
- benchmark-reportingSkill
- bibtex-managerSkill
- citation-graphSkill
- citation-verifierSkill
- design-science-methodologySkill
- docx-thesisSkill
- experiment-reproducibilitySkill
- latex-toolkitSkill
- literature-searchSkill
- lit-review-synthesisSkill
- paper-readerSkill
- proofread-academicSkill
- research-figuresSkill
- research-methodologySkill
- research-questionSkill
- statistics-advisorSkill
- supervisor-updateSkill
- systematic-reviewSkill
- thesis-proposalSkill
- coolify-image-appSkill
- coolify-vps-baselineSkill
- deploy-verificationSkill
- express-prisma-coolify-imageSkill
- ghcr-coolify-pipelineSkill
- live-domain-cutoverSkill
- nextjs-coolify-imageSkill
- proxy-client-addressSkill
- vps-ops-toolkitSkill
- adr-writingSkill
- openapi-specSkill
- readme-writingSkill
- technical-writingSkill
- adversarial-reviewerSkill
- api-design-reviewSkill
- code-review-responseSkill
- create-agentSkill
- create-commandSkill
- create-hookSkill
- create-skillSkill
- db-migration-safetySkill
- dependency-upgradeSkill
- dockerfile-best-practicesSkill
- error-handling-patternsSkill
- executing-plansSkill
- explain-codebaseSkill
- fix-ciSkill
- github-actions-pipelineSkill
- grill-with-docsSkill
- incident-postmortemSkill
- logging-and-observabilitySkill
- parallel-agentsSkill
- performance-optimizationSkill
- refactoring-recipesSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

