Engineering · Skill
Python Design Patterns
Python design patterns including KISS, Separation of Concerns, Single Responsibility, and composition over inheritance. Use this skill when designing a new service or component from scratch and choosing how to layer responsibilities, when refactoring a God class or monolithic function that has grown too large, when deciding whether to add a new abstraction or live with duplication, when evaluating a pull request for structural issues like tight coupling or leaking internal types, when choosing between inheritance and composition for a new class hierarchy, or when a codebase is becoming hard to test because of entangled I/O and business logic.
Open in PhởWhat the skill covers
The sections of its instructions, in order.
- 01 When to Use This Skill
- 02 Core Concepts
- 1. KISS (Keep It Simple)
- 2. Single Responsibility (SRP)
- 3. Composition Over Inheritance
- 4. Rule of Three
- 03 Quick Start
- 04 Detailed patterns and worked examples
- 05 Best Practices Summary
- 06 Troubleshooting
- 07 Related Skills
Reference files
1 file Phở can open while it uses the skill.
- references/details.md
More in Python development
- Async Python Patterns
Master Python asyncio, concurrent programming, and async/await patterns for high-performance applications. Use when building async APIs, concurrent systems, or I/O-bound…
- Python Anti-Patterns Checklist
Use this skill when reviewing Python code for common anti-patterns to avoid. Use as a checklist when reviewing code, before finalizing implementations, or when debugging issues…
- Python Background Jobs & Task Queues
Python background job patterns including task queues, workers, and event-driven architecture. Use when implementing async task processing, job queues, long-running operations, or…
- Python Code Style & Documentation
Python code style, linting, formatting, naming conventions, and documentation standards. Use when writing new code, reviewing style, configuring linters, writing docstrings, or…
- Python Configuration Management
Python configuration management via environment variables and typed settings. Use when externalizing config, setting up pydantic-settings, managing secrets, or implementing…
- Python Error Handling
Python error handling patterns including input validation, exception hierarchies, and partial failure handling. Use when implementing validation logic, designing exception…
- Python Observability
Python observability patterns including structured logging, metrics, and distributed tracing. Use when adding logging, implementing metrics collection, setting up tracing, or…
- Python Packaging
Create distributable Python packages with proper project structure, setup.py/pyproject.toml, and publishing to PyPI. Use when packaging Python libraries, creating CLI tools, or…
- Python Performance Optimization
Profile and optimize Python code using cProfile, memory profilers, and performance best practices. Use when debugging slow Python code, optimizing bottlenecks, or improving…
- Python Project Structure & Module Architecture
Python project organization, module architecture, and public API design. Use when setting up new projects, organizing modules, defining public interfaces with __all__, or…
- Python Resilience Patterns
Python resilience patterns including automatic retries, exponential backoff, timeouts, and fault-tolerant decorators. Use when adding retry logic, implementing timeouts, building…
- Python Resource Management
Python resource management with context managers, cleanup patterns, and streaming. Use when managing connections, file handles, implementing cleanup logic, or building streaming…
- Python Testing Patterns
Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing…
- Python Type Safety
Python type safety with type hints, generics, protocols, and strict type checking. Use when adding type annotations, implementing generic classes, defining structural interfaces…
- UV Package Manager
Master the uv package manager for fast Python dependency management, virtual environments, and modern Python project workflows. Use when setting up Python projects, managing…
Similar engineering skills
Frequently asked questions
What does Python Design Patterns do?
Python design patterns including KISS, Separation of Concerns, Single Responsibility, and composition over inheritance. Use this skill when designing a new service or component from scratch and choosing how to layer responsibilities, when refactoring a God class or monolithic function that has grown too large, when deciding whether to add a new abstraction or live with duplication, when evaluating a pull request for structural issues like tight coupling or leaking internal types, when choosing between inheritance and composition for a new class hierarchy, or when a codebase is becoming hard to test because of entangled I/O and business logic.
Is Python Design Patterns free to use?
Yes. Python Design Patterns is published by Seth Hobson under the MIT licence, and you can use it with a free Phở account.
How do I use Python Design Patterns in Phở?
Press Open in Phở, then Try to apply it to your next message, or add the Python development set so Phở loads it whenever a request matches.
Does Python Design Patterns need other tools?
No. It works in a normal Phở chat with what you type or upload.
Copied unchanged from wshobson/agents at commit 7e2fb55 and credited to Seth Hobson, who is not affiliated with Phở. The full instructions and licence text ship with the skill inside Phở.