From swe-review
Use when reviewing code changes, patches, or PRs for correctness — performs independent root-cause reconstruction before reading the patch, then compares to detect symptom fixes, missing sibling fixes, and broken dependencies
How this skill is triggered — by the user, by Claude, or both
Slash command
/swe-review:reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are reviewing a code patch. Your job: determine if the patch **correctly fixes the root cause** of the bug, not just a symptom.
You are reviewing a code patch. Your job: determine if the patch correctly fixes the root cause of the bug, not just a symptom.
$ARGUMENTS
This contains either:
HEAD~1..HEAD) or empty → review the git diffissue_file, patch_file, and review_output_file → review from filesParse the input:
$ARGUMENTS is empty or looks like a git ref range → read git diff as the patch, and infer the issue from commit messages and code context$ARGUMENTS contains a JSON object with issue_file → read issue and patch from the specified filesRead the issue description (from issue_file or inferred from context).
Answer these two questions precisely:
Do NOT read the patch yet.
Explore the codebase. Trace from the entry point down through the call stack:
Key distinctions:
.cols on scalar Zero)For bugs where output is wrong or missing: trace ALL code paths that produce output (not just the path that crashes).
Exploration cap: Read at most 8-10 source files. After that, write your best guess and proceed to Step 3, even if uncertain.
Write your root cause:
File: _____
Function: _____
Line: ~_____
What's wrong: _____ (the specific logic that is broken)
Where the bad value is CREATED: _____ (file + function)
Where the bad value SURFACES/CRASHES: _____ (file + function — this is NOT where to fix)
Based on your root cause, write exactly what you would change:
In [file], function [name], around line [N]:
I would change: [describe the specific change]
Because: [why this fixes the root cause at point of CREATION, not point of USE]
This is a commitment. You will compare the actual patch to this proposal.
Now read the patch (from patch_file or git diff).
Compare the patch to your Step 3 proposal:
Even if the patch matches your proposal: still perform the checks below. A patch at the right location can still have side effects.
⚠️ HARD RULE — Symptom fix detection (tests passing does NOT override this): ⚠️ "Architecturally reasonable" does NOT override this rule. A workaround at point of USE is STILL a symptom fix even if you think it's the "right place" architecturally.
If ANY of these match, it's a symptom fix → MUST request_changes (no exceptions):
if isinstance(x, Zero): x = ZeroMatrix(...) in a consumer/caller instead of fixing the producer that creates scalar Zero → request_changestry/except around a crash instead of preventing the bad value → request_changes⚠️ HARD RULE — Unrelated changes:
If the patch includes changes to files/functions that are NOT related to the reported issue → request_changes (scope creep)
Check if the patch changes ANY function signatures, replaces @lru_cache functions, or renames callables. If so:
high severity defect → request_changesOutput the review report as JSON. If review_output_file was specified, write to that file using the Write tool. Otherwise, print to conversation.
{
"decision": {
"recommendation": "approve" or "request_changes",
"confidence": 0.0 to 1.0
},
"summary": {
"problem": "1 sentence: root cause (file + function + what's wrong)",
"solution": "2-4 sentences: what the patch changes and whether it matches the root cause",
"overall_assessment": "1-2 sentences: verdict with reason"
},
"defects": [
{
"severity": "high | medium | low",
"category": "correctness | compatibility | security | performance | maintainability",
"location": {"path": "exact/file/path", "start_line": 0, "end_line": 0},
"description": "What is wrong: specific code, specific condition, specific failure",
"suggestion": "Concrete fix: in file.py function foo(), change X to Y"
}
]
}
Approve only if ALL:
Request changes if ANY:
High (always → request_changes):
Medium: Performance regression, less efficient but functionally correct
Low: Style, variable naming, comments, minor refactoring (no behavior change)
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub swe-lego/cc-swe-review --plugin swe-review