code-commenting-checklists

Uses specific checklists to ensure comments for general code, data declarations, and program structure are comprehensive and high quality. Applicable when writing new code, reviewing existing code, or conducting code reviews to maintain documentation completeness and quality.

Last repository push
GitHub Stars
140
Forks
36
Issues / PRs
1

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-commenting-checklists" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-7ecfbf58f69fde74a1220e186a76e4326c97343883f47ea2b55d9f0e9f016cf0. Verify the upstream source and version against https://github.com/kitchen-engineer42/pdf2skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

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

Installation test pending

Uses specific checklists to ensure comments for general code, data declarations, and program structure are comprehensive and high quality. Applicable when writing new code, reviewing existing code, or conducting code reviews to maintain documentation completeness and quality.

0 Downloads

Introduction source: third_party · kitchen-engineer42 · 0.0.1 Reference

SkillPi interpretation

Tasks
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.
Audience
Writing or reviewing code comments Conducting code reviews Establishing code quality standards Onboarding new developers to commenting practices Preparing code for maintenance or handoff
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
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

  1. Write comments as you write code
  2. Apply relevant checklist items before committing
  3. Review against all applicable checklists during self-review

During Code Review

  1. Use checklists as review criteria
  2. Flag missing items for correction
  3. Track common violations for team improvement

For Legacy Code

  1. Prioritize critical sections first
  2. Focus on data declarations and public interfaces
  3. 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);
    }
  }
}

Current listing version

0.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 提供全面的代码注释检查清单,涵盖通用代码、数据声明和程序结构
  • 适用于多种场景:编写新代码、审查现有代码、代码评审等
  • 包含具体的使用指南和常见违规示例,提升实用性
Trigger Precision92/100

Highlights

  • 触发词精准完整,覆盖多种变体,边界清晰
  • description在frontmatter和skill_body中均有完整描述
Structure and Standards95/100

Highlights

  • Phase/步骤清晰,有出口条件
  • 包含端到端示例
  • frontmatter完整
  • 单文件≤500行
Execution Reliability90/100

Highlights

  • 工具来源明确
  • 参数正确
  • 覆盖主要异常
  • 不可逆操作有确认机制
Evidence Verifiability (mean of the first four)89/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.