Review and simplify recently changed code for reuse, clarity, and efficiency while preserving behavior. Use when the user asks to simplify, refine, polish, clean up, or make code clearer, or after finishing a logical chunk of implementation that should be tightened before commit.
Use this skill to improve recently changed code without changing what it does.
/simplify # Review current uncommitted changes
/simplify HEAD~3 # Review changes from 3 commits ago to HEAD
/simplify main # Review changes from main branch to HEAD
/simplify abc123 # Review changes from commit abc123 to HEAD
/simplify focus on error handling # Focus review on specific concerns
/simplify focus on memory efficiency # Focus review on memory efficiency
/simplify --quick # Single-pass quick review (commit prep)
/simplify --staged-only # Review only staged changes
/simplify --json # Output findings as JSON for tooling
/simplify --report-only # Report findings without making changes
| Mode | Behavior |
|---|---|
--quick | Single-pass review focusing on high-impact issues only. Skips parallel agents. Best for quick commit prep. |
--staged-only | Only review files in git staging area (git diff --cached). Ignores unstaged changes. |
--json | Output findings as JSON array for CI/tooling integration. Format: [{file, line, category, issue, suggestion}] |
--report-only | Generate report of findings without auto-fixing. Useful for CI comments. |
/simplify --quick --staged-only # Quick review of staged files only
/simplify --json --report-only # CI-friendly JSON report
First, parse the arguments to detect active modes:
--quick: Set QUICK_MODE=true--staged-only: Set STAGED_ONLY=true--json: Set JSON_OUTPUT=true--report-only: Set REPORT_ONLY=trueAny remaining argument is treated as <base-ref>.
STAGED_ONLY=true, use git diff --cached to review only staged changes.<base-ref> argument is provided, use git diff <base-ref>..HEAD to get all changes from that reference to HEAD.git diff for unstaged changes, or git diff HEAD when staged changes exist and you want the full working-tree delta.Quick Mode (QUICK_MODE=true):
Do a single-pass review yourself, combining reuse, quality, and efficiency checks. Focus only on high-impact issues. Skip spawning parallel sub-agents.
Standard Mode: Use parallel sub-agents when available. Give each pass the full diff or exact changed files plus enough surrounding context to make concrete recommendations. If parallel delegation is unavailable, do the same passes yourself sequentially.
Report-Only Mode (REPORT_ONLY=true):
Do not make any changes. Instead, compile findings into a report. If JSON_OUTPUT=true, format as JSON array:
[
{
"file": "src/example.ts",
"line": 42,
"category": "quality",
"issue": "Redundant state variable",
"suggestion": "Remove cachedValue and derive from source"
}
]
Standard Mode:
When spawning sub-agents, each pass should get:
reuse, quality, or efficiency