Index of every page on this site: llms.txt
All skills
qiao-925 avatar

/python-coding-standards

@50a1ee4
Run it yourself

Python 实现基线能力单元,帮助 Agent 在 Python 代码实现、修改、补全、重构与审查场景中,先对齐项目既有约定,再落实类型边界、日志纪律、命名与结构可读性,避免把个人偏好或项目私货写成通用规范。关键词:Python、编码规范、类型提示、日志、命名、代码结构、项目对齐。

Use this Skill: https://skilld.dev/gh/qiao-925/qiao-skills/python-coding-standards

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesproject-alignment.md

≈393 tokens on demand. Your agent reads this file only when SKILL.md points to it.

项目对齐:先读现状,再落规范

核心问题

Python 规范最常见的误用,不是“标准不够”,而是“无视仓库现状”。

真正有价值的实现基线,应该先判断:

  • 项目已经有哪些明确约定
  • 哪些约定是稳定的
  • 哪些地方根本还没有约定,需要这次补默认值

建议检查顺序

  1. 读取 pyproject.toml、ruff.toml、mypy.ini、pytest.ini 等配置文件。
  2. 查看相邻模块与近期代码,确认命名、导入、logger、类型、测试的现状。
  3. 找出“已有约定”与“尚未收敛”的边界。

应优先沿用的内容

  • 现有格式化与 lint 工具链
  • 现有日志设施或框架约定
  • 现有类型风格
  • 现有目录与导入习惯

可以用通用基线兜底的内容

  • 新增模块的命名
  • 没有统一约定时的导入分组
  • 新增公共接口的类型提示
  • 没有日志封装时的默认日志方式

不该做的事

  • 仅因自己更喜欢另一套风格,就重写整个文件
  • 忽略仓库约定,直接套用通用模板
  • 把某个项目中的私有实践上升为“所有 Python 项目都应如此”

决策规则

  • 仓库已有稳定约定:沿用。
  • 仓库存在多套并行写法:优先贴近当前文件周边。
  • 仓库没有明确约定:使用本 skill 默认基线。

检查清单

  • 已查看项目配置或相邻代码,而不是凭印象改写。
  • 这次变更优先贴合当前文件所在区域的风格。
  • 没有把项目私货误写成通用 Python 规范。

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts7mo4 checks · Risk SAFE
  • Gen Agent Trust Hub7mo

    This skill provides a comprehensive set of Python coding standards and guidelines for an AI agent, focusing on type hints, logging, naming conventions, and code structure. No security risks were detected.

  • Socket7mo

    No alerts

  • Snyk7mo

    Risk: LOW · No issues

  • Runlayer8mo

    5 files scanned · No issues

Signed by skilld at 50a1ee4. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 8 months ago
Other metadata
metadata
{
  "type": "declarative",
  "category": "language-engineering",
  "scope": "python",
  "role": "skill-unit"
}

README badge

README badge for qiao-925/qiao-skills/python-coding-standards