Index of every page on this site: llms.txt
All skills
nielsmadan avatar

/second-opinion

@9fbe49f
Run it yourself

Get external AI opinions on a problem or question. Use when you want diverse perspectives from the agent CLIs you are not running (Claude, Codex, Pi, OpenCode, Droid).

Use this Skill: https://skilld.dev/gh/nielsmadan/agentic-coding/second-opinion

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈46 tokens for metadata: the name and description. ≈3k when used: this file.

Description uses 2.3% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈184 characters, or 2.3%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Second Opinion Command

Get input from the available independent advisors on the current problem or question. Consult the advisor CLIs you are not — from claude, codex, pi, opencode and droid, skip whichever one you are running as, and query the rest. By default, iterates if responses lack 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 profile (600) Timeout per advisor in seconds; overrides each advisor profile's timeout
--words 500 Max words per advisor response

Gotchas

  • .second-opinion.md is written to the project directory and is NOT gitignored by default. If cleanup is skipped (error, timeout), it can be accidentally committed.
  • The advisor CLIs must be installed. If one is missing or fails, the command continues with the others and that advisor's input is simply absent from the synthesis.
  • The advisors are meant to read the code — that's the point. Claude, Pi, OpenCode and Droid run with read-only tool sets, so they can read/explore the repo but cannot modify it. Codex has no read-only mode that works inside the nono sandbox, so it runs without one and nono is its boundary; the prompt still tells it not to modify files. Point them at the relevant files in the prompt; reading them stays fast (~15–25s).
  • Every advisor runs through pratfall (prat). It normalizes the prompt file, timeout and output across the five CLIs, so this skill does not repeat each one's flags. prat execs the real binary off PATH, so no command prefix is needed.
  • Still close stdin with </dev/null on every advisor command. prat prepends redirected stdin to the -f prompt, so an open-but-silent stdin makes it block before launching the agent — and --timeout does not fire there, so the call hangs until the Bash tool kills it. Measured: the same command answers in ~13s with </dev/null and hangs indefinitely without it.
  • The read-only guards are not in this file. They live in the advisor-* profiles in ~/.config/pratfall/config.toml (native_args, tools), because a flag the skill has to retype is a flag the skill can drop. Read that file before changing an advisor, and never invoke a bare prat cc / prat cx / prat pi / prat oc / prat dr here — prat cx in particular renders a plain codex exec with no sandbox.
  • If the Claude advisor reports Not logged in · Please run /login, prefix that one command with sops-exec. prat execs the real binary, and Claude Code does not pass its own credential down to subprocesses, so a nested claude finds nothing. The other advisors inherit theirs from the session environment and need no prefix. This only bites when /second-opinion runs from a Claude Code session — where the Claude advisor is skipped anyway.
  • The advisor's identity is the model, not the CLI. The Pi and OpenCode profiles pin models from two different labs, so their opinions stay independent of each other.
  • Pi warns Model "…" not found for provider "opencode-go". Using custom model id. when the model is newer than its cached catalog, then works normally — that warning is not a failure.
  • Pi and OpenCode advisors bill through the OpenCode Go subscription, so both profiles pin opencode-go/ models (opencode/* is OpenCode Zen, which is pay-as-you-go and has no payment method). The profile's --agent plan is not enough on its own — plan mode can still delegate, which is why the command below also sets OPENCODE_CONFIG_CONTENT. prat profiles have no env field, so it stays inline.
  • Headless gotcha: OpenCode evaluates each part of a compound (;/&&/|) bash command separately and takes the least-permitted verdict; with stdin closed there's no TTY to answer an ask prompt, so the whole call is auto-rejected and the run terminates before producing any prose. The classic trigger is a benign echo --- separator inside an otherwise-allowed read chain. The prompt template already tells the advisor to avoid chaining; if a run still dies with no output, suspect a chained command hitting an un-allowlisted token.

How It Works

Default Flow (Iterative)

  1. Summarize the current problem/question from the conversation (or use what the user provides)
  2. Query advisors in parallel for their perspectives
  3. Evaluate confidence in all responses
  4. If confidence is LOW for any advisor, re-query with additional context (up to 2 iterations)
  5. Present final results with your synthesis

Quick Mode (--quick)

  1. Query all advisors once
  2. Present results immediately without iteration
  3. Useful when you just want fast input without 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?
  • The relevant file paths — list them so the advisors know where to look. This is what makes the opinion code-aware rather than generic; spend effort here.

Write the prompt to .second-opinion.md in the current working directory (dotfile so it stays out of the way; in the project directory so the advisors can read both it and the code it points to). Use this exact filename for all subsequent steps:

Read-only consultation. Do not modify any files — but DO read the relevant code in this project before answering.

Do not dispatch subagents or launch other agent CLIs; answer this consultation yourself.

Shell use: prefer your built-in file-reading tool. If you do run shell commands, run ONE simple command at a time — do NOT chain with `;`, `&&`, or `|` and do NOT add `echo` separators. This is a headless session, so any command that would need confirmation is auto-declined, and a single declined command ends the run before you can answer. A chain is only as permitted as its least-permitted part.

I need a second opinion: {problem_summary}

Relevant files/areas to look at: {file_paths}

Read those (and anything else in the project you need) and give your perspective in {words} words or less. Reference specific functions/files so I know what you looked at. 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 Advisors (in parallel)

Run the advisor commands in parallel — skipping the CLI you are running as. Each names a prat profile that already carries that advisor's model, reasoning level and read-only guards, and reads the prompt with -f .second-opinion.md. All advisors read the files the prompt points them at, typically answering in 1–3 minutes; a plan or code review can take close to 10.

Each advisor profile sets its own deadline (600s), which prat enforces and reports by advisor name. Add --timeout {timeout} after the profile name only when the user passed --timeout. Run the advisors in the background and give the shell tool a timeout 30s longer than prat's (630000 ms by default) so prat is the one that trips first. prat's timeout covers the agent run, not prat's stdin read, so it is not a backstop for a missing </dev/null.

Claude:

prat advisor-claude -f .second-opinion.md </dev/null

Codex:

prat advisor-codex -f .second-opinion.md </dev/null

Pi:

prat advisor-pi -f .second-opinion.md </dev/null

OpenCode: the inline config denies plan mode's task tool and applies only to this process:

OPENCODE_CONFIG_CONTENT='{"agent":{"plan":{"permission":{"task":"deny"}}}}' prat advisor-opencode -f .second-opinion.md </dev/null

Droid: the profile pins Gemini 4 Argon at high effort and permits only file reading and search:

prat advisor-droid -f .second-opinion.md </dev/null

Use the profiles as configured, including in --quick mode. Change an advisor's model or reasoning level only when the user explicitly requests it, and change it in ~/.config/pratfall/config.toml rather than by adding a --model / --effort flag here. If a selected model or reasoning level is unavailable, report that advisor as unavailable and continue with the others.

If prat is missing, say so and stop rather than falling back to raw CLI invocations — the read-only guards live in its profiles.

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: "It depends", "possibly", "might", "could be"
  • Requests for more context: "I'd need to see", "without more context"
  • Very generic advice that could apply to any situation
  • Uncertainty markers: "I'm not sure", "hard to say"
  • Questions back to you about the problem

Step 4: Iterate If Needed (Default Mode Only)

If confidence is LOW for any advisor:

  1. Identify what context is missing based on their feedback
  2. Gather additional context (read relevant files, clarify requirements)
  3. Overwrite .second-opinion.md with enhanced context
  4. Re-query the low-confidence advisor using the same command
  5. Can iterate up to 2 times per advisor

Skip this step entirely if --quick flag was used.

Step 5: Present Results

Format the responses for the user:

## Second Opinions

### {advisor 1}
{advisor_1_response}

### {advisor 2}
{advisor_2_response}

### {advisor 3}
{advisor_3_response}

### {advisor 4}
{advisor_4_response}

### My Take
{your brief synthesis - where they agree, disagree, and your recommendation}

Include one heading per responding advisor.

Name each advisor heading after the CLI and the model it ran (e.g. Codex, Pi (<model>)).

If iteration occurred, note it:

*Note: Re-queried {advisor} with additional context after initial response lacked confidence.*

Step 6: Clean Up

Delete .second-opinion.md using the Bash tool:

rm .second-opinion.md

Timeouts

Each advisor-* profile in ~/.config/pratfall/config.toml sets timeout = 600; change it there rather than here. A user-supplied --timeout is passed to prat as --timeout {timeout} and overrides the profile. Set the shell tool's own timeout 30s above prat's so prat trips first and can name the advisor that ran out.

Error Handling

  • If one advisor fails, continue with the others
  • If all fail, inform the user and offer to retry

Key Differences from /debate

Aspect /second-opinion /debate
Rounds 1-3 (with iteration) 1-10
Quick mode Yes (--quick) No
State files None Full state tracking
Session mgmt No sessions UUID tracking
Output files None rounds/, synthesis.md
Purpose Quick check Deep analysis
Speed ~1-3 min 5-30 min
Read-only Enforced for Claude, Pi, OpenCode, Droid; Codex by prompt, inside nono Configurable

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  # Uses current context from conversation

Troubleshooting

Advisor times out or fails to respond

Solution: Increase the timeout with --timeout=900 or use --quick to skip iteration.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts7mo3 checks · Risk SAFE
  • Gen Agent Trust Hub7mo

    This skill allows the agent to seek an external perspective from the Gemini AI service by summarizing the current task and conversation context. While the core functionality is safe and uses a well-known service, it is vulnerable to indirect prompt injection because it incorporates user-supplied data and file contents into prompts without proper sanitization or boundary markers.

  • Socket7mo

    No alerts

  • Snyk7mo

    Risk: LOW · No issues

Signed by skilld at 9fbe49f. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated 3 weeks ago
argument-hint
[--quick] [--timeout=SECONDS] [--words=500] <question or context>
effort
high
Other metadata
compatibility
Requires pratfall (`prat`) 0.9.1 or newer on PATH plus at least one of claude, codex, pi, opencode or droid besides the one you are running as. Pi and OpenCode advisors need an OpenCode Go key in `OPENCODE_API_KEY`.

README badge

README badge for nielsmadan/agentic-coding/second-opinion