Agent Skills › LodyAI/Lody › delete-comment

delete-comment

GitHub

自动化审计代码注释,分类为冗余、过时或借口并删除,迁移重要决策记录。通过扫描器精准定位,执行语法检查并更新基线,实现注释精简与合规管控。

.agents/skills/delete-comment/SKILL.md LodyAI/Lody

触发场景

请求清理或审查代码注释 需要减少注释数量以符合规范

安装

npx skills add LodyAI/Lody --skill delete-comment -g -y
更多选项

非标准路径

npx skills add https://github.com/LodyAI/Lody/tree/main/.agents/skills/delete-comment -g -y

不安装直接使用

npx skills use LodyAI/Lody@delete-comment

指定 Agent (Claude Code)

npx skills add LodyAI/Lody --skill delete-comment -a claude-code -g -y

安装 repo 全部 skill

npx skills add LodyAI/Lody --all -g -y

预览 repo 内 skill

npx skills add LodyAI/Lody --list

SKILL.md

Frontmatter
{
    "name": "delete-comment",
    "description": "Audit code comments in a scope, classify each as Tautology, Excuse, Stale, or Decision Record, delete the removable ones, relocate durable rationale, and tighten the comment ratchet. Use for comment audits, comment cleanup passes, or any request to reduce or review comments."
}

Delete comments

scripts/check-comment-ratchet.mjs bans comment growth per scope: counted comment lines may only shrink against scripts/comment-ratchet-baseline.json. This skill is the repeatable audit procedure for that ratchet.

Census

  1. node scripts/check-comment-ratchet.mjs --report for per-scope counts.
  2. node scripts/check-comment-ratchet.mjs --dump <dir> to list comments with file and line ranges. The scanner is string/template/regex-aware; trust its ranges, never grep //.
  3. Weighted sample: the heaviest files per scope plus a spread across file kinds (source, tests, UI, libs).

Classify, then act

  • Tautology (restates the next line: "Increment counter", section labels, decorative banners): delete.
  • Stale (describes removed behavior or expired compat windows): delete; if the dead code also remains, report it, don't silently remove it.
  • Excuse (excuses a hack, or a TODO/FIXME with no owner): delete; record the underlying follow-up in the PR body or a note. Only file an issue when the user explicitly asks.
  • Decision Record (non-obvious why: lifecycle, compat, containment): check for an existing durable home first — scoped AGENTS.md, .agents/docs/, linked notes. If covered, delete as redundant. If not, move a condensed version into the nearest AGENTS.md that has word-ceiling headroom (scripts/docs/agents-budgets.json); watch pnpm run docs status.

Exempt, never delete by policy

JSDoc /** */, tool directives (@ts-*, oxlint/eslint/biome/prettier, istanbul/c8, cspell, #region, @generated, sourceMappingURL, PURE annotations, triple-slash, @dec:). The scanner marks these exempt.

Deletion safety

  • Delete comments with the scanner's ranges (see scanComments export) or by hand from the dump; never a line-level // regex — comments inside template literals (GLSL shaders, embedded docs) are false positives.
  • After each file, syntax-check: git diff review plus a parse of the file.
  • Then node scripts/check-comment-ratchet.mjs --update to tighten the baseline; re-run with no args to verify the ratchet passes.

版本历史

  • 4e2f025 当前 2026-11-26 00:12

同 Skill 集合

.agents/skills/archive-agent-notes/SKILL.md
.agents/skills/effect-ts/SKILL.md
.agents/skills/effect-v3-to-v4/SKILL.md
.agents/skills/failure-containment-review/SKILL.md
.agents/skills/verify-session-execution/SKILL.md
.claude/skills/lody-loro-sync-stack/SKILL.md

元信息

文件数
0
版本
32af0d4
Hash
386c46a1
收录时间
2026-11-26 00:12

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-27 02:50
浙ICP备14020137号-1