lean-trim-commentslisted
Install: claude install-skill tony/skills
# 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
1. **Resolve targets.** With paths, expand them. With `--all`, take
`git ls-files`. With `--staged`, take the staged names:
```console
$ 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:
```console
$ git merge-base HEAD origin/HEAD
```