/claude-kit:code-review-rulesfrom Claude Kit
Defines severity classification, decision matrix, and auto-escalation rules for code review. Loaded automatically by the code-reviewer agent.
Ships in Claude Kit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
5+ MINOR same file threshold mirrors the Auto-Escalation rule below — both files use the file as the natural unit for code review, giving a single decision point.Iteration 1: If coder handoff includes spec_check with status=PASS → trust spec compliance, skip plan compliance re-check during REVIEW. Focus REVIEW entirely on code quality (architecture, error handling, security, test coverage).
Iteration 2+ (CHANGES_REQUESTED loop): Even when spec_check.status=PASS, perform a Parts-coverage spot-check by running git diff --name-only $BASE...HEAD and verifying each plan Part has at least one associated changed file. The verification is mechanical: read .claude/prompts/{feature}.md Parts list, map each Part name to one or more files mentioned in the Part body, then assert the changed-files set covers each Part. If any Part is found in parts_implemented but has zero matching changed files, raise a MINOR with category=completeness and a stable problem string "Iter ≥2 spot-check: Part \"{Part name}\" claimed implemented but no matching changed files in this iteration's diff. Possible silent regression.". The spot-check is targeted (not a full re-run) and adds 1-3 extra Bash invocations only on iter ≥ 2.
spec_check.status=PARTIAL: note documented gaps as MINOR during REVIEW (unchanged).
spec_check missing: backward compat — check plan coverage during REVIEW (unchanged).
If coder handoff includes verify_status with lint=PASS and test=PASS → trust coder verification, skip re-run.
Otherwise: run {LINT_CMD} and {TEST_CMD} (resolved from PROJECT-KNOWLEDGE.md; CLAUDE.md fallback; kit-default Go: make lint, make test). If EITHER fails → STOP, return to coder. If both slots unset AND no CLAUDE.md fallback → SKIP QUICK CHECK, emit consolidated NIT.
Do NOT proceed to review if Quick Check fails (whether trusted or re-run).
Also check spec_check from coder handoff. If status=PASS → note compliance trusted. If PARTIAL → note gaps. If missing → plan to check coverage during REVIEW (backward compat).
Run git diff $BASE...HEAD (detect base branch first — see code-reviewer.md process). Assess: files changed, lines changed, layers affected.
If >100 lines or >5 files or 3+ layers → use Sequential Thinking.
Check each area using grep search patterns from Examples:
Scan the comment lines in the diff. Raise an issue when a source comment does either of:
Both belong in the handoff artifact and the commit message, not in a source file.
The coder's normative rule is coder-rules/SKILL.md § Comment Policy (RULE_6).
Scope: only comments on lines this diff added or modified. Do NOT raise pre-existing comments the change did not touch, and do NOT ask for comments to be added — the policy defaults to no comment.
File the issue with category: "style" and this EXACT problem string, unmodified:
Source comment references the development process rather than the code it documents. Process references (plan parts, acceptance criteria, review issue identifiers, phase names) and change narrative belong in the handoff artifact and the commit message, not in source files.
The string is a fixed literal because problem is a canonical-issue-ID hash input —
interpolating anything into it rotates the ID between iterations. Put the place in the
location field instead, and name the enclosing symbol or function there rather than a
bare line number, which drifts.
Severity: MINOR. No new escalation rule — the existing "5+ MINOR in same file → MAJOR" auto-escalation already covers a file saturated with such comments.
Count issues by severity. Apply Decision Matrix and Auto-Escalation rules above. CRITICAL: NEVER approve with BLOCKER issues. Form handoff for completion.
Principle: Choose one — return with wrap (domain/service) or log (handler), never both.
Reference shapes (syntax-correct examples per language):
../planner-rules/code-shapes/<LANGUAGE>.md for language-correct error wrapping per {ERROR_WRAP} slotreturn fmt.Errorf("context: %w", err){ERROR_WRAP} slot unsetWhy: [BLOCKER] Log AND return creates duplicate logs in error chain — language-agnostic anti-pattern.
For more examples (incl. grep search patterns), see Examples.
Cause: Rushed review, missed severity classification. Fix: NEVER approve with blockers — RULE is absolute. Re-check all findings against Severity Classification above before verdict.
Cause: Trusted visual review instead of grep.
Fix: ALWAYS run Grep 'log\.(Error|Warn|Info).*\n.*return' on changed files. Automated checks catch what eyes miss.
Cause: Changes seemed straightforward at first glance. Fix: ALWAYS use Sequential Thinking for 100+ lines, 5+ files, or 3+ layers. No exceptions.
For all troubleshooting cases, see Troubleshooting.
Do NOT read supporting files upfront. This SKILL.md contains all essential rules inline. Load files only when the specific trigger condition is met:
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub hex0xdeadbeef/claude-kit --plugin claude-kit9 skills in this plugin
/cavemanProject-local terse-output mode for /workflow pipeline. Cuts Messages token cost via concise prose. Loaded only at SessionStart by .claude/scripts/caveman-activate.sh — not auto-invoked on user prompts.
/coder-rulesImplementation rules and patterns for /coder command. Load at /coder startup (step 0) or when /workflow enters Phase 3. Covers: 6 CRITICAL rules (plan-only, import matrix, clean domain, no log+return, tests pass, comment quality), the comment policy for source files, evaluate protocol (PROCEED/REVISE/RETURN), dependency-ordered implementation./design-rulesDesign phase rules for /designer command. Load at /designer startup (step 0). Covers spec quality, design checklist, approach evaluation criteria.Other plugins' skills for the same job