clean-comments
Skill0 starsChanged 59 days agoMITView on GitHub
Use when writing, fixing, editing, or reviewing Python comments and docstrings. Enforces high-information documentation—call-sufficient contracts, pyguide-style sections on public APIs, doctest examples—while removing metadata, redundancy, stale comments, and commented-out code.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- chrisleekr/skillstheir own version, first seen Nov 6, 2026
- GUOJIE-HONG/skillstheir own version, first seen Nov 1, 2026
- ramybarsoum/claude-skillstheir own version, first seen Oct 13, 2026
- atomicinnovation/acceleratortheir own version, first seen Sep 22, 2026
- gpu-cli/skillstheir own version, first seen Aug 26, 2026
- L65FREAD/skillstheir own version, first seen Jul 30, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- ertugrul-dmr/clean-code-skills★ 193same name
- atomicinnovation/accelerator★ 34same name
- chrisleekr/skills★ 1same name
- gpu-cli/skills★ 1same name
- GUOJIE-HONG/skills★ 1same name
- L65FREAD/skills★ 1same name
- ramybarsoum/claude-skills★ 0same 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 repository28 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- adapt-to-projectSkill
- author-briefSkill
- author-delivery-briefSkill
- boy-scoutSkill
- bug-fixSkill
- capture-workSkill
- clean-functionsSkill
- clean-generalSkill
- clean-namesSkill
- clean-testsSkill
- close-workSkill
- contract-acquisitionSkill
- init-projectSkill
- intake-intentSkill
- memex-implementationSkill
- new-specSkill
- operational-safetySkill
- project-knowledgeSkill
- python-clean-codeSkill
- receive-briefSkill
- security-checklists-referenceSkill
- security-checklistsSkill
- work-intakeSkill
- work-loopSkill
- workspace-statusSkill
- definition-of-doneSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
4
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 15
Write comments and docstrings only when they add information the code cannot express clearly by itself.
- Distinctive: line 23
Prefer this order — improve the code before adding a comment:
- Distinctive: line 33
Never delete a comment that records a design decision, external constraint, security rule, concurrency assumption, or reason an obvious …
- Distinctive: line 95
If it answers none of these, improve the code or delete the comment.
“Common” is measured: kept by at least 6 in 10 of the 7 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
Clean Comments
Write comments and docstrings only when they add information the code cannot express clearly by itself.
The goal is not fewer comments. The goal is higher information density: contracts, rationale, constraints, invariants, side effects, surprises.
Core Principle
Prefer this order — improve the code before adding a comment:
- Clear names
- Small, focused functions and classes
- Type annotations
- Constants instead of magic values
- Assertions or validation for enforceable invariants
- Docstrings for public contracts
- Comments for non-obvious reasoning or constraints
Never delete a comment that records a design decision, external constraint, security rule, concurrency assumption, or reason an obvious alternative is wrong — rewrite it more clearly instead. Git preserves history; comments preserve reasoning.
Comment Rules (quick reference)
Full rules with examples: references/comments.md
| Rule | One line |
| C1 No inappropriate info | No authors, dates, tickets, change history — that belongs to Git/issue trackers |
| C2 Delete obsolete comments | A stale comment is worse than none; update docs in the same edit as the code |
| C3 No redundant comments | Never restate what the code says; add semantics, not translation |
| C4 Write comments well | Brief, specific, adjacent to the code, focused on why |
| C5 No commented-out code | Delete it; Git preserves versions |
| C6 Intent, not mechanics | Explain why and constraints, not what |
| C7 Refactor before commenting | Rename, extract, constant, type, validate — comment only what remains |
| No TODO/FIXME/HACK labels | Explain the actual constraint instead; TODOs must name concrete unresolved work |
| No decorative sections or closers | # ==== X ==== and # end if are noise; fix the structure |
Docstring Rules (quick reference)
Full rules with examples: references/docstrings.md Templates to copy: assets/docstring-templates.md
| Rule | One line |
| Call-sufficiency test | A docstring must let a caller write the call without reading the body |
| Document contracts, not syntax | Never restate names, types, or obvious returns |
| Method documentation | pyguide-style sections (Args/Returns/Raises) on public APIs, with real contract content — never skeleton filler |
| Style ladder | One-liner → summary + details → sections; escalate only as facets grow |
| Examples beat prose | Runnable doctest examples for tricky behavior |
| Negative space | What it does NOT do (no I/O, no locking, no retry) is contract |
| Class invariants once | Class docstring carries invariants so methods don't repeat them |
| Sections only where owed | Internals stay terse; private helpers need nothing by default |
Review at a Glance
Classify before changing — never delete first and reason afterward:
| Category | Action |
contract / rationale / constraint / invariant | Keep or clarify |
redundant / commented_code / metadata | Delete |
stale | Update or delete |
unclear | Rewrite if useful, otherwise delete |
Full procedure, editing and reviewing workflows, output behavior: references/reviewing.md
Final Test
A comment or docstring survives review only if it answers a question the code cannot answer on its own:
- Why? Under what constraint?
- What must remain true?
- What does the caller rely on — and what must the caller know to call this without reading the body?
- What surprising behavior or side effect exists?
If it answers none of these, improve the code or delete the comment.
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.

