Clean Code Comments

0•

Enforces professional documentation standards by streamlining source code comments and removing redundant historical data.

The Clean Code Comments skill provides a robust framework for managing internal documentation within your codebase. It ensures that comments are purposeful, concise, and focused on explaining current logic rather than documenting the history of changes. By discouraging commented-out code, end-of-line placement, and process-oriented descriptions, this skill helps developers maintain a high standard of readability and reduces the cognitive load required to understand complex logic during code reviews and maintenance.

Características Principales

01Enforces the removal of commented-out code to reduce technical debt
02Discourages process-oriented comments that use past tense verbs
03Promotes sparse, high-impact documentation over noisy commentary
04Filters out redundant versioning information within source files
050 GitHub stars
06Standardizes comment placement above the relevant code blocks

Casos de Uso

01Establishing consistent documentation standards across a shared team codebase
02Cleaning up AI-generated code to ensure it meets professional style guidelines
03Refactoring legacy repositories to improve long-term maintainability
name description
comment-cleanup
Guidelines for comments in code. Use when adding, editing, or removing comments.

Comment Guidelines

  • Use comments sparingly
  • Don't comment out code
    • Remove it instead
  • Don't add comments that describe the process of changing code
    • Comments should not include past tense verbs like added, removed, or changed
    • Example: this.timeout(10_000); // Increase timeout for API calls
    • This is bad because a reader doesn't know what the timeout was increased from, and doesn't care about the old behavior
  • Don't add comments that emphasize different versions of the code, like "this code now handles"
  • Do not use end-of-line comments
    • Place comments above the code they describe