mcpField
C
code-comments-improve

code-comments-improve

github.com/dzhuneytDevelopment062 installsUpdated 3w ago
Repository

About code-comments-improve

A skill that reviews code comments in specified or recently modified files, adding context where needed and revising comments that are unclear, redundant, or outdated. It focuses on explaining rationale and constraints rather than restating code.

Key features

  1. 01Analyzes code structure and existing comments
  2. 02Adds comments for complex logic and edge cases
  3. 03Revises unclear or outdated comments
  4. 04Removes redundant comments
  5. 05Focuses comments on rationale and constraints

Use cases

  1. 01Clarify why a non-obvious algorithm is used
  2. 02Document assumptions and edge-case handling
  3. 03Update comments after implementation changes

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/dzhuneyt/skills --skill code-comments-improve

After installing, type/code-comments-improvein Claude Code to confirm it loaded.

Details

From the project README

Improve code comments in the specified files (or recently worked on files if none provided):

  1. Analyze the code structure and existing comments

    • Read specified files or detect recently modified files
    • Identify functions, classes, and complex logic blocks
    • Evaluate existing comments for clarity and usefulness
  2. Add strategic inline comments where beneficial:

    • Complex business logic that isn't obvious from code alone
    • Non-obvious algorithmic choices or optimizations
    • Important assumptions or constraints
    • Edge cases and their handling
    • Integration points with external systems
  3. Improve existing comments:

    • Simplify overly verbose or technical jargon
    • Remove redundant comments that just restate the code
    • Fix outdated comments that don't match current implementation
    • Convert WHAT comments to WHY comments when appropriate
  4. Focus on the WHY, not the WHAT:

    • Explain business reasons and decision rationale
    • Document why this approach was chosen over alternatives
    • Clarify non-obvious requirements or constraints
    • Avoid commenting obvious code with good naming
  5. Comment guidelines:

    • Keep comments concise and focused
    • Use clear, simple language
    • Ensure comments add value beyond what code conveys
    • Place comments close to relevant code
    • Use consistent comment style for the project

Output: Present the improved code with enhanced comments, explaining the reasoning behind each comment addition or change.

Comments

Markdown supported