Loading...
Loading...
Runs external LLM code reviews (OpenAI Codex or Google Gemini CLI) on uncommitted changes, branch diffs, or specific commits. Use when the user asks for a second opinion, external review, codex review, gemini review, or mentions /second-opinion.
npx skill4agent add trailofbits/skills second-opinion--yolo# Codex
codex review --uncommitted
codex review --base <branch>
codex review --commit <sha>
# Gemini (code review extension)
gemini -p "/code-review" --yolo -e code-review
# Gemini (headless with diff — see references/ for full heredoc pattern)
git diff HEAD > /tmp/review-diff.txt
cat <<'PROMPT' | gemini -p - --yolo
Review this diff...
$(cat /tmp/review-diff.txt)
PROMPTAskUserQuestionAskUserQuestionheader: "Review tool"
question: "Which tool should run the review?"
options:
- "Both Codex and Gemini (Recommended)" → run both in parallel
- "Codex only" → codex review
- "Gemini only" → gemini CLIheader: "Review scope"
question: "What should be reviewed?"
options:
- "Uncommitted changes" → --uncommitted / git diff HEAD
- "Branch diff vs main" → --base (auto-detect default branch)
- "Specific commit" → --commit (follow up for SHA)header: "Project context"
question: "Include project conventions file so the review
checks against your standards?"
options:
- "Yes, include it"
- "No, standard review"--uncommitted--base--commitAGENTS.mdheader: "Review focus"
question: "Any specific focus areas for the review?"
options:
- "General review" → no custom prompt
- "Security & auth" → security-focused prompt
- "Performance" → performance-focused prompt
- "Error handling" → error handling-focused prompt# For uncommitted:
git diff --stat HEAD
# For branch diff:
git diff --stat <branch>...HEAD
# For specific commit:
git diff --stat <sha>~1..<sha>git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null \
| sed 's@^refs/remotes/origin/@@' || echo maingpt-5.3-codexxhigh--uncommitted--base--commitAGENTS.mdgpt-5.2-codextimeout: 600000gemini-3-pro-preview--yolo-e-mgemini -p "/code-review" --yolo -e code-reviewgit diffgemini -pgemini-cli-securitysecurity/security:analyze-p/security:scan-depstimeout: 600000git diff| Scope | Diff command |
|---|---|
| Uncommitted | |
| Branch diff | |
| Specific commit | |
## Codex Review (gpt-5.3-codex)
<codex output>
## Gemini Review (gemini-3-pro-preview)
<gemini output>| Error | Action |
|---|---|
| Tell user: |
| Tell user: |
Gemini | Tell user: |
Gemini | Tell user: |
| Model auth error (Codex) | Retry with |
| Empty diff | Tell user there are no changes to review |
| Timeout | Inform user and suggest narrowing the diff scope |
| Tool partially unavailable | Run only the available tool, note the skip |
User: /second-opinion
Claude: [asks 4 questions: tool, scope, context, focus]
User: picks "Both", "Branch diff", "Yes include CLAUDE.md", "Security"
Claude: [detects default branch = main]
Claude: [shows diff --stat: 6 files, +103 -15]
Claude: [runs Codex review with security prompt]
Claude: [runs Gemini review with security prompt + dep scan]
Claude: [presents both reviews, highlights agreements/differences]User: /second-opinion check uncommitted changes for bugs
Claude: [scope known: uncommitted, focus known: custom]
Claude: [asks 2 questions: tool, project context]
User: picks "Codex only", "No context"
Claude: [shows diff --stat: 3 files, +45 -10]
Claude: [runs codex review --uncommitted with prompt]
Claude: [presents review]User: /second-opinion
Claude: [asks 4 questions]
User: picks "Gemini only", "Uncommitted", "No", "General"
Claude: [shows diff --stat: 2 files, +20 -5]
Claude: [runs gemini -p "/code-review" --yolo -e code-review]
Claude: [presents review]User: /second-opinion
Claude: [asks questions] → user picks "Both", "Uncommitted", "General"
Claude: [shows diff --stat: 45 files, +3200 -890]
Claude: "Large diff (3200+ lines). High-effort reasoning will be
slow. Proceed, or narrow the scope?"
User: "proceed"
Claude: [runs both reviews]