python-patterns
Skill4 starsChanged 56 days agoMITView on GitHub
Provides idiomatic modern Python (3.11+) patterns covering type hints, dataclasses and pydantic at boundaries, pathlib, context managers, generators, async basics, explicit error handling, and a uv/ruff/pytest project layout. Use when writing, reviewing, or refactoring Python code or setting up a Python project.
76 other projects use a version of this.
Adopted by
Most recently taken up by
- KevinLoichot/everything-claude-codetheir own version, first seen Nov 29, 2026
- aayushsoam/clawbot-plustheir own version, first seen Nov 29, 2026
- multiplex-ai/muggle-ai-teamstheir own version, first seen Nov 29, 2026
- gromov0737/skillstheir own version, first seen Nov 29, 2026
- Cyvid7-Darus10/claude-code-configtheir own version, first seen Nov 29, 2026
- hybridlabor-api/aostheir own version, first seen Nov 29, 2026
Used with
Projects with it also use upstash-qstash, nuxt4-patterns and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
xfstudioSkillupstash-qstash
Upstash QStash expert for serverless message queues, scheduled jobs, and reliable HTTP-based task delivery without managing infrastructure. Use when: qstash, upstash queue, serverless cron, scheduled http, message queue serverless.
Also in 5 projects that use this
loulanyueSkillnuxt4-patterns
Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData.
Also in 14 projects that use this
RojiosSkilldart-flutter-patterns
Production-ready Dart and Flutter patterns covering null safety, immutable state, async composition, widget architecture, popular state management frameworks (BLoC, Riverpod, Provider), GoRouter navigation, Dio networking, Freezed code generation, and clean architecture.
Also in 10 projects that use this
royaluniondesign-sysSkillcontent-hash-cache-pattern
Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation.
Also in 23 projects that use this
TironFoxSkillagent-payment-x402
Add x402 payment execution to AI agents — per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents need to pay for APIs, services, or other agents.
Also in 8 projects that use this
junimnjwSkillralphinho-rfc-pipeline
RFC-driven multi-agent DAG execution pattern with quality gates, merge queues, and work unit orchestration.
Also in 17 projects that use this
Other versions76 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 76
- vudovn/ag-kit★ 8.2ksame name
- vudovn/antigravity-kit★ 8.2ksame name
- openJiuwen-ai/agent-core★ 513same name
- loulanyue/awesome-claude-notes★ 272same name
- xenitV1/Antigravity-Workflows★ 130same name
- Fmarzochi/EGC★ 61same name
- kumaran-is/claude-code-onboarding★ 35same name
- Ashfaqbs/ai-coding-agent-toolkit★ 27same name
- VoDaiLocz/kilo-kit-mcp★ 27same name
- Benkapner/claude-code-basecamp★ 17same name
66 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- assessSkill
- brainstormingSkill
- brew-ideaSkill
- compound-learningsSkill
- executing-plansSkill
- flutter-patternsSkill
- jump-startSkill
- milestone-planningSkill
- react-patternsSkill
- tdd-workflowSkill
- using-opmSkill
- verification-before-completionSkill
- writing-plansSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.
0
Common
Most of the 73 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Always-true conventions (PEP 8, annotations, immutability, specific exceptions, config and secrets, FastAPI) live in OPM's rules …
- Distinctive: line 25
Explicit over implicit: No import-time side effects, no hidden global configuration.
- Very specific: line 38
Read references/typing-and-data.md when annotating code or modelling data (dataclass, pydantic, Protocol).
- Very specific: line 39
Read references/files-iteration-async.md when touching files, writing context managers or generators, or writing async code.
- Very specific: line 40
Read references/errors-and-logging.md when designing exceptions, logging, or config, or reviewing for anti-patterns.
- Very specific: line 41
Read references/project-and-testing.md when setting up a project (uv, ruff, pyright, pytest) or writing tests.
“Common” is measured: kept by at least 6 in 10 of the 73 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Python Patterns
Readable, explicit, typed. These patterns target Python 3.11 or newer with uv for
environments, ruff for lint and format, and pytest for tests.
Always-true conventions (PEP 8, annotations, immutability, specific exceptions, config and
secrets, FastAPI) live in OPM's rules python/coding-style.md and python/testing.md
(.claude/rules/opm/python/ once installed, rules/python/ in the plugin). This skill keeps
the patterns and worked examples.
When to use
- Writing new Python modules, packages, scripts, or services.
- Reviewing Python diffs for idiom, typing, and error handling.
- Setting up or modernising a Python project's tooling.
Core principles
- Readability over cleverness. Names say what things hold; comprehension over a three-line loop, a function over a three-clause comprehension.
- Explicit over implicit. No import-time side effects, no hidden global configuration.
- EAFP where the exception is the normal control flow (
try: d[key] except KeyError), LBYL where a check is cheaper and clearer (if path.exists()before a destructive operation). - Immutability by default: rule
python/coding-style.md(Immutability).
Decision rules
dataclassfor internal data you construct yourself;pydantic.BaseModelat system boundaries. Never pass rawdict[str, Any]deeper than the boundary.pathlibeverywhere, alwaysencoding="utf-8".- Anything that acquires must release, and
withis how Python says so. asynciofor I/O-bound concurrency, a thread pool for blocking libraries, processes for CPU-bound work.
References
- Read references/typing-and-data.md when annotating code or modelling data (dataclass, pydantic, Protocol).
- Read references/files-iteration-async.md when touching files, writing context managers or generators, or writing async code.
- Read references/errors-and-logging.md when designing exceptions, logging, or config, or reviewing for anti-patterns.
- Read references/project-and-testing.md when setting up a project (uv, ruff, pyright, pytest) or writing tests.
Review checklist
- Every public function is annotated;
Anyappears only at a justified boundary. - External input is validated into a model at the edge.
- Files, sockets, locks, and transactions are opened with
with. - No bare
except; exceptions are chained; errors are logged once. pathlibandencoding="utf-8"for all file access.- Async code has no blocking calls and bounds its concurrency.
ruff check,ruff format --check,pyright, andpytestall pass.
Related skills
opm:tdd-workflow- pytest RED/GREEN cycle withuv run pytest.opm:verification-before-completion(full gate) - the uv/ruff/pytest gate sequence.
<!-- Adapted from affaan-m/ecc (MIT) -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

