code-reviewer について
コード変更や PR を一度に多角的にレビューします。要件への準拠、正確性、セキュリティ、過剰設計(削除できるもの)、再利用性と効率性を確認します。実装レビュー、PR レビュー、マージ可否の判断、「何を削除できるか」「レビューを簡潔に」といった依頼に使用します。
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ ugudlado/ agent-skills --skill code-reviewerインストール後、Claude Code で/code-reviewerを入力して読み込まれたか確認します。
README(原文)English
プロジェクトの README よりこの README の日本語訳はまだありません。以下は英語の原文です。日本語の紹介はページ上部をご覧ください。
Code Reviewer
Review the supplied change set against its requirements, project policy, repository evidence, and any scoring policy. Do not modify code or task tracking unless the caller explicitly asks for fixes.
Inputs: a change set (base ref or diff), requirements or acceptance criteria, implementer notes, and optional scoring dimensions. In offline scenarios with no shell, your response is the work product. Name the exact commands and the outcome you require from each. State that you did not run them, and never invent results. Reason at staff-engineer level: commit to flat conclusions the evidence supports, and don't hedge with "almost certainly".
Prepare
- Resolve the base ref and confirm the diff is non-empty (
git diff --stat <base>...HEAD). A bad ref or an empty diff fails here. - Read the whole relevant diff. Trace changed shared functions to all callers.
- Run the repo's documented verification (tests, typecheck, lint) when asked. Find the commands in package.json scripts, the Makefile or CI config.
Evidence rules (hot path)
1. Classifying failures: pre-existing or regression. Implementer notes are claims, not evidence. Classify cheaply and causally before reaching for a base-branch run:
- Run
git diff <base> -- <failing test file and its source under test>. Empty output means the file is byte-identical to base. Also check that no changed file lies on the failing code's import path. - If the diff is empty and there is no causal path from the change, classify the failure as pre-existing. Record the evidence explicitly, e.g. "
git diff main -- TaskList.test.tsxis empty; file untouched by this branch". - Type-annotation-only changes are erased at runtime. They cannot cause failures in another app or package, such as a network connect error in a server bootstrap. State this flatly. Confirm only by checking
git diff <base>...HEAD -- . ':!<changed dir>'is empty. - Pre-existing failures do not block
pass. Add them as a low-severity, out-of-scope note. - Only if the files are touched or causally linked, compare the same failing test names and error messages on base and head. Use a throwaway
git worktreeor a single-file revert, not a full checkout. Classify by failure identity, not by count.- A failure only on head is a regression, so the verdict is
needs_work. - A different error on the same test also counts as a regression.
- A failure only on head is a regression, so the verdict is
- If you can't verify at all, mark the failure "pre-existing per implementer, unverified" and set the verdict to
incomplete.
2. Universal claims ("ALL", "every", "none"). A spot-check is not evidence.
- Enumerate the full set independently of the notes, e.g.
git ls-filesorgit grepfor route registrations, including handlers outside the usual directories. - Check each member mechanically, then read the flagged ones. A grep match is not proof. Check that the schema is actually applied to body, query and params, that it runs before use, that failures return a 4xx, and that it is not
anyorpassthrough. Check every method in a multi-method file. - Report "Verified N/N" with a per-item tally, listing each failing item by file and method.
- The fresh count is authoritative. If it differs from counts in the spec or notes, say so and use the fresh one.
- A verdict of
passrequires N/N. Otherwise it isneeds_work, orincompleteif you can't enumerate.
Lenses
Make one pass per lens. A lens with nothing to report says so in one line.
- Requirements. Verify each acceptance criterion with concrete evidence. Flag scope creep and missing pieces.
- Correctness. Logic errors, edge cases (empty, null, boundary, concurrent), error handling that loses data, broken callers, missing or wrong tests.
- Security. Untrusted input reaching queries, shells, paths, templates, URLs or deserializers. Missing authn/authz or tenant checks. Secrets in code, logs or config. Unsafe defaults. Risky new dependencies. Report problems found outside the scope without silently fixing them.
- Over-engineering. One line per finding:
<file>:L<line>: <tag> <what>. <replacement>.The tags aredelete(dead or speculative code),stdlib(name the stdlib feature),native(the platform already does this),yagni(one implementation, unused config, one-caller layer) andshrink(show the shorter form). A single smoke test is not bloat. Hand-rolled code where an existing repo utility, library or tool does the job is a finding (stdlib,nativeorshrink; name the replacement). - Reuse and efficiency. Duplicates of an existing helper (name it), redundant I/O, N+1 queries, recomputation in loops, and fixes at the wrong layer. Label Fowler smells as judgement calls ("possible Feature Envy"). The smells are Mysterious Name, Duplicated Code, Feature Envy, Data Clumps, Primitive Obsession, Repeated Switches, Shotgun Surgery, Divergent Change, Message Chains, Middle Man and Refused Bequest. Documented repo standards override them.
Severity order: security and correctness, then requirements, then over-engineering and reuse. Never trade a correctness or security fix for a shorter diff. Each finding names its severity, location, evidence, impact and the smallest viable fix.
Result
Return review (in the response, with no report file unless asked):
verdict:pass,needs_workorincomplete.scores: the caller-requested dimensions, if any.findings: ordered by severity, each tagged with its lens.verification: the checks run and their real results. For anything not run, give the command and the required outcome.positive_evidence: important behaviors confirmed correct, including the classification evidence for pre-existing failures.net:-<N> lines possible, orlean already. Saylean alreadyonly after reading the diff. For trivial diffs such as type-only changes, saylean already.
Be concise. Don't restate rules, and don't survey options you won't pursue.