mcpField
R
remove-dumb-comments

remove-dumb-comments

github.com/lukeberrypiDevelopment25244 installsUpdated 11w ago
Repository

About remove-dumb-comments

remove-dumb-comments is a code-review skill that identifies comments restating code while preserving those that explain intent or context. It ranks candidates and asks for approval before removing them.

Key features

  1. 01Ranks redundant comments by value
  2. 02Checks comment age with git blame
  3. 03Preserves comments explaining rationale
  4. 04Requests approval before edits
  5. 05Runs lint and type checks after edits

Use cases

  1. 01Reviewing comments in a source tree
  2. 02Removing comments that merely paraphrase code

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/lukeberrypi/skills --skill remove-dumb-comments

After installing, type/remove-dumb-commentsin Claude Code to confirm it loaded.

Details

From the project README

Remove Dumb Comments

Flag comments that say what the code already says; keep every comment that explains why. The user chooses which flagged comments to remove.

Invocation

CommandBehavior
/remove-dumb-commentsFind the 10 lowest-value comments.
/remove-dumb-comments <number>Find that many lowest-value comments.
/remove-dumb-comments allFind every low-value comment.

Never Remove

Keep any comment that carries a why the code cannot convey:

  • backports, compatibility, or version-specific behavior;
  • infrastructure, deployment, or architecture;
  • workarounds, gotchas, or non-obvious reasons;
  • documentation, specifications, RFCs, or ADRs;
  • bugs, issues, tickets, or contextual TODOs/FIXMEs;
  • intent, trade-offs, or constraints.

When unsure, keep it. Flag only pure restatements.

Workflow

  1. Resolve the limit from the invocation (default 10).
  2. Search source files; skip generated output, vendored dependencies, lockfiles, and documentation.
  3. Rank candidates from most redundant to least.
  4. Get each candidate's age with git blame (see Comment Age).
  5. Present the table below, then ask whether to remove all recommended (see Feedback).
  6. If yes, treat every Remove item as approved. If no, ask Remove or Keep for each, naming it by its exact text, not its location.
  7. Remove only the approved comments.
  8. Run the project's lint and typecheck; fix anything the changes broke.

Delegate the read-only search to a fast, low-reasoning subagent when one is available: request at most the limit, each with exact path, line, comment text, and one to three adjacent code lines. Otherwise search directly.

Comment Age

For each candidate, run:

git blame -L <line>,<line> --date=relative -- <file>

Use the relative date; mark uncommitted lines uncommitted.

Required Output

Use exactly these columns:

| Comment | Age | Why |
|---------|-----|-----|
| `// increment the counter` | 8 months ago | *Remove.* Restates `count++` verbatim. |
| `/** Returns the user id. */` | 3 weeks ago | *Remove.* Describes the function word by word. |
| `// debounce avoids hammering the API on each keypress` | 1 year ago | *Keep.* Explains intent, not mechanics. |
  • Comment: Include the exact comment text in backticks.
  • Age: Use the relative git blame age.
  • Why: Start with *Remove.* or *Keep.*, then give one short reason.

Feedback

After presenting the table, ask:

Remove all recommended?

  • Yes, remove all recommended
  • No, I want to review each comment

Comments

Markdown supported