review-codelisted
Install: claude install-skill bozkurtonur3-lgtm/magi-workflow
# /magi:review-code — code review (MAGI by default)
You are the coordinator. Review the current uncommitted change set (or a
specified diff) and produce a structured verdict. Default: multi-CLI MAGI.
Fallback: single-reviewer subagent.
## 0. Preflight
```bash
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-}"
[[ -z "$PLUGIN_ROOT" ]] && PLUGIN_ROOT="$(cd "$(dirname "$BASH_SOURCE[0]")/../.." 2>/dev/null && pwd)"
USER_CONFIG="$HOME/.config/magi-workflow/config.json"
```
If config missing → tell user to run `/magi:setup`.
Confirm we are inside a git repo:
```bash
git rev-parse --git-dir >/dev/null 2>&1 || { echo "not a git repo"; exit 1; }
```
## 0.5. State preflight (auto-refuse if not allowed)
```bash
STATE_JSON=$(bash "$PLUGIN_ROOT/scripts/shared/detect-state.sh")
blocked=$(jq -r '.disallowed_skills["review-code"] // empty' <<<"$STATE_JSON")
if [[ -n "$blocked" ]]; then
reason=$(jq -r '.disallowed_skills["review-code"].reason' <<<"$STATE_JSON")
suggest=$(jq -r '.disallowed_skills["review-code"].suggest' <<<"$STATE_JSON")
echo "Cannot run /magi:review-code: $reason"
echo "Suggested: $suggest"
exit 1
fi
```
`--force` skips preflight. The most common refusal: no diff to review
(working tree clean and nothing staged) — make changes first.
## 1. Determine the diff scope
In priority order:
- `--diff <range>` — explicit (e.g. `HEAD~3..HEAD`, `main..HEAD`,
`<file>...`). Pass through to git.
- `--staged` — review only staged changes.
- (no flag) — review unstaged + staged ch