design-patterns
Skill9 starsChanged 8 months agoMITView on GitHub
**Design Patterns, SOLID & Clean Architecture**: Reference guide and advisor for software design patterns, SOLID principles, Clean Code practices, and Clean Architecture. Use whenever the user asks about design patterns, SOLID principles, Clean Code, Clean Architecture, DDD, refactoring, code organization, coupling, cohesion, or wants guidance on how to structure their code. Trigger when the user mentions 'pattern', 'SOLID', 'clean code', 'clean architecture', 'DDD', 'domain-driven', 'refactor', 'abstraction', 'dependency injection', 'repository pattern', or asks 'how should I structure this' or 'what pattern should I use'.
41 other projects use a version of this.
Adopted by
Most recently taken up by
- elidadutra187/claude-skillstheir own version, first seen Nov 29, 2026
- TudorAndrei/skillstheir own version, first seen Nov 29, 2026
- atstaeff/ai-agentstheir own version, first seen Nov 29, 2026
- bryanus1/agent-skillstheir own version, first seen Nov 16, 2026
- travissmithv1/claude-skillstheir own version, first seen Nov 16, 2026
- Ajustor/claude-skillstheir own version, first seen Nov 16, 2026
Used with
Projects with it also use logging-patterns, tdd-rust and 10 more.
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.
DIL8654Skilllogging-patterns
Keep logs structured, correlated, low-noise, and safe for production support. Use when adding operational logging, reviewing observability, or improving diagnostics in .NET services.
Also in 7 projects that use this
FlorianBruniauxSkilltdd-rust
Also in 3 projects that use this
nek1987Skillsolid-principles
SOLID object-oriented design principles for maintainable code
Also in 7 projects that use this
ufodev-ioSkillsecurity-guardian
Comprehensive security layer for all interactions with Claude: audits code, dependencies, commands, configs, and AI-generated output for vulnerabilities. Protects against prompt injection, data leaks, unsafe advice, and social engineering. Works in Cursor, Claude Code, claude.ai, and API contexts. Use always as a background security protocol in any Claude-powered environment.
Also in 3 projects that use this
mstuder-slalomSkilljpa-patterns
JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.
Also in 6 projects that use this
zavierSkilljava-code-review
Java代码审查技能,通过比较两个git分支进行自动化代码审查
Also in 3 projects that use this
Other versions41 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 41
- rtk-ai/rtk★ 88ksame name
- piomin/claude-ai-spring-boot★ 1.5ksame name
- decebals/claude-code-java★ 763same name
- waybarrios/opencode-power-pack★ 547same name
- FlorianBruniaux/ccboard★ 106same name
- nimadorostkar/Claude-Skills-collection★ 41same name
- DIL8654/claude-code-dotnet-template★ 8same name
- tstapler/dotfiles★ 8same name
- cookieMonsterDev/agents-skills★ 7same name
- piomin/claude-ai-quarkus★ 7same name
31 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.
- adrSkill
- ai-ml-engineeringSkill
- api-documentationSkill
- api-gateway-patternsSkill
- architecture-review-boardSkill
- backend-reviewSkill
- chaos-engineeringSkill
- code-reviewSkill
- compliance-reviewSkill
- cost-optimizationSkill
- csharp-dotnet-reviewSkill
- database-reviewSkill
- data-engineeringSkill
- developer-experienceSkill
- devops-infraSkill
- domain-modelingSkill
- elixir-reviewSkill
- engineering-budgetSkill
- engineering-metricsSkill
- event-driven-architectureSkill
- feature-flagsSkill
- flutter-reviewSkill
- frontend-reviewSkill
- full-reviewSkill
- git-flowSkill
- go-reviewSkill
- graphql-reviewSkill
- health-checkSkill
- incident-postmortemSkill
- kubernetes-reviewSkill
- migration-strategySkill
- multi-tenancySkill
- observabilitySkill
- on-call-designSkill
- one-on-oneSkill
- pentestSkill
- performance-profilingSkill
- pr-descriptionSkill
- python-reviewSkill
- quality-standardSkill
- rust-reviewSkill
- security-reviewSkill
- sprint-planningSkill
- swift-reviewSkill
- systematic-debuggingSkill
- team-scalingSkill
- tech-debt-prioritizationSkill
- technical-interviewSkill
- tech-specSkill
- terraform-iacSkill
- testing-strategySkill
- ux-reviewSkill
- vendor-evaluationSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 39 edited versions we read keep these.
6
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 65
Use patterns when they solve a specific problem.
- Distinctive: line 81
Don't use Factory when a simple constructor works
- Distinctive: line 82
Don't use Strategy for a single implementation (YAGNI)
- Distinctive: line 83
Don't use Observer for direct 1-to-1 calls
- Distinctive: line 84
Don't use DDD for CRUD apps with no business logic
- Distinctive: line 85
Don't add layers for things that won't change
“Common” is measured: kept by at least 6 in 10 of the 39 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
Design Patterns, SOLID & Clean Architecture
You are a software architect advisor. Help the user choose and apply the right patterns for their specific context. Patterns are tools, not rules — always explain WHY a pattern fits, not just HOW to implement it.
SOLID Principles
S — Single Responsibility: A class has one reason to change. Separate concerns, one actor/stakeholder per class.
O — Open/Closed: Open for extension, closed for modification. Strategy pattern solves this: new implementations without editing existing code.
L — Liskov Substitution: Subtypes are substitutable for base types without breaking behavior. If a child breaks the parent's contract, LSP is violated.
I — Interface Segregation: Clients depend only on interfaces they use. Many small interfaces beat one fat interface.
D — Dependency Inversion: Depend on abstractions, not concretions. Domain defines ports (interfaces); infrastructure implements adapters.
→ See solid-examples.md for detailed TypeScript examples.
Clean Architecture
┌─────────────────────────────────────┐
│ Presentation │ ← Controllers, CLI, UI
│ ┌─────────────────────────────┐ │
│ │ Application │ │ ← Use Cases, DTOs
│ │ ┌─────────────────────┐ │ │
│ │ │ Domain │ │ │ ← Entities, Value Objects, Interfaces
│ │ └─────────────────────┘ │ │
│ └─────────────────────────────┘ │
└─────────────────────────────────────┘
Infrastructure ← DB, APIs, Messaging, FilesDependency Rule: Dependencies always point inward. Domain knows nothing about infrastructure.
→ See clean-architecture-guide.md for Entities, Value Objects, Use Cases, and Repositories.
Common Design Patterns
| Creational | Structural | Behavioral |
| Factory Method | Adapter | Strategy |
| Abstract Factory | Decorator | Observer |
| Builder | Facade | Command |
| Singleton | Proxy | State |
| Chain of Responsibility |
Use patterns when they solve a specific problem. Don't add them preemptively.
Domain-Driven Design
Bounded Context: Clear boundary with its own ubiquitous language and model.
Aggregate: Cluster of entities treated as one unit. Has an Aggregate Root that controls access.
Domain Events: Something that happened in the domain (OrderPlaced, PaymentReceived). Enables loose coupling between contexts.
Anti-Corruption Layer: Translates between bounded contexts to prevent external models from polluting your domain.
→ See ddd-quick-reference.md for context mapping, event sourcing, and when to use DDD.
When NOT to Use Patterns
- Don't use Factory when a simple constructor works
- Don't use Strategy for a single implementation (YAGNI)
- Don't use Observer for direct 1-to-1 calls
- Don't use DDD for CRUD apps with no business logic
- Don't add layers for things that won't change
Simplicity beats cleverness. Add patterns only when complexity demands it.
Refactoring Guidance
- Identify the code smell (duplication, long method, god class, feature envy)
- Name the pattern that fixes it
- Show before/after with concrete code
- Explain the trade-off (what you gain, what complexity you add)
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.

