Agent skill

Sweep Comments

by ahmetb in ahmetb/dotfiles

Hold code comments and docstrings to a strict quality bar. An agent skill from ahmetb/dotfiles.

Apache-2.0Auto-check passedDevelopment

Install Sweep Comments

skills CLI
$ npx skills add ahmetb/dotfiles --skill sweep-comments -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ahmetb/dotfiles sweep-comments --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ahmetb/dotfiles.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/sweep-comments .claude/skills/sweep-comments && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sweep-comments
GitHub stars
139
Token cost
~2k tokens
SKILL.md length
1,164 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
Apache-2.0

At a glance

Hold code comments and docstrings to a strict quality bar. An agent skill from ahmetb/dotfiles.

  • Works in 5 steps: List every comment and docstring in the… → Check each against the current design,… → Apply the bar above to what remains;… → …
  • Editing comments — adding a comment to new code
  • SKILL.md covers The reader, The bar, Examples that do not survive and Writing new comments, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Sweep Comments is an agent skill from ahmetb/dotfiles. Hold code comments and docstrings to a strict quality bar. Use whenever writing or editing comments — adding a comment to new code, being asked to "document this", "add comments", or "make this reviewer-ready" — and as a dedicated staleness sweep before opening or updating a pull request. Symptoms that this skill applies: comments that restate the adjacent code, docstring boilerplate on small internal helpers, derivation walkthroughs, war-story narration, or comments describing behavior a design pivot has since…

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Technical documentation, Text to speech and voice and Project scaffolding. The repository describes itself as: Ahmet's dotfiles and macOS customizations. The licence is Apache-2.0.

When your agent uses it

  • Editing comments — adding a comment to new code
  • Being asked to document this
  • Make this reviewer-ready — and as a dedicated staleness sweep before opening
  • Updating a pull request

Example prompts

  • “document this”
  • “add comments”
  • “make this reviewer-ready”
  • “/sweep-comments”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. List every comment and docstring in the touched files.
  2. Check each against the current design, not the design it was
  3. Apply the bar above to what remains; compress prose to its
  4. Check the commit message and module docstring the same way — they
  5. Verify the sweep was purely editorial: tests still pass, and any

What it can do on your machine

Read from SKILL.md and the folder at commit a435fa0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Sweep Comments loads about 2k tokens when it runs. Until then it costs about 135 tokens; SKILL.md has 1,164 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~135
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ahmetb/dotfiles at commit a435fa0, republished under its Apache-2.0 licence (© ahmetb). 1,164 words, ~2,023 tokens.

Download SKILL.mdSave it as .claude/skills/sweep-comments/SKILL.md (or your agent's skills folder).
name
sweep-comments
description
Hold code comments and docstrings to a strict quality bar. Use whenever writing or editing comments — adding a comment to new code, being asked to "document this", "add comments", or "make this reviewer-ready" — and as a dedicated staleness sweep before opening or updating a pull request. Symptoms that this skill applies: comments that restate the adjacent code, docstring boilerplate on small internal helpers, derivation walkthroughs, war-story narration, or comments describing behavior a design pivot has since deleted.

Sweep comments

Every comment must state a constraint the code itself cannot show, in one short sentence. If deleting the comment loses nothing a maintainer needs, delete it. Thoroughness is accuracy, not volume: an accurate, lean file is stronger in review than one padded with restatements.

The reader

Write for the reader you actually have: a professional who is competent at reading code and willing to learn the context on their own. They can read a call signature, follow a loop, and look up a library. Comments exist to hand them the facts they cannot get that way — not to tutor them through the language, the stdlib, or the control flow. Assuming an incompetent reader is what produces restatement comments; assuming this reader is what keeps them out.

The bar

A comment earns its place only if it says something you cannot get by reading the statement below it. Hold every comment — new or existing — to this test.

Keep (these say what the code cannot):

  • Behavioral constraints of external tools and systems, e.g. a flag chosen because of a filesystem cache pathology, a layout-engine quirk, a protocol quirk.
  • The why behind magic values: weights, thresholds, limits, ports.
  • Schema documentation on data tables and wire formats.
  • Source-of-truth pointers ("the registry in X is authoritative").
  • A deliberate absence ("no retry here on purpose; rsync --partial handles resumption").

Delete (these repeat what the code already shows):

  • Restatements of the next line ("Build the command", "Loop over the files in sorted order", "Get the service id from the environment").
  • Literal readings of a call — describing what os.environ.get or a four-line function does in prose.
  • Process narration and war stories: how the fix was found, what the code used to do, why this change is correct. That is PR-description material, not a comment.
  • Derivation walkthroughs. State the constraint or invariant in one sentence; do not teach the algebra line by line.

Examples that do not survive

Each of these was found in a real pre-PR sweep (identifiers genericized). The pattern, not the wording, is what to recognize:

  • # Defaults to "primary" but honors SERVICE_ID from the environment above an os.environ.get("SERVICE_ID", "primary") — a literal reading of the call. What survived instead: the one fact the code could not show (which config layer wins when both are set).
  • A four-line comment above a four-line classification function, paraphrasing its branches almost word for word. Deleted outright.
  • # Entries stack above their group's anchor row on a list literal whose ordering already shows exactly that. The list is the statement; the comment is an echo.
  • A comment justifying a layout mechanism "because auxiliary edges do not constrain placement" — auxiliary edges had been deleted a dozen iterations earlier. Stale rationale from a design pivot; rewritten to the mechanism's actual current purpose.
  • A four-line header on an enum-to-role table re-describing enum names that are self-descriptive. Shrunk to the single surviving fact: the one non-obvious classification decision.
  • "After several failed attempts we discovered that the renderer ignores these edges during coordinate assignment" — the constraint (renderer ignores them) survives in one sentence; the journey does not.

Writing new comments

  • One short sentence per constraint. If a comment needs a second sentence, check whether it is carrying a second (or zero-th) fact.
  • Never mix a restatement with a real fact to justify the comment. Split off the fact and delete the restatement half.
  • Match docstring weight to audience: a public API earns parameter docs; a ten-line internal helper earns one line stating purpose, not an Args/Returns block.
  • Name specifics, not categories ("the vessel_command edge", not "the relevant edge").
  • When a comment enumerates parallel facts — several name mappings, per-case rationales, a set of invariants — format it as a bullet list, one fact per bullet, rather than packing the enumeration into prose. Readers scan lists; they re-read packed sentences. The one-short-sentence rule then applies per bullet.
  • Do not pad a file with comments to appease an "under-documented" complaint — reviewers are protected by every comment being true and non-obvious, not by comment count.
  • Never invent a rationale for a value whose reason you do not know. A wrong why-comment is worse than none.
Show full SKILL.md (480 more words)Show less

The pre-PR sweep

Design pivots during a working session are the main source of lying comments: a comment written for iteration 3 still sitting on the code of iteration 12. Before opening or updating a PR:

Do the sweep yourself, in one context. Do not partition it across subagents. A comment's value is holistic: whether it earns its place depends on what the neighboring code, the other comments, the module docstring, and the session's design pivots already say — context that no per-file or per-package delegate has. Splitting the reading and keeping the "judgment" is the same violation through a keyhole: the judgment is only as good as the reading it is built on. If the diff is large, sweep it in one pass anyway; reading the whole diff is what the sweep is.

  1. List every comment and docstring in the touched files.
  2. Check each against the current design, not the design it was written for. A comment referring to anything deleted or renamed — a removed retry loop, a dropped edge category, a dead config band — is rewritten to the truth or deleted.
  3. Apply the bar above to what remains; compress prose to its irreducible content.
  4. Check the commit message and module docstring the same way — they go stale on the same pivots.
  5. Verify the sweep was purely editorial: tests still pass, and any generated output (code generation, DOT/SVG, fixtures) is byte-identical before and after.

Rationalizations

ExcuseReality
"The team lead wants thorough documentation"Thorough means every comment is true and non-obvious, not that every line has one.
"The derivation helps reviewers check the math"Put derivations in the PR description or a design doc. In code, one sentence stating the invariant suffices.
"It's half restatement, but the other half is real"Keep the real clause, delete the restatement half.
"Args/Returns blocks look professional"Boilerplate on internal helpers buries the one comment that matters.
"I'll leave the old comment as historical context"Git history is the historical context. A stale comment is a lie with authority.
"No time to sweep before the PR"A sweep of touched files takes minutes; a reviewer misled by a stale comment costs a review round.
"The diff is huge — I'll fan the reading out to subagents and keep the judgment"Judgment built on delegated reading is delegated judgment. The sweep's value is one reader seeing the whole change.
"The reader might not know this API"The reader is a competent professional who will look it up. Document your constraint, not their library.

Red flags — stop and re-check

  • A comment beginning with what the next line literally does.
  • A docstring longer than the function it documents.
  • "Previously", "used to", "we changed this to" in a comment.
  • A comment you are keeping because deleting it feels like losing work.
  • A sweep plan that contains the word "delegate", "fan out", or "per-file subagent".

© ahmetb, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/sweep-comments of ahmetb/dotfiles.

Open the folder on GitHubat commit a435fa0

Compare with similar skills

Sweep Comments next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Sweep Comments compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sweep Comments this skillahmetb/dotfiles139—~2kAutomated safety check: PassApache-2.0
Comment Cleanuphaacked/dotfiles134—~2.4kAutomated safety check: PassNone
Post Draft Reviewagent-substrate/substrate4.6k—~2.8kAutomated safety check: PassApache-2.0
Review Kedro PRkedro-org/kedro11k—~2.8kAutomated safety check: PassCustom licence
Opik Documentation Patternscomet-ml/opik22k—~1.3kAutomated safety check: PassApache-2.0
Eli5coldteadotai/pr-lens1.9k—~2.3kAutomated safety check: PassMIT

Similar skills

  • Comment Cleanup

    haacked/dotfiles

    Delete and tighten code comments in source files after they are written.

    134 GitHub stars~2.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Post Draft Review

    agent-substrate/substrate

    Posts pull request review findings as GitHub draft (pending) inline comments for a human to edit and submit, instead of publishing them straight to the PR author.

    4.6k GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Review Kedro PR

    kedro-org/kedro

    Review a Kedro PR for checklist compliance, architecture, correctness, and clarity.

    11k GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Rules for writing PR descriptions, changelog entries and feature documentation in the Opik repository, including the exact headings that CI requires.

    22k GitHub stars~1.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Eli5

    coldteadotai/pr-lens

    WHAT: Explains a codebase, a folder, a feature, a command or a pull request to someone who knows nothing about it, as a PR Lens canvas whose walkthrough builds the picture one part at a time.

    1.9k GitHub stars~2.3k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Qwen Agent

    thananon/9arm-skills

    Delegate menial, well-scoped coding tasks to a cheap Qwen-backed subagent via the claude-9arm command instead of burning Claude tokens/quota.

    3.2k GitHub stars~1.5k tokensUpdated 3 mo ago
    DevelopmentAuto-check passed

More from ahmetb/dotfiles

  • Here Now

    ahmetb/dotfiles

    USE THIS SKILL ONLY ON PUBLIC OPEN SOURCE REPOS!!!. An agent skill from ahmetb/dotfiles.

    139 GitHub stars~3k tokensUpdated 1 mo ago
    Auto-check passed
  • Here Now Internal

    ahmetb/dotfiles

    Upload and share files on here.now (https://here-now.chimera-logarithm.ts.net), Baseten's internal artifact-sharing service.

    139 GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Commit PR

    ahmetb/dotfiles

    How to name branches, writing commit titles/messages and sending PRs with correct format

    139 GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Declaudish

    ahmetb/dotfiles

    Translate text written in "Claudish" — the characteristic prose style of Claude and Claude Code — into plain, direct, idiomatic English.

    139 GitHub stars~2k tokensUpdated 1 mo ago
    Auto-check passed
  • Report Styling

    ahmetb/dotfiles

    Design system for single-file HTML engineering reports and deep dives — two-column sticky-TOC layout, green-accented semantic color coding, timeline step lists, code-anchored prose.

    139 GitHub stars~1.2k tokensUpdated 1 mo ago
    Auto-check passed

Categories

Questions about Sweep Comments

What does Sweep Comments do?

Hold code comments and docstrings to a strict quality bar. An agent skill from ahmetb/dotfiles. Sweep Comments is an agent skill from ahmetb/dotfiles. Hold code comments and docstrings to a strict quality bar.

When should I use Sweep Comments?

Sweep Comments fits situations like: editing comments — adding a comment to new code; being asked to document this; make this reviewer-ready — and as a dedicated staleness sweep before opening; updating a pull request.

How do I install Sweep Comments in Claude Code?

Run `npx skills add ahmetb/dotfiles --skill sweep-comments -a claude-code`. Or copy the skill folder (.claude/skills/sweep-comments in ahmetb/dotfiles) into .claude/skills/sweep-comments in your project. Claude Code loads it when a task matches its description.

How do I install Sweep Comments in Codex?

Run `npx skills add ahmetb/dotfiles --skill sweep-comments -a codex`. Or copy the skill folder (.claude/skills/sweep-comments in ahmetb/dotfiles) into .agents/skills/sweep-comments in your project. Codex loads it when a task matches its description.

Can I use Sweep Comments in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ahmetb/dotfiles --skill sweep-comments -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sweep-comments, .gemini/skills/sweep-comments, .github/skills/sweep-comments and .opencode/skills/sweep-comments in your project.

What does Sweep Comments need to run?

SKILL.md names no scripts, command-line tools or credentials: Sweep Comments is instructions for the agent only.

Does Sweep Comments access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Sweep Comments safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Sweep Comments use?

Sweep Comments is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sweep Comments use?

About 2k tokens (SKILL.md is roughly 8.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Sweep Comments?

Skills that share tags, products or a category with Sweep Comments: Comment Cleanup (haacked/dotfiles, 134 stars), Post Draft Review (agent-substrate/substrate, 4.6k stars), Review Kedro PR (kedro-org/kedro, 11k stars) and Opik Documentation Patterns (comet-ml/opik, 22k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sweep Comments?

ahmetb (a GitHub user) maintains it in ahmetb/dotfiles, which has 139 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on August 24, 2026.

Source: ahmetb/dotfiles on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.