python-standards
Skill1 starsChanged 2 months agoMITView on GitHub
Pythonコーディング規約を確認・適用するとき、「規約を確認して」と言われたときに参照する。
7 other projects use a version of this.
Adopted by
Most recently taken up by
- pablolok/claude-skillstheir own version, first seen Oct 13, 2026
- microsoft/amplifier-module-tool-skillstheir own version, first seen Oct 13, 2026
- microsoft/amplifier-bundle-skillstheir own version, first seen Oct 13, 2026
- L-1124/QQMusicApitheir own version, first seen Oct 8, 2026
- alphacrack/readme2demotheir own version, first seen Jul 5, 2026
- motola10/claude-code-basetheir own version, first seen Jun 26, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- L-1124/QQMusicApi★ 529same name
- microsoft/amplifier-bundle-skills★ 12same name
- alphacrack/readme2demo★ 9same name
- microsoft/amplifier-module-tool-skills★ 8same name
- rishapgandhi/python-skills★ 4same name
- motola10/claude-code-base★ 1same name
- pablolok/claude-skills★ 1same name
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 repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adrSkill
- architecture-checkSkill
- brainstormSkill
- branch-namingSkill
- codex-delegateSkill
- config-explainSkill
- config-setSkill
- cross-reviewSkill
- design-interviewSkill
- diagnosing-bugsSkill
- fix-ciSkill
- handoffSkill
- leakage-checkSkill
- literature-reviewSkill
- mlflow-logSkill
- multi-seedSkill
- mutation-testSkill
- paper-writingSkill
- pre-mortemSkill
- property-testSkill
- refactor-scoutSkill
- regression-suiteSkill
- retrospectiveSkill
- security-reviewSkill
- spec-checklistSkill
- tddSkill
The file
Files
Python プロジェクト標準
プロジェクト全体で統一するPythonの規約。CONTEXT.md(ドメイン用語)とは別に、 コーディング規約をここに固定する。
パッケージ管理
- パッケージマネージャ: uv
- Python バージョン: 3.12
- 依存の追加:
uv add <パッケージ>(pyproject.toml に記録される) - 開発用依存:
uv add --dev <パッケージ>
テスト
- フレームワーク: pytest
- 実行:
uv run python -m pytest tests/ -q - fixture を活用し、テスト間でデータを共有する場合は conftest.py に置く
- カバレッジ目標: 特に定めないが、公開する関数には最低1テストを書く
合成データとログ出力
- テストは合成データのみを使う。
data/raw等の実データをテストの入力・fixture に含めない - ログ・標準出力には shape / hash / 統計量のみを書き、個票(レコード単位の生の値)を print しない(データの静かな漏洩を防ぐ)
型ヒント
- 公開する関数・メソッドには型ヒントを必ず付ける
- 内部のヘルパー関数は省略可
Anyの使用は最小限に。使う場合はコメントで理由を添える- Python 3.10+ の型構文(
list[str],X | None)を使う。typing.List,typing.Optionalは使わない
テンソルの shape/dtype 注釈(ML コードのみ)
- 動機: mypy は
Tensorの中身(次元・dtype)を検査できないため、 shape/dtype の食い違いは型チェックを素通りする。 - 対象: テンソルを受け渡す公開関数(モデルの forward、collate_fn、 前処理、損失、評価指標)。
- 手段1: jaxtyping の注釈(
Float[Tensor, "batch instance dim"]のように dtype(Float等)と次元名まで書き、次元名は関数をまたいで一貫させ CONTEXT.md の用語に合わせる)。 導入はuv add --dev jaxtyping beartype。実行時検査はテスト実行時にだけ 有効化し、有効化の具体的な記述は jaxtyping の公式ドキュメントに従う (conftest.py に置き、本番実行のオーバーヘッドを増やさない)。 - 手段2(依存を増やせない場合の代替): docstring に Shape/dtype 節(入力・出力の
次元・dtype)を書き、テストで
assert x.shape == (...)と dtype の assert を 1つ以上置く。 - どちらも無いテンソル受け渡し関数は evaluator-standards の「型安全性」で 指摘対象になる。
- 注意: このテンプレート本体に対象コードは無い。この節は導入先 プロジェクト向けの規約である。
docstring
- スタイル: Google スタイル
- 公開する関数・クラスには必ず付ける。Args / Returns / Raises を書く
- 内部のヘルパーは1行docstringで可
フォーマット / リント
- ruff format + ruff check(設定は pyproject.toml に記載)
- auto_format.py フックで .py 編集後に自動実行される
import の順序
- 標準ライブラリ → サードパーティ → プロジェクト内
- ruff の isort 互換ルールに任せる(手動で並べ替えない)
このスキルの使い方
- Generator がコードを書くとき: この規約に沿っているか自己チェックする
- evaluator-standards がレビューするとき: この規約を基準に判定する
- 新しいプロジェクトで規約を変えたい場合: このファイルをコピーして プロジェクト直下に置き、内容を編集する
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.

