comment-audit
Skill0 starsChanged 7 months agoMITView on GitHub
Audit code comments and agent-facing docs against a repository's comment policy. Use when asked to review comments, audit stale or redundant comments, check AIDEV-NOTE anchors, evaluate comment-policy.md / CLAUDE.md / AGENTS.md compliance, or inspect changed files for comments that should be kept, deleted, updated, or investigated.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- smarzban/agent-skillstheir own version, first seen Nov 15, 2026
- meowdiocre/meowpitheir own version, first seen Oct 27, 2026
- aayushbtw/skillstheir own version, first seen Sep 8, 2026
- mjmorales/claude-skillstheir own version, first seen Jun 1, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- meowdiocre/meowpi★ 3same name
- smarzban/agent-skills★ 1same name
- aayushbtw/skills★ 0same name
- mjmorales/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
Show its rules and text
We split this skill into the rules it gives an agent
26 rules. 0 are common, 17 are distinctive, and 9 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
17
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Default to audit-only. Do not edit files unless the user explicitly asks for fixes.
- Very specific: line 16
Load policy: Read the repo's comment-policy.md if present.
- Very specific: line 17
Choose scope: If the user gives a file or directory, audit that.
- Very specific: line 20
Find candidate comments: Use rg first for obvious comment markers and loaded terms.
- Very specific: line 21
Classify each finding: Use keep, delete, update, or investigate.
- Distinctive: line 26
Use this only when the repo has no local policy.
- Distinctive: line 28
Keep comments that encode invariants, business rules, security constraints, compliance rules, non-local coupling, compatibility promises, …
- Distinctive: line 29
Delete comments that paraphrase the next line or restate obvious syntax.
- Distinctive: line 30
Update comments that are stale, misleading, vague, missing required annotations, or no longer match code behavior.
- Distinctive: line 31
Prefer specific comments near the code they constrain.
- Distinctive: line 32
Treat stale comments as bugs.
- Distinctive: line 47
Do not generalize these labels across projects.
- Very specific: line 58
Prefer investigate over guessing when a comment refers to product, legal, compliance, migration, or incident context that is not in the …
- Very specific: line 71
Do not require every language to follow AIDEV-NOTE:.
- Very specific: line 75
Use rg to find likely issues before deeper reading.
- Distinctive: line 97
When the user asks for documentation freshness, changed-file review, or a base-to-head audit, compare code changes against agent-facing …
- Distinctive: line 106
Treat README.md, AGENTS.md, CLAUDE.md, architecture notes, runbooks, and tutorials as comment-like prompt surface.
- Very specific: line 117
Read at least the surrounding function/class/module.
- Distinctive: line 118
Check referenced symbols or files when named.
- Distinctive: line 119
Check tests or callers when the comment states behavior not obvious from the local code.
- Distinctive: line 120
Check recent diff context if auditing changed files.
- Distinctive: line 146
If there are no findings, say that clearly and name the residual risk, for example: "No high-signal issues found in changed files.
- Distinctive: line 150
If the user asks to apply fixes:
- Distinctive: line 153
Do not invent business, legal, security, or historical context.
- Very specific: line 155
Leave investigate items as report findings unless the user provides the missing context.
- Distinctive: line 156
After edits, summarize changed files and remaining risks.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Comment Audit
Overview
Audit comments as prompt surface for future AI-assisted edits. The goal is not "more comments" or "fewer comments"; it is to preserve comments that carry information the code cannot recover and remove or repair comments that are redundant, vague, stale, or misleading.
Default to audit-only. Do not edit files unless the user explicitly asks for fixes.
Workflow
- Load policy. Read the repo's
comment-policy.mdif present. Also read relevantCLAUDE.md,AGENTS.md,.cursorrules, or package-local policy files when they govern the audited path. If no local policy exists, use the fallback policy below. - Choose scope. If the user gives a file or directory, audit that. Otherwise audit changed files with
git diff --name-only --diff-filter=ACMR HEADand include staged files if relevant. If there is no git repo, ask for a scope. - Skip noise. Exclude dependencies, generated artifacts, lockfiles, vendored code, build outputs, minified files, snapshots, and test fixtures unless the user explicitly includes them.
- Detect language conventions. Infer expectations from file extensions and local patterns. Do not apply TypeScript/JSDoc rules blindly to Python, Go, Rust, Java, or docs.
- Find candidate comments. Use
rgfirst for obvious comment markers and loaded terms. Then read nearby code before classifying. - Classify each finding. Use
keep,delete,update, orinvestigate. - Report. Lead with the highest-risk findings. Include file, line, action, reason, and suggested replacement or next step.
Fallback Policy
Use this only when the repo has no local policy.
- Keep comments that encode invariants, business rules, security constraints, compliance rules, non-local coupling, compatibility promises, or historical rationale the code cannot express.
- Delete comments that paraphrase the next line or restate obvious syntax.
- Update comments that are stale, misleading, vague, missing required annotations, or no longer match code behavior.
- Prefer specific comments near the code they constrain.
- Treat stale comments as bugs. In agent-heavy repos, stale comments can become bad input for the next agent run.
- Preserve public API documentation when the language ecosystem expects it, but verify it still matches behavior and types.
Project-Specific Overlays
Local policy beats the fallback policy. If comment-policy.md, CLAUDE.md, AGENTS.md, or package docs define project-specific terms, enforce those definitions.
Common examples:
legacyshould say whether it means public compatibility, fallback behavior, old naming, or dead code.deprecatedshould name the replacement and removal policy.temporaryshould name the removal condition, issue, owner, or deadline.compat-fallbackshould name the trigger, normal path, and retirement condition.removed-deador equivalent terms should not survive in comments that describe current behavior.
Do not generalize these labels across projects. Read the local policy first and use the repo's vocabulary.
Classification
Use these labels:
keep- The comment carries real context the code cannot recover, is accurate, and is placed where future edits will see it.delete- The comment restates nearby code, adds generic filler, or creates noise with no recoverable value.update- The comment is useful in principle but stale, vague, too far from the constrained code, or missing required project-specific metadata.investigate- The comment makes a claim that cannot be verified locally. Name what must be checked.
Prefer investigate over guessing when a comment refers to product, legal, compliance, migration, or incident context that is not in the repo.
Language Awareness
Apply the repo policy through the conventions of the file being audited:
- TypeScript / JavaScript: JSDoc may define public API, generated docs, typedefs, deprecation contracts, or consumer-facing behavior. Deletion threshold is higher for exported symbols.
- Python: Docstrings can be runtime help, API docs, or behavior contracts. Check whether tests, callers, or generated docs rely on them.
- Go: Public package, type, function, and method comments are part of Go documentation conventions. Do not delete solely because they restate a name.
- Rust:
///and//!comments may include examples, docs, and doctests. Verify examples still compile conceptually. - Java / Kotlin / C#: Doc comments may define API contracts and generated documentation. Check
@deprecated, replacement links, and version/removal notes. - Markdown / agent docs:
CLAUDE.md,AGENTS.md, README architecture notes, and policy docs are prompt surface. Stale statements here can be higher risk than inline comments.
Do not require every language to follow AIDEV-NOTE:. Treat it as one useful convention, not a universal syntax.
Cheap Pre-Pass
Use rg to find likely issues before deeper reading. Adapt patterns to the repo.
Useful searches:
rg -n "AIDEV-NOTE|TODO|FIXME|HACK|temporary|deprecated|legacy|compat|fallback|workaround|remove|delete|old|special handling|returns the appropriate|helper function" .
rg -n "@deprecated|@todo|@fixme|@internal|@public" .
rg -n "for now|eventually|later|soon|should be removed|no longer used|not used|dead code" .Flag these common problems:
- Bare
temporary,for now, orworkaroundwith no issue, owner, or removal condition. - Bare
@deprecatedwith no replacement or removal/version policy. legacywithout explaining whether it means public compatibility, dead code, old name, or fallback.- Vague warnings such as "special handling", "be careful", or "business logic" with no rule, file, symbol, or consequence.
- Generic AI-style comments such as "returns the appropriate value", "helper function", or "processes the data".
- Comments naming symbols, files, feature flags, APIs, or migrations that no longer exist.
- Comments far from the code they constrain, especially when the constrained code is likely to be edited without reading the header.
Diff Freshness Pass
When the user asks for documentation freshness, changed-file review, or a base-to-head audit, compare code changes against agent-facing docs:
git diff --name-only --diff-filter=ACMR <base>...HEAD
git diff --unified=0 <base>...HEAD -- <changed-files>
rg -n "<symbol-or-rule-from-diff>" README.md AGENTS.md CLAUDE.md docs/ .cursorrules 2>/dev/nullTreat README.md, AGENTS.md, CLAUDE.md, architecture notes, runbooks,
and tutorials as comment-like prompt surface. If a changed symbol, feature
flag, business rule, route, migration, config key, or public workflow is
documented, check whether the prose still matches the code. Classify stale
or unverifiable docs the same way as stale inline comments: update,
delete, or investigate.
Reading Nearby Code
For each candidate comment:
- Read at least the surrounding function/class/module.
- Check referenced symbols or files when named.
- Check tests or callers when the comment states behavior not obvious from the local code.
- Check recent diff context if auditing changed files.
- Distinguish "stale comment" from "code bug": if the comment documents a real policy and code violates it, classify as
investigateorupdate code?rather than deleting the comment.
Output Format
Use this structure:
Comment audit: <scope>
Summary
- keep: <n>
- delete: <n>
- update: <n>
- investigate: <n>
Findings
1. <action> <file>:<line>
Comment: <short excerpt>
Reason: <one or two sentences>
Suggested action: <delete/update text/check X>
Notes
- <policy gaps, language-specific caveats, or files skipped>If there are no findings, say that clearly and name the residual risk, for example: "No high-signal issues found in changed files. This did not audit unchanged architecture docs."
Fix Mode
If the user asks to apply fixes:
- Apply only low-risk deletes or local wording updates.
- Do not invent business, legal, security, or historical context.
- Preserve public API docs unless replacement wording is clearly known.
- Leave
investigateitems as report findings unless the user provides the missing context. - After edits, summarize changed files and remaining risks.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

