second-opinion
Skill11 starsChanged 10 days agoMITView on GitHub
GPT (GPT-6 Astra by default) as advisor, adversarial reviewer or judge through headless `codex exec`, always read-only; never an implementer. Modes: advise (independent read on a plan, diff or design, beside Claude's own view, with follow-ups), review (Codex's built-in reviewer on uncommitted work, a branch or a commit), adversarial (tries to break confidence in a change; optional parallel lenses; every finding verified by Claude before it is shown), judge (scores a reviewer's verdict for insistir and goal-loop). Trigger on "second opinion", "segunda opinión", "ask codex/GPT to review", "que codex lo revise", "revisión adversarial", "adversarial review", "que GPT ataque este cambio", "critica este plan", "challenge this design", "judge this review", "usa astra". Falls back to a Claude subagent, labelled same-provider, when Codex is unavailable. Not askcodex (one-shot text or images) and not for writing code.
45 other projects use a version of this.
Adopted by
Most recently taken up by
- arcasilesgroup/ai-engineeringtheir own version, first seen Nov 8, 2026
- storybookjs/storybooktheir own version, first seen Nov 8, 2026
- mdigital94/vibe-shield-plugintheir own version, first seen Nov 8, 2026
- Wasif-ZA/metatroopertheir own version, first seen Nov 8, 2026
- vadimchernets/after-chattheir own version, first seen Nov 8, 2026
- pahlevikun/levistacktheir own version, first seen Nov 1, 2026
Used with
Projects with it also use insecure-defaults, variant-analysis and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
allanninalSkillinsecure-defaults
Detects fail-open insecure defaults (hardcoded secrets, weak auth, permissive security) that allow apps to run insecurely in production. Use when auditing security, reviewing config management, or analyzing environment variable handling.
Also in 3 projects that use this
allanninalSkillvariant-analysis
Find similar vulnerabilities and bugs across codebases using pattern-based analysis. Use when hunting bug variants, building CodeQL/Semgrep queries, analyzing security vulnerabilities, or performing systematic code audits after finding an initial issue.
Also in 3 projects that use this
shmehroSkillux-audit
Perform a heuristic UX audit on a UI screen, flow, or component description
Also in 3 projects that use this
sunnyclinches44Skillexplain
Explains code using real-world analogies and ASCII diagrams
Also in 5 projects that use this
photon-groveSkillunslop
Detects and rewrites generic, overly polished, or AI-sounding prose while preserving meaning. Use when the user asks to "unslop", humanize, de-AI, tighten, or review whether writing sounds generated.
Also in 4 projects that use this
SentrySkillcommit
Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.
Also in 6 projects that use this
Other versions45 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 45
- storybookjs/storybook★ 91ksame name
- vanillagreencom/kendex★ 76same name
- arcasilesgroup/ai-engineering★ 65same name
- Amazon-Quick/Amazon-Quick-official-catalog★ 50same name
- manusco/resonance★ 38same name
- arsenyinfo/skills★ 29same name
- maroffo/claude-forge★ 17same name
- microsoft/amplifier-bundle-skills★ 12same name
- flurdy/agent-skills★ 9same name
- dkpapadopoulos/auto-claude-skills★ 6same name
35 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- image-to-frontendSkill
- motion-designSkill
- compound-knowledgeSkill
- file-todosSkill
- agent-sdk-wizardSkill
- askcodexSkill
- managed-agents-wizardSkill
- metapromptSkill
- goal-loopSkill
- insistirSkill
- remote-agentsSkill
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 6 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 38 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
Codex advises, reviews and judges; it never implements: Every call is read-only whatever the user's Codex config says (it may set …
- Very specific: line 39
Always scripts/ask_codex.sh (the Codex MCP server no longer exists: removed in codex-cli 0.154).
- Very specific: line 47
Model and effort: Default model gpt-6-astra when Codex's catalog (~/.codex/models_cache.json) lists it, else the config default.
- Distinctive: line 82
Prefer paths and ranges over pasted content: Codex reads the repo.
- Distinctive: line 84
Own view first: Before reading Codex's answer, write Claude's position in 3-6 bullets (verdict, top risks, recommendation).
- Distinctive: line 86
Never put this view into the prompt.
- Very specific: line 89
Read last_message. Before endorsing any Codex claim that changes the recommendation, open the cited file:line or rerun the cited command …
- Distinctive: line 104
No disagreements → say so in one line.
- Very specific: line 137
When the caller fixes findings and asks again (a full-send or full-stop run, "loop until Codex agrees"), run rounds under this budget.
- Distinctive: line 150
Never agree just to end the loop.
- Distinctive: line 241
Never fail the caller's pipeline because Codex is unavailable, and never present a fallback answer as Codex's.
“Common” is measured: kept by at least 6 in 10 of the 38 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Second opinion
Request: $ARGUMENTS
Mode by first word: review → review mode · adversarial (or challenge) → adversarial mode ·
judge → judge mode · anything else (or advise) → advise mode. --provider claude anywhere in
the request → skip Codex, go straight to the fallback path and label the result
"same-provider (requested)".
Codex advises, reviews and judges; it never implements. Every call is read-only whatever the
user's Codex config says (it may set danger-full-access). Never ask Codex for a patch to apply,
never pass it a writable sandbox. Claude verifies what it reports and does any fixing.
If you are Codex, a Codex review of your own work is same-provider: label every result "same-provider (Codex reviewing Codex)", or ask the user to run this from Claude Code.
Paths below are relative to this skill's directory, ${CLAUDE_SKILL_DIR} (other harnesses: the
absolute path of the folder holding this SKILL.md). Shell state does not survive between Bash
calls: set REPO in the same call that runs the script.
Transport (both modes)
Always scripts/ask_codex.sh (the Codex MCP server no longer exists: removed in codex-cli
0.154). Never hand-rolled codex flags. The script runs codex exec --sandbox read-only
--skip-git-repo-check --ephemeral -C "$REPO" -o <out>/last-message.md - (or codex exec review
with sandbox_mode="read-only"; review ignores --output-schema, openai/codex#38545), disables Codex memories so no unrelated session leaks in, ignores execpolicy .rules, lifecycle
hooks and the notify command (each can run outside the sandbox), pins review_model for native
review, checks
install and codex login status first, and enforces a timeout.
Model and effort. Default model gpt-6-astra when Codex's catalog
(~/.codex/models_cache.json) lists it, else the config default; SECOND_OPINION_MODEL or -m
overrides. Default effort high (SECOND_OPINION_EFFORT or -e; the user's config may default
to low). Use xhigh for adversarial reviews of risky changes; max/ultra only when asked.
REPO=$(git rev-parse --show-toplevel 2>/dev/null || pwd) && \
"${CLAUDE_SKILL_DIR}/scripts/ask_codex.sh" -C "$REPO" [--schema FILE] [-e high|xhigh] \
[--keep-session] [--resume SESSION_ID|last] [--review uncommitted|base:REF|commit:SHA] \
[-t 540] [-m MODEL] < prompt.md # --review: < /dev/null (it takes no instructions)- stdout (key=value):
out_dir,last_message,session_id,model,elapsed_s.out_diralso holdsprompt.mdandcodex.log(stderr, includes the session header). - Exit 0 ok · 2 usage · 3 not installed · 4 not logged in · 5 timeout → fallback now · 6 codex failed or empty answer → retry once, then fallback · 7 invalid JSON (judge) → retry once, then fallback.
- The Bash tool caps a call at 600000 ms: keep
-tat or below its 540 s default and set the tool timeout to 600000 ms, or run it withrun_in_backgroundfor long judges, so exit 5 reaches you instead of the tool's own kill. Any other exit (e.g. 127) → fallback. Measured on a one-file repo: codex-cli 0.156 + gpt-5.6-sol judge-e high37 s, advise 35 s,--resume10-12 s; codex-cli 0.157.1 + gpt-6-astra-e highnative review 28 s, adversarial 44-51 s with two lenses running in parallel. Real repos take longer: for a diff over ~10 files,-e xhigh, or when the caller has other work, run with Bashrun_in_background: trueand-t 1800; the harness wakes you when it exits.
Advise mode
- Material, first match wins:
- Question, plan path, paths or git range given in the request → use them.
- A plan file the conversation is working from (e.g.
*-plan.md,plans/*.md) → its path. - Uncommitted changes →
git diff(name the range; Codex can run it). - Branch ahead of its base →
git diff <base>...HEAD. - Nothing → stop: "Nothing to review: give a question, a plan, or changes." Never call Codex with empty material. Prefer paths and ranges over pasted content: Codex reads the repo. Paste only what exists nowhere on disk; cap pasted material at ~12,000 characters.
- Own view first. Before reading Codex's answer, write Claude's position in 3-6 bullets (verdict, top risks, recommendation). This keeps the comparison honest in both directions. Never put this view into the prompt.
- Render references/advise-prompt.md to a file and run:
ask_codex.sh -C "$REPO" --keep-session < prompt.md. Keepsession_id. - Read
last_message. Before endorsing any Codex claim that changes the recommendation, open the cited file:line or rerun the cited command yourself. Mark each Codex point checked or unchecked. Present:
## Second opinion: Codex (<model>, read-only) # or: same-provider fallback (Claude) **Disagreements** - <topic>. Codex: … Claude: … Resolution: <who is right and the evidence, or what would settle it> **Agreed independently**: points both reached (strongest signal) **Only Codex raised**: each marked checked / unchecked **Only Claude raised** **Recommendation**: what to do next, one short paragraphNo disagreements → say so in one line; do not invent any.
- Follow-ups on the same topic: pipe the new question to
ask_codex.sh -C "$REPO" --resume <session_id> < followup.md(the session keeps the earlier context and stays read-only). Resume by explicitsession_id;--resume lastpicks the newest session in$REPOand races with any other Codex run there (parallel lenses included). Same presentation format. Unrelated question → new session.
Review mode
Codex's built-in reviewer, the same one as /review inside Codex. Use it for "review my changes"
with no special framing; use adversarial mode when the question is whether the change should ship.
- Target, first match wins: a commit SHA in the request →
commit:<sha>; a base branch named →base:<ref>; uncommitted changes (git status --porcelainnot empty) →uncommitted; branch ahead of its base →base:<base>; nothing → stop, "Nothing to review". ask_codex.sh -C "$REPO" --review <target> < /dev/null. The built-in reviewer takes no instructions (Codex rejects a target plus a prompt): a request with a focus ("focus on migrations") goes to adversarial mode instead.- For each finding, open the cited lines and mark it confirmed or rejected (with the reason) before presenting. Present Codex's summary, then confirmed findings by priority, then rejected ones. Never start fixing: offer.
Adversarial mode
Tries to break confidence in a change: failure modes, trust boundaries, data loss, races, and the design assumptions the approach depends on. Findings are JSON forced by references/adversarial.schema.json. Read references/adversarial.md for the procedure: target and focus, Claude's own view first, one run or 2-3 parallel lenses, merging, verifying every finding, and the presentation.
Fix and re-check loop (review or adversarial)
When the caller fixes findings and asks again (a full-send or full-stop run, "loop until Codex
agrees"), run rounds under this budget. Adapted from tstack's sol-loop (t3dotgg/tstack, MIT).
- Budget. 3 rounds. Round 1 reviews the whole change; later rounds review only code changed since the last round plus the open finding ids. Extend to 5 only for security, permissions, auth, data loss or state/concurrency while a gating finding stays open with evidence, or when the user asks. One reviewer per round: never start a second one in parallel.
- Gating. A finding gates only when you confirmed it yourself (open the file:line or rerun the command) and it breaks the intended case or a caller will hit it. Another path, a rare case, small performance cost or extra compatibility is a nit whatever severity Codex gave it.
- Answer each finding. Agree: smallest fix; prefer deleting or narrowing code over a new lock, cache, helper or option; add one focused test only when the intent needs it. Disagree: say why with evidence. Nit or out of scope: decline in one line and list it as a follow-up. Never agree just to end the loop.
- Ledger across rounds: id · severity · outcome (fixed / disagree / declined) · evidence.
Rounds 2 and later always run in adversarial mode, even when round 1 was review mode: the
built-in reviewer takes no instructions (
ask_codex.sh --reviewexits 2 on a non-empty stdin), so it cannot receive the ledger. Put the ledger and "mark each old idresolvedorstill open: <reason>; review only the code changed since round<n-1>" in the adversarial focus. Re-run the checks andgit diff --shortstat <base>each round: when review grew the diff, cut first. - Stop. Agreed: verdict
ship(or no confirmed findings) on the current diff, no gating finding open. Early stop: a round returns only nits. Stuck: one item disputed after two replies, or the budget ends; show both sides in 2-3 lines each and let the user decide. The end of the budget is not approval. - Report: rounds, model, what changed because of Codex, diff size before → after, fixed and
declined findings with reasons. In a PR description add one line:
Reviewed with second-opinion: <N> rounds with <model>, verdict <verdict>.
Judge mode
Scores a reviewer's verdict for insistir, goal-loop, or a user who asks to judge a review.
Send only artifacts:
| Input | Source |
| Task spec + acceptance criteria | plan task or goal contract |
| Diff (inline) or range + paths | git diff <base>..<head> -- <files> |
| Check results | reviewer checks, verifier evidence runs |
| Caller-specific checks | goal-loop: agents/judge.md body + held-out results; else none |
| Reviewer verdict | reviewer JSON, verbatim; goal-loop has no reviewer: pass none |
Never send the implementer's reasoning, chain-of-thought, self-assessment or summary of what it did. The judge sees artifacts only; anything else anchors it.
Steps:
- Empty diff → do not call; return "nothing to judge".
- Render references/judge-prompt.md and run:
ask_codex.sh -C "$REPO" --schema "${CLAUDE_SKILL_DIR}/references/verdict.schema.json" -e high < prompt.md.--output-schemais honored (verified): the final message is one JSON object matching references/verdict.schema.json. - Shape is forced, substance is not. A schema-forced model answers even an empty or broken
prompt with a well-formed, vacuous APPROVED (observed: all 5s, evidence "N/A"). Reject the
verdict and rerun once if any criterion's
evidencelacks a file:line, or if it is APPROVED while the check results show a failure. Second failure → fallback. - Recompute
score = 0.4*correctness + 0.2*spec_compliance + 0.2*security + 0.2*maintainabilityfromcriteria; use the recomputed value. Acriticalfinding is a correctness or security defect; amajorfinding is an unmet acceptance criterion (schema definition), so the work does not meet its contract whatever the score. Gate:
Band Condition Action Auto-approve verdictAPPROVED, score ≥ 4.0, no critical or major findingjudge confirms quality Auto-revise score < 2.5, or any critical or major finding fix now; findings become the fixer's input Middle anything else (minor findings only, or 2.5 ≤ score < 4.0) caller decides; the reviewer verdict is the tiebreaker Reviewer vs judge:
Reviewer APPROVED + judge auto-approve → APPROVED (consensus) Reviewer APPROVED + judge auto-revise → REVISE with the judge findings Reviewer APPROVED + judge middle band → APPROVED; judge findings go to the summary as follow-ups Reviewer REVISE + judge any → REVISE; union of reviewer and judge findingsCallers without a reviewer (goal-loop) treat only auto-approve as a pass. Always return every finding, whatever the band: callers carry them into their summary.
- Return to the caller: the verdict JSON, the recomputed score, the band, the provider label
(
codex <model>orsame-provider fallback (Claude)), andelapsed_s.
When the judge is worth its cost: multi-file, cross-cutting or security-sensitive tasks; any
REVISE or borderline reviewer verdict; citation- or provenance-bearing docs (same-family reviewers
check coherence, not correspondence). Skip single-file or config edits the reviewer clearly
APPROVED with all checks green, and record judge: skipped (trivial).
Fallback: same-provider
Triggers: exit 3/4/5, a second exit 6/7, a second vacuous verdict, or --provider claude.
- Tell the user which case happened (e.g. "codex not logged in: run
codex login"). - Spawn a fresh subagent (Agent tool; a read-only type such as
Explorewhen available, elsegeneral-purpose) with the rendered prompt verbatim. It has no sandbox: tell it to modify nothing and run only commands that write nothing (observed: running Python left__pycache__/behind; setPYTHONDONTWRITEBYTECODE=1). Judge mode: add "Reply with only the JSON object; it must matchreferences/verdict.schema.json" and give the schema's absolute path. Validate and gate exactly as above. - Judge mode: if the fallback's verdict also fails step 3 (evidence without file:line, or
APPROVED against failing checks), return
judge: unavailablewith the reason; never gate on it. - Label every output
same-provider fallback (Claude). It still gates, but callers must report it as such: it loses the cross-provider independence the judge exists for. - Never fail the caller's pipeline because Codex is unavailable, and never present a fallback answer as Codex's.
Why a different provider
Models rate their own family's output higher than warranted; a model with different training data and reward models has different blind spots. Cross-model judging separates good from bad work better than same-model judging ("Judging the Judges", arXiv 2604.23178). But unverified cross-provider findings hurt: Codex reviewing Claude's drafts without running anything lowered the pass rate from 91.4% to 82.8% (arXiv 2607.21656). That is why every finding is verified before it is shown and nothing is auto-applied.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

