Logo vun Comment Stinky

Comment Stinky

Communautéit
saschb2b
comment-stinky

Detect code-comment smells in any language, explain the cost of each, and propose the rewrite. Built against the failure mode where a comment narrates the edit that produced it (now, no longer, previously, instead of the old X) rather than the standing reason the code has its shape, because the reader only ever has the file, never the diff. Six pillars and 37 categories cover change narration and diff residue, redundancy (restating the code, signature echo, banner ceremony), missing intent (magic constants, workarounds, swallowed errors, unstated invariants), truth and decay (stale and lying comments, dead anchors), placement and form (a comment that wants to be a name, a test, or a doc comment, unowned TODOs), and voice. Ships a four-question write gate and a taxonomy of the nine comments worth writing. Apply implicitly whenever you write or edit a comment or docstring, and when asked to comment, document, audit, or clean up comments in a codebase, diff, file, or snippet. Defers prose register to no-slop.

Iwwersiicht

Editeursaschb2b
Repositoryskills
Skill-Nummcomment-stinky
Stären
22
Forks
3
Matgeliwwert Fichieren
19
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 19 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum saschb2b op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Comment Stinky an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/saschb2b/skills/tree/main/skills/engineering/comment-stinky
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/saschb2b/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/engineering/comment-stinky .claude/skills/comment-stinky
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Comment Stinky an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Comment Stinky automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Comment Stinky net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Comment Stinky

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.

What it sniffs for

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.

  1. Change narration. The signature agent smell. A comment that describes the edit rather than the code: diff narration (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.
  2. Redundancy. Comments that restate the code, doc comments that echo the signature, step-by-step narration of obvious lines, banner ceremony, and tutorial voice explaining the language rather than this code.
  3. Missing intent. The comments that should exist and do not: unexplained constants and thresholds, workarounds with no named cause, deliberate deviations from convention, silent ordering dependencies, swallowed errors and empty blocks, unstated invariants, unexplained tradeoffs, and regression guards with no provenance.
  4. Truth and decay. Comments that contradict the code, doc comments that lie about parameters or errors, anchors pointing at moved line numbers, files, symbols, and dead URLs, rationale copied to several sites that then drifts, and invariants stated only in prose that a type or assertion could hold.
  5. Placement and form. Rationale at the wrong altitude, a comment that wants to be a name, a test, or a type, // 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).
  6. Voice. First-person authorship, hedging, overclaiming safety nothing backs, and decoration.

Scope modes

ModeTriggerWhat to do
Write gateyou are about to add or edit a comment, anywhere, at any timeRun 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-checkyou just finished an edit and are about to hand it overExtract 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 PRComment lines added or changed in the diff, plus the surrounding code needed to judge truth.
File or folder scanfiles or directories namedEvery 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 sniffa pasted function or commentOnly 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.

Workflow per target

  1. Read the code before the comment. A comment can only be judged against what it sits on, and half the catalog is about the two disagreeing.
  2. Walk each comment against the pillars, and each uncommented non-obvious decision against Pillar 3. Missing comments are findings too.
  3. Run the matching "Don't flag" line before reporting. If it applies, suppress the finding.
  4. Rate the smell (see ratings below).
  5. Emit a finding with location, the cost, and a before-to-after rewrite. Never propose deleting a comment without saying where its information goes instead, if anywhere.
  6. End with a summary count. If nothing survives the guard, say it smells fresh.

Stink ratings

  • Rancid. The comment misleads, or its absence hides a trap. Fix now. (A comment that contradicts the code, a doc comment lying about what a function throws, a ghost reference to code that no longer exists, an empty catch with no reason, an unstated ordering dependency or concurrency invariant, a workaround nobody can safely remove because its cause is unnamed.)
  • Funky. Real drag, not yet a lie. Should fix. (Diff narration, a comment restating the line under it, a magic timeout with no rationale, an unowned TODO, rationale duplicated across four call sites, a comment that wants to be a function name.)
  • Whiff. Minor or stylistic. Optional. (Banner ceremony, an essay where two sentences do, hedging, emoji.)

Don't flag (the guard that keeps this useful)

The catalog carries a per-smell exception line. These cut across all of them.

  • The comparative test. "X rather than Y" is good writing when Y is the alternative a reader would reach for on their own ("average rather than sum, so a three-word query stays comparable to a one-word one"). It is change narration only when Y is what the file used to say. Ask whether a reader who never saw the old code would recognize Y. If yes, leave it alone.
  • History that is still load-bearing is not change narration. "This works around a bug in the upstream parser, fixed in v3 but we pin v2" is a standing fact about the world, not a diff note.
  • A regression comment that names the failure it prevents is provenance, not a changelog. It becomes a smell only when it says what was changed instead of what breaks without it.
  • License headers, generated-file banners, editor directives, eslint-disable with a reason, and codegen markers are machinery, not prose. Leave them.
  • Respect the ecosystem's doc convention and the project's existing one over the catalog default. A codebase with rustdoc examples on every public item is not over-commenting.
  • One finding per real problem. Prefer the smallest rewrite that removes the smell, and prefer deleting a bad comment to expanding it.
  • Do not demand a comment on genuinely obvious code. Pillar 3 fires on non-obvious decisions, not on coverage.
  • Defer prose register to 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.

Output format

Comment Stinky report, <scope>

src/features/shell/components/CommandPalette.tsx
  [Rancid] ghost-reference (change narration), line 489
    Smell: the rationale ends "the old fixed Actions-then-Concepts order buried
      the 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 the
      whole 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 was
      declared first." The reason survives; the history goes to git.

  [Funky] restates-the-code (redundancy), line 311
    Smell: "// 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>."

Source

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.

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Comment Stinky?

Detect code-comment smells in any language, explain the cost of each, and propose the rewrite. Built against the failure mode where a comment narrates the edit that produced it (now, no longer, previously, instead of the old X) rather than the standing reason the code has its shape, because the reader only ever has the file, never the diff. Six pillars and 37 categories cover change narration and diff residue, redundancy (restating the code, signature echo, banner ceremony), missing intent (magic constants, workarounds, swallowed errors, unstated invariants), truth and decay (stale and lyin...

Firwat Comment Stinky op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Comment Stinky besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Comment Stinky an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/saschb2b/skills/tree/main/skills/engineering/comment-stinky an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Comment Stinky benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Comment Stinky benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Comment Stinky domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Comment Stinky gratis?

Jo. De Skill gëtt vum saschb2b ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇