design-principles
Skill19 starsChanged 8 months agoMITView on GitHub
Audit a codebase against well-known software design principles: SOLID, DRY, YAGNI, KISS, Law of Demeter, Separation of Concerns, Composition over Inheritance, and the code-relevant 12-Factor subset. Scores findings by impact and effort, runs adversarial debate on contested violations, and generates a prioritized DESIGN_AUDIT.md. Use when reviewing code quality beyond what linters catch, assessing design health before a refactor, or onboarding to an unfamiliar codebase. Can be invoked standalone or delegated from tech-debt.
24 other projects use a version of this.
Adopted by
Most recently taken up by
- twglhk/gamedev-agent-skillstheir own version, first seen Nov 8, 2026
- stigmer/stigmertheir own version, first seen Nov 8, 2026
- omidnw/my-skillstheir own version, first seen Nov 3, 2026
- skrrt-sh/skillstheir own version, first seen Nov 1, 2026
- shangyiy/life-kittheir own version, first seen Nov 1, 2026
- ovargas/virtual-teamtheir own version, first seen Oct 25, 2026
Used with
Projects with it also use test-driven-development.
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.
OpenAISkilltest-driven-development
Use when implementing any feature or bugfix, before writing implementation code
Also in 3 projects that use this
Other versions24 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 24
- launchapp-dev/animus-cli★ 39same name
- HermeticOrmus/design-mastery-claude-code★ 18same name
- ovargas/virtual-team★ 14same name
- shangyiy/life-kit★ 10same name
- stigmer/stigmer★ 9same name
- shualippe/design-principles-skill★ 8same name
- madeinlowcode/skills-claude-code★ 7same name
- Nirusan/claude-config★ 7same name
- robconery/kolea★ 7same name
- jlengrand/my-skills★ 4same name
14 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.
In this repository53 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/skills/agent-rules/AGENTS.mdAGENTS.md
- .github/workflows/AGENTS.mdAGENTS.md
- pkg/AGENTS.mdAGENTS.md
- agent-ready-goSkill
- agent-rulesSkill
- architecture-designerSkill
- cli-developerSkill
- cloudformation-to-pulumiSkill
- code-reviewerSkill
- commitlintSkill
- commitSkill
- csharp-developerSkill
- decideSkill
- dep-upgradeSkill
- devops-engineerSkill
- flux-cliSkill
- flux-operator-cliSkill
- golang-proSkill
- go-nolint-auditSkill
- javascript-proSkill
- kubernetes-specialistSkill
- lint-fixSkill
- markdownlintSkill
- prSkill
- pull-request-msg-with-ghSkill
- pulumi-arm-to-pulumiSkill
- pulumi-automation-apiSkill
- pulumi-best-practicesSkill
- pulumi-cdk-to-pulumiSkill
- pulumi-cliSkill
- pulumi-componentSkill
- pulumi-escSkill
- pulumi-goSkill
- pulumi-neoSkill
- pulumi-pythonSkill
- pulumi-terraform-to-pulumiSkill
- pulumi-typescriptSkill
- python-proSkill
- reviewSkill
- roadmapSkill
- rust-async-patternsSkill
- rust-best-practicesSkill
- rust-engineerSkill
- scoutSkill
- security-auditSkill
- spring-boot-engineerSkill
- sre-engineerSkill
- sync-websiteSkill
- tailscale-installSkill
- tech-debtSkill
- the-foolSkill
- typescript-proSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 21 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 35
If not in a git repository, warn but proceed — git history will be unavailable but file analysis still works.
- Distinctive: line 47
Read README.md and CONTEXT.md (if present) for architectural intent.
- Distinctive: line 155
Must cite specific reasons beyond "it works." Points out risks of the proposed change.
- Very specific: line 169
Write the report using the template in references/report-template.md.
- Distinctive: line 173
Run markdownlint on the generated file:
- Distinctive: line 191
Ask which items to address first
“Common” is measured: kept by at least 6 in 10 of the 21 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
<!-- Copyright 2025-2026 Richard Shade. Licensed under Apache-2.0. --><!-- SPDX-License-Identifier: Apache-2.0 -->Design Principles Audit
Audit the codebase against well-known design principles. Produce a scored DESIGN_AUDIT.md with prioritized remediation actions.
Core principle: Investigate, do not pattern-match. Read the actual code to determine whether a violation is genuine, intentional, or a false positive. Only flag findings with specific file:line evidence.
Prerequisite check
git --version 2>/dev/null && git rev-parse --is-inside-work-tree 2>/dev/nullIf not in a git repository, warn but proceed — git history will be unavailable but file analysis still works.
Step 1: Detect context
Determine language, framework, and paradigm — this governs which principles apply and how violations manifest:
ls go.mod package.json pyproject.toml Cargo.toml *.csproj 2>/dev/nullRead README.md and CONTEXT.md (if present) for architectural intent.
Determine audit scope from input:
- Full audit (default) — entire codebase, excluding
vendor/,node_modules/, generated files - Module audit — specific directory or package
- Delegated mode — called by tech-debt; focus on changed files and surface findings for the scorecard
For language-specific violation patterns per principle, see
references/principles-guide.md.
Step 2: Scan for violations
For each applicable principle, read actual code and identify violations. Do not grep for keywords — trace call paths and responsibilities.
SOLID
- S — Single Responsibility: Find files/classes/functions with multiple distinct reasons to change. Signals: files > 300 lines mixing concerns, functions doing I/O + business logic + formatting.
- O — Open/Closed: Find code that requires modification (not
extension) to add new behavior. Signals: long
switch/if-elsechains on type tags, no interface/abstraction at extension points. - L — Liskov Substitution: Find subtypes that weaken preconditions, strengthen postconditions, or throw unexpected errors. Signals: overrides that do nothing, panic on valid input, type assertions before use.
- I — Interface Segregation: Find broad interfaces forcing implementors to satisfy methods they do not use. Signals: interface with > 5 methods, stub/no-op implementations.
- D — Dependency Inversion: Find high-level modules importing concrete low-level types. Signals: direct instantiation of dependencies, no interfaces at package boundaries, untestable code.
DRY
Find logic, structure, or data duplicated in two or more places where a single abstraction would reduce maintenance risk. Distinguish genuine duplication from coincidental similarity — two functions that look alike but evolve independently are not DRY violations.
YAGNI
Find abstractions, configuration options, or generality added without a current use case. Signals: unused parameters, dead code paths, interfaces with one implementation, config keys never read.
KISS
Find needlessly complex solutions. Signals: indirection that adds no value, abstractions solving problems the codebase does not have, multi-layer delegation for simple operations.
Law of Demeter
Find call chains that expose internal structure: a.GetB().GetC().Do().
Each unit should talk only to its immediate collaborators.
Separation of Concerns
Find mixed layers: HTTP logic in domain models, SQL in handlers, presentation in business rules. Trace data flow from entry points.
Composition over Inheritance
Find deep inheritance hierarchies (> 2 levels), base classes modified to satisfy subclasses, or tight coupling through inheritance. Note: in Go and functional languages, flag missing interface usage rather than inheritance misuse.
12-Factor (code-relevant subset)
- Config: Hardcoded values that should come from environment variables (URLs, credentials, feature flags, thresholds).
- Logs:
fmt.Println,print(), or ad-hoc string concatenation instead of a structured logging library. - Stateless processes: In-memory state that prevents horizontal scaling (package-level mutable globals, local file caching of user-specific data).
Step 3: Score findings
For each finding assign Impact, Effort, and Priority using the
framework in references/report-template.md.
- Impact: CRITICAL / HIGH / MEDIUM / LOW
- Effort: S (< 1 day) / M (1–5 days) / L (1–2 weeks) / XL
- Priority: P1 (high impact + low effort) through P4 (low impact, any effort)
Score each principle area 0–10 for the summary scorecard.
Step 4: Adversarial debate
Identify the top 3 findings with the highest combined Impact × Effort score where the violation is genuinely contested (reasonable engineers could disagree). Skip findings that are clear-cut.
For each debated finding:
- Red (refactor): argues the violation should be fixed. Must propose a concrete diff or refactoring approach. Challenges whether the current design is justified.
- Blue (keep): argues the current design is correct given context. Must cite specific reasons beyond "it works." Points out risks of the proposed change.
- White (verdict): evaluates on evidence. Decides: refactor, keep, or add justification comment.
Debate rules
- Red and Blue must cite specific code, not generalities
- Red must propose a concrete change, not just identify the smell
- Blue cannot simply defend status quo without reasoning
- White's verdict is final and must be actioned in the report
Step 5: Generate DESIGN_AUDIT.md
Write the report using the template in references/report-template.md.
Include executive summary, principle scorecard, detailed findings with
evidence, debate verdicts, and prioritized remediation roadmap.
Run markdownlint on the generated file:
markdownlint DESIGN_AUDIT.md 2>/dev/null || \
npx markdownlint-cli DESIGN_AUDIT.md 2>/dev/nullFix any issues before presenting.
Step 6: Present summary
Show the user:
- Principle scorecard (name, score 0–10, top finding)
- Overall design health score (sum of principle scores / max)
- Debate verdicts for contested findings
- P1 items requiring immediate attention
- Top 5 remediation priorities with estimated effort
- Ask which items to address first
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
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.

