second-opinion
ABOUTME: Second opinion from Gemini CLI to help Claude analyze problems
ABOUTME: Gathers context, writes prompt, calls Gemini, synthesizes both viewpoints
Second Opinion
MANDATORY: Always use --model gemini-3.1-pro-preview. No other model. No fallback. No substitution.
Quality Notes
- Invest time in writing a good prompt; garbage in, garbage out
- Include ALL relevant context: files, errors, constraints, what you've tried
- Synthesize thoughtfully; don't just relay Gemini's output
Execution Flow
Step 1: Understand the problem
Before calling Gemini, Claude MUST clearly articulate:
- The problem - what is being analyzed or decided
- Claude's current analysis - what Claude thinks so far
- Relevant context - code snippets, error messages, architecture constraints
- Specific question - what Claude wants a second opinion on
Step 2: Gather context
Collect all relevant material:
- Read the files involved (full content, not summaries)
- Include error messages/stack traces if debugging
- Include project constraints (from CLAUDE.md, architecture docs)
- Include what has been tried and why it didn't work (if applicable)
Step 3: Build the prompt
Load the prompt template and compose the full request:
PROMPT=$(cat ~/.claude/skills/second-opinion/prompts/default.md)
Claude writes a CONTEXT block containing:
- Problem description
- Claude's current analysis/hypothesis
- All gathered context (code, errors, docs)
- The specific question for Gemini
Step 4: Call Gemini CLI
cd <project_root>
gemini --model gemini-3.1-pro-preview --yolo <<EOF
$PROMPT
## Problem Context
$CONTEXT
EOF
Step 5: Synthesize
After receiving Gemini's response, Claude presents a unified analysis:
| Aspect | Claude | Gemini | Consensus |
|---|---|---|---|
| Root cause | ... | ... | agree/differ |
| Approach | ... | ... | agree/differ |
| Risks | ... | ... | complementary |
Final recommendation: Claude's updated position, incorporating Gemini's input where it adds value. Explain what changed (or didn't) and why.
When to Use
- Stuck on a debugging problem
- Weighing architectural trade-offs
- Unsure about root cause analysis
- Want to validate an approach before implementing
- Complex decisions with multiple valid paths
When NOT to Use
- Code review before commit (use
gemini-review) - Simple, well-understood problems
- When you just need to read more code/docs first
Troubleshooting
| Issue | Solution |
|---|---|
| "gemini: command not found" | Install Gemini CLI: see https://github.com/google-gemini/gemini-cli |
| API errors | Check GEMINI_API_KEY is set |
| Timeout | Reduce context size; focus on the most relevant files |
| Unhelpful response | Sharpen the specific question; vague asks get vague answers |
More from maroffo/claude-forge
email-cleanup
Clean up Gmail - archive old emails, delete promotions, manage storage. Use when user wants to clean inbox, archive emails, or free up space.
25newsletter-digest
Process newsletters into Second Brain digest. Use when user wants to process newsletters, create digest, or catch up on subscriptions. Not for web clippings (use process-clippings) or email bookmarks (use process-email-bookmarks).
22table-image
Render markdown tables as hand-drawn sketch images. Use when user wants a table rendered as an image, visual table, or diagram illustration.
21apple-swift
Apple platform development with Swift, SwiftUI, async/await, and performance. Use when working with .swift files, Package.swift, Xcode projects, or building for iOS/macOS/watchOS/visionOS.
20react-nextjs
React + Next.js App Router development. Use when working with .tsx/.jsx files, next.config, or user asks about Server Components, data fetching, state management, forms, or React testing.
20inbox-triage
Review and prioritize Gmail inbox. Use when user wants to check email, review inbox, or see what needs attention.
19