Agent skill · software engineering · aiskillstore

python-design-patterns

Python design patterns including KISS, Separation of Concerns, Single Responsibility, and composition over inheritance. Use when making architecture decisions, refactoring code structure, or evaluating when abstractions are appropriate.

Why this skill is useful

Provides domain-specific knowledge on design patterns that enhance code maintainability and architecture decisions in Python.

What it needs

About 6k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

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 Fundamental Patterns Pattern 1: KISS - Keep It Simple Before adding complexity, ask: does a simpler solution work? The factory pattern adds code without adding value here. Save patterns for when they solve real problems. Pattern 2: Single Responsibility Principle Each class or function should have one reason to change. Now HTTP changes don't affect business logic, and vice versa. Pattern 3: Separation of Concerns Organize code into distinct layers with clear responsibilities. Each layer depends only on layers below it: Pattern 4: Composition Over Inheritance Build behavior by combining objects rather than inheriting. Advanced Patterns Pattern 5: Rule of Three Wait until you have three instances before abstracting. Pattern 6: Function Size Guidelines Keep functions focused. Extract when a function: Exceeds 20-50 lines (varies by complexity) Serves multiple distinct purposes Has deeply nested logic (3+ levels) Pattern 7: Dependency Injection Pass dependencies through constructors for testability. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/python-design-patterns

View the source on GitHub

Browse the @skills marketplace