agentleFS
ku5icku5ic/claude-kit/skills/python-patterns/SKILL.md

python-patterns

Skill2 starsChanged 7 days agoMITView on GitHub

Python language-level patterns for type hints, strictness, project layout, async, error handling, packaging, and review-worthy anti-patterns. Use whenever the project contains `.py` files or a Python manifest (`pyproject.toml`, `requirements.txt`, `Pipfile`, `uv.lock`, `poetry.lock`), OR the user asks about Python, its typing and type checkers, its async model, or its packaging and project structure, even if "Python" is not mentioned by name.

56 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use configure-ecc, 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.
  • royaluniondesign-sysSkill

    configure-ecc

    Interactive installer for Everything Claude Code — guides users through selecting and installing skills and rules to user-level or project-level directories, verifies paths, and optionally optimizes installed files.

    Also in 12 projects that use this

  • loulanyueSkill

    nuxt4-patterns

    Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData.

    Also in 10 projects that use this

  • RojiosSkill

    dart-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 7 projects that use this

  • royaluniondesign-sysSkill

    content-hash-cache-pattern

    Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation.

    Also in 16 projects that use this

  • TironFoxSkill

    agent-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 6 projects that use this

  • TironFoxSkill

    openclaw-persona-forge

    为 OpenClaw AI Agent 锻造完整的龙虾灵魂方案。根据用户偏好或随机抽卡, 输出身份定位、灵魂描述(SOUL.md)、角色化底线规则、名字和头像生图提示词。 如当前环境提供已审核的生图 skill,可自动生成统一风格头像图片。 当用户需要创建、设计或定制 OpenClaw 龙虾灵魂时使用。 不适用于:微调已有 SOUL.md、非 OpenClaw 平台的角色设计、纯工具型无性格 Agent。 触发词:龙虾灵魂、虾魂、OpenClaw 灵魂、养虾灵魂、龙虾角色、龙虾定位、 龙虾剧本杀角色、龙虾游戏角色、龙虾 NPC、龙虾性格、龙虾背景故事、 lobster soul、lobster character、抽卡、随机龙虾、龙虾 SOUL、gacha。

    Also in 5 projects that use this

  • +1 more from royaluniondesign-sys

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 53 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Default assumption: Python 3.11 or later, type hints required on public function signatures, mypy or pyright in strict mode.

    line 8

“Common” is measured: kept by at least 6 in 10 of the 53 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Python patterns

Default assumption: Python 3.11 or later, type hints required on public function signatures, mypy or pyright in strict mode.

  • 3.11 is the floor: TaskGroup, Self, StrEnum, and ExceptionGroup all landed there.
  • 3.14 (current stable since 2025-10-07, latest 3.14.7) made deferred annotation evaluation the default; on older supported versions, from __future__ import annotations is still useful for forward references.
  • Adapt advice to the version in the project's .tool-versions, pyproject.toml, or .python-version.

Reference files

FileCovers
reference/typing.mdType hints, strictness, mypy/pyright per-module overrides
reference/project-layout.mdsrc/ layout, pyproject.toml, packaging, py.typed (PEP 561), namespace packages (PEP 420)
reference/async.mdasync def hazards, TaskGroup, anyio cancellation scopes
reference/errors.mdException design, chaining, LBYL vs EAFP, logger.exception
reference/common-patterns.mdDataclasses, enums, pathlib, functools.cache, Pydantic v2 patterns
reference/anti-patterns.mdThirteen language anti-patterns, free-threaded build implications, testing-adjacent items

References

Version notes

Checked: 2026-09-26 against https://www.python.org/downloads/ and https://docs.python.org/3/whatsnew/

  • 3.15 (pre-release, planned 2026-10-01): typing additions PEP 747 TypeForm, PEP 728 TypedDict(closed=True, extra_items=...), PEP 800 disjoint bases. Not yet guidance here.
  • 3.14 (2025-10-07, latest 3.14.7 on 2026-08-05): deferred annotation evaluation by default (PEP 649); from __future__ import annotations on a deprecation path (PEP 749); free-threaded build officially supported (PEP 779), 5-10% single-threaded penalty, not the default build.
  • 3.13: free-threaded build experimental (PEP 703). Once 3.13 reaches EOL the floor here moves and the from __future__ paragraph can go.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.