comment-sweep
在 PR 前抓住低级注释问题,减轻后续审查负担
根据规范扫描 PR/暂存 diff 中新增的代码注释并报告违反项
扫描 PR 或暂存区中新加入的代码注释,按团队规范指出问题并给修正建议(比如复述标识符、把 WHY 写成长段、保留变更历史痕迹等)。在准备创建 PR 或提交前运行,能在 reviewer 手动 review 前清理低质量注释。特点是只检查新增注释、支持 staged/worktree 模式,并能自动跳过仅含 revert 的提交,减少无效提醒。
▸ 展开 SKILL.md 英文原文
Reviews newly added code comments in a git diff against rules/code-comments.md. Detects identifier paraphrase, WHAT/HOW explanation of next code, comparison comments ('既存の X と異なり'), change history references (Copilot 指摘 / issue ID prefix / 'added for' / 'fixes URL'), 3+ line blocks compressible to a 1-line WHY, and duplicate sentences within a block. Default scans the diff between the PR base and HEAD for PR readiness. '--staged' scans the index, '--worktree' scans tracked uncommitted changes, BASE_BRANCH (any positional arg) overrides the base ref. Auto-skips when base..HEAD contains only revert commits (subjects all start with 'Revert "'). Use BEFORE 'gh pr create', or when the user mentions コメントチェック / コメント sweep / comment review / 余計なコメント / コメント不適切.
帮我安装这个 skill:https://raw.githubusercontent.com/kanka-jp/coding-agent-playbook-20260707/main/.claude/skills/comment-sweep/SKILL.mdcurl -fsSL "https://raw.githubusercontent.com/kanka-jp/coding-agent-playbook-20260707/main/.claude/skills/comment-sweep/SKILL.md"# comment-sweep PR / staged / worktree diff の **新規追加コメント行**を [rules/code-comments.md](../../../rules/code-comments.md) の規範に照らして判定し、違反箇所を報告して修正まで導く leaf skill ([rules/skills.md](../../../rules/skills.md))。`/pr-codex-ci` の前段として走らせると、codex review が低レベル指摘 (コメント余計) に時間を使わなくなる。 ## いつ使うか - **PR 作成前 (推奨)**: `gh pr create` の**前**。実装直後・テスト直後等、push 前に sweep を通す - **既存 PR への追加 push 前**: review 対応や bug fix の差分にも適用 (commit 後・push 前に default モードで) - **ユーザーから「コメント不適切」「余計なコメント」等の指摘を受けた直後**: 全変更ファイルに対し再 sweep - **PR を作らない一時的な変更でも**: commit 前に `--staged` または `--worktree` モードで動かしてよい ## 引数モード | 引数 | 対象 diff | 用途 | |------|----------|------| | (なし) | `git diff origin/<HEAD-branch>...HEAD` (HEAD-branch は `ori