comment-judge
БесплатноБез исполняемых скриптовНе проверенLLM-as-a-judge rubric for code comments (forbidden, false, stale, narration, noise, keep). Loaded in-process by code-reviewer, dotnet-cop and angular-cop to…
от fmflurry★ 173 звезды на GitHubОб этом скилле
comment-judge
LLM-as-a-judge for code comments. Applies rubric-based verdict, harvests blocks, emits structured findings. Loaded in-process by code-reviewer/dotnet-cop/angular-cop during review; used by the comment-judge agent for module-scoped purges.
Modes
REVIEW: Candidates are added/changed comments in the diff. Source: bash scripts/check-added-comments.sh <base> if the repo provides that script; otherwise git diff -U0 <base>...HEAD | grep -nE '^\+.*(//|/\*|#|<!--)', merged with pre-existing comments within ±10 lines of changed hunks (git diff -U10 <base>...HEAD | grep -nE '^\+.*(//|/\*|#|<!--)'). Goal: verify each comment truthfully describes code behavior.
PURGE: Scans a directory for all comments (added or pre-existing). Source: bash scripts/check-added-comments.sh --path <dir> if available; otherwise grep -rnE '(//|/\*|#|<!--)' <dir> (directory-scoped only; repo-wide is prohibitively slow). Goal: delete stale, false, forbidden, or noisy comments in bulk.
EXPLICIT: Caller supplies a list of path:start-end line ranges (used for manual calibration and edge-case handling).
Grouping
Merge consecutive path:line hits in the same file into blocks: start_line..end_line. One block = one contiguous region. Emit verdict and reasoning once per block, not per line.
Asymmetric cost (REVIEW vs PURGE)
REVIEW mode: Missing a false comment is costly (reviewers trust the code). A wrong flag is cheap (human ignores). Strategy: flag suspected false/stale/forbidden comments even with partial evidence. Tier as ❓ (low) when evidence is incomplete.
PURGE mode: Verdicts are bulk-applied to many files. Delete only at high confidence (Important or Nit). Any doubt → keep + ❓ marker for follow-up.
Never auto-apply false: Comment may be correct and code may be wrong = possible bug. Always require human review.
Rubric
Read the code the comment describes: enclosing symbol, or ±15 lines, or ≤60 lines below a doc block. Never read files >400 lines whole. When CodeMemory is off, skip it. For stale checks, use codememory_definitions only when CodeMemory is on; otherwise one targeted Grep.
Ask in order; first failure wins:
a) FORBIDDEN class (per the project's code-comments rule — ~/.claude/rules/common/code-comments.md / ~/.config/opencode/instructions/code-comments.md, or the repo's own copy if it has one)
- Narration: restates what code does; rename the code instead (tier: Nit).
- adr-restate: Restating, paraphrasing, or quoting design-doc/RFC/rule sections, points, phases, or citing project convention files (AGENTS.md, rules, CLAUDE.md) content. Citations must be bare pointers only:
(ADR-1042)or(RFC 7636 §4.2)for external specs (section allowed for RFCs only). Tier: Nit. - task-ref (extended): Requirement or work-item IDs:
US\d+,EX\d+,SEC\d+,R\d{1,2},F\d[a-z]?,#\d{5,},WI \d+,TC #\d+,Phase \d,sub-phase,P\d(\.\d)?,Pin #\d+. Fix: strip the ID; keep the sentence if a why remains. Tier: Nit. - Suppression/TODO missing reason or ticket number (tier: Nit).
- History/changelog/task reference (tier: Nit).
- Quality claim or verification assertion (tier: Nit).
- Section banners or
#regionmarkers (tier: Nit). - Verdict: delete or rewrite (reason rule).
b) FALSE or STALE (tier: Important)
- FALSE: Comment claims behavior the code does NOT perform (e.g., "thread-safe" without locks). The contradicting evidence is IN the attached code itself (enclosing symbol, ±15 lines). Must quote contradicting
path:line+ exact line. - STALE: Comment describes behavior, a call site, a symbol, or an architecture that has moved or been removed. The contradicting evidence lives OUTSIDE the attached code (another file, a removed/renamed symbol, a deleted method call). Even though the claim is technically untrue now, the comment was once correct and was never updated when the code changed. Verdict: rewrite if the attached code still needs a non-obvious why (supply corrected ≤1-line reason); else delete. Evidence: quote removal or cite
codememory_definitionsresult. - Mixed (noise + stale): When history/ticket noise is attached to stale code, classify STALE (Important outranks Nit); remove noise + supply corrected reason if needed.
- Verdict: false (REVIEW mode only; PURGE requires high confidence). If low confidence → ❓.
c) NARRATION (restates next lines or method signature)
- Example:
// Creates a new userabovepublic User Create(…) {}. - Verdict: delete.
d) NOISE (task/phase/agent history, verbose doc blocks, overstated impl detail on private members)
- Example:
// As discussed in ticket 1234,// Agent wrote this. - Verdict: delete, or rewrite to one line if non-obvious why is buried.
e) KEEP (non-obvious why, invariant with bare pointer, public/cross-module contract)
- Example: `// Sort by created_at DESC; mat
Установить comment-judge в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл comment-judge?
LLM-as-a-judge rubric for code comments (forbidden, false, stale, narration, noise, keep). Loaded in-process by code-reviewer, dotnet-cop and angular-cop to judge every added or changed comment in a review; used by the comment-judge agent for per-module comment purges. Use when judging whether comments are true, useful, or should be deleted/rewritten.
Как установить скилл comment-judge?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл comment-judge запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic