code-comments
Skill0 starsChanged 2 months agoMITView on GitHub
What it is — what a comment in code says and what it must not: the reader it is written for, the register it is written in, the moment it must not be anchored to, and the single source of truth it points at rather than restates. Ships check-comments.sh, which reads comments out of the syntax tree and holds them to the machine-decidable half. Use when writing or editing a comment, reviewing a diff that adds one, deciding whether an explanation belongs beside the line at all, converting comments to a simpler register, or setting the rules up in a new repository. Triggers: comment, code comment, inline comment, commented-out code, TODO, FIXME, banner comment, section header comment, docstring, comment style, комментарий, комментарии в коде, закомментированный код, поясни в комментарии, оформи комментарий, нужен ли тут комментарий, стиль комментариев.
33 other projects use a version of this.
Adopted by
Most recently taken up by
- ryoppippi/ccusagetheir own version, first seen Nov 29, 2026
- cheap-pets/skillstheir own version, first seen Nov 29, 2026
- tonanywhere/my-favorite-promptstheir own version, first seen Nov 29, 2026
- bmsuisse/skillstheir own version, first seen Nov 27, 2026
- petekp/claude-code-setuptheir own version, first seen Nov 23, 2026
- ton-anywhere/my-favorite-promptstheir own version, first seen Nov 22, 2026
Used with
Projects with it also use improve-codebase-architecture, api-design and 4 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
GoogleSkillimprove-codebase-architecture
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
Also in 5 projects that use this
MicrosoftSkillapi-design
Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.
Also in 3 projects that use this
GoogleSkillcodebase-design
Shared 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.
Also in 4 projects that use this
HashiCorpSkillchangelog
Add a Changie change fragment (`.changes/<major>.x/unreleased/*.yaml`) for a GitHub Pull Request, commit, and push.
Also in 3 projects that use this
MicrosoftSkillhandoff
Compact the current conversation into a handoff document for another agent to pick up.
Also in 4 projects that use this
- +1 more from google
Other versions33 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 33
- ryoppippi/ccusage★ 20ksame name
- bholmesdev/hubble.md★ 1.5ksame name
- KittyCAD/modeling-app★ 1.3ksame name
- overmind-core/overmind★ 798same name
- AllayMC/Allay★ 347same name
- pensarai/apex★ 327same name
- portabletext/editor★ 287same name
- petekp/claude-code-setup★ 50same name
- keitakn/engineering-skills★ 17same name
- caidanw/skills★ 11same name
23 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Files
code-comments
A comment is written for one reader: whoever is about to change the line it sits on. That reader can see what the line does. What they cannot see is the constraint that made it the right line, and a comment that does not carry one is a line of code with no code in it
Everything below follows from the reader. The caller has --help, the person choosing the project has the readme, and whoever needs the arrangement explained has the maintainer documents; none of them is reading this line
check-comments.sh beside this file decides the machine-decidable half: it reads comments out of each file's syntax tree, so a # inside a string is never one, and proves every rule able to fail on a planted copy before it reads anything real. check-comments.sh --help is the reference for what it checks and how a line is excused
What a comment carries
- The reason, not the restatement.
# enable bluetoothabovehardware.bluetooth.enable = truesays nothing the line has not said. What earns the place is a constraint, an upstream defect, an order that matters, a measured cost - A reason that outlives the moment. Not "removed on 2026-07-22" but "removed from nixpkgs because it needed GTK2". The danger is not the date but the dependency: a comment anchored to a moment is true only while something it cannot observe stays the same, and it goes on reading as true after it stops being so. Version pins live in the lock file
- Nobody's voice. "we", "our", "let's" describe the people who arranged the code; the next reader needs the arrangement
- No hedge. "probably", "should work", "seems to" beside a fact reads as permission to doubt the fact, and a comment too uncertain to state plainly is a measurement not yet made
- English, and no marker. TODO, FIXME, XXX and HACK name work, and work lives where work is tracked; the reason the line is the way it is lives here
What replaces a comment
- Commented-out code is replaced by the language's own way of turning a thing off. A commented line claims "this is how to put it back" and nothing checks that claim: the path it names can be renamed upstream and the line goes on promising a rollback that no longer exists. A live
enable = falsebeside the reason is checked by whatever checks the rest of the file - A reason several places depend on moves to a document at the root, and the comment points at it. One text carries the mechanism, every other place carries a link. Restating it is how two copies of one explanation drift apart in silence — see references/single-source.md
- A divider header earns its line when it says something the names below do not.
# --- Options ---above an attribute calledoptslabels what is already labelled. See references/headers.md
Form
- At most 100 columns, and one unbreakable token — a hash, a fingerprint, a URL — may carry the excess alone
- A stack of single-line comments longer than two lines asks why it is long, and the answer is usually that it explains several lines at once and should be split among them, or restates a document and should point at it. Where the language has a multi-line comment form and the block survives both questions, it belongs in that form
- The register is ASD-STE100: short sentences, active voice, one thought each, a word in its plain sense. What is taken from the standard, what is deliberately not, and how it reads on real comments is references/register.md
- What a template prints is a comment too. A checker's
--templateoutput teaches its own style to the first line of every file started from it
Following the letter of a rule while breaking its point is breaking the rule; the rules are short so the point can be read
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
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.

