clean-comments

Remove redundant code comments while preserving valuable explanations during code cleanup.

12|2|Updated May 29, 2025
One-click install
npx skills add https://github.com/sorryhyun/DiPeO --skill clean-comments
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-comments
Source: https://github.com/sorryhyun/DiPeO/tree/main/.claude/skills/clean-comments
Command: npx skills add https://github.com/sorryhyun/DiPeO --skill clean-comments

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Codebases often accumulate redundant, obvious, or outdated comments that add noise rather than value, making code harder to read, understand, and maintain. This skill automates the removal of such comments while meticulously preserving only the critical explanations, enhancing code clarity and developer focus.

Core Features & Use Cases

  • Obvious Comment Removal: Automatically deletes comments that merely restate what the code clearly does (e.g., // increment counter above counter++), reducing visual clutter.
  • Valuable Explanation Preservation: Intelligently identifies and keeps comments that explain complex algorithms, non-obvious implementations, business logic, or architectural decisions, ensuring crucial context is never lost.
  • Comment Simplification: Reduces verbose comment blocks to concise, meaningful lines, focusing on the "why" behind the code rather than a literal description of its "what."
  • Use Case: Before a code review or a major commit, run this skill on a newly developed module. It will strip away comments like # Loop through items and keep only the crucial ones, such as # IMPORTANT: Must validate before save to prevent orphaned records, ensuring reviewers focus on the code's intent and not redundant text.

Quick Start

Before:

Increment the counter

counter += 1

After:

counter += 1

Before:

This function calculates the total price by iterating through

all items in the cart, multiplying each item's quantity by its

price, and then summing all the results together to get the final total.

def calculate_total(cart):

return sum(item.quantity * item.price for item in cart)

After:

Includes bulk discount calculation for quantities >10

def calculate_total(cart):

return sum(item.quantity * item.price for item in cart)

Frequently Asked Questions about clean-comments

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I remove unnecessary comments from my code?

Remove unnecessary comments by identifying and deleting statements that merely restate what the code clearly does, such as `// increment counter` above `counter++`. This skill automates that removal while preserving comments explaining complex logic, business decisions, or non-obvious implementations, reducing visual clutter and improving readability.

What comments should I keep when cleaning up code?

Keep comments that explain the 'why' behind code: complex algorithms, non-obvious implementations, business logic, architectural decisions, and critical constraints. Remove comments that simply describe what the code obviously does. This distinction ensures reviewers focus on intent rather than redundant text.

When should I clean comments from my codebase?

Clean comments before code reviews, major commits, or after refactoring newly developed modules. Running this during these stages strips redundant documentation like `# Loop through items` while retaining crucial context such as `# IMPORTANT: Must validate before save to prevent orphaned records`.

Can I simplify verbose comment blocks automatically?

Yes, this skill reduces verbose multi-line comment blocks to concise, meaningful lines focused on the 'why' rather than literal descriptions of the 'what'. For example, a paragraph-long explanation of a calculation gets replaced with a single line noting the business logic it implements.

How many files can I process at once with comment cleanup?

Comment cleanup is limited to a maximum of 15 files per session. This constraint ensures focused, manageable processing for code quality improvement and refactoring workflows without overwhelming the analysis.