agentleFS
kumaran-iskumaran-is/claude-code-onboarding/.claude/skills/comment-analyzer/SKILL.md

comment-analyzer

Skill36 starsChanged 6 months agoMITView on GitHub

Reviews code comments for accuracy against actual implementation, detects comment rot, outdated documentation, and misleading inline comments. Use after refactoring, before PRs, or when comments might be stale.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Iron Law: If the comment contradicts the code, the comment is wrong — never accept a comment at face value without reading the …

    line 17
  2. Distinctive:

    After refactoring code that has existing comments

    line 25
  3. Distinctive:

    Before opening a PR with documentation changes

    line 26
  4. Distinctive:

    When code was changed but comments might not have been updated

    line 27

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Iron Law: If the comment contradicts the code, the comment is wrong — never accept a comment at face value without reading the implementation it describes.

Comment Analyzer

Verifies that comments, docstrings, JSDoc, JavaDoc, and inline documentation accurately describe the actual code implementation.

When to Use

  • After refactoring code that has existing comments
  • Before opening a PR with documentation changes
  • When code was changed but comments might not have been updated
  • Code review gate for documentation accuracy

What to Check

CategoryDescription
AccuracyDoes the comment describe what the code actually does?
StalenessWas code changed but the comment not updated?
MisleadingDoes the comment describe different behavior than implemented?
CompletenessAre error cases, side effects undocumented?
RedundancyComments that just restate the code (i++ // increment i)

Severity Levels

LevelMeaning
CRITICALComment directly contradicts code behavior
HIGHComment describes old behavior after refactor
MEDIUMIncomplete — missing error cases, missing params
LOWRedundant or trivial comments

Output Format

## Comment Analysis: [scope]

### CRITICAL
- [file:line] Comment: "[quote]" -> Actual: [what code really does]

### HIGH
- [file:line] Comment: "[quote]" -> Stale since: [what changed]

### Summary
- Total: N (critical: X, high: Y, medium: Z, low: W)
- Recommendation: PASS / FAIL Comments need updates before PR

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.