simplify-code-comments
Skill12 starsChanged 2 months agoMITView on GitHub
Keep code comments signal-only in any programming language — never write comments that restate the code, and delete existing noise comments instead of rewriting them. Use when writing or generating code (to avoid producing filler comments), when asked to clean up, simplify, or remove comments, or when reviewing code for comment noise. Preserves doc comments (JSDoc, docstrings, javadoc, rustdoc, godoc), "why" comments, ticket/ADR anchors, and deprecation notices.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- ivklgn/bag-of-skillsword for word, first seen Sep 4, 2026
Other versions1 project uses a version of this.
Word for word · 1
- ivklgn/bag-of-skills★ 12100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
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 repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- new-skillSkill
- review-and-releaseSkill
- 12-factor-appsSkill
- ask-meSkill
- audit-websiteSkill
- can-i-useSkill
- code-reviewerSkill
- compatibility-auditSkill
- explain-branch-changesSkill
- humanizer-ruSkill
- humanizerSkill
- jsdocSkill
- load-branch-changesSkill
- nextjs-developerSkill
- recapSkill
- reset-permissionsSkill
- review-golangSkill
- seo-auditSkill
- test-health-checkSkill
- update-golang-depsSkill
- update-node-depsSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Business rules: not derivable from the code — why a boundary/condition is exactly this
- Distinctive: line 35
When genuinely unsure — especially if the comment makes a domain or historical claim that cannot be verified from the code — keep it.
- Distinctive: line 81
When asked to clean comments in existing code:
- Distinctive: line 84
Delete noise comments — the comment only, never the code under it.
- Distinctive: line 85
Leave signal comments byte-for-byte unchanged.
- Distinctive: line 86
Do not rename, refactor, or reformat anything else.
- Very specific: line 87
If asked to review rather than edit, report noise comments as file:line with the verdict "delete" — no proposed rewrites.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Simplify Code Comments
A comment is either signal (context the code cannot express) or noise (a restatement of what the code already says). The decision is binary: noise gets deleted, signal stays untouched. There is no third option — never rewrite, shorten, "improve", or replace a noise comment with a better one.
The Two Rules
Rule 1 — When writing code: default to no comments. Self-documenting names carry the "what". Write a comment only when it holds a non-obvious "why" that the code cannot express. If tempted to explain what a line does — rename the variable/function instead, don't comment. If the code is reasonably clear as-is, write nothing and move on; do not add a comment "for readability".
Rule 2 — When cleaning existing code: delete noise, don't polish it. A noise comment is removed wholesale. Do not:
- rewrite it more concisely
- move its content into a doc comment
- replace it with a "better" comment
- refactor the surrounding code to "make the comment unnecessary" (unless refactoring was the actual task)
And do not over-trim: this is not a minimization contest. Comments classified as signal stay verbatim — no tightening their wording, no merging, no translation. If a pass over a file finds no noise, change nothing.
What Is Signal (keep, untouched)
- Non-obvious "why": an invariant or pitfall that is easy to break (race conditions, hydration mismatches, ordering requirements, platform quirks)
- Business rules not derivable from the code — why a boundary/condition is exactly this
- Hidden behavior: side effects, call-order or environment requirements
- Ticket/ADR/doc anchors (
JIRA-1234,see docs/adr/...) — context links - Workarounds with the cause and the removal condition
- Doc comments on public API (JSDoc, docstring, javadoc, rustdoc, godoc, XML docs): purpose, contract, units, error behavior, constraints — anything beyond what the signature/types already state
- Deprecation notices with a replacement pointer
- Tooling directives:
# noqa,// eslint-disable,#pragma,// nolint, license headers, shebangs, code-generation markers
When genuinely unsure — especially if the comment makes a domain or historical claim that cannot be verified from the code — keep it. Deleting real context is worse than tolerating borderline noise.
What Is Noise (delete, don't improve)
- Restating what a line/branch/condition does:
// increment counter,# loop over users,// hide subscription when completeabove the exact condition - Translating an identifier into prose:
// getUserById gets user by id - Doc comments that duplicate the signature:
@param userId — the user id,:returns: the user, docstring"""Gets user by id."""onget_user_by_id - Section banners:
// ==== helpers ====,# imports - Narrating obvious structure:
// constructor,// return the result,// end of loop - Commented-out code with no explanation of why it's kept
- Change-log narration:
// updated to use new API,// fixed bug
Note the doc-comment distinction: a doc comment that only mirrors the signature is noise; the same doc comment stating a contract, unit, or constraint beyond the signature is signal. Judge by content, not by form.
Examples
Noise — delete the comment, leave the code exactly as-is:
// show slider only on mobile
{isMobile ? <SeriesSlider /> : null}def get_user_by_id(user_id: str) -> User:
"""Gets a user by id.""" # noise: duplicates the signature — delete the docstringSignal — keep verbatim:
// pda flag, not useBreakpoint: that one defaults to desktop on SSR → hydration
// mismatch for the server-streamed slider slot
const isPDA = useAppSelector(s => s.browser.pda);def get_device_id() -> str:
"""Long-lived device identifier; survives login/logout.
Analytics/anti-fraud only — never use for authorization (see ADR-014).
"""Cleanup Procedure
When asked to clean comments in existing code:
- Walk the target files; classify each comment as signal or noise using the lists above.
- Delete noise comments — the comment only, never the code under it.
- Leave signal comments byte-for-byte unchanged.
- Do not rename, refactor, or reformat anything else; the diff must contain only comment deletions.
- If asked to review rather than edit, report noise comments as
file:linewith the verdict "delete" — no proposed rewrites.
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.

