skills/ai-review/SKILL.md
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".
npx skillsauth add eins78/skills ai-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Request code reviews from a second AI model mid-session via CLI.
gemini CLI installed (run ${CLAUDE_SKILL_DIR}/scripts/install-dependencies.sh)GEMINI_API_KEY env var (recommended — see "Paid API" below) or Google Account OAuth (gemini interactively once)codex CLI for OpenAI reviews: brew install codexQuality over speed. When a review is requested, you MUST wait for the result. Do NOT:
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.
| 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:
--no-context for small/focused reviews to cut token usageThe 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.
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.
# 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.
export GEMINI_API_KEY="your-key-here"
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.gemini -p "hello" — should respond without OAuth prompts or quota errors.| | 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 |
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 |
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 --staged
After receiving the review:
| 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 |
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):
--plan flag, PLAN.md at repo root, most recent .claude/plans/*.mdCLAUDE.md, GEMINI.md, AGENTS.md at repo rootUse --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.
Default provider is gemini. Override per-session:
# Use OpenAI instead
REVIEW_PROVIDER=codex ${CLAUDE_SKILL_DIR}/scripts/review.sh
-p) and cannot browse the repo. Project context is auto-included to compensate — see "Auto-Context" above.development
Use when writing or reviewing any TypeScript code. Covers discriminated unions, branded types, Zod at boundaries, const arrays over enums, and safe access patterns.
development
Use when facing technical uncertainty, unproven architecture, or building a large feature where agents or humans risk getting lost in details before confirming the architecture works. Prevents horizontal layer-by-layer building that delays integration feedback.
tools
Use when sending commands to tmux panes, reading pane output, creating windows/panes, or monitoring tmux sessions. Covers reliable targeting, synchronization, and output capture patterns.
tools
Use when converting a PDF into a fold-and-print booklet (zine) — A4 sheets, double-sided, short-edge flip, fold to A5. Triggers: make a zine, make a booklet, booklet PDF, imposition, fold-and-print, 2-up booklet, print as booklet, signature imposition, pdf-zine, pdf2zine, bookletimposer. Wraps the `pdf2zine` Docker-based CLI; prefer it over hand-rolled Ghostscript or pdfjam scripts.