this skill
Judge every comment and docstring in the target files against
references/comment-policy.md, then delete or rewrite the ones
that fail. Edits in place and prints a diff. Never commits, never
pushes, never requires a clean tree.
Confirm before the first edit
This skill deletes code the user did not ask you to touch, and it can
be routed to from a passing remark about comments. Present the
classification and get an explicit yes through ask-user-choice
before any Edit.
No exceptions: not for a single comment, not for a file the user just
named, not under --all. --diff-only is the way to skip the edit,
not the confirmation.
$ARGUMENTS
paths/globs — files to audit, resolved through git ls-files -- <glob> when tracked, else as literal paths.
--staged — audit what is staged rather than the branch diff.
--all — audit every tracked file. Expect a large diff; say so
before confirming.
--diff-only — classify and show what would change, edit nothing.
With no paths, the target set is the files this branch changed.
Steps
Resolve targets. With paths, expand them. With --all, take
git ls-files. With --staged, take the staged names:
$ git diff --name-only --cached --diff-filter=d
Otherwise find the trunk ref (git rev-parse --abbrev-ref origin/HEAD, falling back to the repo's default branch) and take
its merge base:
$ git merge-base HEAD origin/HEAD
Then take the names changed since it:
$ git diff --name-only --diff-filter=d <merge-base>
Keep source files; drop lockfiles, generated output, and vendored
trees. Reject an empty target set with a clear message rather than
widening the scope on your own.
Load the policy and voice. Read
references/comment-policy.md, then ./AGENTS.md and
./CLAUDE.md. Where the host project sets its own comment rules,
those govern.
Classify. Every comment and docstring in range gets one verdict
— keep, rewrite, or delete — and a failing gate by name for
anything not kept. A verdict you cannot attach to a gate is a keep.
Read the surrounding code before judging. A comment that looks like
narration but pins an invariant is a keep, and the loss gate is
what protects it.
Preview and confirm. Show each rewrite as old and new text, and
each deletion with the code it sat above, grouped by file. Confirm
through ask-user-choice. Skip only for --diff-only.
Apply. Use Edit. Rewrites are concrete and shorter than what
they replace. Do not touch the code itself; a comment that is wrong
because the code is wrong is a finding to report, not to fix here.
Diff. Print git diff -- <targets>.
Report and hand off. Give the counts kept, rewritten, and
deleted, and name anything skipped and why. Then offer next steps
through ask-user-choice: commit with /commit, tighten the prose
too with the lean-tighten skill, or discard — review the printed diff
first, since git checkout -- <file> resets the whole file to HEAD
and drops any other uncommitted work in it.
What this does not do
- Commit or push — that is
/commit.
- Edit code, only its comments.
- Rewrite prose files — that is the
lean-tighten skill.
- Rewrite history — that is the
pr-deslop skill.
- Add missing comments. Absence is not a finding here.
Portability notes
ask-user-choice — present the listed options and wait for the user to pick one. Hosts with a structured multiple-choice tool (Claude Code's AskUserQuestion) should use it; otherwise print a numbered list and wait for a numbered reply. Never proceed on an assumed answer.
$ARGUMENTS — the text the user passed when invoking this skill. If your host does not substitute it, read it as the user's request in the current turn, and ask when there is none.
- Bundled files — every relative path in this skill points at a file shipped inside this skill directory. Read them from here, not from the host's plugin tree.
1---2name: lean-trim-comments3description: Use when existing source comments or docstrings are bloated, dense, repetitive, AI slop, or should be trimmed, debloated, and kept light.4---56# this skill78Judge every comment and docstring in the target files against9`references/comment-policy.md`, then delete or rewrite the ones10that fail. Edits in place and prints a diff. Never commits, never11pushes, never requires a clean tree.1213## Confirm before the first edit1415This skill deletes code the user did not ask you to touch, and it can16be routed to from a passing remark about comments. Present the17classification and get an explicit yes through `ask-user-choice`18before any `Edit`.1920No exceptions: not for a single comment, not for a file the user just21named, not under `--all`. `--diff-only` is the way to skip the edit,22not the confirmation.2324## `$ARGUMENTS`2526- `paths/globs` — files to audit, resolved through `git ls-files --27 <glob>` when tracked, else as literal paths.28- `--staged` — audit what is staged rather than the branch diff.29- `--all` — audit every tracked file. Expect a large diff; say so30 before confirming.31- `--diff-only` — classify and show what would change, edit nothing.3233With no paths, the target set is the files this branch changed.3435## Steps36371. **Resolve targets.** With paths, expand them. With `--all`, take38 `git ls-files`. With `--staged`, take the staged names:3940 ```console41 $ git diff --name-only --cached --diff-filter=d42 ```4344 Otherwise find the trunk ref (`git rev-parse --abbrev-ref45 origin/HEAD`, falling back to the repo's default branch) and take46 its merge base:4748 ```console49 $ git merge-base HEAD origin/HEAD50 ```5152 Then take the names changed since it:5354 ```console55 $ git diff --name-only --diff-filter=d <merge-base>56 ```5758 Keep source files; drop lockfiles, generated output, and vendored59 trees. Reject an empty target set with a clear message rather than60 widening the scope on your own.61622. **Load the policy and voice.** Read63 `references/comment-policy.md`, then `./AGENTS.md` and64 `./CLAUDE.md`. Where the host project sets its own comment rules,65 those govern.66673. **Classify.** Every comment and docstring in range gets one verdict68 — keep, rewrite, or delete — and a failing gate by name for69 anything not kept. A verdict you cannot attach to a gate is a keep.7071 Read the surrounding code before judging. A comment that looks like72 narration but pins an invariant is a keep, and the loss gate is73 what protects it.74754. **Preview and confirm.** Show each rewrite as old and new text, and76 each deletion with the code it sat above, grouped by file. Confirm77 through `ask-user-choice`. Skip only for `--diff-only`.78795. **Apply.** Use `Edit`. Rewrites are concrete and shorter than what80 they replace. Do not touch the code itself; a comment that is wrong81 because the code is wrong is a finding to report, not to fix here.82836. **Diff.** Print `git diff -- <targets>`.84857. **Report and hand off.** Give the counts kept, rewritten, and86 deleted, and name anything skipped and why. Then offer next steps87 through `ask-user-choice`: commit with `/commit`, tighten the prose88 too with the `lean-tighten` skill, or discard — review the printed diff89 first, since `git checkout -- <file>` resets the whole file to HEAD90 and drops any other uncommitted work in it.9192## What this does not do9394- Commit or push — that is `/commit`.95- Edit code, only its comments.96- Rewrite prose files — that is the `lean-tighten` skill.97- Rewrite history — that is the `pr-deslop` skill.98- Add missing comments. Absence is not a finding here.99100101## Portability notes102103- `ask-user-choice` — present the listed options and wait for the user to pick one. Hosts with a structured multiple-choice tool (Claude Code's `AskUserQuestion`) should use it; otherwise print a numbered list and wait for a numbered reply. Never proceed on an assumed answer.104- `$ARGUMENTS` — the text the user passed when invoking this skill. If your host does not substitute it, read it as the user's request in the current turn, and ask when there is none.105- Bundled files — every relative path in this skill points at a file shipped inside this skill directory. Read them from here, not from the host's plugin tree.