Empty one package or directory of code comments and add it to the comment-free list. Every comment is read and sorted (restatement, stale, excuse, decision record); decisions move to docs/adr, known defects to TODO.md, the rest is deleted, and scripts/comment-gate.mjs then keeps the path empty. Use when the owner says "delete-comment", "清注释", "注释清理", "把 X 的注释删掉", or names a path to make comment-free.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Delete Comment?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/sma1lboy-delete-comment)
---
name: delete-comment
description: Empty one package or directory of code comments and add it to the comment-free list. Every comment is read and sorted (restatement, stale, excuse, decision record); decisions move to docs/adr, known defects to TODO.md, the rest is deleted, and scripts/comment-gate.mjs then keeps the path empty. Use when the owner says "delete-comment", "清注释", "注释清理", "把 X 的注释删掉", or names a path to make comment-free.
---
# delete-comment
Why and what the rule is: [`docs/adr/0004-comment-free-paths.md`](../../../docs/adr/0004-comment-free-paths.md). This page is how to do one more path.
Take **one** package or directory per PR. `packages/rove-client` (852 comments, 1694 lines) was one sitting; `packages/rove` is 28,700 lines and has to go directory by directory.
## 1. Read every comment
```bash
node scripts/comment-gate.mjs --count # where the lines are
node scripts/comment-gate.mjs --list <path> > /tmp/c.txt # each comment with the code line under it
```
Read the whole file. Do not sample, and do not hand the sorting to a regex: a decision record and a restatement look the same until you read the code line under them.
Sort each comment into one of four:
| Kind | Looks like | What happens |
| --- | --- | --- |
| Restatement | `/** Delete an automation. */` over `deleteAutomationOp` | deleted |
| Stale | names a file, version or framework that is gone | deleted; `git grep` the name before you decide |
| Excuse | `KNOWN BUG`, `TODO`, `hack`, `for now`, `workaround` | deleted, and the defect goes into `TODO.md` with file and symptom |
| Decision record | why this and not the obvious other thing; what breaks if you change it | moved to an ADR |
If you cannot tell stale from decision, check the code. A "must stay in sync with X" comment where X no longer exists is stale; where X exists it is a decision.
## 2. Write the decisions down before deleting anything
- Chord placement goes in `docs/design/keybinding-decisions.md`. Search it first: most placements are already there.
- A topic with a `docs/design/*.md` page goes on that page.
- Everything else goes in a new `docs/adr/NNNN-<topic>.md`, one per topic (0005–0007 are the model): numbered rules, each one sentence of rule and one of what breaks without it, naming the function.
- Check every function, file and binding id you name in the ADR against the code. In the first pass three names written from memory were wrong.
A decision that is already recorded is not written twice.
## 3. Strip and prove nothing else changed
```bash
node scripts/comment-gate.mjs --strip <path>
bunx biome format --write <path> # only this path, never the repo root
```
A package the root Biome config ignores (`rove-harness`, `rove-docs`, `rove-landing`, `branding`) has its own formatter or none: use that package's `format` script, or do not format at all. Root Biome there changes quote style and `--verify` then reports every file.
Then show that the code is the same: `node scripts/comment-gate.mjs --verify` transpiles each changed file at the merge base and in the working tree with comments removed and compares them. Zero files may differ. Then the package's own typecheck and tests, and `packages/rove` `test/architecture` (some of those tests read source text).
Tool directives are kept by the script (`biome-ignore`, `@ts-expect-error`, `@jsxImportSource`, knip's `@public`, `silent-catch-ok:`, `ui-ok:`, `/// <reference`, coverage ignores), and a `/*!` licence header stays. A doc comment that carries `@public` is cut down to `/** @public */`. Files the script never looks at: declaration files (`.d.ts`, `.d.mts`), generated ones (`*.generated.*`, `*.gen.*`, whose generator writes the header back), `*.min.*`, and anything under `vendor/`. A comment a tool reads that the script does not know belongs in `DIRECTIVE`, not in an exemption.
## 4. Add the path to the list
Add it to `CLEAN` in `scripts/comment-gate.mjs` and run `node scripts/comment-gate.mjs`: exit 0. From then on `pre-pr` and CI fail any PR that adds a comment there.
## Test directories
Tests get no ADR: strip, format, `--verify`, run the suites, list the path. Skim `--list` for a comment that names a real defect first. `--verify` can report a file whose only change is parentheses Biome added around an arrow body once the comment above it was gone; read that diff and move on.
## Several paths at once
Six sessions did six paths in one afternoon (2026-12-01) without a merge conflict. What made that work:
- Give each session paths no other session has, and an ADR number chosen beforehand (`0008`, `0008b`, …). Two sessions picking "the next number" collide.
- Sessions do not edit `scripts/comment-gate.mjs`, `AGENTS.md` or this skill. They open a PR and report; one integrating session checks each PR, merges it, and adds all the paths to `CLEAN` in a single PR afterwards.
- A session whose `--verify` or a gate fails for a reason it cannot explain stops and reports. Three sessions hit the same false alarm within minutes; one fix on main released all of them.
- The integrator re-runs on every PR: files outside the slice (must be none), `--verify`, `--list` (empty), and a grep of every identifier the ADR names. Then it looks for tool directives the strip took by mistake: `git diff <base> origin/main -- packages | grep -E '^-\s*/\*\*?\s*@'`.
- A flat directory too big for one session splits by file name with glob pathspecs (`':(glob)packages/rove-daemon/src/daemon/[a-c]*'`); four sessions shared `daemon/` that way. Each formats only its own files: `git ls-files -- '<pathspec>' | xargs bunx biome format --write`.
- Leave out paths other sessions are editing. A strip touches every file, so it conflicts with any open branch there.
## Do not
- List `packages/rove-plugin-sdk` before its doc comments are in `docs/PLUGIN-SDK.md`: outside plugin authors read them in their editor.
- Delete a comment in a path you are not finishing. Half-emptied paths cannot go on the list, and nothing stops the comments coming back.
- Replace a deleted comment with a longer name that restates it (`deleteAutomationAndItsHistoryOp`).
- Add a per-line escape marker to the gate. A reason worth keeping is worth an ADR line.