Engineering / comment-stinky
Detect code-comment smells in any language, explain the cost of each, and propose the rewrite.
Signed, graded provenance for this skill. Integrity, authorship, capability, and freshness as evidence you weigh, not a verified badge.
A code-comment smell detector and a write-time gate, in any language. It exists because of one specific failure mode. A coding agent's working context is a diff, so it writes comments aimed at whoever reviews that diff. The diff is transitory. The comment is permanent. One commit later the comment describes a state nobody can see, and the reader who needed to know why the code is shaped this way gets a paragraph about a change instead.
The rule the whole skill reduces to: write for a reader who has only this file open and does not know that a change ever happened. The reasoning behind it is in comment-audience.md, and why agents specifically break it is in agent-context-collapse.md.
Three operating documents. Read the one the task needs. taxonomy.md is the positive half, the nine kinds of comment worth writing and where every other kind of information actually belongs. catalog.md is the smell catalog, six pillars and 37 categories with detection signals, fixes, exceptions, and sources. write-gate.md is the four-question gate plus the trigger-phrase table and the rewrite recipes.
Six pillars, 37 categories, in catalog.md. The background models live as linked concepts under references/concepts/; read one when a finding needs the model explained, not just named.
now, no longer, used to), ghost references to code that is not in the tree, comparatives measured against the deleted version, changelog text parked in the source, reviewer defense, prompt echo, session residue, eulogies for deleted code, commented-out code.// where the ecosystem's doc-comment form is what tools read, essays where two sentences do, and debt with no owner, ticket, or condition (bare TODOs, and the undated "for now" that never gets listed anywhere).| Mode | Trigger | What to do |
|---|---|---|
| Write gate | you are about to add or edit a comment, anywhere, at any time | Run the four questions in write-gate.md before the comment lands. This is the implicit mode and it is the point of the skill. |
| Self-check | you just finished an edit and are about to hand it over | Extract only the comment lines you added (command in write-gate.md) and gate each one. Cheap, and it catches the smell at the only moment it is free to fix. |
| Diff scan | "review the comments on this branch", a PR | Comment lines added or changed in the diff, plus the surrounding code needed to judge truth. |
| File or folder scan | files or directories named | Every comment, docstring, and doc comment in scope, judged against the code it sits on. |
| Repo sweep | "audit the comments in this codebase" | Prioritize the files with the highest comment density, the most recent churn, and the public API surface. Skip vendored, generated, and license headers. |
| Fragment sniff | a pasted function or comment | Only that surface. State what you assumed about the code off-screen. |
| Author mode | "comment this", "document this function" | Skip the scan. Pick the kind from taxonomy.md, write it, then gate it. |
The catalog carries a per-smell exception line. These cut across all of them.
eslint-disable with a reason, and codegen markers are machinery, not prose. Leave them.no-slop and the wider "this was hard to understand" repair to breadcrumbs rather than duplicating them. The split with no-slop is substance versus sound: that skill decides whether a sentence reads as generated (em dashes, slop vocabulary, marketing voice), this one decides whether the comment should exist, what it should say, and where the information belongs. Its references/code-comments.md is the one-page register pass over the same surface.Comment Stinky report, <scope>src/features/shell/components/CommandPalette.tsx[Rancid] ghost-reference (change narration), line 489Smell: the rationale ends "the old fixed Actions-then-Concepts order buriedthe thing most queries are looking for." No such order exists in the tree.Cost: the reader cannot check the claim or find what it refers to, so thewhole comment reads as unverifiable and gets ignored.Rewrite: "Groups are ordered by their own best match, so typing 'agent'leads with the Agent Panel concept rather than with whichever action wasdeclared first." The reason survives; the history goes to git.[Funky] restates-the-code (redundancy), line 311Smell: "// No animation; just redraw the new position" above a bare draw call.Cost: one more line to keep true, and it says nothing the call does not.Rewrite: delete. If the absence of animation is deliberate, say why("dragging skips the tween so the node tracks the cursor exactly").Summary: 1 rancid, 1 funky across 1 file.
When the scope is clean, say so plainly: "Smells fresh. No comment smells found in <scope>."
The positive taxonomy adapts Salvatore Sanfilippo's comment classification and Ousterhout's A Philosophy of Software Design chapters on comments; the routing table draws on Chris Beams on commit messages and Fowler on code as documentation. The change-narration pillar is grounded in a survey of agent-written comments in the okf-viewer codebase. Each catalog entry carries its own link.