python-design-patterns skill (wshobson): design principles for Python code
A reference skill that makes your agent apply simple design principles when it designs or refactors Python code.
- Installs
- 23.3K
- on skills.sh
- Stars
- 42.1K
- on GitHub
- Files
- 1
- besides SKILL.md
- Updated
- Oct 2026
- last repo commit
python-design-patterns is guidance, not a tool. The agent loads it when you design a Python service, split a class that grew too big, choose between inheritance and composition, or decide whether to add an abstraction.
The SKILL.md states four core ideas: keep it simple, single responsibility, composition over inheritance and the rule of three. It adds ten best practices and a troubleshooting list. references/details.md holds eight patterns with code. The skill bundles no scripts.
Good for
- Python developers designing a new service or component
- Engineers refactoring a God class or an oversized function
- Reviewers checking pull requests for tight coupling
Install python-design-patterns
Claude Code
- 1
Copy this prompt.
Install the python-design-patterns skill in Claude Code. Run this command: npx skills add https://github.com/wshobson/agents --skill python-design-patterns Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
From its listing on skills.sh. Source.
What's in the skill
When it loads
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.
Sections in SKILL.md
- When to Use This Skill
- Core Concepts
- 1. KISS (Keep It Simple)
- 2. Single Responsibility (SRP)
- 3. Composition Over Inheritance
- 4. Rule of Three
- Quick Start
- Detailed patterns and worked examples
- Best Practices Summary
- Troubleshooting
- Related Skills
Key facts
- Author
- wshobson (agents repo)
- Installs on skills.sh
- 23,287 as of 2026-11-02
- License
- MIT (as detected by GitHub)
- Last commit to the repo
- 2026-10-30
What it includes
Choose the simplest solution that works
Complexity must be justified by concrete requirements. The quick start shows a plain dictionary of formatters instead of a factory or registry.
Read ·
KISSEach unit has one reason to change
Separate concerns into focused components.
Read ·
Single ResponsibilityCombine objects instead of extending classes
Build behavior by composing objects.
Read ·
Composition over inheritanceWait for three copies before abstracting
Duplication is often better than a premature abstraction. The troubleshooting section says to abstract sooner if copies diverge and cause bugs.
Read ·
Rule of threeSmall functions, injected dependencies, tests per layer
Includes keeping functions to 20 to 50 lines, constructor injection, deleting dead code before abstracting, and explicit over clever.
Read ·
Ten best practicesFive fixes for growing classes, long constructors and layering
Covers the reason-to-change test, constructors with 7 or more parameters, shallow composition, diverging duplicates and services importing from the API layer.
Read ·
TroubleshootingEight patterns with Python examples
Patterns 1 to 8: KISS, single responsibility, separation of concerns, composition over inheritance, rule of three, function size, dependency injection and common anti-patterns.
Try: “This UserService class has HTTP parsing and business rules mixed together. Split it.”
Read ·
references/details.md
From the official docs
Questions
What does python-design-patterns do?
It makes your agent follow a small set of design principles when it writes or refactors Python. These are KISS, single responsibility, separation of concerns, composition over inheritance and the rule of three.
Does it teach classic patterns like Factory or Observer?
Mostly the opposite. The SKILL.md's quick start replaces a factory or registry with a dictionary, and it says to wait for three instances before abstracting.
How do I install it in Claude Code, the Claude app or Codex?
Use the install box at the top of this page. The SKILL.md does not name which clients it works in, and the repo is a collection of plugins, so check the repo README for its own install routes.
Does it work with other skills?
Its Related Skills section links python-testing-patterns and python-project-structure from the same plugin collection. They are optional extras, not requirements. Install them only if you want testing and layout guidance too.
Does it need an API key?
None is mentioned in the SKILL.md or its reference file.
Is it safe to install?
It is two markdown files and bundles no scripts. It changes how your agent structures code, so review refactors the same way you review any large diff. Large moves of code can break behavior even when the design looks cleaner.
Information
updated Nov 2, 2026
- Repository
- wshobson/agents
- Folder
plugins/python-development/skills/python-design-patterns
Sources
Docs, issue trackers and discussions this page is built from.
Show all 2Hide
- python-design-patterns SKILL.md · github.com
- python-design-patterns details.md · github.com