design-patterns
Skill22 starsChanged 9 months agoMITView on GitHub
Comprehensive skill for all 26 Gang of Four design patterns with practical implementations and real-world examples. Use when the user asks to apply a design pattern, refactor code using patterns, choose between competing patterns, or review existing pattern usage. Covers creational (Abstract Factory, Builder, Factory Method, Prototype, Singleton, Object Pool), structural (Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy, Private Class Data), and behavioral patterns (Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, Visitor, Null Object) with real-world examples, trade-offs, and anti-patterns.
18 other projects use a version of this.
Adopted by
Most recently taken up by
- fourcolors/skillstheir own version, first seen Sep 30, 2026
- ralvarezdev/ralvaskillstheir own version, first seen Sep 29, 2026
- rtk-ai/rtktheir own version, first seen Sep 22, 2026
- decebals/claude-code-javatheir own version, first seen Sep 6, 2026
- CasLubbers/code-design-skillstheir own version, first seen Aug 25, 2026
- waybarrios/opencode-power-packtheir own version, first seen Aug 17, 2026
Used with
Projects with it also use logging-patterns, jpa-patterns and 7 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 5 projects that use this
FaisalAlqarniSkilljpa-patterns
JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.
Also in 4 projects that use this
MindrallySkillspring-boot
Expert guidance for Spring Boot application development with best practices for RESTful APIs, testing, security, and deployment
Also in 3 projects that use this
kayamanSkillsolid-principles
Enforces SOLID principles (SRP, OCP, LSP, ISP, DIP) in object-oriented and multi-paradigm code. Use when designing classes and interfaces, evaluating responsibility assignment, reviewing code for coupling issues, applying dependency inversion, refactoring fat interfaces, or checking that subtypes are truly substitutable.
Also in 3 projects that use this
Model Context ProtocolSkillissue-triage
Generate an issue triage report for the C# MCP SDK. Fetches all open issues, evaluates SLA compliance against SDK tier requirements, reviews issue discussions for status and next steps, cross-references related issues in other MCP SDK repos, and produces a BLUF markdown report. Use when asked to triage issues, audit SLA compliance, review open issues, or generate an issue report.
Also in 3 projects that use this
MicrosoftSkillcode-quality
Statically check changed C# against the same deterministic rules github-code-quality[bot] runs on pull requests, so a contributor can fix likely findings before opening the PR and keep the bot's inline comments to a minimum. Activate when a contributor asks to "check code quality", "run code quality on my changes", "will the code quality bot complain", "pre-check before I open the PR", "code quality check", or similar. Scoped to C#. Reads the diff and compares it against the enumerated csharp-code-quality rule set below — no CodeQL download or build required. This is a fast approximation of a dataflow engine, not a reproduction; report accordingly. Does NOT apply fixes unless explicitly asked.
Also in 3 projects that use this
Other versions18 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 18
- rtk-ai/rtk★ 82ksame name
- piomin/claude-ai-spring-boot★ 1.3ksame name
- decebals/claude-code-java★ 747same name
- waybarrios/opencode-power-pack★ 531same name
- FlorianBruniaux/ccboard★ 96same name
- ratacat/claude-skills★ 56same name
- booklib-ai/booklib★ 38same name
- nimadorostkar/Claude-Skills-collection★ 28same name
- DIL8654/claude-code-dotnet-template★ 9same name
- CasLubbers/code-design-skills★ 2same name
8 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 repository44 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- accessibilitySkill
- api-designSkill
- cicdSkill
- clean-architectureSkill
- database-designSkill
- debuggingSkill
- dispatching-parallel-agentsSkill
- git-workflowSkill
- microservicesSkill
- performanceSkill
- refactoringSkill
- scrumSkill
- securitySkill
- solidSkill
- subagent-driven-developmentSkill
- testingSkill
- verification-before-completionSkill
- composer-dependenciesSkill
- finishing-branchSkill
- php-upgradeSkill
- ticket-deliverySkill
- worktree-opsSkill
- architectSkill
- backend-devSkill
- frontend-devSkill
- product-managerSkill
- project-managerSkill
- qa-engineerSkill
- scrum-masterSkill
- agent-creatorSkill
- agentic-rules-writerSkill
- agent-teamsSkill
- brainstormingSkill
- dispatching-agent-teamsSkill
- image-annotateSkill
- plugin-creatorSkill
- pr-message-writerSkill
- report-writerSkill
- stakeholder-update-writerSkill
- ticket-writerSkill
- using-ecosystemSkill
- web-screenshotSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 18 edited versions we read keep these.
1
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 80
Keep pattern implementations minimal — if the pattern introduces more complexity than it resolves, reconsider the approach
“Common” is measured: kept by at least 6 in 10 of the 18 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
A thorough reference covering 26 design patterns organized by intent — creational, structural, and behavioral — featuring PHP 8.3+ implementations, UML guidance, and practical use cases.
Pattern Index
Creational Patterns
- Abstract Factory — Produce families of related objects without specifying their concrete classes → reference
- Builder — Assemble complex objects through a step-by-step process → reference
- Factory Method — Declare an interface for object creation, letting subclasses determine the concrete type → reference
- Prototype — Duplicate existing objects without coupling to their concrete classes → reference
- Singleton — Guarantee that a class has exactly one instance → reference
- Object Pool — Recycle expensive-to-create objects for repeated use → reference
Structural Patterns
- Adapter — Translate one interface into another that clients expect → reference
- Bridge — Separate an abstraction from its implementation so both can evolve independently → reference
- Composite — Arrange objects into tree structures for uniform treatment → reference
- Decorator — Layer new behaviors onto objects dynamically through wrapping → reference
- Facade — Offer a streamlined interface to a complex subsystem → reference
- Flyweight — Minimize memory usage by sharing common state across many objects → reference
- Proxy — Manage access to an object through a surrogate → reference
- Private Class Data — Limit access to class attributes → reference
Behavioral Patterns
- Chain of Responsibility — Route requests through a chain of handlers → reference
- Command — Represent requests as standalone objects → reference
- Interpreter — Establish a grammar representation and an interpreter for it → reference
- Iterator — Walk through elements without revealing the underlying structure → reference
- Mediator — Tame chaotic dependencies through a central coordinator → reference
- Memento — Snapshot and restore object state without breaking encapsulation → reference
- Null Object — Supply a do-nothing default to eliminate null checks → reference
- Observer — Automatically inform dependents when state changes → reference
- State — Change behavior when internal state transitions → reference
- Strategy — Make algorithms interchangeable at runtime → reference
- Template Method — Outline an algorithm skeleton and let subclasses fill in specific steps → reference
- Visitor — Introduce operations to objects without altering their classes → reference
When to Use Which Pattern
| Problem | Pattern |
| Need to create families of related objects | Abstract Factory |
| Complex object construction with many options | Builder |
| Want to defer instantiation to subclasses | Factory Method |
| Need copies of complex objects | Prototype |
| Need exactly one instance globally | Singleton |
| Incompatible interfaces need to work together | Adapter |
| Want to vary abstraction and implementation independently | Bridge |
| Tree structures with uniform treatment | Composite |
| Add responsibilities dynamically without subclassing | Decorator |
| Simplify a complex subsystem interface | Facade |
| Many similar objects consuming too much memory | Flyweight |
| Control access, add lazy loading, or log access | Proxy |
| Multiple handlers for a request, unknown which handles it | Chain of Responsibility |
| Queue, log, or undo operations | Command |
| Need to interpret a simple language/grammar | Interpreter |
| Traverse a collection without exposing internals | Iterator |
| Reduce coupling between many communicating objects | Mediator |
| Need undo/snapshot capability | Memento |
| One-to-many event notification | Observer |
| Object behavior depends on its state | State |
| Need to switch algorithms at runtime | Strategy |
| Algorithm skeleton with customizable steps | Template Method |
| Add operations to object structures without modification | Visitor |
Best Practices
- Favor composition over inheritance — reach for Decorator, Strategy, or Bridge before resorting to deep class hierarchies
- Apply patterns to address real problems, not hypothetical ones
- Leverage PHP 8.3+ features: enums for State, readonly classes for Value Objects, first-class callables for Strategy
- Combine patterns when it makes sense (e.g., Builder + Fluent Interface, Strategy + Factory Method)
- Keep pattern implementations minimal — if the pattern introduces more complexity than it resolves, reconsider the approach
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.

