From Claude Kit
Defines severity classification, decision matrix, auto-escalation rules, and spec check trust logic for automated code review agents.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-kit:code-review-rulesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- BLOCKER: Architecture/security violation — blocks approval
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:
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:
npx claudepluginhub hex0xdeadbeef/claude-kit --plugin claude-kitMulti-phase code review pipeline with mechanical checks, graph-scoped context, parallel review agents, cross-agent deduplication, and structured output. Use for completed work reviews.
Runs Stage 2 code quality review (SOLID, DRY, security, test quality) after spec review passes. Used via /review or 'check code quality'.
Runs structured code reviews with parallel multi-reviewer fan-out, test output gates, and confidence scoring. Supports adversarial review via Codex or thorough Claude-only review.