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.

referenceslogging-and-diagnostics.md

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

日志与诊断:正式运行路径不用 print

核心目标

日志的职责是帮助运行态诊断,而不是临时把信息打到屏幕上。

默认规则

  • 正式运行路径优先使用项目已有日志设施。
  • 若项目没有封装,使用标准库 logging 或框架推荐方式。
  • print 仅保留给测试、示例、一次性脚本或临时调试。

级别选择

级别 适用场景
debug 详细调试过程、排查信息
info 正常关键节点、里程碑状态
warning 可恢复异常、降级、边界情况
error 明确失败但流程可继续
exception 未预期异常,需要附带堆栈

记录原则

  • 记录足够上下文,但避免敏感信息。
  • 错误路径要么记录失败原因,要么抛出异常,最好两者逻辑一致。
  • 不要用日志替代错误处理本身。

示例判断

适合 print

  • CLI 工具的用户可见输出
  • 教学示例
  • 临时调试

不适合 print

  • Web 服务
  • 后台任务
  • 长期运行 worker
  • 需要被日志系统采集的正式脚本

反模式

  • 服务端主路径靠 print 观察运行状态。
  • 捕获异常后既不记录也不抛出。
  • 记录了大量噪音日志,却缺少真正关键节点。

检查清单

  • 正式运行路径未滥用 print。
  • 异常分支有合适的日志级别。
  • 日志里没有明显敏感信息。

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