design-patterns
Installation
SKILL.md
Design Patterns Skill
Goal
To improve code maintainability, flexibility, and readability by applying proven solutions to common design problems.
Supported Patterns (2025 Context)
Creational
- Factory / Builder: For complex object construction (e.g., configuring LLM clients).
- Singleton: Use sparingly (e.g., for Database connections or Logging service).
Structural
- Adapter: Connecting legacy code or external APIs (e.g., standardizing different LLM APIs).
- Facade: Simplifying complex subsystems (e.g., a simple
WebScraperclass wrapping Puppeteer). - Composite: For tree structures (e.g., parsing code ASTs).
Behavioral
- Strategy: Swappable algorithms (e.g., switching between 'Fast' and 'Smart' search).
- Observer: Event handling (e.g., updating UI when data changes).
- State: Managing complex entity lifecycles (e.g., Order status: Pending -> Paid -> Shipped).