prune-comments
Remove unnecessary comments from code: tombstones, redundant restatements, and comments a well-named variable or function would replace.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Remove unnecessary comments from code: tombstones, redundant restatements, and comments a well-named variable or function would replace.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Make a set of things (code, prose, config, docs) consistent along a dimension the user names, by picking a canonical form and conforming every member to it.
Remove illegal states from data structures by redesigning their types so the illegal states cannot be represented at all.
Perform a task with a worker agent, critique it with an adversary agent, and apply the accepted critiques with a reconciler agent.
Replace jargon and imported metaphors in code and prose with concrete, domain-fitting terms a reader understands without translation.
Create a new Claude Code skill following the conventions of existing skills.
Do an editorial review of a post or article and report findings ordered by importance.
| name | prune-comments |
| description | Remove unnecessary comments from code: tombstones, redundant restatements, and comments a well-named variable or function would replace. |
| argument-hint | [file, module, or function to prune] |
Remove unnecessary comments from the target code: comments about the code's past or future, comments that restate what the code plainly does, and comments a well-named variable or function would replace. Cut whole comments or the dead clauses inside one. Leave the comments that earn their place, and say so when none can go.
jj show --git
Arguments: $ARGUMENTS
Prune the target named in the arguments if given; otherwise the code changed in the current commit shown above; if there are no arguments and the commit has no changes, ask the user which code to prune and stop.
stratify's job; see
"Replacing a comment with a name".// changed to a Map, // now handles null) is a tombstone still: the edit
that produced the code is invisible and irrelevant to anyone reading the
result.These principles double as the test for a cut: remove a comment only when the code still tells the reader everything the comment did. They aren't exhaustive; reason from first principles when none fits cleanly.
// used to use a Map here, // TODO: rename once #1234 lands that has
landed, // changed to handle the null case, // new implementation,
// legacy. Commented-out code is a tombstone too; delete it.// increment the counter above count++, // loop over the users above the
loop, // return the result above the return, a docstring that only repeats
the function's name back in spaced-out words.// validate input, // now build the request. These are usually a sign to
extract a named function (see below), not just to delete the label.// called by the checkout flow to total the cart,
// the dashboard relies on this being sorted) is stale-prone and overly
prescriptive: callers come and go, the code records who calls what, and the
doc shouldn't presume one caller's use is the API's purpose. Trim the caller
clause; keep whatever describes the API. If the caller's usage reveals a real
contract (the result must be sorted, say), restate it as an API invariant, not
a fact about that caller.When a comment exists only because something is poorly named or because a block of code needs a label, the fix is to name the thing, not to delete the comment and lose the intent.
// minutes until the token expires
becomes a minutesUntilExpiry variable, and the comment goes.These are stratify's extractions. Run /stratify to perform the rename or
extraction so it stays a pure, behavior-preserving move, then delete the
now-redundant comment. Keep these changes small and local; if the cleanup grows
into a real refactor, hand it to stratify as its own task rather than doing it
here.