Use when refactoring code or designing flexible systems. Covers creational, structural, and behavioral patterns with Python examples.
View on GitHubbfmcneill/agi-marketplace
core
core/skills/design-patterns/SKILL.md
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/bfmcneill/agi-marketplace/blob/main/core/skills/design-patterns/SKILL.md -a claude-code --skill design-patternsInstallation paths:
.claude/skills/design-patterns/# Design Patterns Classic object-oriented design patterns for building flexible, maintainable software. ## When to Use This Skill Use this skill when: - **Refactoring code** with complex conditionals or tight coupling - **Designing systems** that need flexibility for future changes - **Recognizing anti-patterns** that a design pattern would solve - **Code reviews** where design decisions need validation - **Explaining patterns** to team members ## Pattern Categories ### Creational Patterns Focus on object creation mechanisms: - **Factory Method** - Decouple object creation from usage - **Singleton** - Single global instance - **Builder** - Complex object construction step-by-step - **Abstract Factory** - Families of related objects ### Structural Patterns Deal with object composition: - **Decorator** - Add behaviors dynamically - **Facade** - Simplify complex subsystems - **Adapter** - Make incompatible interfaces work together - **Proxy** - Control access, caching, lazy loading ### Behavioral Patterns Address communication between objects: - **Observer** - Event notification/subscription - **Strategy** - Interchangeable algorithms - **Command** - Encapsulate requests as objects - **State** - Behavior based on internal state ## Quick Reference | Pattern | Use When | Complexity | |---------|----------|------------| | Factory Method | Creating objects without specifying exact class | Medium | | Singleton | Need single global instance | Easy | | Builder | Complex construction with many optional params | Medium | | Decorator | Adding behaviors dynamically | Medium | | Facade | Simplifying complex library/subsystem | Easy | | Adapter | Integrating incompatible interfaces | Easy | | Observer | Multiple objects need state change notifications | Medium | | Strategy | Switching algorithms at runtime | Medium | | Command | Undo/redo, queuing, scheduling operations | Medium | | State | Object behavior varies by internal state | Hard | ## Pattern Selection Guide **Pr