design-patterns
Design Patterns
Proven solutions to recurring design problems.
Context
You are selecting a design pattern for a problem. Understand the tradeoffs of each.
Domain Context
- Creational: How to create objects? (Singleton, Factory, Builder, Prototype)
- Structural: How to compose objects? (Adapter, Bridge, Facade, Proxy, Decorator)
- Behavioral: How do objects interact? (Observer, Strategy, State, Command, Iterator)
Instructions
- Identify Problem: What design issue are you facing?
- Map to Pattern: Which pattern solves this?
- Understand Intent: Why does this pattern work?
- Consider Tradeoffs: Complexity, flexibility, testability?
- Implement: Code the pattern; don't memorize, understand
- Refine: Adapt the pattern to your context
Anti-Patterns
- Applying patterns everywhere (pattern obsession); YAGNI
- Stacking patterns (Factory + Builder + Proxy); complexity without benefit
- Not understanding the pattern before using it; cargo cult programming
- Choosing pattern based on name not problem; same name, different intent
- Over-engineering simple problems with patterns; sometimes direct code is clearer
Further Reading
- Gang of Four, Design Patterns (the bible)
- Eric Freeman & Elisabeth Freeman, Head First Design Patterns
- Refactoring.Guru Design Patterns online
More from sethdford/claude-skills
api-test-automation
Expert approach to api-test-automation in test automation. Use when working with .
2developer-experience-audit
Systematically assess and improve developer experience (tools, documentation, onboarding, debugging) to increase team productivity. Use in roadmapping or when noticing developer friction.
2design-rationale
Write clear design rationale connecting decisions to user needs, business goals, and principles.
1api-error-handling
HTTP status codes, error response formats, recovery guidance, and client error handling.
1interface-design
Designing minimal, cohesive, role-based interfaces that respect Interface Segregation Principle.
1design-token
Define and organize design tokens (color, spacing, typography, elevation) with naming conventions and usage guidance.
1