code-commenting-checklists
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "code-commenting-checklists":https://skillpi.com/zh/skills/deepskill-7ecfbf58f69fde74a1220e186a76e4326c97343883f47ea2b55d9f0e9f016cf0。安装前核对上游来源和版本:https://github.com/kitchen-engineer42/pdf2skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
使用特定清单确保通用代码、数据声明和程序结构的注释全面且高质量。适用于编写新代码、审查现有代码或进行代码评审,以保障文档完整性与质量。
介绍来源: third_party · kitchen-engineer42 · 0.0.1 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 适合谁
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: code-commenting-checklists
description: Use specific checklists to ensure comprehensive and high-quality code commenting for general code, data declarations, and program structures. Apply when writing new code, reviewing existing code, or conducting code reviews to ensure completeness and quality of documentation.Code Commenting Checklists
When to Use This Skill
- Writing or reviewing code comments
- Conducting code reviews
- Establishing code quality standards
- Onboarding new developers to commenting practices
- Preparing code for maintenance or handoff
General Comment Techniques Checklist
Apply this checklist to ensure overall comment quality:
- [ ] Understandability: Can others immediately pick up the code and understand it?
- [ ] Intent explanation: Does the comment explain the intent or summarize functionality, rather than repeating the code?
- [ ] PPP usage: Was Pseudocode Programming Process used to reduce commenting time?
- [ ] Refactoring first: Was tricky code rewritten instead of just adding comments?
- [ ] Currency: Are comments up-to-date with the current code?
- [ ] Clarity: Are comments clear and correct?
- [ ] Maintainability: Does the comment style allow easy modification?
Data Declaration Comment Rules
Apply this checklist when declaring variables, constants, and data structures:
- [ ] Units: Are units of measurement commented? (e.g.,
// milliseconds,// kilograms) - [ ] Value ranges: Are valid ranges for numeric data commented?
- [ ] Encoding meanings: Are coded values explained? (e.g., status codes, enum values)
- [ ] Input constraints: Are restrictions on input data documented?
- [ ] Flag documentation: Are flags documented to the bit level?
- [ ] Global variables (declaration): Is each global variable commented at its declaration?
- [ ] Global variables (usage): Is each global variable identified at every use via naming convention, comment, or both?
- [ ] Magic numbers: Are magic numbers replaced with named constants rather than just documented?
Program Structure and File Comment Rules
Apply this checklist for subprograms, functions, classes, and files:
- [ ] Subprogram purpose: Is the purpose of each subprogram commented?
- [ ] Subprogram details: Are additional facts included when appropriate?
- Input and output data
- Interface assumptions
- Limitations and constraints
- Error correction behavior
- Global effects
- Algorithm sources
- [ ] Control structures: Is each control statement commented?
- [ ] Complex structure endings: Are long/complex control structure endings commented, or simplified to eliminate the need?
- [ ] Program overview: Is there a short document providing an overall view of program organization?
- [ ] File purpose: Is the purpose of each file described?
- [ ] Author information: Does the file include author name, email, and phone number?
Usage Guidelines
During Code Writing
- Write comments as you write code
- Apply relevant checklist items before committing
- Review against all applicable checklists during self-review
During Code Review
- Use checklists as review criteria
- Flag missing items for correction
- Track common violations for team improvement
For Legacy Code
- Prioritize critical sections first
- Focus on data declarations and public interfaces
- Document complex logic before simple code
Common Violations to Watch
Data Declarations
// BAD: No units or range
let timeout = 5000;
// GOOD: Complete documentation
// Timeout in milliseconds for API calls (range: 1000-30000)
let timeout = 5000;
Magic Numbers
# BAD: Magic number documented but not replaced
# Days in a year (365)
days = 365
# GOOD: Named constant
DAYS_IN_YEAR = 365
days = DAYS_IN_YEAR
Global Variables
// BAD: Global used without identification
public static int count;
// ... later ...
count++;
// GOOD: Clearly identified at usage
public static int g_userCount; // Global: total active users
// ... later ...
g_userCount++; // Global: increment active user count
Control Structures
// BAD: Complex structure without comment
for (let i = 0; i < items.length; i++) {
for (let j = i + 1; j < items.length; j++) {
if (items[i] > items[j]) {
// swap
}
}
}
// GOOD: Commented or simplified
// Bubble sort: compare each pair and swap if out of order
for (let i = 0; i < items.length; i++) {
for (let j = i + 1; j < items.length; j++) {
if (items[i] > items[j]) {
swap(items, i, j);
}
}
}当前收录版本
0.0.1
安全与评测信息
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供全面的代码注释检查清单,涵盖通用代码、数据声明和程序结构
- 适用于多种场景:编写新代码、审查现有代码、代码评审等
- 包含具体的使用指南和常见违规示例,提升实用性
亮点
- 触发词精准完整,覆盖多种变体,边界清晰
- description在frontmatter和skill_body中均有完整描述
亮点
- Phase/步骤清晰,有出口条件
- 包含端到端示例
- frontmatter完整
- 单文件≤500行
亮点
- 工具来源明确
- 参数正确
- 覆盖主要异常
- 不可逆操作有确认机制
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。