| name | cli-review |
| description | Dispatch a review task to Gemini CLI (large-context review — plans, docs, large file corpora) or Codex CLI (code review — diffs, PRs, implementation quality). Routes based on the nature of the artifact being reviewed. Use from achieve-goal, literature-survey skills, or any skill that needs a CLI-based review gate. This is a headless CLI review gate over a concrete artifact (code, diff, or doc corpus); for an interactive second opinion or a side-by-side model comparison via MCP chat, use consult-llm instead. |
CLI Review
Dispatches a review to Gemini CLI or Codex CLI. The caller provides what to review and which files to read. This skill handles routing, invocation, and failure handling.
CLIs are read-only — they never modify files. They return structured text feedback; the calling skill decides what to act on.
Routing
| What is being reviewed | Route to |
|---|
| Plan, design, architecture, or proposal | Gemini CLI |
| Large corpus of docs/files requiring synthesis | Gemini CLI |
| Literature survey consolidation (phases 3.7, 4, 5) | Gemini CLI |
| Exploration of an unfamiliar codebase or domain | Gemini CLI |
| Code changes, diff, PR, or implementation quality | Codex CLI |
When ambiguous: text/docs/plans → Gemini; code → Codex.
Mixed reviews (e.g. "does this implementation match the plan?") → run both sequentially: Gemini first for plan coherence, Codex for code quality.
Invocation
Gemini CLI
gemini --prompt "<task description>
Read these files:
- /absolute/path/to/file1
- /absolute/path/to/file2
<specific questions or output format>"
Claude does not pre-summarize the files. Gemini reads them autonomously — that is the point of the 1M context window.
Codex (MCP tool — PRIMARY transport)
Use the mcp__codex__codex MCP tool, not the CLI, as the first choice (2026-07-03: two silent
CLI hangs cost ~4.5h of wall-clock; the MCP app-server transport returned the same multi-file
review in ~2 min):
mcp__codex__codex(
prompt="<task description + files to read + expected return format>. Do not modify any files.",
cwd="/path/to/repo",
sandbox="read-only",
approval-policy="never",
)
Codex CLI (fallback only)
The pre-v0.45 codex --approval-mode full-auto --quiet invocation NO LONGER EXISTS. If the
MCP tool is unavailable, use:
cd /path/to/repo && codex exec --sandbox read-only --skip-git-repo-check "<prompt>" </dev/null
Mandatory guards — each omission has caused a silent indefinite hang (failure ledger
cli-review:codex-exec-hangs-undetected):
</dev/null — codex exec otherwise blocks forever reading the open stdin pipe.
--skip-git-repo-check (or run from a trusted git-repo cwd) — otherwise it stops at the trust check.
- Probe first: run
codex exec ... "Reply with exactly: CODEX-OK" </dev/null with a ~2-min
timeout before the real review; if the probe fails or hangs, switch to the MCP tool.
- Liveness watchdog (applies to BOTH CLIs): after launching any review in the background,
verify within ~3 minutes that the process is accumulating CPU time or producing output.
Near-zero CPU on a "running" review = hang → stop it (TaskStop, never pkill) and switch
transport. Silence is never evidence of progress.
Failure Handling
- Non-zero exit (crash): retry once with a simpler or more constrained prompt; if it fails again, skip the review, note it was skipped, and continue
- Silent hang (process alive, no output, ~zero CPU growth): kill via TaskStop and switch transport (CLI → MCP tool, or Gemini↔Codex if one backend is down); do NOT wait it out
- Clean exit, empty output: treat as "no issues found" — valid result, not an error; do not retry
Output
Return the CLI's stdout to the calling skill verbatim. The calling skill is responsible for acting on the feedback — this skill only dispatches and returns.