Token导航 LogoToken导航TokenDH.com
开发规范只读github未标认证来源可访问clear审计通过

python-guidelinesPython guidelines 测试

Agent Skill

用于辅助 Python 项目开发、测试、依赖管理和常见框架工作流。它适合让 Agent 阅读 Python 代码、定位测试问题、整理运行命令、生成脚本或分析数据处理逻辑。使用时需要确认项目虚拟环境、依赖版本和测试入口;涉及执行脚本、读写文件、访问数据库或调用外部 API 时,应先明确运行目录和输入输出范围,避免误改生产数据。

总安装

445

周安装

18

GitHub Stars

1

下载量

140
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:python-guidelines(Python guidelines 测试)
来源仓库:https://github.com/viktor-ferenczi/skills
仓库路径:skills/python-guidelines
安装命令:
npx skills add https://github.com/viktor-ferenczi/skills --skill python-guidelines
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/viktor-ferenczi/skills --skill python-guidelines

简介

制定符合行业标准的 Python 编码规范。

  • 细化命名规则、注释要求与函数设计准则。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • 提供类型注解强制级别与 CI 检查配置建议。
  • 新项目应尽早建立代码审查流程落实规范。
  • 历史项目改造宜分阶段渐进式推进。python-guidelines 属于开发规范类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Add type hints wherever you can. Think more like static typing, avoid changing the type of the same variable. Define complex (nested) types separately if they are used in more than one place in the code. Omit type hints when the type is obvious from the context (e.g., x = 1).

Write clean, human-readable code. Avoid spaghetti code; keep it structured. Refactor the code as a separate step before making further changes whenever it would become too nested. Too much nesting means more than 2 levels inside functions and methods.

Avoid adding too many parameters to functions and methods. In such cases introduce a data model class to store that information, especially if they are used together more than once. The same applies to return values.

Prefer using data model classes to dictionaries, Pydantic is good, but can also use a dataclass if you have to. For converting between naming schemes, always use explicit from_something and to_something methods instead of hardcoding the external names of fields everywhere in the code. It typically happens while loading/saving data from/to JSON with a different naming convention than the fields of the corresponding Pydantic model class.

Do not use catch-all exception handling (except Exception), except to cover retryable processing, like request handlers or batch data processing. In all other cases use explicit exception handling wherever required. Disable catch-all error handling in development, especially if a debugger is connected. Never use exception handling for logic, except if there is no other alternative.

Do not combine multiple context managers into a single context manager just to save nesting on with statements at the top level of the application. It is better to write them out explicitly, even if the nesting level increases.

Do not use excessive nested iteration. While it needs less code, it also makes error handling and debugging at a per-item level much harder when exceptions happen anywhere inside the generator functions.

Do not introduce abstractions prematurely. Do not add abstract base classes, unless there are multiple subclasses or there will be multiple soon according to the current plans.

Do not write comments unless they are absolutely necessary to explain *why* the code is written the way it is. Do not add a description of the method or function arguments if they are obvious from their names or types. Prefer writing single-line docstrings that explain what the function or method does.

Define any duration in seconds (floating point), unless instructed otherwise.

Prefer test-driven development whenever it is practical.

Use only absolute imports, because relative imports will fail when you run a file directly, as Python loses the context of the project's package structure.

Follow these guidelines from the Zen of Python:

  • Explicit is better than implicit. Simple is better than complex. Complex is better than complicated.
  • Flat is better than nested. Sparse is better than dense, readability counts.
  • Special cases aren't special enough to break the rules, although practicality beats purity.
  • Errors should never pass silently, unless explicitly silenced.
  • If the implementation is hard to explain, it's a bad idea.
  • In the face of ambiguity, refuse the temptation to guess.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenCode

26.61%
按下载量换算37

Claude Code

22.92%
按下载量换算32

cline

19.3%
按下载量换算27

kilo

12.66%
按下载量换算18

windsurf

7.82%
按下载量换算11

Codex

3.22%
按下载量换算5

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills