code-commenter

Reads code files at a specified path, automatically adds comments to the code, and saves the annotated copies to the same path.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "code-commenter" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-caa6116190f9070da5f1ab96b63d54a095298fc4cd2d2d5b9de66dd5c91541f2. Verify the upstream source and version against https://skillhub.cn/skills/user_cfba634a/code-commenter before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Reads code files at a specified path, automatically adds comments to the code, and saves the annotated copies to the same path.

0 Downloads

Introduction source: third_party · user_cfba634a · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Inputs and outputs
Translation pending; see source documentation.
Limits and differences
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: code-commenter
description: "读取指定路径下的代码,自动添加注释,生成带注释的副本保存到同路径"

代码注释添加技能

读取指定路径下的代码文件,分析代码逻辑,逐段添加中文注释,生成带注释的副本保存到同一目录下。

触发方式

用户输入以下内容即可触发:

  • "给这段代码加注释"
  • "帮我注释一下这个文件"
  • "给 XXX 路径下的代码添加注释"

执行流程

1. 输入确认

  • 用户提供文件路径(绝对路径或相对路径)
  • 确认文件存在且为支持的代码文件类型
  • 支持类型:.py .js .ts .java .c .cpp .h .hpp .go .rs .rb .php .sh

2. 注释规范

  • 函数/方法:添加功能说明、参数说明、返回值说明
  • 类:添加类功能说明、属性说明
  • 复杂逻辑块:添加逻辑说明
  • 变量声明:关键变量添加注释
  • 使用中文注释,保持简洁清晰

3. 输出方式

  • 读取原文件内容
  • 逐段分析并添加注释
  • 生成新文件:在原文件名基础上添加 _commented 后缀
  • 示例:main.py → main_commented.py
  • 保存到原文件同一目录下

4. 注意事项

  • 不修改原文件,仅生成带注释的副本
  • 保留原代码所有逻辑,不改变任何功能
  • 注释风格与代码原有风格保持一致
  • 如果文件不存在或路径无效,提示用户

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value75/100

Highlights

  • 提供代码自动注释功能,解决开发者代码可读性痛点
  • 支持13种主流编程语言文件类型,覆盖面广
  • 生成副本不修改原文件,安全可靠
Trigger Precision85/100

Highlights

  • 触发词覆盖多种常见表达方式,边界清晰
  • 能准确识别用户添加注释的需求场景
Structure and Standards90/100

Highlights

  • 执行流程分4个清晰步骤,结构合理
  • 包含具体示例和文件命名规则,易于理解
  • frontmatter完整,文档结构规范
Execution Reliability75/100

Areas to improve

  • 异常处理覆盖不全 Reported severity: Minor

    未说明如何处理文件读取/写入权限、编码格式等常见异常情况

    Recommendation: 建议补充对权限错误、编码问题、磁盘空间不足等异常的处理说明

Highlights

  • 支持文件存在性检查和路径有效性验证
  • 输出文件命名规则清晰,避免覆盖原文件
  • 保留原代码所有逻辑,不改变任何功能
Evidence Verifiability (mean of the first four)81/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.