ai-review
Skill2 starsChanged 15 days agoMITView on GitHub
Get AI code review from a second model (Gemini/OpenAI) mid-session via CLI. Use when asked to review code, get a second opinion, check quality, or verify implementation — especially in unfamiliar stacks. Triggers on /ai-review, "review this", "get a second opinion", "check with another model".
- Reads credentials
- Installs packages
6 other projects use a version of this.
Adopted by
Most recently taken up by
- SkyWalker2506/ccplugin-ai-reviewtheir own version, first seen Oct 20, 2026
- tingyulu/MyR2D2their own version, first seen Oct 16, 2026
- nobodywho-ooo/nobodywhotheir own version, first seen Oct 8, 2026
- PaddlePaddle/Paddletheir own version, first seen Oct 8, 2026
- dgilford/ai-science-toolkittheir own version, first seen Oct 1, 2026
- SanHsien/agent-astromechtheir own version, first seen Sep 27, 2026
Used with
Projects with it also use pickup.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
HermeticOrmusSkillpickup
Read a HANDOFF.md and restore session context. The entry ritual -- the opposite of /handoff. Use at the start of a new session after a handoff, machine switch, or context clear.
Also in 3 projects that use this
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- PaddlePaddle/Paddle★ 24ksame name
- nobodywho-ooo/nobodywho★ 1.7ksame name
- dgilford/ai-science-toolkit★ 82same name
- tingyulu/MyR2D2★ 19same name
- SanHsien/agent-astromech★ 0same name
- SkyWalker2506/ccplugin-ai-review★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository17 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- skills/agent-workspace/templates/CLAUDE.mdCLAUDE.md
- agent-workspaceSkill
- ai-council-reviewSkill
- apple-mailSkill
- apple-notesSkill
- ballotSkill
- chrome-browserSkill
- dossierSkill
- lab-notesSkill
- pandocSkill
- paprika-recipesSkill
- pdf-zineSkill
- private-podcast-feedSkill
- send-to-kindleSkill
- text-to-speechSkill
- tmux-controlSkill
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 7 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
Quality over speed: When a review is requested, you MUST wait for the result.
- Very specific: line 50
Use --no-context for small/focused reviews to cut token usage
- Distinctive: line 52
Use a paid API key to avoid capacity limits entirely (see below)
- Distinctive: line 74
Add this to your shell profile so new shells pick it up.
- Very specific: line 75
Verify it works: gemini -p "hello" — should respond without OAuth prompts or quota errors.
- Distinctive: line 96
Tip: Create multiple keys in the same project to separate ai-review usage from interactive gemini CLI use
- Distinctive: line 144
After receiving the review:
- Distinctive: line 146
Consider WARNING items — fix unless there's a good reason not to
- Distinctive: line 148
If the review raises questions you're unsure about, discuss with the user
- Very specific: line 168
Use --no-context to skip this (e.g., for very large payloads).
- Very specific: line 174
Default provider is gemini.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AI Code Review
Request code reviews from a second AI model mid-session via CLI.
Prerequisites
geminiCLI installed (run${CLAUDE_SKILL_DIR}/scripts/install-dependencies.sh)- Auth: either
GEMINI_API_KEYenv var (recommended — see "Paid API" below) or Google Account OAuth (geminiinteractively once) - Optional:
codexCLI for OpenAI reviews:brew install codex
CRITICAL: Never Skip Reviews
Quality over speed. When a review is requested, you MUST wait for the result. Do NOT:
- Skip the review because of rate limits or timeouts
- Proceed without the review and say "we can review later"
- Substitute your own review instead of calling the external model
The gemini CLI handles rate limit retries automatically. If the script exits with a timeout (exit code 2), ask your human partner for help — do not silently continue.
Rate Limits (Free Tier — Google Account Auth)
| Metric | Limit |
| Requests per minute | 60 RPM |
| Requests per day | 1,000 RPD |
| Capacity (tokens/time) | Very low — the real bottleneck |
| Model | Auto-selected by Google (upgrades over time) |
| Cost | $0 |
Important: The RPM/RPD limits are rarely the issue. Google also enforces a capacity quota (total tokens processed per rolling time window) that is much more restrictive. Large review payloads (code + auto-context) can exhaust this quota in just a few requests, triggering a TerminalQuotaError with a multi-hour reset (typically 1-3 hours). This is especially tight on newer auto-selected models (e.g., Gemini 2.5 Pro).
To reduce quota pressure:
- Use
--no-contextfor small/focused reviews to cut token usage - Split large reviews into smaller chunks
- Use a paid API key to avoid capacity limits entirely (see below)
The CLI retries automatically on per-minute rate limit hits (resets in seconds). The capacity quota does NOT retry — it requires waiting for the reset window. The script has a 1-hour timeout — if exceeded, it aborts and you should ask the user for help.
Paid API (Recommended for Regular Use)
The free tier's capacity quota makes it impractical for more than a few reviews per session. A paid API key removes this bottleneck at minimal cost.
Setup
- Get a key from Google AI Studio
- Enable billing on the associated Google Cloud project — without billing, the API key still uses free-tier capacity limits (the same bottleneck as OAuth). In AI Studio: Settings → Billing, or in the Google Cloud Console.
- Configure the gemini CLI to use API key auth:
# Set auth type in gemini settings (~/.gemini/settings.json) # Run gemini interactively once — it will prompt to select auth method. # Choose "Gemini API Key" when prompted. - Set the environment variable:
Add this to your shell profile so new shells pick it up. If you're in an already-running session (e.g., Claude Code), you'll need to source the file or restart the session.export GEMINI_API_KEY="your-key-here" - Verify it works:
gemini -p "hello"— should respond without OAuth prompts or quota errors.
Cost Estimate (Gemini 2.5 Pro)
| Tokens | Cost | |
| Input per review (context + diff) | ~8-12K | ~$0.01-0.015 |
| Output per review | ~1-2K | ~$0.01-0.02 |
| Total per review | ~$0.02-0.04 |
| Usage level | Reviews/month | Est. cost |
| Light (few/week) | ~20 | ~$0.50 |
| Moderate (few/day) | ~60 | ~$1.50 |
| Heavy (many/day) | ~150 | ~$4.00 |
Tracking Usage
- AI Studio → Dashboard → Usage tab (requests, tokens, costs)
- Google Cloud Console → APIs & Services → Dashboard → "Generative Language API"
- Billing Reports → group by SKU for per-model breakdown
- Tip: Create multiple keys in the same project to separate ai-review usage from interactive gemini CLI use
How to Use
Step 1: Determine What to Review
Choose based on context:
| Situation | What to send |
| Just wrote code | The specific files changed |
| Mid-feature | git diff (unstaged changes) |
| Before commit | git diff --cached (staged changes) |
| Branch review | git diff main...HEAD |
| Specific concern | Single file or function |
Step 2: Run the Review
Use the review script at ${CLAUDE_SKILL_DIR}/scripts/review.sh — this path resolves to the skill's own directory regardless of the current working directory. Never use ./scripts/review.sh (that's relative to CWD and will fail in other repos). Never pipe code directly to gemini or codex — always use the review script.
# Review unstaged changes (default)
${CLAUDE_SKILL_DIR}/scripts/review.sh
# Review staged changes
${CLAUDE_SKILL_DIR}/scripts/review.sh --staged
# Review specific files
${CLAUDE_SKILL_DIR}/scripts/review.sh path/to/file1.swift path/to/file2.swift
# Review branch diff vs main
${CLAUDE_SKILL_DIR}/scripts/review.sh --branch
# Review branch vs remote (when working on main directly)
REVIEW_BASE_BRANCH=origin/main ${CLAUDE_SKILL_DIR}/scripts/review.sh --branch
# Add extra context string for better reviews
${CLAUDE_SKILL_DIR}/scripts/review.sh --context "SwiftUI app, iOS 18+, Swift 6" path/to/file.swift
# Review with a specific plan file
${CLAUDE_SKILL_DIR}/scripts/review.sh --plan PLAN.md path/to/file.swift
# Skip auto-context (only send the code/diff)
${CLAUDE_SKILL_DIR}/scripts/review.sh --no-context --stagedStep 3: Act on Feedback
After receiving the review:
- Address any ERROR-severity issues immediately
- Consider WARNING items — fix unless there's a good reason not to
- INFO items are suggestions — use judgment
- If the review raises questions you're unsure about, discuss with the user
Handling Failures
| Exit code | Meaning | Action |
| 0 | Success | Act on review feedback |
| 1 | No code to review / bad args | Check arguments |
| 2 | Timeout (>1 hour blocked) | Ask user for help — do not skip the review |
Auto-Context
The review script automatically prepends project context to every review so the reviewer understands conventions, architecture, and intent. No manual "Code Review Context" section needed in CLAUDE.md.
Included automatically (in order):
- Implementation plan — first found of:
--planflag,PLAN.mdat repo root, most recent.claude/plans/*.md - Project instructions — first found of:
CLAUDE.md,GEMINI.md,AGENTS.mdat repo root - File tree — repo structure at depth 3
Use --no-context to skip this (e.g., for very large payloads).
The --context flag adds an additional inline context string on top of the auto-context.
Provider Configuration
Default provider is gemini. Override per-session:
# Use OpenAI instead
REVIEW_PROVIDER=codex ${CLAUDE_SKILL_DIR}/scripts/review.shImportant Notes
- Reviews are advisory — the second model may have false positives
- Large diffs (>50KB) may be truncated. Split into smaller reviews if needed.
- The review model runs in prompt mode (
-p) and cannot browse the repo. Project context is auto-included to compensate — see "Auto-Context" above.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

