design-patterns
Skill0 starsChanged 38 days agoApache-2.0View on GitHub
Trigger: design patterns, patrones de diseño, pattern selection, architecture, arquitectura, technical design, diseño técnico, GoF, factory, strategy, singleton, anti-pattern. Select GoF + system patterns when forces are present; avoid spamming.
33 other projects use a version of this.
Adopted by
Most recently taken up by
- thistleknot/skillstheir own version, first seen Nov 8, 2026
- gustaferiksson/skillstheir own version, first seen Nov 7, 2026
- alexandrecsp/skillstheir own version, first seen Nov 1, 2026
- cookieMonsterDev/agents-skillstheir own version, first seen Nov 1, 2026
- decebals/claude-code-javatheir own version, first seen Nov 1, 2026
- ralvarez-ai/ralvaskillstheir own version, first seen Nov 1, 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 5 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
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
DIL8654Skillapi-contract-review
Review ASP.NET Core Web API contracts for HTTP semantics, versioning, backward compatibility, and response consistency. Use when the user asks to review an API, check endpoints, validate REST behavior, or before releasing contract changes.
Also in 3 projects that use this
Other versions33 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 33
- rtk-ai/rtk★ 86ksame name
- piomin/claude-ai-spring-boot★ 1.4ksame name
- decebals/claude-code-java★ 763same name
- waybarrios/opencode-power-pack★ 547same name
- FlorianBruniaux/ccboard★ 94same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- DIL8654/claude-code-dotnet-template★ 8same name
- tstapler/dotfiles★ 8same name
- cookieMonsterDev/agents-skills★ 7same name
- piomin/claude-ai-quarkus★ 7same name
23 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 repository31 other files it gives its agents.
- architecture-lintSkill
- architecture-questSkill
- autofixSkill
- branch-prSkill
- chained-prSkill
- cognitive-doc-designSkill
- comment-writerSkill
- gentle-uiSkill
- gh-address-commentsSkill
- gh-fix-ciSkill
- github-automationSkill
- github-prSkill
- go-testingSkill
- grillingSkill
- issue-creationSkill
- judgment-daySkill
- playwright-interactiveSkill
- playwrightSkill
- product-questSkill
- skill-creatorSkill
- skill-improverSkill
- systemic-issue-triageSkill
- tailwind-4Skill
- test-fixingSkill
- typescriptSkill
- ui-designSkill
- ui-ux-principlesSkill
- using-git-worktreesSkill
- web-searchSkill
- work-unit-commitsSkill
- zod-4Skill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 8 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 32 edited versions we read keep these.
8
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 17
No pattern spamming / Golden Hammer: never apply a familiar pattern to everything.
- Distinctive: line 18
Lightest route first: check the lightweight alternative (closures, optionals, direct calls, inheritance, plain functions) BEFORE adding …
- Distinctive: line 19
Singleton is the last resort: prefer dependency injection (container-scoped single instance).
- Distinctive: line 22
Every pattern adds complexity (classes, indirection, layers) — complexity is the cost you pay, so state the benefit explicitly in the …
- Distinctive: line 55
Check the lightweight alternative table column first.
- Distinctive: line 56
When a pattern survives, choose the minimal one that covers the forces — not the most elaborate family.
- Very specific: line 58
Check the anti-pattern list in references/patterns-decision-guide.md — reject any candidate that degenerates into one.
- Distinctive: line 59
If a second pattern would cover the same forces, prefer the one with lower total complexity.
- Distinctive: line 63
When a pattern is selected or rejected, record in the artifact: pattern name, forces present, lightweight alternative considered (and why …
“Common” is measured: kept by at least 6 in 10 of the 32 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
Activation Contract
Load when selecting, applying, or reviewing a design pattern — creational, structural, behavioral, or system architecture (microservices, saga, CQRS, EDA). Applies to design work, architecture review, and implementation that adds abstractions. Read references/patterns-decision-guide.md for the full condensed tables before deciding.
Hard Rules
- Forces first: apply a pattern ONLY when the forces that motivate it are present. No pattern is correct for every problem.
- No pattern spamming / Golden Hammer: never apply a familiar pattern to everything. A "perfect, future-flexible" design you cannot justify today is over-design.
- Lightest route first: check the lightweight alternative (closures, optionals, direct calls, inheritance, plain functions) BEFORE adding indirection, extra classes, or a new abstraction layer.
- Singleton is the last resort: prefer dependency injection (container-scoped single instance). Global state breaks tests, hides dependencies, couples clients.
- Visitor is high-risk: it breaks encapsulation and every element-change ripples into all visitors. Use only for stable object structures (e.g. AST walks).
- Never design an anti-pattern intentionally: God Object, Spaghetti Code, Distributed Monolith, Shared Database, God Gateway, Chatty Communication are failure modes, not trade-offs.
- Every pattern adds complexity (classes, indirection, layers) — complexity is the cost you pay, so state the benefit explicitly in the artifact.
Decision Gates
| Force present | Pattern to consider |
| Create objects, client decoupled from concrete class | Factory Method |
| Family of related products, platform variants | Abstract Factory |
| Object with many optional params / telescoping constructor | Builder (or named/optional params) |
| Expensive object creation, need copies | Prototype (or Factory Method) |
| One shared resource instance | DI container (NOT Singleton) |
| Incompatible interfaces must coexist | Adapter |
| Add behavior dynamically, transparently | Decorator (or plain inheritance if static) |
| Access control / lazy / remote to an object | Proxy |
| Simplify a complex subsystem's surface | Facade (keep it thin!) |
| Abstraction and implementation vary independently | Bridge (only for long-lived complex systems) |
| Trees of uniform parts/wholes | Composite |
| Many small objects, memory-critical | Flyweight |
| Family of interchangeable algorithms | Strategy (or closures/callbacks) |
| Behavior changes with internal state | State (or explicit FSM / switch for simple cases) |
| One-to-many change notification | Observer (unsubscribe or leak!) |
| Queue / undo / log operations | Command |
| Algorithm skeleton with overridable steps | Template Method (or callbacks/composition) |
| Many objects, centralize interaction | Mediator (watch the god-Mediator) |
| New operations on a stable object structure | Visitor (only stable structures) |
| Multi-service business transaction | Saga (orchestration simple / choreography resilient) |
| Read/write models differ, query-heavy | CQRS (only when justified; never for simple CRUD) |
| Propagating failure isolation | Circuit Breaker / Bulkhead |
| Small autonomous deployable units | Only after Modular Monolith proves the need |
Execution Steps
- State the concrete problem and the forces present (variation axis, coupling to break, shared state, performance, scale).
- Check the lightweight alternative table column first; if it suffices, stop and use it.
- When a pattern survives, choose the minimal one that covers the forces — not the most elaborate family.
- State the costs explicitly in the design artifact: extra classes/indirection/complexity, and why they pay off.
- Check the anti-pattern list in
references/patterns-decision-guide.md— reject any candidate that degenerates into one. - If a second pattern would cover the same forces, prefer the one with lower total complexity.
Output Contract
When a pattern is selected or rejected, record in the artifact: pattern name, forces present, lightweight alternative considered (and why rejected), costs added, and the anti-pattern(s) avoided. A rejection is a valid outcome — "no pattern" is a design decision.
References
references/patterns-decision-guide.md— condensed tables: full problems, risks, and lightweight alternatives for each GoF + system architecture pattern; explicit anti-pattern catalog.
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.

