agentleFS
AudiusProjectAudiusProject/apps/.claude/skills/delete-comment/SKILL.md

delete-comment

Skill622 starsChanged 12 days agoApache-2.0View on GitHub

Purge code comments from a package or directory of the apps repo. Classifies each comment as tautology, stale, excuse or decision record, deletes them, files GitHub issues for excuses, moves decision records into docs/adr/, and ratchets .comment-baseline.json down. Use when asked to delete comments, run the comment purge, or continue the comment ratchet on a path.

25 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 24 edited versions we read keep these.

  • 0

    Distinctive

    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
  1. Very specific:

    Commit .comment-baseline.json with the deletions.

    line 60

“Common” is measured: kept by at least 6 in 10 of the 24 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/delete-comment

Policy: docs/adr/0001-no-code-comments.md. Code explains what; non-obvious why lives in an ADR; unfinished work lives in an issue.

Target: $ARGUMENTS (a path under the repo root). If empty, pick the path with the most budgeted comments from .comment-baseline.json and confirm it with the user.

1. Inventory

Work in a fresh worktree branched from origin/main.

node scripts/comment-ratchet.cjs --stats $ARGUMENTS
node scripts/comment-ratchet.cjs --list $ARGUMENTS > /tmp/comments.jsonl

Each line is {file, line, endLine, ownLine, isLine, body}. Consecutive // lines are already merged into one block. Directives (eslint-disable, @ts-expect-error, prettier-ignore, @deprecated, generator headers, ...), generated code, vendored public/ and *.min.js files, examples/ tutorials, license headers and /** */ JSDoc in public-API packages (sdk, harmony, fixed-decimal, spl) are exempt and never listed.

2. Classify

For every listed comment, read it with the surrounding code and pick exactly one:

CategoryMeaningAction
tautologyRestates the code, names or types; section headers; step narrationdelete
staleCommented-out code, or describes code, systems or behaviour that no longer exist (sagas, libs, discovery/content/creator nodes...)delete
excuseAdmits our code is hacky, incomplete or temporary (TODO, "for now", "hack", missing types, "fix these deps")delete + issue
decisionNon-obvious why a reader would get wrong without it: platform/library quirks, ordering or race constraints, money/security reasoning, deliberate fallbacksdelete + ADR

A correct workaround for a third-party bug is a decision, not an excuse. Be strict with decisions: if a competent reader would work it out from the code in a minute, it is a tautology.

For more than ~300 comments, split the inventory into batches of ~400 and hand each batch to a worker subagent (a directive category catches pragmas the exemption regex missed; widen the regex in scripts/comment-ratchet.cjs for those) with snippets of the code around each comment. Have each one write a verdicts JSONL rather than edit files. Each verdict keeps the inventory fields and adds cat, reason, plus issue (excuse) or topic + record (decision).

Spot-check at least 30 verdicts yourself before applying, weighted toward decision and excuse.

3. Issues for excuses

Before deleting, file excuses as GitHub issues in AudiusProject/apps, grouped by area (one issue per directory or feature, never one per comment). Each issue gets a checklist of - [ ] <issue sentence> — <permalink to file#Lline at the pre-purge commit SHA>, and the tech-debt label if it exists. Confirm the number of issues with the user before creating them.

4. ADRs for decisions

Group decision verdicts by topic. For each topic, add or extend docs/adr/NNNN-<topic>.md using the template in docs/adr/README.md: one ### <file or function> subsection per record, written as a plain decision with its reason. Add every new ADR to the index in docs/adr/README.md. Extend an existing topic ADR instead of creating a duplicate.

5. Delete and ratchet

node .claude/skills/delete-comment/apply.cjs /tmp/verdicts.jsonl
npx prettier --write <touched files>
npm run lint:comments:update
npm run lint:comments

Then run lint and typecheck for each package you touched (npx turbo run lint typecheck --filter=<pkg>). Deleting a comment must never change behaviour. If lint flags a removed eslint-disable or similar, the exemption regex in scripts/comment-ratchet.cjs missed a directive: restore it and widen the regex.

Commit .comment-baseline.json with the deletions. The PR body reports comments and lines removed, issues filed and ADRs added or extended.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.