Audit code comments against the rubric in RUBRIC.md: every comment block gets one verdict and one reason, and the run ends on a report. The skill edits no code: cleaning up is a later, separate job.
Write the report in the language of the conversation.
1. Pin the scope
The arguments name the scope:
- Paths (a file or a folder): audit every comment block in the git-tracked files under them.
- A git ref, a range, or a PR number: diff mode. Resolve it to
git diff <base>...HEAD(for a PR, its base branch), and check the diff is non-empty before going further. - Nothing: the whole repo, as for the path
..
Only git-tracked files count (git ls-files).
2. Load the repo's rules
The rubric is the default; the repo's documented rules override it. Read:
- The standards docs (
CODING_STANDARDS.md,CONTRIBUTING.md,AGENTS.md,CLAUDE.md, or their equivalents) for anything about comments: language, doc-comment conventions, required docs, forbidden patterns. - The lint configs for rules that require or forbid comments (Rust
missing_docs, ESLintjsdoc/require-*, SwiftLintmissing_docs…): they turn aDeleteinto aRewrite, seeRUBRIC.md.
Then list the generated files, which are out of scope: paths marked linguist-generated in .gitattributes, files whose header says they are generated (@generated, Generated by …, DO NOT EDIT, do not modify), and paths the repo docs name as generated.
Done when you hold the list of overriding rules (possibly empty) and the list of generated paths.
3. Build the work list
Group the in-scope files into zones, one per language, with a language's dialects in the same zone (.ts, .tsx, .js, and the <script> of .vue are one zone).
- Diff mode: the blocks to audit are the comment blocks added or modified by the diff, plus the unchanged blocks attached to code the diff changes (the doc comment of a modified function, a comment inside a modified body): those are the ones a change may have made stale. Read each touched file around its hunks to find them.
- Paths: every comment block in the in-scope files. Estimate the volume with
git grep -con the comment markers of each language.
Done when every in-scope file sits in a zone, with its estimated count of comment lines.
4. Judge every block
Read RUBRIC.md before judging. Every judge, you or a sub-agent, reads it too.
- A diff or a few files (under ~150 comment lines): judge inline.
- Larger: split each zone into batches of ~150 comment lines (whole files, never half a file) and dispatch one sub-agent per batch, in parallel, on a mid-tier model (such as Sonnet), or on the review agent the repo designates. A lighter model mistakes stale comments for paraphrase. Each prompt carries: the absolute path of
RUBRIC.md, the overriding rules from step 2, the batch's file list, and the output contract below.
Output contract, one line per comment block, nothing else:
<path>:<first line> | <line count> | <verdict> | <reason> | <note>
The note is one short sentence. For Rewrite, the proposed text. For Ticket, a proposed issue title.
Save all the lines in one file in a temp directory. Done when every file of the work list has been read in full, every block in it holds a line, and no batch came back empty or truncated.
5. Report
Count from the collected lines (awk -F' \| ' over the file), never by hand. The report has these sections:
- Scope: what was audited (paths or diff, date, commit), the overriding rules applied, and the generated paths excluded.
- Summary: one row per zone, then a total row: blocks, comment lines, then the number of blocks for each verdict.
- By reason: one row per reason, one column per zone, with the block counts.
- Examples: two or three representative blocks for each reason that occurs, each quoted with
path:lineand its note. - Tickets: every
Ticketline, withpath:line, the comment text, and the proposed issue title. - Findings: every non-
Keepline, grouped by zone then by file. When there are more than ~50, put them in a<details>block.
In diff mode, skip the zone breakdown when the diff touches only one language, and lead with the findings.