/agent-skills:comment-guidelinesfrom agent-skills
What makes a code comment worth writing versus noise that will rot — a narrow allow-list plus named anti-patterns (narration, changelog comments, caller-referencing comments, commented-out code, placeholder spam, AI-voice filler). Use whenever writing, editing, or reviewing code that contains or might contain comments.
Ships in agent-skills. 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.
None: SKILL.md is the whole skill.
Default to no comments. Names and structure should carry meaning; add a comment only when the code cannot say something on its own. When one is warranted, keep it to one line of at most 120 characters, written as a plain // (or your language's equivalent) — if it doesn't fit, shorten it rather than wrapping to a second line. The exception is a real public API surface (see below), which is documented with the language's doc-comment form instead, wrapped across multiple lines at that same 120-character width rather than left as one long line.
Only these justify the cost of a comment that can go stale:
If a comment would only restate what a good name or a smaller function could already say, do that instead of writing the comment.
A declaration that another repo, layer, or process consumes across a boundary — an HTTP/REST endpoint handler, a published library's public surface, a CLI command — is a different, more justified category with its own conventions. Document it with the language's doc-comment form (KDoc/Javadoc's /** */, JSDoc, a Python docstring, and so on) instead of a plain //; the one-line cap above doesn't apply to it either. Everything else keeps the default — a one-line //, even a private helper sitting directly above a function or class.
Each of these is a comment that duplicates something the reader — or the codebase itself — already has a better source for. That's what makes them rot: nothing forces them to stay true.
Narration. A comment for nearly every line, restating the statement below it (// increment i above i++). Comment where the logic is non-obvious, not on every line.
Changelog comments. // fixed bug per #123, // added this for the new feature, // changed from X to Y. This is edit history, and edit history has an authoritative home already: the commit message. A comment in the file should describe the code as it stands now, not how it got here.
Caller-referencing comments. Naming a specific caller instead of documenting the callee's own contract — whether it lists several, // Called by CheckoutController.submitOrder() and by the nightly InventorySync.reconcileStock() job, or just one, // Independently fetchable — the frontend's /bostad/:id route never has to go through /api/search first. Either way, this is information that belongs to the caller, not the callee: "find references" answers it correctly forever, while the comment answers correctly only until that caller changes — worse yet when the caller sits in another repo or layer, where "find references" can't even reach, so nothing will ever catch the comment going stale. Fix it by stating the contract, not who currently exercises it: the second example above becomes // Independently fetchable — does not require a prior list call.
Commented-out code. Delete it. Version control already remembers it, correctly and permanently — a comment doesn't.
Placeholder spam. A TODO/FIXME with no tracked task behind it is a note to no one. Only leave one if it's tied to something real.
AI-voice filler. Hedging, throat-clearing, or a comment that doesn't read like a colleague wrote it. Say the one true thing and stop.
What SKILL.md sets; muted values are Claude Code's defaults
32 skills in this plugin
/blackbox-test-casesGenerate exhaustive, non-negotiably rigorous black-box test case descriptions (Given/When/Then, not code) for a public API's external contract — never its implementation. Use for zero-tolerance test coverage, an extremely strict/exhaustive black-box test case sweep, or whenever "thorough" test-case generation isn't thorough enough. Produces an API handoff file, one case file per sub-agent — each is its own source of truth — and a master index file pointing at all of them. Every case carries a checkbox so a later implementing agent can track what's been turned into runnable tests. This skill never writes runnable tests itself./brand-palettePick a primary and accent color that fit a given project and fit each other, or — given an explicit primary — pick three accent candidates that each fit the primary and the project, then generate the full Tailwind v4 color-token system (raw OKLCH scales plus the semantic layer, light and dark) for all three candidates as copy-paste CSS and a visual HTML report written into the project. Use when the user wants brand colors chosen for a project, a Tailwind color system generated from a repo, or a secondary/accent color picked to pair with a primary they already have.Other plugins' skills for the same job
/codebase-designShared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.npx claudepluginhub joachimwedin/agent-skills --plugin agent-skills