Classify every comment as tautology, stale, excuse or decision record. Tautology/stale/excuse comments are deleted (excuses filed as issues #196-#236), decisions moved to docs/adr/0001-0034. - scripts/lint-comments.sh + .comment-baseline: per-file comment count may only go down; wired into tests/all.sh - .claude/skills/delete-comment: repeatable audit workflow - cargo fmt applied to touched crates Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2.4 KiB
2.4 KiB
name, description
| name | description |
|---|---|
| delete-comment | Audit and delete code comments in this repo. Classify each comment as tautology, excuse, stale or decision record, delete it, move decisions into ADRs, draft issues for excuses, and lower the comment-lint baseline. Use for /delete-comment, "clean up comments", "comment audit", or when scripts/lint-comments.sh fails. |
delete-comment
Comments are banned in this repo. scripts/lint-comments.sh enforces a ratchet: .comment-baseline holds the allowed comment lines per file, and the count may only go down. This skill burns the baseline down.
Steps
- Pick the scope: files named by the user, otherwise the files with the highest counts in
.comment-baseline. - Read each comment next to its code and classify it:
- Tautology: repeats what the code shows. Delete.
- Stale: refers to code or behaviour that no longer exists or no longer matches. Verify against the code, then delete.
- Excuse: excuses a hack ("for now", "quick", "good enough", "TODO", "simplified", unhandled edge cases). Delete the comment and write an issue draft for the hack. Never change behaviour in this pass.
- Decision record: a non-obvious why (constraint, protocol quirk, trade-off, rejected alternative, ordering requirement). Delete it and write an ADR. Be strict: most comments are tautology.
- Keep only what the lint allows or tooling needs: shebangs,
// SAFETY:,// rustfmt::,// clippy::,# shellcheck, and clap///doc comments that become--helptext. Those stay in the baseline. - ADRs:
docs/adr/NNNN-slug.mdwith Status, Context, Decision, Consequences and aCode:line naming file and symbol. Number after the highest existing ADR. Group related comments into one ADR. - Issues: append one section per excuse to
docs/issues/(Location, What is hacky, Proper fix, Original comment). Ask the user where to file them before posting anywhere external. - Run the narrowest check (
cargo check -p <crate> --all-targets,bash -nfor shell) and fix breakage. - Run
scripts/lint-comments.sh --update, thenscripts/lint-comments.shto confirm it passes. Report counts per category, ADRs written, issues drafted and lines removed.
Rules
- New comments fail the lint. If code needs explaining, rename or restructure it; if the why is non-obvious, write an ADR.
- Do not delete user-facing sample config documentation (
config.sample.toml) or text inside string literals.