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, комментарий, комментарии в коде, закомментированный код, поясни в комментарии, оформи комментарий, нужен ли тут комментарий, стиль комментариев.
17 other projects use a version of this.
Adopted by
Most recently taken up by
- ton-anywhere/my-favorite-promptstheir own version, first seen Sep 26, 2026
- cilinmengye/personal-agent-skillstheir own version, first seen Sep 24, 2026
- swaroopsm/skillstheir own version, first seen Sep 17, 2026
- overmind-core/overmindtheir own version, first seen Sep 15, 2026
- alumpe/skillstheir own version, first seen Sep 11, 2026
- keitakn/engineering-skillstheir own version, first seen Sep 10, 2026
Other versions17 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 17
- overmind-core/overmind★ 376same name
- petekp/claude-code-setup★ 47same name
- keitakn/engineering-skills★ 14same name
- caidanw/skills★ 9same name
- Sir-chawakorn/sanook-cli★ 9same name
- ARTPARK-SAHAI-ORG/calibrate-backend★ 4same name
- karlhorky/agent-skills★ 4same name
- ton-anywhere/my-favorite-prompts★ 4same name
- luabagg/agent-skills★ 3same name
- bmsuisse/skills★ 2same name
7 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.

