python-patterns

A set of practical patterns for structuring maintainable Python packages, libraries, and command-line tools. It focuses on type hints, data classes, file paths, error handling, and clear module boundaries.

In plain words
What is it for?
Use it when creating or refactoring Python libraries, command-line tools, and modules while keeping the code organized and readable.
Why use it?
It helps prevent Python code from becoming tangled, unclear, or difficult to change. It also favors simple standard-library solutions before adding outside packages.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/erichare/skillroute/python-patterns
Any agent
npx skills add erichare/skillroute --skill python-patterns
Clone the repo
git clone --depth 1 https://github.com/erichare/skillroute

Made for: Claude Code, Codex.

Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 104 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00023 $0.00104
Opus 5 $0.00012 $0.00052
Sonnet 5 $0.00005 $0.00021
Haiku 4.5 $0.00002 $0.00010

Measured yesterday against content hash e8cbefd64f18, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

python-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

examples/skills/python-patterns/SKILL.md · 19 lines

What it actually says

Python Patterns

Use this skill for Python package structure, idiomatic code, error handling, dataclasses, and maintainable module design.

When to Use

  • Build a new Python library or CLI.
  • Refactor Python modules without changing behavior.
  • Choose simple standard-library patterns before adding dependencies.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 19 lines · 23 tokens per session scan A e8cbefd64f18

Subscribe to this mod's changes

python-patterns is a skill published in the GitHub repository erichare/skillroute (39 stars, last pushed 5d ago), licensed MIT. It adds 23 tokens to every session and 104 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

opendream-context

Reference only. Canonical rules stay in README.md, AGENTS.md, and docs/.

pylit-ai/opendream · 0 tokens

mcp-apps-builder

MANDATORY for ALL MCP server work - mcp-use framework best practices and patterns. READ THIS FIRST before any MCP server work, including: Creating new MCP servers Modifying existing MCP servers (adding/updating tools, resources, prompts, widgets) Debugging MCP server issues or errors Reviewing MCP server code for…

Shubhamsaboo/awesome-llm-apps · 139 tokens

project-graveyard

Scans the developer's machine for dead side projects, autopsies each one from its git history (died at the payments wall, killed by a newer project, finished but never shipped), surfaces their personal death patterns, and picks the corpse most worth resurrecting — then helps ship it. Use when the user mentions…

Shubhamsaboo/awesome-llm-apps · 127 tokens

commit-archaeologist

Reconstructs why code exists from local git history, including the introducing commit, later changes, current authors, repeated companion files, and likely intent. Use when the user asks "why does this code exist", "who wrote this function and why", or to "explain the history of this function" before a rewrite…

Shubhamsaboo/awesome-llm-apps · 82 tokens

dependency-doctor

Checks requirements.txt, pyproject.toml, and package.json dependency manifests for surface-level direct-dependency footguns: standard-library shadowing pins, abandoned backports, unpinned dependencies, and obvious intra-manifest conflicts, plus opt-in PyPI yanked releases. Use when the user asks to check a manifest…

Shubhamsaboo/awesome-llm-apps · 115 tokens

scope-creep-detector

Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad pull requests, changes that grew beyond a fix, dependency additions, public API renames, config or CI edits, oversized hunks, and formatting-only files. Use when the user asks whether a change grew beyond the fix, a PR is too…

Shubhamsaboo/awesome-llm-apps · 98 tokens