review-code

A code-review command that examines the current Git changes and can create a DRIFT.md report when a sprint context exists. It normally coordinates reviews from multiple command-line reviewers.

In plain words
What is it for?
Use it to review a Git diff, collect review findings, produce a verdict, or prepare the drift information required by the MAGI commit process.
Why use it?
It provides a structured check of uncommitted work and records differences from the sprint context before certain commit workflows.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/howar31/magi-workflow/review-code
Any agent
npx skills add howar31/magi-workflow --skill review-code
Clone the repo
git clone --depth 1 https://github.com/howar31/magi-workflow

Made for: Claude Code, Codex.

Per session 125 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,744 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00125 $0.02744
Opus 5 $0.00063 $0.01372
Sonnet 5 $0.00025 $0.00549
Haiku 4.5 $0.00013 $0.00274

Measured 2d ago against content hash 0c94d466eeed, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

review-code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/review-code/SKILL.md · 336 lines

How it starts

The opening of the file, as written. The whole thing — 336 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/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

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:

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)

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 changes against HEAD.
    • If working tree is clean, fall back to last commit (HEAD~..HEAD) and warn the user.

Capture the diff:

git diff $diff_args > "$workdir/changes.diff"
git diff --stat $diff_args > "$workdir/changes.stat"

Show the user git diff --stat first so they confirm scope before tokens get spent.

2. Branch on review mode

2a. Single-reviewer mode (--single)

Dispatch the magi-reviewer subagent. Build a brief:

You are dispatched to review this change set.

## Repo
<path>, branch <branch>, target <upstream-branch>

## Diff
<paste of changes.diff or --reference if too large>

## Files to read in full
- <path>
- <path>

## Project context
- TECHSTACK.md: <verbatim or summary>
- Conventions: CLAUDE.md / AGENTS.md (root)

## Sprint contract (if a sprint context exists)
<verbatim PLAN.md and/or SPEC.md from magi/<num>-<slug>/>

## Acceptance criteria (if applicable)
<from current sprint's SPEC.md if exists>

## Output protocol
Follow your standard structure: Verdict + 🔴 / 🟡 / 🟢 sections.
If a sprint contract was provided above, additionally output a
`## Drift from contract` section with A / B / C classes per your agent
spec.

Read the full file on GitHub · 336 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 336 lines · 125 tokens per session scan A 0c94d466eeed

Subscribe to this mod's changes

review-code is a skill published in the GitHub repository howar31/magi-workflow (2 stars, last pushed 3d ago), licensed MIT. It adds 125 tokens to every session and 2,744 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

model-compatibility

Model family compatibility matrix covering loaders, resolutions, samplers, CFG, VAE, ControlNet, and LoRA compatibility for SD 1.5, SDXL, Flux, SD3, and video models.

artokun/comfyui-mcp · 47 tokens

comfyui-node-registry

Authoring & publishing ComfyUI custom nodes to the Comfy Registry, covering node structure, pyproject.toml spec, comfy-cli publishing, and CI.

artokun/comfyui-mcp · 38 tokens

flux-txt2img

Build Flux txt2img workflows with Flux.1 Dev (SRPO), Flux 2 Klein 9B, Turbo LoRAs, FluxGuidance, and DualCLIPLoader patterns.

artokun/comfyui-mcp · 44 tokens

civitai

Discover Civitai models with the BUILT-IN downloadmodel action:"searchcivitai" and install/generate them locally. Find a checkpoint/LoRA/embedding on Civitai, download it into ComfyUI, and use its trigger words. Optionally pair the official Civitai MCP for community features (images browsing, posting, collections).

artokun/comfyui-mcp · 76 tokens

chief-strategy-officer

Owns where the business plays and how it wins over a multi-year horizon — portfolio choices, corporate development, strategic partnerships, and planning under uncertainty. Use this for a decision about which markets or businesses to be in, whether to build, buy, or partner, how to allocate capital across business…

cbrock84/headcount · 93 tokens

performance-analysis

Measurement approaches, profiling patterns, bottleneck identification, and optimization guidance. Use when diagnosing performance issues, establishing baselines, identifying bottlenecks, or planning for scale. Always measure before optimizing.

rsmdt/the-startup · 42 tokens