一键导入
python
Python development guidelines and best practices. Use when working with Python code.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Python development guidelines and best practices. Use when working with Python code.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | python |
| description | Python development guidelines and best practices. Use when working with Python code. |
Standards and best practices for Python development. Follow these guidelines when writing or modifying Python code.
Apply DRY, KISS, and SOLID consistently. Prefer functional methods where relevant; use classes for stateful behavior. Use composition with Protocol classes for interfaces rather than inheritance. Each module should have a single responsibility. Use dependency injection for class dependencies.
Any unless necessary__init__.py; prefer blank filesdict, list instead of typing.Dict, typing.Liststr | None instead of Optional[str]from __future__ import annotations at top of files with type hintsenvironment.py file with individual methods per variable (e.g., api_key() for API_KEY, database_url() for DATABASE_URL)src/ directory structuretest_def foo() create class TestFoopytest over unittestpytest-mock for mockingconftest.py for shared fixturestests/__test_<package_name>__ for shared testing codeWhen implementing Python code:
references/uv-scripts.md.references/uv-monorepo.md.Best practices when developing in Crystal codebases
Best practices when developing in Go codebases
Write an Architecture Decision Record (ADR) — lead with the decision, give neutral context, and state consequences both ways. Use when recording an architectural or technical decision, documenting why a choice was made, or capturing tradeoffs for future maintainers.
Write essays, blog posts, newsletters, and opinion pieces in a personal first-person voice — concrete cold open, argument by historical analogy, deliberate sentence rhythm, aphoristic kicker. Use when drafting or editing personal essays, blog posts, op-eds, newsletter issues, or any first-person long-form meant to persuade or reflect.
Write an RFC or design doc — summary-first, with goals/non-goals, real alternatives, drawbacks, and open questions. Use when proposing a technical change for review, writing a design doc, or documenting a system or feature proposal before building it.
Write clear technical documents — design docs, PR descriptions, proposals, postmortems — that lead with the decision and ground every claim in specifics. Use when drafting or editing workplace technical writing where a reader must act or later understand why. For the specific RFC and ADR formats, use writing-rfc and writing-adr.