/clairvoyance:comments-docs [file or module path]from clairvoyance
Reviews comment quality and documentation practices: identifies comment types, detects comment rot, and applies the 'comment repeats code' test. Use when reviewing comments or docs.
Ships in clairvoyance. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
When invoked with $ARGUMENTS, focus the analysis on the specified file or module. Read the target code first, then apply the checks below.
Comments are not recording a design that already exists. They are the medium in which the design is discovered. Code captures mechanism. Comments capture meaning. Even a perfect programming language could not replace them. The information types are distinct.
"Comments should describe things that aren't obvious from the code." — John Ousterhout, A Philosophy of Software Design
"Obvious" is from the perspective of someone reading the code for the first time, not the author. If a reviewer says something isn't obvious, it isn't. Don't argue, clarify.
What and why for callers. Must be sufficient to use the interface without reading implementation. Operate at two levels: intuition (a sentence giving the mental model) and precision (argument/return docs more specific than the code). A comment that says "offset" does not specify inclusive vs exclusive.
What a block does (high-level) and why, not line-by-line how. For variable comments, think nouns, not verbs: describe what the variable represents, not how it's manipulated.
Document dependencies spanning module boundaries. Place at a convergence point, or maintain a central designNotes file with labeled sections per topic and short pointer comments in the code (// See "Zombies" in designNotes). Neither approach is perfect. This is a genuinely unsolved problem.
Each field should have a comment capturing what's not obvious from the type or name: what it represents, units, valid ranges, boundary conditions (inclusive/exclusive), nullability, resource ownership (who frees/closes), invariants and relationships to other fields.
Useful comments say things the code does not. If another developer could write the same comment just by reading the surrounding code, it doesn't need to exist and should be deleted.
Rephrasing an entity name doesn't cut it. A comment about fetchUserProfile that says "Fetches the user profile" is still noise.
When a comment must be long, qualified, or convoluted, that's a design problem, not a writing problem. Simple descriptions come from well-designed abstractions.
| Comment | Implementation | Signal |
|---|---|---|
| Short, simple | Substantial | Deep — hides complexity well |
| Long, complicated | Short | Shallow — description nearly as complex as code |
| Must describe internals | Any | Leaky abstraction |
Write interface comments before method bodies. If a comment is hard to write, the abstraction is wrong, and you find out before writing the implementation. Comments written after-the-fact produce worse results: design intent has scrolled out of the context window, and a finished implementation contaminates your perspective, so you end up restating the code instead of capturing why you wrote it.
See the full workflow for the complexity canary tests and cost analysis.
Robert Martin argues in Clean Code that comments are failures and signs that the code wasn't expressive enough. His alternative is method extraction: replace a commented block with a well-named method.
Method names work for simple operations. extractSubstring is better than a comment above a five-line block. But names can hit a ceiling. A name can say what a method does but it won't say why, describe the preconditions or explain non-obvious constraints. A name alone cannot carry that, but a comment can. Taken to the extreme, method extraction encourages splitting code into infinite small methods, which can increase complexity rather than reduce it.
The issue is a default bias, not a hard rule: treating comments as "junk" causes them to be skipped, and useful design context goes unrecorded for every collaborator — human or agent — who reads the code later. The best place for design context is right next to the code it describes, not in a separate document that the reader may never find or even know to look for.
Red flag signals for comments are cataloged in red-flags (Comment Repeats Code, Implementation Documentation Contaminates Interface, Hard to Describe).
For deeper coverage, load on demand:
What SKILL.md sets; muted values are Claude Code's defaults
16 skills in this plugin
/abstraction-qualityEvaluates whether abstractions provide a genuinely different way of thinking or are structurally shallow. Use when adjacent layers feel redundant, wrappers add boilerplate without depth, or an abstraction feels leaky. Not for a single module's interface-to-implementation ratio (use deep-modules) or information leakage across boundaries (use information-hiding)./code-evolutionEvaluates whether changes to existing code maintain or degrade design quality. Use when the user asks to review a diff or PR (for example before merging it), or asks about recently modified files, to judge whether each change looks designed-in or bolted-on. Not for scanning design smells (use red-flags) or assessing overall design investment (use strategic-mindset)./npx claudepluginhub codybrom/clairvoyance --plugin clairvoyanceOther plugins' skills for the same job