agentleFS
mmccallammccalla/coding-agent-skill-library/skills/solid-principles/SKILL.md

solid-principles

Skill4 starsChanged 5 months agoApache-2.0View on GitHub

Applies SOLID for modularity, dependency boundaries and testability without over-engineering. Use when refactoring modules, services, agents, or dependency boundaries.

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 11 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 11

    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
  1. Distinctive:

    Use this skill when designing or refactoring classes, modules, services, interfaces, dependency boundaries, plug-ins, tools, agents, MCP …

    line 13
  2. Distinctive:

    Check Single Responsibility: each unit should have one reason to change.

    line 22
  3. Distinctive:

    Check Open/Closed: extension should not require risky modification of stable code paths.

    line 23
  4. Distinctive:

    Check Liskov Substitution: implementations must honour the contract expected by callers.

    line 24
  5. Distinctive:

    Check Interface Segregation: consumers should depend only on methods, fields or capabilities they actually use.

    line 25
  6. Distinctive:

    Check Dependency Inversion: high-level policy should depend on abstractions or ports, not concrete infrastructure details.

    line 26
  7. Distinctive:

    Add or update tests around the changed boundary.

    line 28
  8. Distinctive:

    Do not create abstract interfaces unless there is a real boundary, more than one implementation, a test seam, or likely volatility.

    line 32
  9. Distinctive:

    Do not split code so aggressively that behaviour becomes harder to trace.

    line 33
  10. Distinctive:

    Prefer composition over inheritance unless inheritance clearly models a stable substitutable relationship.

    line 34
  11. Distinctive:

    Keep contracts explicit with types, schemas, protocols or tests.

    line 35

“Common” is measured: kept by at least 6 in 10 of the 6 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

SOLID Principles

When to use

Use this skill when designing or refactoring classes, modules, services, interfaces, dependency boundaries, plug-ins, tools, agents, MCP servers or A2A components.

Objective

Improve maintainability and testability by ensuring code has clear responsibilities, stable boundaries, substitutable components, focused interfaces and explicit dependencies.

Procedure

  1. Identify the unit under change: class, module, service, tool, agent or workflow.
  2. Check Single Responsibility: each unit should have one reason to change.
  3. Check Open/Closed: extension should not require risky modification of stable code paths.
  4. Check Liskov Substitution: implementations must honour the contract expected by callers.
  5. Check Interface Segregation: consumers should depend only on methods, fields or capabilities they actually use.
  6. Check Dependency Inversion: high-level policy should depend on abstractions or ports, not concrete infrastructure details.
  7. Apply the smallest refactor that improves the design.
  8. Add or update tests around the changed boundary.

Rules

  • Do not create abstract interfaces unless there is a real boundary, more than one implementation, a test seam, or likely volatility.
  • Do not split code so aggressively that behaviour becomes harder to trace.
  • Prefer composition over inheritance unless inheritance clearly models a stable substitutable relationship.
  • Keep contracts explicit with types, schemas, protocols or tests.
  • Preserve public behaviour unless explicitly asked to change it.

References

Verification

  • SOLID issue addressed identified.
  • Design boundary change described.
  • Tests or checks run reported.
  • Residual risks or assumptions stated.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.