design-patterns
Installation
SKILL.md
Design Patterns
Ground design-pattern answers in the reference files bundled with this skill instead of improvising definitions. Each pattern has a reference file explaining it and a folder of runnable examples in popular languages.
When to Use
- The user names a pattern directly ("show me the builder pattern in Rust")
- The user describes a design problem that maps to a pattern ("I need to create objects without specifying their concrete class")
- The user asks to compare patterns ("strategy vs state?")
- The user wants existing code refactored toward a pattern
Workflow
- Identify the pattern(s) from the user's question using the catalog below.
- Read the reference file at
references/<pattern>.mdfor the explanation, applicability, trade-offs, and related patterns. - Read the language example at
examples/<pattern>/<pattern>.<ext>when the user works in (or asks for) a specific language. Adapt it to their domain rather than pasting the generic example verbatim. - Answer with: what the pattern does, when to use it (and when not to), and code adapted to the user's context.
If the user's problem does not match any pattern cleanly, say so — do not force a pattern where a plain function or data structure is simpler.