second-opinion
Second Opinion
Get input from Gemini on the current problem or question. By default, iterate if the response lacks confidence.
Usage
/second-opinion <question or context>
/second-opinion --quick <question> # Single pass, no iteration
/second-opinion --words=300 <question> # Limit response to 300 words
/second-opinion --timeout=120 <question> # Set timeout to 120s
/second-opinion # Uses current conversation context
Parameters
| Parameter | Default | Description |
|---|---|---|
--quick |
off | Single pass, no iteration |
--timeout |
300 |
Timeout per advisor in seconds |
--words |
500 |
Max words per advisor response |
How It Works
Default Flow (Iterative)
- Summarize the current problem/question from the conversation, or use what the user provides
- Query Gemini for its perspective
- Evaluate confidence in the response
- If confidence is LOW, re-query with additional context, up to 2 iterations
- Present final results with your synthesis
Quick Mode (--quick)
- Query Gemini once
- Present results immediately without iteration
- Use this when fast input matters more than refinement
Execution
Step 1: Prepare the Context
Extract or use the user's question/problem. If not explicitly provided, summarize:
- What is the current task or problem?
- What approaches are being considered?
- Any relevant file paths or code context
Write the prompt to .second-opinion.md in the current working directory. Use this exact filename for all subsequent steps:
Read-only consultation. Do not modify any files.
I need a second opinion: {problem_summary}
Give your perspective in {words} words or less. Focus on:
- Key considerations I might be missing
- Potential issues with the current approach
- Alternative approaches worth considering
If you need more context to give a confident answer, say so clearly.
Step 2: Query Gemini
Run Gemini using the Bash tool timeout set to {timeout} seconds:
gemini -p "Read the file at .second-opinion.md and follow the instructions within it." --approval-mode default --output-format text
If gemini is unavailable in the current environment, report that clearly rather than failing silently.
If Gemini prints status lines such as Loaded cached credentials. before the actual response, ignore those lines and use only the substantive model output.
Step 3: Evaluate Confidence
After receiving responses, evaluate each for confidence level:
High Confidence Indicators:
- Direct, specific recommendations
- References to specific code, files, or patterns
- Clear reasoning with concrete examples
- Definitive statements about approach
Low Confidence Indicators:
- Hedging language such as "it depends", "possibly", "might", or "could be"
- Requests for more context
- Generic advice that could apply to any situation
- Uncertainty markers such as "I'm not sure" or "hard to say"
- Questions back to you about the problem
Step 4: Iterate If Needed (Default Mode Only)
If confidence is LOW:
- Identify what context is missing based on their feedback
- Gather additional context by reading relevant files or clarifying requirements from the conversation
- Overwrite
.second-opinion.mdwith enhanced context - Re-query Gemini using the same file-reference command
- Iterate at most 2 times
Skip this step entirely if --quick is used.
Step 5: Present Results
Format the responses for the user:
## Second Opinions
### Gemini
{gemini_response}
### My Take
{your brief synthesis - key takeaways and your recommendation}
If iteration occurred, note it:
*Note: Re-queried {advisor} with additional context after the initial response lacked confidence.*
Step 6: Clean Up
Delete .second-opinion.md when finished:
rm .second-opinion.md
Error Handling
- If Gemini fails, inform the user and offer to retry
- If the environment blocks
gemini, surface that explicitly instead of silently omitting it
Examples
/second-opinion Should I use useCallback here or is it premature optimization?
/second-opinion Is this the right place to add error handling?
/second-opinion Review my approach to implementing this feature
/second-opinion --quick Just tell me if this pattern looks right
/second-opinion
Troubleshooting
Advisor times out or fails to respond
Solution: Increase the timeout with --timeout=600 or use --quick to skip iteration. If one advisor consistently fails, present the other advisor's response and mention the gap.
All advisors agree with no diversity of opinion
Solution: Rephrase the question to include a specific alternative you want evaluated, or provide more context about the trade-offs you are weighing.
More from nielsmadan/agentic-coding
pdf
Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.
22code-review
Code review workflow. Use when reviewing code changes, PRs, or specific files for quality, bugs, and best practices.
13review-comments
Review and clean up low-quality code comments. Use when you notice "what" comments that should be "why" comments, or want to clean up comment noise before a PR.
12resolve-conflicts
Resolve git conflicts from any operation (merge, rebase, cherry-pick, stash, revert). Use when encountering conflicted files during git operations.
11review-history
Analyze how code changed over time. Use when investigating regressions, understanding why code was written a certain way, or finding when a behavior changed.
11rn-upgrade
React Native upgrade workflow. Use when upgrading React Native, bumping RN version, migrating to a new RN release, or resolving breaking changes after a React Native update.
10