# Design Patterns

> Use when: apply a design pattern to a real problem without over-engineering the solution.

- Skill: `kimtth/design-patterns` (Agent Skill)
- Install (CLI): `npx skillmds@latest add kimtth/design-patterns`
- Raw SKILL.md: https://api.skillmd.com/api/skills/kimtth/design-patterns/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: kimtth (https://skillmd.com/u/kimtth)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/kimtth/design-patterns

---


Goal: use patterns to clarify design, not to decorate simple code.

Use for:
- recurring design problems with known solutions
- naming and structuring a chosen approach
- reviewing whether a pattern fits or adds noise

Workflow:
1. State the actual problem and forces involved.
2. Match it to a pattern's intent, not its name.
3. Apply the smallest form that solves the problem.
4. Name the participants clearly in the code.
5. Reassess: would plain code be simpler here.
6. Verify behavior is unchanged and clearer.

Common patterns:
- strategy for interchangeable behavior
- factory for controlled construction
- adapter to bridge incompatible interfaces
- observer for event notification
- decorator to add behavior without subclassing

Rules:
- choose by intent, not by familiarity
- do not introduce a pattern for a one-off case
- prefer composition over inheritance-heavy patterns
- the simplest design that works beats a clever one

