Sweep code comments in a repo or folder. Sort each into tautology, stale, excuse or decision record, delete the noise, file issues for the hacks and move decisions into ADRs. Then lock the scope with a ratchet lint rule. Use when asked to delete, clean up or audit comments, or to ban comments in a codebase.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Delete Comments?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/magnusrodseth-delete-comments)
---
name: delete-comments
description: Sweep code comments in a repo or folder. Sort each into tautology, stale, excuse or decision record, delete the noise, file issues for the hacks and move decisions into ADRs. Then lock the scope with a ratchet lint rule. Use when asked to delete, clean up or audit comments, or to ban comments in a codebase.
---
# Delete Comments
Comments in agent-written code mostly add noise. An **excuse** comment does more damage: it lets one hack through, and the next agent copies it. This skill removes comments, keeps the decisions they held, and blocks new ones. Adapted from Matt Pocock's "comments considered harmful" prompt.
## 1. Fix the scope
Ask for the scope if the user did not name one: the whole repo or a folder. Exclude generated, vendored and third-party code. Keep comments that tools read: license headers, shebangs, type and lint directives (`// @ts-expect-error`, `# noqa`, `eslint-disable`), doc comments on a published API, and build pragmas.
## 2. Classify every comment
List every comment in scope with `file:line`. Put each in exactly one bucket:
| Bucket | Test | Action |
|---|---|---|
| Tautology | Restates what the code already shows | Delete |
| Stale | Refers to code, behavior or facts that no longer hold | Delete |
| Excuse | Justifies a hack or shortcut ("temporary", "workaround", "TODO: clean up", "hacky but works") | Delete, and file one issue per hack |
| Decision record | States a non-obvious why that the code cannot show | Move into an ADR |
| Unsure | You cannot tell excuse from decision, or the reason is unclear | Leave it and list it for Magnus |
Done when every comment in scope has a bucket. A sample is not done. Put a comment in **unsure** rather than guess between excuse and decision record. Deleting a real decision loses information that cannot be recovered.
## 3. Show the plan before changing anything
Report the counts per bucket, the full unsure list, each planned issue (title and the hack it fixes), and each planned ADR. Estimate the lines removed. Wait for approval, since issues are outward-facing.
## 4. Apply
- Delete tautology, stale and excuse comments. Change no code except the comment lines.
- File the issues with the `github-issue` skill. Do not fix hacks in this change.
- Write ADRs with the `domain-modeling` skill and its ADR format. Group related decision comments into one ADR.
## 5. Lock it with a ratchet
Add a lint rule that bans comments in the scope. Then baseline the comments left over (unsure items and anything excluded), so the rule blocks new comments and the baseline can only shrink.
- Extend the linter the repo already runs. Load `find-docs` to confirm the current rule and config before you write them.
- ESLint has a built-in ratchet: `eslint --suppress-all` writes `eslint-suppressions.json`, and `--prune-suppressions` removes entries once they are fixed.
- Without a native baseline, commit a count file and a check that fails when the count rises.
- Keep the allowed directives from step 1 out of the ban.
Run the lint and the tests. Both must pass before the PR.
## 6. Report
Give the lines removed, the issues filed (as links), the ADRs written, the remaining baseline count and the unsure list.