decomment
Strip the noise comments an AI agent left behind on a branch — the ones that restate the code line by line or narrate the change as a story ("was X, now Y", "added a guard here"). Git holds the history and the code holds the present; only genuinely non-obvious comments survive.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- decomment
- description
- Strip the noise comments an AI agent left behind on a branch — the ones that restate the code line by line or narrate the change as a story ("was X, now Y", "added a guard here"). Git holds the history and the code holds the present; only genuinely non-obvious comments survive.
- when_to_use
- Trigger on: decomment, /decomment, "remove the pointless comments", "look at the comments, they duplicate the code", "clean up the comments on this branch", "too many comments", "the agent commented every line", "drop the narrative comments", cleaning up after an agent that documented its own diff.
- allowed-tools
- [ "Bash", "Read", "Edit", "Grep", "Glob" ]
- argument-hint
- optional: a ref/path to scope the sweep
03 SKILL.md 正文
decomment
Scope
Default: comments this branch added, nothing else.
base=$(git merge-base HEAD origin/HEAD 2>/dev/null || git merge-base HEAD origin/main)
git diff "$base"...HEAD # committed work on the branch
git diff; git diff --staged # plus anything still uncommitted
Only added (+) comment lines are in scope. Pre-existing comments stay unless the user
names them — someone thought about those, and you are not reading their context.
An argument narrows or moves the scope (a ref, a path); honour it and say what you covered.
Cut
- Restates the code.
// increment the counterovercounter++; a docstring that lists the parameters and their types and says nothing else. - Narrates the change. "previously this used X", "now returns null instead of throwing",
"moved here from utils", "added after the incident". That is a commit message living in
the wrong file.
git log -Sfinds it forever; the reader of this line does not need it. - Announces the obvious.
// constructor,// imports,// helper functions,// early return, banner bars separating two-line blocks. - Explains the language. What
??,useMemo, a context manager or a try/finally does. - Reassures. "this is safe because we checked above" three lines under the check.
Trim
A comment is not atomic. The common shape after an agent writes it is one useful sentence welded to one worthless one:
/**
* A session `uid` is `userId_projectId_sessionHash`. <- the domain format, unguessable: keep
* Returns the project id, or `undefined` when the uid <- the six lines below say this: cut
* does not have that shape.
*/
Cut the dead sentence, keep the live one, and delete only — never rewrite the words that stay, never merge two sentences into a better one. If what survives no longer reads as a sentence, keep the whole thing and say so in the report.
Two recurring dead openers worth naming:
- The restated signature. The first line of a doc block that says what the symbol's own
name says (
Temp session data is goneoverclassifyMissingSessionData). - Diff voice. "say why here", "note that we now…", "this addresses the review comment". A comment talks to whoever opens the file in a year, not to the reviewer of this PR.
Keep
- Why, not what — the reason a non-obvious choice was made, an invariant the types cannot express, an ordering that looks arbitrary and is not.
- A trap. "looks idempotent, is not", "the API returns 200 on failure", a workaround with the upstream issue or ticket it waits on.
- Anything the toolchain reads:
eslint-disable,@ts-expect-error,# type: ignore,# noqa,#pragma, codegen markers, license headers. These are code wearing a comment's clothes — deleting one changes behaviour. - Public API docs in a codebase that documents its public surface, even when they read as obvious. Follow the file's neighbours — including their length: a one-line convention makes a six-line block on the symbol next door the thing that looks wrong.
- A measured number. "batching over 500 doubled p99" earns its line; "for performance" does not.
- Anything you are unsure about. The user can always ask for a second, harsher pass.
How
- Read the diff, then read each candidate in its file, not in the hunk — a comment can read as redundant in a diff and carry the file's only warning in place.
- List what you propose, grouped by file, each with the comment verbatim and one clause of reasoning: cut whole, trim to the surviving sentences (quote what goes and what stays), keep. Anything you nearly cut and kept goes in a short second list — that is where the user corrects your taste.
- Apply after the user agrees: delete whole comment lines, trailing comments, and — for a trim — the dead sentences inside a block. Deletion only: never reword what stays, never touch code, never reflow a line you did not cut into. Mind comment-shaped text inside strings and regexes.
- Verify: the repo's typecheck or lint on the touched files, then
git diff— every hunk must be a deletion of comment lines and nothing else. - Report the count per file and leave the commit to the user unless they asked otherwise.
Two agents chattering at each other produce the worst of this: each documents its own edit for the other to read. When the diff is mostly such comments, say so plainly — the fix is a line in that repo's CLAUDE.md, not a sweep every week.
04 同仓库更多 Skills
yt-dub
Give a YouTube video Yandex's Russian voice-over (the Yandex Browser / voice-over-translation one) at any length — including past Yandex's 4-hour limit — and mux it into the best video YouTube serves, with the original sound kept as a second track; optionally drop the result into Plex on SugarDaddy. Also when only the translated audio is wanted.
codex-proxy
Run an OpenAI-compatible Chat Completions endpoint on localhost that spends the user's ChatGPT/Codex subscription instead of an API key — for apps that take a Base URL, API key and model id (dictation post-processing, editors, scripts). Install it as an always-on LaunchAgent, check its status, print the key, try a request, or debug a failing app.
revdiff-ru
Review a diff in revdiff with everything except the code translated into Russian, line numbering preserved 1:1 so annotations map back to the real files. One command does the translation; then /revdiff:revdiff opens the result.
peer-chat
A prompt starting with "Chat from Codex:" is a peer message: answer it only through peer-chat.py, never in your own output. Also use when the user says "chat with codex", "talk to codex", "work with codex", "do this with codex", "build this with codex", "discuss this with codex" (the agent in the other pane of this agterm split). Not for a one-shot task handed off, and not for a read-only second opinion.
memory-review
Use when an agent memory directory has grown large enough that nobody remembers what is in it, when memories look stale or contradictory, when the same fact seems to live in both memory and a CLAUDE.md, or when the user asks to review, prune, audit or clean up their memories. Also use before retiring a project whose memories should move somewhere else.
cleanup
Tidy up after yourself and close your own agterm session.