From swe-review
Use when resolving software issues, fixing bugs, or implementing fixes that need quality assurance — orchestrates automated patchgen, independent code review via subagent, and revision loop until approved or max rounds reached
How this skill is triggered — by the user, by Claude, or both
Slash command
/swe-review:resolveThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Resolve a software issue using an automated patchgen → review → revision loop. You generate the fix, an independent reviewer checks it, and you revise based on feedback. The loop runs until the reviewer approves or 3 rounds are reached.
Resolve a software issue using an automated patchgen → review → revision loop. You generate the fix, an independent reviewer checks it, and you revise based on feedback. The loop runs until the reviewer approves or 3 rounds are reached.
Raw arguments: $ARGUMENTS
Parse flags first, then treat the remainder as the issue description:
| Flag | Default | Meaning |
|---|---|---|
--no-review | (not set) | Skip the review-revision loop entirely; only run patchgen |
--max-rounds N | 3 | Maximum number of review-revision rounds |
Parsing rules:
$ARGUMENTS for --no-review and --max-rounds N (where N is a positive integer)If the issue description is empty after parsing, ask the user to describe the issue or provide a GitHub issue URL.
Parse the issue:
$ARGUMENTS looks like a GitHub URL (contains github.com and /issues/), fetch details:
gh issue view <URL> --json title,body,comments
Compose the issue text from the title, body, and key comments.$ARGUMENTS directly as the issue description.Derive instance name:
login-timeout-bug, django__django-12345, session-refresh-fixCreate workspace directory:
WORKSPACE="./docs/swe-review/<instance_name>_$(date +%Y%m%d_%H%M%S)"
mkdir -p "$WORKSPACE"
Save the issue:
$WORKSPACE/issue.mdRecord base commit:
BASE_COMMIT=$(git rev-parse HEAD)
Remember this — all diffs will be against $BASE_COMMIT.
You are now the developer fixing this issue.
Understand the problem: Read $WORKSPACE/issue.md carefully. Identify what's expected vs what's happening.
Explore the codebase: Use Grep, Glob, and Read to find relevant files. Trace the code path from the entry point to the root cause.
Generate the fix: Use the Edit tool to modify the necessary files. Make focused, minimal changes that address the root cause.
Commit your changes:
git add <changed files>
git commit -m "fix: <concise description of the fix>"
Save the initial diff:
Write the output of git diff $BASE_COMMIT..HEAD to $WORKSPACE/patch_round_0.diff
If --no-review was set: Skip this entire step. Go directly to "Loop Exit (No Review)" below.
Otherwise, set round = 0 and max_rounds to the parsed value (default 3).
Increment round by 1. If round > max_rounds, go to "Loop Exit (Max Rounds Reached)".
Use the Agent tool to launch a review subagent that invokes the swe-review:review skill. The subagent must be completely independent — it knows nothing about your patchgen process.
Agent tool parameters:
subagent_type: "general-purpose"description: "swe-review round N"prompt (fill in the actual absolute paths for WORKSPACE):Invoke the swe-review:review skill to perform an independent code review.
Use the Skill tool:
skill: "swe-review:review"
args: the following JSON (as a single string):
{"issue_file": "<WORKSPACE_ABSOLUTE_PATH>/issue.md", "patch_file": "<WORKSPACE_ABSOLUTE_PATH>/patch_round_<N-1>.diff", "review_output_file": "<WORKSPACE_ABSOLUTE_PATH>/review_round_<N>.json"}
After the skill completes, verify the review report was written to the output file.
After the subagent completes, read the review report from $WORKSPACE/review_round_<N>.json.
If recommendation is "approve":
If recommendation is "request_changes":
round >= max_rounds, go to "Loop Exit (Max Rounds Reached)"You have full context from the patchgen phase. Read the defects from the review report and address them:
Process defects by severity (high → medium → low):
location, description, and suggestionCommit the revision:
git add <changed files>
git commit -m "fix: address review round N feedback"
Save the updated diff:
Write the output of git diff $BASE_COMMIT..HEAD to $WORKSPACE/patch_round_<N>.diff
Go back to "Loop Start"
Write $WORKSPACE/summary.md:
# Resolution Summary
## Issue
<issue description>
## Outcome: APPROVED
- Rounds: <N>
- Final confidence: <confidence>
## Final Review
<last review summary>
## Changes
Run `git diff <BASE_COMMIT>..HEAD` to see all changes.
Tell the user:
git diff <BASE_COMMIT>..HEADWrite $WORKSPACE/summary.md:
# Resolution Summary
## Issue
<issue description>
## Outcome: MAX ROUNDS REACHED (3)
- Final decision: request_changes
- Final confidence: <confidence>
## Outstanding Defects
<list defects from last review>
## Review History
- Round 1: <decision> (confidence <X>)
- Round 2: <decision> (confidence <X>)
- Round 3: <decision> (confidence <X>)
## Changes
Run `git diff <BASE_COMMIT>..HEAD` to see all changes.
Tell the user:
/swe-review:review to get a fresh reviewgit diff <BASE_COMMIT>..HEADWhen --no-review is set, skip the review loop entirely after patchgen.
Write $WORKSPACE/summary.md:
# Resolution Summary
## Issue
<issue description>
## Outcome: PATCHGEN ONLY (review disabled)
## Changes
Run `git diff <BASE_COMMIT>..HEAD` to see all changes.
Tell the user:
/swe-review:review separately to get a reviewgit diff <BASE_COMMIT>..HEADCreates, 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