From ccmagic
Multi-model code review (Codex + Gemini + Claude triage) with dimension-focused passes
How this skill is triggered — by the user, by Claude, or both
Slash command
/ccmagic:codex-review [branch|full|PR#] [--model MODEL] [--focus DIMENSION] [--threshold N][branch|full|PR#] [--model MODEL] [--focus DIMENSION] [--threshold N]sonnetThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Multi-model code review: Codex and/or Gemini CLI provide broad coverage across focused dimensions, Claude triages findings, adds its own review pass, and creates an actionable fix plan.
Multi-model code review: Codex and/or Gemini CLI provide broad coverage across focused dimensions, Claude triages findings, adds its own review pass, and creates an actionable fix plan.
Parse $ARGUMENTS:
| Argument | Mode | Description |
|---|---|---|
| (empty) | branch | Diff current branch vs main (default) |
branch | branch | Explicit branch diff |
full | full | Full codebase — module-aware chunking |
<number> | pr | Review PR by number |
--model MODEL | (modifier) | Codex model (default: gpt-5.3-codex, fallback: gpt-5-codex) |
--focus DIM | (modifier) | Run only one dimension: security, architecture, correctness, errors, tests, deps |
--threshold N | (modifier) | Confidence threshold, default 80 |
Check for available review tools:
# Check Codex
which codex 2>/dev/null && codex --version 2>/dev/null
# Check Gemini CLI
which gemini 2>/dev/null && gemini --version 2>/dev/null
Tool availability determines the review strategy:
/ccmagic:review.Neither Codex CLI nor Gemini CLI is installed.
Codex: npm install -g @openai/codex (https://github.com/openai/codex)
Gemini: npm install -g @anthropic-ai/gemini-cli
Falling back to Claude-only review...
Read convention files (silent skip if missing):
CLAUDE.md in project root.claude/CLAUDE.mdcontext/conventions.mdCollect into {PROJECT_CONVENTIONS} for the Claude triage pass and Claude-originated review.
git diff --name-only main...HEAD
git diff --stat main...HEAD
git log --oneline main...HEAD
git diff main...HEAD > /tmp/codex-review-diff.txt
gh pr diff {N} --name-only
gh pr view {N} --json title,body,baseRefName
gh pr diff {N} > /tmp/codex-review-diff.txt
Instead of head -200, discover project structure and partition intelligently:
# 1. Detect project type from build configs
ls package.json go.mod Cargo.toml pyproject.toml pom.xml build.gradle 2>/dev/null
Discover ALL relevant files (expanded from source-only):
find . -type f \( \
-name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \
-o -name "*.py" -o -name "*.go" -o -name "*.rs" -o -name "*.java" \
-o -name "*.rb" -o -name "*.swift" -o -name "*.kt" -o -name "*.scala" \
-o -name "*.cs" -o -name "*.php" -o -name "*.vue" -o -name "*.svelte" \
-o -name "pom.xml" -o -name "build.gradle" -o -name "build.gradle.kts" \
-o -name "package.json" -o -name "Cargo.toml" -o -name "go.mod" \
-o -name "pyproject.toml" -o -name "requirements*.txt" -o -name "Gemfile" \
-o -name "Dockerfile" -o -name "docker-compose*.yml" \
-o -name "*.tf" -o -name "*.tfvars" \
-o -name "application.yml" -o -name "application.properties" \
-o -name "*.env.example" -o -name ".env.example" \
-o -name "*.yaml" -o -name "*.toml" \
\) \
-not -path "*/node_modules/*" -not -path "*/.git/*" \
-not -path "*/dist/*" -not -path "*/build/*" \
-not -path "*/__pycache__/*" -not -path "*/vendor/*" \
-not -path "*/target/*" -not -path "*/.next/*" \
-not -path "*/.terraform/*" \
> /tmp/codex-review-files.txt
Partition into modules by top-level source directory:
# Group files by first meaningful directory (src/*, app/*, lib/*, cmd/*, pkg/*, etc.)
# Create one file list per module: /tmp/codex-module-{name}.txt
# Cap at 6 modules. Group smaller dirs together if >6.
Run separate Codex/Gemini passes per module and aggregate findings. This replaces the head -200 cap with intelligent partitioning.
Same tiering as the review skill:
For >50 files, focus Codex/Gemini on Tier 1+2 only.
Load ${CLAUDE_SKILL_DIR}/codex-prompts.md for dimension-specific prompt templates.
Default (no --focus): Run all applicable dimensions:
security — alwayscorrectness — alwayserrors — alwaysarchitecture — always for full mode, branch/PR if >10 files changedtests — always for full mode, branch/PR if test files existdeps — only for full mode or if dependency files changedWith --focus: Run only the specified dimension.
For each dimension, run available tools in parallel:
Codex pass:
REVIEW_MODEL="${MODEL:-gpt-5.3-codex}"
FALLBACK_MODEL="${FALLBACK_MODEL:-gpt-5-codex}"
# Inject dimension-specific prompt and diff content via stdin
# (--base and [PROMPT] are mutually exclusive in codex; pipe diff instead)
cat /tmp/codex-{dimension}-prompt.txt /tmp/codex-review-diff.txt | \
codex --model ${REVIEW_MODEL} --full-auto exec - \
2>&1 | tee /tmp/codex-{dimension}-output.txt
Gemini pass (if available):
# Run same dimension prompt through Gemini for cross-model coverage
gemini --model gemini-2.5-pro -p "$(cat /tmp/codex-{dimension}-prompt.txt)" \
2>&1 | tee /tmp/gemini-{dimension}-output.txt
For full mode: Run each dimension per module, then aggregate:
# Per module, per dimension
cat /tmp/codex-{dimension}-prompt.txt <(echo "Files to review:") /tmp/codex-module-{name}.txt | \
codex --model ${REVIEW_MODEL} --full-auto exec - \
2>&1 | tee /tmp/codex-{dimension}-{module}-output.txt
Model fallback: If primary model access fails (check for "model not found", "not available", "permission denied"), retry once with FALLBACK_MODEL.
Load ${CLAUDE_SKILL_DIR}/codex-triage.md for full triage instructions.
cat /tmp/codex-*-output.txt /tmp/gemini-*-output.txt 2>/dev/null
Apply {PROJECT_CONVENTIONS} from Step 2 when evaluating findings.
For each finding, assess:
Same file + overlapping lines + same issue type → merge. Keep highest confidence, most specific detail.
Drop findings below threshold (default 80, --threshold N override). Exception: Critical findings with confidence 60+ survive.
After triaging external findings, Claude reviews areas where it has an advantage (full codebase access, convention knowledge). See Part 2 of ${CLAUDE_SKILL_DIR}/codex-triage.md.
Launch parallel Explore agents for:
Claude-originated findings are tagged with source: claude and enter the same severity/confidence pipeline. Skip anything already covered by a triaged external finding.
For all Critical and High findings from any source (Codex, Gemini, Claude), launch parallel verification Explore agents (capped at 4):
Process verdicts:
# Cross-Model Code Review
## Summary
- **Scope**: branch changes | full codebase | PR #X
- **Tools Used**: Codex ({model}) [+ Gemini] + Claude
- **Dimensions**: [list of passes run]
- **Files Analyzed**: N total (M prioritized)
- **Confidence Threshold**: [threshold]
- **Convention Sources**: [files loaded or "none"]
- **Findings**: X Critical, Y High, Z Medium, W Low
## Critical Issues ({count}) — Verified
For each:
> **[severity] [confidence]% [source: codex|gemini|claude|multi]** `file:line`
> **Issue**: one-line summary
> **Trigger**: concrete scenario
> **Verification**: CONFIRMED — [evidence]
> **Fix**: minimal safe change
> **Test**: specific test to add
## High Priority Issues ({count}) — Verified
[same format]
## Medium Priority Issues ({count})
[same format, without verification]
## Convention Violations ({count})
> **[confidence]% [source: claude]** `file:line`
> **Rule**: [quoted convention]
> **Violation**: what differs
> **Fix**: how to comply
## Low Priority / Suggestions ({count})
[grouped by file]
## Dismissed Findings ({count})
> ~~`file:line` — [issue] (source: {tool})~~
> **Dismissed**: [reason]
## Model Agreement
[Where models agreed vs disagreed, how disagreements were resolved]
## Positive Findings
[Good patterns observed]
## Overall Assessment
[Quality rating, key risks, recommendation]
## Raw Tool Output
<details>
<summary>Codex output (click to expand)</summary>
[raw codex output per dimension]
</details>
<details>
<summary>Gemini output (click to expand)</summary>
[raw gemini output per dimension, if used]
</details>
Create TodoWrite entries for all confirmed findings, grouped by severity then file:
For findings where models disagree or verification was uncertain:
Present both assessments via AskUserQuestion:
Disputed: [issue at file:line] Codex says: [assessment] Gemini says: [assessment] (if applicable) Claude says: [assessment] Options: Fix | Defer | Dismiss
Record decision in report.
/ccmagic:reviewKey principle: Multiple models catch different things. Codex and Gemini provide broad, independent coverage. Claude provides judgment, convention awareness, and codebase-wide context. Findings that survive multi-model agreement and verification are high-confidence signals worth acting on.
npx claudepluginhub devondragon/ccmagic --plugin ccmagicCreates bite-sized, testable implementation plans from specs or requirements, with file structure and task decomposition. Activates before coding multi-step tasks.