Skip to content

feat: add Gemini CLI as cross-model second-opinion provider#562

Open
fubla wants to merge 1 commit intogarrytan:mainfrom
fubla:feat/gemini-second-opinion
Open

feat: add Gemini CLI as cross-model second-opinion provider#562
fubla wants to merge 1 commit intogarrytan:mainfrom
fubla:feat/gemini-second-opinion

Conversation

@fubla
Copy link
Copy Markdown

@fubla fubla commented Mar 27, 2026

Summary

Adds Google Gemini CLI (npm install -g @google/gemini-cli) as a fallback cross-model second-opinion provider in all skills that currently use Codex. When Codex is not installed but Gemini CLI is available, skills now use Gemini instead of skipping the cross-model review entirely or falling back to a same-model Claude subagent.

Detection pattern (replaces which codex):

if which codex; then PROVIDER="Codex"
elif which gemini; then PROVIDER="Gemini"
fi

Command mapping:

Codex Gemini equivalent
codex exec "prompt" -s read-only gemini --prompt "prompt"
codex review --base main gemini --prompt with diff content

Affected skills (10 total):

  • /office-hours — Phase 3.5 second opinion
  • /ship — adversarial review (medium + large tier), design review lite
  • /review — adversarial review, design review lite
  • /plan-ceo-review — outside voice
  • /plan-eng-review — outside voice
  • /plan-design-review — design outside voices
  • /design-review — design outside voices
  • /design-consultation — design sketch outside voices

Source changes (2 files):

  • scripts/resolvers/review.tsgenerateCodexSecondOpinion, generateAdversarialStep, generateCodexPlanReview
  • scripts/resolvers/design.tsgenerateDesignReviewLite, generateDesignSketch, generateDesignOutsideVoices

All generated SKILL.md files regenerated for both Claude and Codex hosts via bun run gen:skill-docs.

Design decisions

  • Codex-first priority: Codex is checked first in the detection block. Gemini is the fallback. This preserves existing behavior for users who have Codex installed.
  • Claude subagent still the last resort: If both Codex and Gemini fail or are unavailable, the existing Claude subagent fallback is preserved unchanged.
  • All errors remain non-blocking: Gemini failures (auth, timeout, capacity) are handled identically to Codex failures — log and fall back.
  • No new config: No gstack-config changes needed. Detection is purely binary-based (which gemini).
  • Gemini --prompt flag: Gemini CLI uses --prompt for non-interactive single-shot mode (vs Codex's exec subcommand). For codex review (structured diff review with no Gemini equivalent), the diff is piped into the prompt with review instructions.

Why this matters

Gemini CLI is free (1,000 requests/day with a personal Google account, Gemini 2.5 Pro with 1M context). Many gstack users may not have Codex but do have Google accounts. This change means cross-model second opinions — which catch real blind spots that same-model reviews miss — are accessible to a much larger user base.

Test plan

  • bun run gen:skill-docs succeeds for Claude host
  • bun run gen:skill-docs --host codex succeeds for Codex host
  • E2E: /office-hours with Gemini installed, Codex not installed → Gemini used for Phase 3.5
  • E2E: /ship with Gemini installed → adversarial review uses Gemini
  • E2E: neither installed → falls back to Claude subagent (existing behavior)

🤖 Generated with Claude Code

Add Google Gemini CLI as a fallback cross-model second-opinion provider
in all skills that currently use Codex. The detection pattern checks for
Codex first, then Gemini, then falls back to Claude subagent.

Affected resolvers:
- review.ts: generateCodexSecondOpinion, generateAdversarialStep,
  generateCodexPlanReview
- design.ts: generateDesignReviewLite, generateDesignSketch,
  generateDesignOutsideVoices

Gemini CLI command mapping:
- codex exec "..." -s read-only → gemini --prompt "..."
- codex review --base <base> → gemini --prompt with diff piped in

All provider errors remain non-blocking with Claude subagent fallback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant