npx skills add https://github.com/siviter-xyz/dot-agent --skill pythonPython 开发的标准和最佳实践。在编写或修改 Python 代码时请遵循这些指南。
始终应用 DRY、KISS 和 SOLID 原则。在相关情况下优先使用函数式方法;对有状态行为使用类。使用带有 Protocol 类的组合来实现接口,而非继承。每个模块应具有单一职责。对类依赖使用依赖注入。
Any__init__.py 中使用桶式导出;优先使用空白文件dict、list 代替 typing.Dict、typing.Liststr | None 代替 广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
Optional[str]from __future__ import annotationsenvironment.py 文件,为每个变量使用单独的方法(例如,api_key() 对应 API_KEY,database_url() 对应 DATABASE_URL)src/ 目录结构test_ 开头def foo() 创建 class TestFoopytest 而非 unittestpytest-mock 进行模拟conftest.py 存放共享夹具tests/__test_<package_name>__ 存放共享测试代码在实现 Python 代码时:
references/uv-scripts.md。references/uv-monorepo.md。每周安装数
209
代码仓库
GitHub 星标数
7
首次出现
2026 年 1 月 20 日
安全审计
安装于
claude-code124
opencode117
gemini-cli116
cursor114
codex109
github-copilot107
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.Weekly Installs
209
Repository
GitHub Stars
7
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code124
opencode117
gemini-cli116
cursor114
codex109
github-copilot107
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
111,800 周安装