PlugWiki

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. 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. 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

  1. When to Use This Skill
  2. Core Concepts
  3. 1. KISS (Keep It Simple)
  4. 2. Single Responsibility (SRP)
  5. 3. Composition Over Inheritance
  6. 4. Rule of Three
  7. Quick Start
  8. Detailed patterns and worked examples
  9. Best Practices Summary
  10. Troubleshooting
  11. Related Skills

Key facts

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 · KISS

  • Each unit has one reason to change

    Separate concerns into focused components.

    Read · Single Responsibility

  • Combine objects instead of extending classes

    Build behavior by composing objects.

    Read · Composition over inheritance

  • Wait 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 three

  • Small 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 practices

  • Five 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 · Troubleshooting

  • Eight 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

wshobson/agentsskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 2
  1. python-design-patterns SKILL.md · github.com
  2. python-design-patterns details.md · github.com

Updated Nov 2, 2026.