Back to Skills

design-patterns

verified

Use when refactoring code or designing flexible systems. Covers creational, structural, and behavioral patterns with Python examples.

View on GitHub

Marketplace

agi-marketplace

bfmcneill/agi-marketplace

Plugin

core

Repository

bfmcneill/agi-marketplace

core/skills/design-patterns/SKILL.md

Last Verified

January 21, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/bfmcneill/agi-marketplace/blob/main/core/skills/design-patterns/SKILL.md -a claude-code --skill design-patterns

Installation paths:

Claude
.claude/skills/design-patterns/
Powered by add-skill CLI

Instructions

# 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

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
3944 chars