python-design-patternslisted
Install: claude install-skill Adnova-Group/muster
# Python Design Patterns
Write maintainable Python code using fundamental design principles. These patterns help you build systems that are easy to understand, test, and modify.
## When to Use This Skill
- Designing new components or services
- Refactoring complex or tangled code
- Deciding whether to create an abstraction
- Choosing between inheritance and composition
- Evaluating code complexity and coupling
- Planning modular architectures
## Core Concepts
### 1. KISS (Keep It Simple)
Choose the simplest solution that works. Complexity must be justified by concrete requirements.
### 2. Single Responsibility (SRP)
Each unit should have one reason to change. Separate concerns into focused components.
### 3. Composition Over Inheritance
Build behavior by combining objects, not extending classes.
### 4. Rule of Three
Wait until you have three instances before abstracting. Duplication is often better than premature abstraction.
## Quick Start
```python
# Simple beats clever
# Instead of a factory/registry pattern:
FORMATTERS = {"json": JsonFormatter, "csv": CsvFormatter}
def get_formatter(name: str) -> Formatter:
return FORMATTERS[name]()
```
## Detailed patterns and worked examples
Detailed pattern documentation lives in `references/details.md`. Read that file when the navigation tier above is insufficient.
## Best Practices Summary
1. **Keep it simple** - Choose the simplest solution that works
2. **Single responsibility** - Each unit has one reason to