agentleFS
farofyfarofy/ignite/skills/review/comment-review/SKILL.md

comment-review

Skill0 starsChanged 4 months agoApache-2.0View on GitHub

Review the comments in the current diff against a production standard, in any programming language. Classifies each comment as KEEP, REWRITE or REMOVE and reports the result. Never edits a file. Use when reviewing code comments, judging comment quality before a commit or pull request, or when the user says "review comments", "check the comments", "đánh giá comment", "review comment code", "soát comment".

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check git status for ?? entries before trusting the diff to be complete.

    line 31
  2. Very specific:

    Use three dots, not two. main...HEAD shows what the branch added since it diverged.

    line 33
  3. Very specific:

    Use the doc-comment syntax, not a line comment.

    line 109
  4. Distinctive:

    Read the project configuration before applying any number:

    line 125
  5. Distinctive:

    Prefer self-describing code.

    line 145
  6. Distinctive:

    Remove a comment when the code still reads correctly without it, or when it repeats what a variable, function or class name already states.

    line 153
  7. Very specific:

    Delete it. Version control holds the history, and dead code in a comment rots without anyone noticing.

    line 165
  8. Very specific:

    No marketing terms, no subjective opinion, no AI-style prose.

    line 197
  9. Distinctive:

    No personal remarks about the code or its author.

    line 201
  10. Distinctive:

    Do not suggest new comments to raise the count.

    line 235

≈ “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

Comment review

You are a software architect reviewing comments to a production standard.

Scope

Review the comments in a range of changes. Resolve which range before reading any code, and state the resolved range at the top of the report.

Resolution order:

SituationRange
The user names a range or a commitUse it as given
Uncommitted work existsgit add -N . then git diff HEAD
On a branch with commits of its owngit diff <base>...HEAD
Neither of the aboveAsk which range to review

<base> is the integration branch the work started from, usually origin/main or origin/staging. Find it with git merge-base --fork-point origin/main HEAD when it is not obvious.

A plain git diff HEAD hides files that git has never seen, and a new file is where new comments usually live. Run git add -N . first, which records the intent to add without staging content, so untracked files appear in the diff. Check git status for ?? entries before trusting the diff to be complete.

Use three dots, not two. main...HEAD shows what the branch added since it diverged. main..HEAD drifts as main moves ahead, which reports comments the author never touched.

Working with temporary commits

Commits made to checkpoint progress are normal. Review the net result of the range, not each commit in turn. A comment added in one commit and deleted in the next does not exist in the net diff and must not be reported.

For a single commit, use git show <sha>. For an arbitrary span, use git diff <from>..<to>.

Note that checkpoint subjects such as 1 or wip are rejected by git-hooks/commit-msg. An author reaches such a checkpoint with git commit --no-verify and rewrites the history before pushing, so the span under review may contain them.

Output contract

This skill reports only. It never edits a file, never stages a change and never rewrites a comment in place. A proposed replacement is printed for the author to apply.


1. Classify every comment first

A single rule set cannot serve all comments, because the three kinds below answer to different authorities. Classify before judging.

KindWhere it livesGoverned by
DirectiveAnywhereThe compiler, linter or build system
DocAbove an exported or public symbolThe language documentation standard
ImplementationInside a function bodyThe rules in this skill

Directive comments: never touch

These carry meaning to a tool. Removing one changes behaviour or breaks the build, so they are out of scope even when they look redundant.

LanguageExamples
Go//go:build, //go:generate, //nolint
Python# type: ignore, # noqa, # pragma: no cover, # fmt: off
TypeScript, JavaScript// @ts-expect-error, // eslint-disable-next-line, // prettier-ignore
Java// CHECKSTYLE:OFF, // NOSONAR
C, C++// clang-format off, #pragma
Shell#!/bin/sh, # shellcheck disable=SC2086
AnyLicense headers, SPDX-License-Identifier

Report these as KEEP without comment, or omit them from the report entirely.

Doc comments: follow the language, review the content

Documentation tooling parses these, so the brevity rules below do not apply. Multiple lines and structured tags are correct here. Follow the language's own standard, and check the convention beside it.

LanguageStandardConvention to check
Java, KotlinJavadoc, KDocFirst sentence is the summary and ends with a period. @param, @return, @throws. KDoc adds @property and [symbol] links
PythonDocstring, PEP 257Triple quotes, a summary line, then details. One docstring style across the repo
GoDoc comment starting with the symbol nameOpens with the name, User is ..., full sentences, no blank line above the symbol
RustRustdoc ////// on items, //! on a module. Markdown, a summary line, # Examples and # Panics sections
C#XML documentation comments<summary>, <param>, <returns>, <exception>, <see cref>
JavaScript, TypeScriptJSDoc, TSDocIn TS drop the type from @param, the signature carries it. Document each exported symbol, and a field on the field itself so editor hover finds it
PHPPHPDoc@param, @return, @throws. Types belong here where the signature has none
RubyRDoc, YARDYARD @param [Type] name, @return [Type]

Judge only the content: is it accurate, does it say something the signature does not already say, is the language plain. A type the signature already declares does not belong in the doc text, repeating it is REWRITE. Never collapse a doc comment into one line.

Use the doc-comment syntax, not a line comment. A comment that documents an exported or public symbol must use the language's doc form: /** */ in Java and Kotlin, /// in Rust, a """ docstring in Python, XML /// in C#, JSDoc in TypeScript. A // or # line comment sitting above a public symbol as its documentation is REWRITE to the doc form, so javadoc, pydoc and editor hover read it. This does not force a doc comment onto every public symbol. It fixes the form of the ones that are there.

Implementation comments

Everything in section 2 and section 3 applies to these.


2. Line length

Read the project configuration before applying any number:

  1. .editorconfig (max_line_length)
  2. Formatter config: .prettierrc (printWidth), rustfmt.toml (max_width), .clang-format (ColumnLimit), pyproject.toml (line-length)
  3. Linter config: .eslintrc (max-len), checkstyle.xml (LineLength), setup.cfg, .flake8

Fall back to 80 when nothing is configured. Allow up to 95 when the extra room makes the line clearer.

The limit covers the whole line, indentation included. A comment nested eight levels deep has far less room than one at the top level.


3. Rules for implementation comments

Necessity

Prefer self-describing code. Keep a comment only when it explains one of these:

  • Business logic that the code cannot express.
  • A technical decision that is not obvious from the code.
  • A system limitation or a workaround.
  • A constraint imposed by a third party service or protocol.
  • Context a newcomer needs and the code does not carry.

Remove a comment when the code still reads correctly without it, or when it repeats what a variable, function or class name already states.

Accuracy comes first

A comment that states something the code does not do is worse than no comment, because it sends the reader the wrong way. Check every comment against the code it sits on. A mismatch is REWRITE when the intent survives, REMOVE when it does not. Report these before anything else.

Commented-out code

Delete it. Version control holds the history, and dead code in a comment rots without anyone noticing. This is REMOVE no matter how much context surrounds it. The exception is a directive that only looks like code, such as # fmt: off.

Form

  • As short as the point allows. One line is the common case. When the point genuinely needs more room, use the block comment format of the language rather than a run of single-line comments.
  • Short, direct, no decorative characters and no filler punctuation.
  • TODO, FIXME and NOTE need a tracked issue reference. Without one, they are REMOVE.

What to explain

State the reason or the constraint. Do not narrate the mechanism.

The Linux kernel phrases the same rule as "tell WHAT your code does, not HOW". Its WHAT is the purpose, and its HOW is the narration this skill rejects. The two documents agree on the axis and differ on the label, so read the axis.

  • Narration, remove: // increment the counter
  • Reason, keep: // retry three times, the payment SLA allows no more

Language

Comments are written in English, plain and short, roughly A1 to B2. Keep technical terms, system names, APIs, frameworks and standards in English.

Banned wording

No marketing terms, no subjective opinion, no AI-style prose. Reject words such as awesome, excellent, optimal, perfect, smart, powerful, beautiful, flexible, clean, simple.

No personal remarks about the code or its author.


4. Verdicts

Give exactly one verdict per comment.

VerdictMeaning
KEEPCarries value and meets every criterion
REWRITEWorth keeping, but the wording fails a rule
REMOVEAdds nothing the code does not already say

Format each finding as:

path/to/file.ext:42  REWRITE
  current: // loop through all the users in the list
  reason:  describes the code rather than the reason
  propose: // skip suspended users, the billing job rejects them

REWRITE always carries a proposed replacement. REMOVE carries a reason and no replacement.

Report any comment that contradicts its code first, then commented-out code. Order the rest by necessity, then accuracy, then clarity, then brevity, then consistency with the project.


5. Proposing a comment that does not exist

Do not suggest new comments to raise the count. Propose one only where the diff introduces:

  • Business logic that is hard to follow.
  • A technical decision that reads as arbitrary.
  • A constraint that matters and is invisible in the code.
  • A workaround.
  • Context the code cannot carry.

6. When nothing is wrong

Say so directly. State that every comment in the diff meets the standard, and give the count reviewed. Do not manufacture findings.


House rules

These come from this project rather than from a published guide. They carry the same weight here, but do not cite them as external standard:

  • The banned wording list.
  • English at roughly A1 to B2.
  • The allowance of 95 characters above a configured limit.

Reference conventions

The rest of the judgement follows published guides:

  • Google style guides for the language in question, including the requirement that a TODO carries an identifier
  • Airbnb JavaScript style guide
  • Kubernetes Go conventions
  • The Linux kernel coding style, which prescribes a block format for multi-line comments and argues that a function needing internal comments should be split instead
  • The documentation standard of the language itself, listed in section 1

Where the project has its own convention, the project wins.

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.