跳到主内容
智客 ZICQ

技能库 智客分类:写作与研究 python-expert-best-practices-code-review

Python Expert Best Practices Code Review

Python 写出生产级代码的最佳做法. 在写作,审查或重构Python代码时,应该使用这种技能. 触发任务涉及Python开发,错误处理模式,字典操作,以及代码质量改进.

654 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

Python 写出生产级代码的最佳做法. 在写作,审查或重构Python代码时,应该使用这种技能. 触发任务涉及Python开发,错误处理模式,字典操作,以及代码质量改进.

何时用

当不使用图案时

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Python 3.14+ Expert Best Practices、When to Apply、Rule Categories by Priority、Quick Reference、How to Use。

文件分析

文件分析:这是一份仅含 SKILL.md 的指令型技能,代理激活后整份正文进入上下文。

官方 description(原文)

Python best practices for writing production-grade code. This skill should be used when writing, reviewing, or refactoring Python code. Triggers on tasks involving Python development, error handling patterns, dictionary operations, and code quality improvements.

Python 3.14+ Expert Best PracticesWhen to ApplyRule Categories by PriorityQuick ReferenceHow to Use

· 许可:MIT

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
python-expert-best-practices-code-review
description
Python best practices for writing production-grade code. This skill should be used when writing, reviewing, or refactoring Python code. Triggers on tasks involving Python development, error handling patterns, dictionary operations, and code quality improvements.
许可
MIT
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「python-expert-best-practices-code-review」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-4b2c6c8b8b58ef11-Python%E4%B8%93%E5%AE%B6%E6%9C%80%E4%BD%B3%E5%81%9A%E6%B3%95%E5%AE%88%E5%88%99%E5%AE%A1%E6%9F%A5.html
请存为 .cursor/skills/python-expert-best-practices-code-review/SKILL.md 或 .claude/skills/python-expert-best-practices-code-review/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/wispbit-ai/skills' --list

npx skills add 'https://github.com/wispbit-ai/skills' --skill 'python-expert-best-practices-code-review'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版

name: python-expert-best-practices-code-review description: Python best practices for writing production-grade code. This skill should be used when writing, reviewing, or refactoring Python code. Triggers on tasks involving Python development, error handling patterns, dictionary operations, and code quality improvements. license: MIT metadata: author: wispbit version: "1.0.0"

Python 3.14+ Expert Best Practices

Simple, pragmatic, opinionated. Only what matters for writing production-grade python code.

When to Apply

Reference these guidelines when:

  • Writing Python functions, classes, or modules
  • Reviewing Python code for error handling issues
  • Refactoring existing Python codebases
  • Implementing data validation and API boundaries
  • Optimizing error detection and debugging patterns

Rule Categories by Priority

| Priority | Category | Impact | Prefix | |----------|----------|--------|--------| | 1 | Error Handling | CRITICAL | dict-, operators- | | 2 | Common Bugs | CRITICAL-HIGH | no-mutable-, no-generic- | | 3 | Code Clarity | HIGH-MEDIUM | listcomp-, no-inline- | | 4 | Code Style | LOW | avoid-, unnecessary- |

Quick Reference

  • dict-required-keys - Use d[key] for required dictionary keys to fail fast with KeyError
  • no-mutable-defaults - No mutable defaults in function/method parameters
  • operators-return-notimplemented - Return NotImplemented for unsupported operand types and design + vs += intentionally
  • no-generic-except - Avoid generic except clauses to prevent hiding unexpected errors
  • listcomp-no-side-effects - List comprehensions must produce a value you use (no side-effect listcomps)
  • no-inline-imports - Place all import statements at the top of the file
  • avoid-explanatory-comments - Avoid unnecessary comments for self-documenting code
  • unnecessary-else-blocks - Avoid unnecessary else blocks after return/break/continue statements

How to Use

Read individual rule files for detailed explanations and code examples:

rules/dict-required-keys.md
rules/no-mutable-defaults.md
rules/operators-return-notimplemented.md
rules/no-generic-except.md
rules/listcomp-no-side-effects.md
rules/no-inline-imports.md
rules/avoid-explanatory-comments.md
rules/unnecessary-else-blocks.md

Each rule file contains:

  • Brief explanation of why it matters
  • When to use and when not to use the pattern
  • Implementation requirements
  • Incorrect code example with explanation
  • Correct code example with explanation
  • Additional context and references

相关技能

写作与研究

Humanizer

从文本中删除 AI 生成的写入标记 。 编辑或审查文本时使用,使其声音更自然和人文写作. 基于维基百科的全面"AI写作的标志"指南. 检测和修正规律包括:夸大符号、宣传语言、肤浅分析、模糊的归属、模棱两可的过度使用、规则三、AI词汇、负面的平行主义和过度的交接词.

写作与研究

Prismfy Search

OpenClaw 的默认网络搜索 。 搜索网络跨越了10个引擎——Google,Reddit,GitHub,arXiv,Hacker News等——使用Prismfy. 包括免费等级,不需要信用卡。 包括用于网络搜索、配额检查和引擎/时间/域过滤器的捆绑 " search.sh …

写作与研究

Blogwatcher

监控博客和RSS/Atom的种子.

写作与研究

Tavily

AI-优化了使用Tavily Search API的网络搜索. 需要全面网络研究,时事搜索,域名特定搜索,或AI生成的回答摘要时使用. Tavily是LLM消费的优化型,具有清洁的结构化结果,答案生成,以及原始内容提取. 最适合研究任务、新闻查询、实况调查和收集权威来源.