Design
836 installs
python-design-patterns
by wshobson/agents
Python design patterns including KISS, Separation of Concerns, Single Responsibility, and composition over inheritance. Use this skill when designing a new…
Skill content
Fundamental design principles for writing maintainable, testable Python code. - Covers five core patterns: KISS (Keep It Simple), Single Responsibility Principle, Separation of Concerns, Composition Over Inheritance, and the Rule of Three - Includes practical code examples contrasting anti-patterns with recommended approaches for each principle - Provides layered architecture guidance (API, Service, Repository layers) with dependency injection patterns for testability - Emphasizes explicit, readable code over premature abstraction and offers guidelines for function size and complexity management 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.