writing-comments
Skill0 starsChanged 50 days agoMITView on GitHub
Use when writing or reviewing comments and doc comments, or when a diff adds explanatory prose alongside code.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- scheron/Dailytheir own version, first seen Nov 8, 2026
- MarvinJWendt/skillstheir own version, first seen Oct 15, 2026
- withastro/astrotheir own version, first seen Oct 8, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- withastro/astro★ 64ksame name
- scheron/Daily★ 4same name
- MarvinJWendt/skills★ 1same name
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.
In this repository20 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- capturing-decisionsSkill
- choosing-subagent-modelsSkill
- committing-changesSkill
- debugging-systematicallySkill
- delegating-workSkill
- designing-changesSkill
- exploring-a-codebaseSkill
- injecting-dependenciesSkill
- planning-changesSkill
- pruning-testsSkill
- reflecting-on-changesSkill
- resolving-conflictsSkill
- reviewing-codeSkill
- verifying-changesSkill
- writing-logsSkill
- writing-project-instructionsSkill
- writing-skillsSkill
- writing-testsSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 50
Never overwrite an existing doc comment: Add where missing; reconcile only when the contract changed.
- Distinctive: line 55
Every multi-line comment block you just added:
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Writing comments
The default is no comment. Names and structure carry the meaning; a comment is for what they provably cannot. Where the project has a convention, follow the project.
The one test
- A comment answers why, and the why is not obvious from the code beside it.
- Describes what the code does: delete it. Recoverable from the next three lines: delete it.
- Code that needs a comment to be followed needs a better name or a smaller function instead.
Limits
| Kind | Limit |
| Line comment | 1 line |
| Member doc comment (function, property, case) | 1 line. A second only for a genuinely subtle exception |
| Type-level doc comment (class, struct, enum, protocol, module) | Several lines, to orient a reader about the whole type |
Over the limit means cut, not reflow — the second sentence usually restates the first.
Never
- Narrate — "loop over the items", "set the title", "returns nil when empty".
- Restate the signature — a parameter doc repeating the name and type.
- Decorative dividers. A structured section marker the language supports is fine.
- Migration history — "moved from X", "new in the refactor". Git knows.
- Ticket ids. In public API docs they leak an internal tracker.
- Commentary on the change. Describe the code as it stands, not how it got there.
When a doc comment is warranted
| Declaration | Doc comment |
| Public or exported | Yes — it is the contract, and exempt from the member limit where the contract needs the words |
| Internal helper with a non-obvious exception | Yes — one line naming the exception |
| Internal helper self-evident from its name | No |
| Override or conformance with no added behavior | No |
| A constant whose value encodes a decision | Yes — why this value |
Existing comments
- Never delete an existing comment or TODO unless asked. These rules govern what you write, not what you remove.
- Never overwrite an existing doc comment. Add where missing; reconcile only when the contract changed.
Self-check
Every multi-line comment block you just added:
git diff -U0 | awk '/^\+ *(\/\/|#|--)/{n++; if (n>1) print; next} {n=0}'Empty output, or only type-level overviews, passes. Anything else is over the limit until you can name why that block earns a second line.
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.

