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.

referencesnaming-and-structure.md

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

命名与结构:顺着 Python 习惯读代码

命名基线

对象 推荐形式
模块文件 snake_case.py
包目录 snake_case/
类 PascalCase
函数 / 变量 snake_case
常量 UPPER_SNAKE_CASE
私有成员 _snake_case

命名原则

  • 表意优先,缩写克制。
  • 同一概念尽量用同一术语,不混用近义词。
  • 布尔值优先使用 is_、has_、can_、should_ 这类前缀。

导入与文件结构

  • 导入通常分为:标准库、第三方库、本地模块。
  • 组间空行,组内保持稳定顺序。
  • 避免通配符导入。
  • 跨包引用优先使用项目当前主流方式;若无明确约定,优先清晰的绝对导入。

函数与模块结构

  • 函数优先保持单一主路径。
  • 错误和边界情况前置,减少嵌套。
  • 一个模块只承载一组紧密相关的职责。
  • 如果读者需要跳很多层才能看懂主流程,通常说明结构过重。

反模式

  • 用 calc、proc、tmp 这类模糊缩写承载长期语义。
  • 一个文件同时塞进不相关职责。
  • 导入顺序和分组混乱,增加阅读成本。
  • 为了“优雅”拆成很多跳转,主路径反而难追。

检查清单

  • 名称是否能直接表达主要意图。
  • 术语在同一模块内是否保持一致。
  • 导入分组是否稳定、清楚。
  • 主流程是否可以顺序阅读。

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