Token导航 LogoToken导航

Agent Skill · 前端设计

python-comments(Python comments 测试)

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

python-comments 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 6,266。

总安装 536周安装 34GitHub Stars 1下载 280核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/acaprino/alfio-claude-plugins --skill python-comments

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

增强 Python 代码注释的完整性与可读性。自动生成函数说明、参数描述和返回值文档。python-comments 属于前端设计类 Skill,可作为该场景下的辅助能力补充。支持 Google、NumPy 等多种 docstring 格式。安装方式:通过 alfio-claude-plugins 添加注释生成能力。

避免过度注释简单语句,保持注释价值密度。

来源仓库内路径:skills/python-comments

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/acaprino/alfio-claude-plugins --skill python-c…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

python-comments 怎么安装?

在终端执行 npx skills add https://github.com/acaprino/alfio-claude-plugins --skill python-comments。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

python-comments 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

python-comments 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

python-comments 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

python-comments 用的人多吗?

公开数据是累计安装 536 次,近一周安装 34 次,下载 280 次,GitHub 1 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

python-comments 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
python-comments

Python comments 测试 · 本页

5361需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Python Comments

Purpose

Two operational modes for Python code comments:

  1. Write mode - Add missing comments, improve existing ones, fix negative-type comments
  2. Audit mode - Classify all comments, identify gaps, produce structured quality report

Core principle: comments explain *why*, code explains *what*. Type hints explain *types*.

When to Invoke

Write mode triggers:

  • User requests "add comments", "document this", "improve comments"
  • Code review flags missing docstrings or unclear logic
  • New module/class/function lacks documentation
  • Complex algorithm or business rule needs explanation

Audit mode triggers:

  • User requests "review comments", "comment quality", "documentation audit"
  • Pre-release documentation review
  • Onboarding prep for new team members
  • Legacy code assessment

When NOT to Invoke

  • Code is scheduled for deletion
  • User wants API reference generation (use documentation tools instead)
  • User wants type stub generation (use type hint tools instead)
  • Trivial scripts or one-off scripts where comments add no value

Antirez Comment Taxonomy for Python

Nine comment types from antirez's "Writing system software: code comments". See references/taxonomy.md for full detail.

Positive Types (write these)

TypeNamePython FormPurpose
1FunctionDocstringWhat the function/class/module does
2DesignDocstring or #Architecture rationale, API design choices
3WhyInline #Non-obvious reasoning behind code
4TeacherInline #Domain knowledge, algorithm explanation
5ChecklistInline #Steps that must not be skipped or reordered
6Guide# section headersNavigation aids in long modules

Negative Types (detect and fix these)

TypeNameDetectionFix
7TrivialRestates the codeDelete
8DebtTODO, FIXME, HACKResolve or create issue
9BackupCommented-out codeDelete (git preserves history)

Python-Specific Mapping

Docstrings vs Inline Comments

  • Docstrings ("""...""") - Types 1-2. Describe *interface* (what, args, returns, raises). Follow PEP 257.
  • Inline comments (#) - Types 3-6. Describe *implementation* (why, how, context).
  • Type hints - Reduce comment burden. Document *semantics* in docstrings, not types.

Type Hints Reduce Comment Burden

# BAD: Comment duplicates type hint
def process(data: list[dict]) -> bool:
    """Process data.

    Args:
        data: A list of dictionaries  # Redundant - type hint says this
    """

# GOOD: Docstring adds semantic meaning
def process(data: list[dict]) -> bool:
    """Process sensor readings and flag anomalies.

    Args:
        data: Sensor readings keyed by timestamp, each containing
              'value', 'unit', and optional 'calibration_offset'
    """

PEP 257 Essentials

  • One-line docstrings: """Return the user's full name.""" (imperative mood, period)
  • Multi-line: summary line, blank line, elaboration
  • All public modules, classes, functions, methods need docstrings
  • Private methods: docstring if logic is non-obvious

Write Mode Workflow

Execute in four phases.

Phase 1: Scan

  1. Read entire file/module being commented
  2. Identify all existing comments and docstrings
  3. Map code structure: modules, classes, functions, complex blocks
  4. Note type hints already present (reduces docstring burden)

Output: Inventory of existing documentation and code structure.

Phase 2: Classify Gaps

For each code element, determine what's missing:

  1. Module-level - Missing module docstring? Missing guide comments for sections?
  2. Class-level - Missing class docstring? Missing design rationale?
  3. Function-level - Missing docstring? Missing parameter semantics? Missing why-comments on complex logic?
  4. Block-level - Complex algorithms without teacher comments? Non-obvious conditions without why-comments? Multi-step processes without checklist comments?

Prioritize gaps by impact:

  • Critical - Public API without docstring, complex algorithm without explanation
  • High - Non-obvious business rule without why-comment, multi-step process without checklist
  • Medium - Missing guide comments in long modules, missing design rationale
  • Low - Private helpers without docstrings (skip if logic is obvious)

Output: Prioritized gap list with comment type needed for each.

Phase 3: Write

Apply comments following these rules:

  1. Choose correct type - Use taxonomy from Phase 2 classification
  2. Choose correct form - Docstring for types 1-2, inline # for types 3-6
  3. Choose correct style - Match project's existing docstring style; default to Google style. See references/docstring-styles.md
  4. Write concisely - Every word must earn its place
  5. Fix negatives - Delete trivial comments (type 7), resolve or issue-track debt (type 8), delete backup code (type 9)

Writing rules per type:

  • Type 1 (Function): Imperative mood. Document purpose, args semantics (not types if hints exist), returns, raises, side effects. See references/docstring-styles.md
  • Type 2 (Design): Explain *why this approach* over alternatives. Place at module/class level or above complex function
  • Type 3 (Why): One line above the non-obvious code. Start with "why" reasoning, not "what" description
  • Type 4 (Teacher): Explain domain concept or algorithm. Link to external reference if applicable
  • Type 5 (Checklist): Number the steps. Mark order-dependent sequences. Note what breaks if skipped
  • Type 6 (Guide): Section headers in long modules. Use # --- Section Name --- or # region/# endregion

Output: Commented code.

Phase 4: Verify

  1. No trivial comments added - Every comment adds information not in the code
  2. No type duplication - Docstrings don't repeat type hints
  3. Style consistency - All docstrings follow the same style (Google/NumPy/Sphinx)
  4. Existing comments preserved - Don't delete valid existing comments unless explicitly negative types
  5. Code unchanged - Only comments/docstrings modified, zero logic changes

Output: Final commented code passing all checks.

Audit Mode Workflow

Execute in four phases.

Phase 1: Collect

  1. Extract all comments and docstrings from target code
  2. Record location (file, line, scope)
  3. Record form (docstring, inline #, block #)
  4. Record associated code element (module, class, function, block)

Output: Comment inventory with locations.

Phase 2: Classify

For each comment, assign:

  • Type (1-9 from taxonomy)
  • Quality (good / adequate / poor)
  • Accuracy (correct / outdated / misleading)

Quality criteria per type - see references/taxonomy.md for detail:

  • Type 1 (Function): Covers purpose, args, returns, raises? Imperative mood?
  • Type 2 (Design): Explains rationale? References alternatives considered?
  • Type 3 (Why): Explains reasoning, not just restates code?
  • Type 4 (Teacher): Accurate domain explanation? Links to sources?
  • Type 5 (Checklist): Steps numbered? Consequences of skipping noted?
  • Type 6 (Guide): Consistent format? Matches actual code sections?
  • Type 7 (Trivial): Delete candidate
  • Type 8 (Debt): Has actionable resolution path?
  • Type 9 (Backup): Delete candidate

Output: Classified comment inventory with quality assessments.

Phase 3: Gap Analysis

Identify what's missing:

  1. Public API coverage - Percentage of public functions/classes/modules with docstrings
  2. Why-comment coverage - Complex logic blocks with non-obvious reasoning explained
  3. Design documentation - Architecture decisions documented at module/class level
  4. Negative type count - Number of trivial, debt, and backup comments

Severity levels:

  • Critical - Public API without docstrings, misleading comments
  • High - Complex logic without why-comments, outdated comments
  • Medium - Missing design rationale, missing guide comments
  • Low - Missing private method docstrings, minor style inconsistencies

Output: Gap analysis with severity ratings.

Phase 4: Report

Generate structured audit report.

Audit Report Format

## Comment Audit Report

### Summary
- **Files analyzed:** N
- **Total comments:** N (docstrings: N, inline: N)
- **Comment density:** N comments per 100 LOC
- **Type distribution:** Type 1: N, Type 2: N, ... Type 9: N
- **Quality score:** N/10

### Critical Gaps
- [ ] {file}:{line} - {element} - Missing {type} comment - {impact}

### Issues Found
#### Negative Comments (fix or remove)
- {file}:{line} - Type {N} ({name}) - "{comment text}" - Action: {delete/resolve/rewrite}

#### Outdated Comments
- {file}:{line} - "{comment text}" - Mismatch: {description}

#### Quality Issues
- {file}:{line} - Type {N} - Issue: {description}

### Coverage Metrics
| Scope | With Docstring | Without | Coverage |
|-------|---------------|---------|----------|
| Modules | N | N | N% |
| Classes | N | N | N% |
| Public functions | N | N | N% |
| Public methods | N | N | N% |

### Recommendations
1. **Priority 1:** {action} - {N elements affected}
2. **Priority 2:** {action} - {N elements affected}
3. **Priority 3:** {action} - {N elements affected}

### Comment Style
- **Detected style:** {Google/NumPy/Sphinx/mixed}
- **Consistency:** {consistent/inconsistent}
- **Recommendation:** {standardize on X style}

See references/examples/audit-mode-examples.md for complete report examples.

Key Constraints

  • NEVER add trivial comments - If the code says x += 1, do not add # increment x
  • NEVER add placeholder docstrings - """Process data.""" on a complex function is worse than nothing
  • NEVER duplicate type hints - If type hints exist, document semantics not types
  • NEVER change code logic - Comments and docstrings only, zero functional changes
  • PRESERVE existing style - Match the project's existing docstring style
  • PRESERVE valid comments - Only modify/delete comments that are negative types (7-9) or demonstrably wrong

Integration with Same-Package Skills

  • python-refactor - Refactoring may require updating comments. Run write mode after refactoring to update docstrings
  • python-tdd - Test docstrings benefit from type 1 (function) comments. Audit mode can assess test documentation
  • python-performance-optimization - Performance-critical code benefits from type 4 (teacher) comments explaining algorithm choices
  • python-packaging - Package-level documentation (__init__.py docstrings) follows type 1+2 patterns

平台分布

Codex

37.55%
按下载量换算105

Claude

27.9%
按下载量换算78

Cursor

19.77%
按下载量换算55

Gemini CLI

10.35%
按下载量换算29

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills