skills/solid-principles/SKILL.md
SOLID object-oriented design principles methodology — loaded by implementer agent when writing code and by code-reviewer agent when checking for design violations
npx skillsauth add bostonaholic/team solid-principlesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
SOLID is a set of five design principles that reduce coupling, increase cohesion, and make software easier to maintain and extend. Apply them when writing new code and check for violations when reviewing code.
A module, class, or function should have one reason to change.
A "reason to change" means one actor or stakeholder whose requirements could change the code. Code with multiple responsibilities becomes a tangled web where changing one concern breaks another.
UserService
that validates input, persists to the database, AND sends emails)and in a function name: validateAndSave(), parseAndFormatDate()Software entities should be open for extension but closed for modification.
Adding new behavior should not require changing existing, tested code. Achieve this through abstraction: program to interfaces, not implementations.
if/else or switch on a type field that must be modified every
time a new type is addedif type === 'admin' ... else if type === 'user'Subtypes must be substitutable for their base types without altering program correctness.
If code works correctly with a Shape, it must work correctly with a
Rectangle that extends Shape, without the caller knowing which it got.
NotImplementedError or do nothinginstanceof before calling methods: if (x instanceof Square)ReadOnlyList cannot mutate) but
must fulfill all contracts the base type advertisesClients should not be forced to depend on interfaces they do not use.
Fat interfaces force clients to implement or depend on methods they do not need, creating unnecessary coupling.
UnsupportedOperationException
for several methodsHigh-level modules should not depend on low-level modules. Both should depend on abstractions. Abstractions should not depend on details.
Business logic should not import database drivers, HTTP clients, or file system APIs directly. It should depend on interfaces that those details implement.
newimport DatabaseClient from './database' inside a domain serviceDatabase.query(...),
Clock.now(), Config.get(...)) — static calls have no seam, so tests
cannot substitute themRegistry.getInstance()) —
the dependency is real but invisible in the signature, so the class lies
about what it needsReportGenerator(reportingDb, clock) can serve many
date ranges via generate(startDate, endDate). A
ReportGenerator(reportingDb, clock, startDate, endDate) creates a new
instance per query and conflates identity with work.When writing new code:
When reviewing code for SOLID violations:
issue: SRP violation — this function handles both input validation and database write.switch or if/else chain.Every SOLID finding should cite the specific file and line, name the principle, and explain the consequence: why does this violation matter for this codebase right now?
data-ai
Todo-first progress convention for multi-step procedures — loaded by every multi-step agent to track its own steps without drift
testing
Adversarially review a technical design document with fresh context before the human gate. Dispatches the built-in `general-purpose` subagent (clean context, no shared history with the design-author) against `docs/plans/<id>/design.md` and presents its verdict — APPROVE, REQUEST CHANGES, or COMMENT. Optional, not part of the QRSPI pipeline. Trigger on "review the design doc", "audit design.md", "is this design ready", or `/eng-design-doc-review`.
development
Generator-evaluator separation and review methodology — loaded by review agents to enforce fresh-context review discipline, Conventional Comments format, and gate verdicts
data-ai
Prepare one or more isolated git worktrees — one per repository the topic touches. Router action — no agent. Trigger on "set up the worktree", "isolate this work", or "/team-worktree".