/jaiskills:second-opinion [advise|review|adversarial|judge] [--lenses a,b] [--provider claude] <question, plan, range or paths>from jaiskills — Jairo's personal agent skills
Invokes GPT (GPT-6 Astra by default) as a read-only advisor, adversarial reviewer, or judge via headless codex exec. Modes: advise, review, adversarial, judge. Falls back to a Claude subagent when Codex is unavailable.
Ships in jaiskills — Jairo's personal agent skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
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.
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)
out_dir, last_message, session_id, model, elapsed_s.
out_dir also holds prompt.md and codex.log (stderr, includes the session header).-t at or below its 540 s default and set the tool
timeout to 600000 ms, or run it with run_in_background for 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 high 37 s, advise 35 s, --resume 10-12 s;
codex-cli 0.157.1 + gpt-6-astra -e high native 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 Bash run_in_background: true and -t 1800; the
harness wakes you when it exits.Material, first match wins:
*-plan.md, plans/*.md) → its path.git diff (name the range; Codex can run it).git diff <base>...HEAD.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. Keep session_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 paragraph
No 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 explicit session_id; --resume last picks the newest
session in $REPO and races with any other Codex run there (parallel lenses included). Same presentation format.
Unrelated question → new session.
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.
commit:<sha>; a base branch named →
base:<ref>; uncommitted changes (git status --porcelain not 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.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.
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).
ask_codex.sh --review exits 2 on a non-empty
stdin), so it cannot receive the ledger. Put the ledger and "mark each old id resolved or
still open: <reason>; review only the code changed since round " in the adversarial
focus.
Re-run the checks and git diff --shortstat <base> each round: when review grew the diff,
cut first.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.Reviewed with second-opinion: <N> rounds with <model>, verdict <verdict>.Scores a reviewer's verdict when the user asks to judge a review. No skill calls this mode.
Send only artifacts:
| Input | Source |
|---|---|
| Task spec + acceptance criteria | the task or plan the user gives |
| Diff (inline) or range + paths | git diff <base>..<head> -- <files> |
| Check results | reviewer checks, verifier evidence runs |
| Extra checks | hunts the user names; else none |
| Reviewer verdict | reviewer JSON or text, verbatim; none when there is no reviewer |
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-schema is 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 evidence lacks 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*maintainability
from criteria; use the recomputed value. A critical finding is a correctness or security
defect; a major finding is an unmet acceptance criterion (schema definition), so the work does
not meet its contract whatever the score.
Gate:
| Band | Condition | Action |
|---|---|---|
| Auto-approve | verdict APPROVED, score ≥ 4.0, no critical or major finding | judge 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) | user 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 findings
With no reviewer verdict (none), only auto-approve is a pass. Always return every
finding, whatever the band.
Report to the user: the verdict JSON, the recomputed score, the band, the provider label
(codex <model> or same-provider fallback (Claude)), and elapsed_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).
Triggers: exit 3/4/5, a second exit 6/7, a second vacuous verdict, or --provider claude.
codex login").Explore when available, else
general-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; set PYTHONDONTWRITEBYTECODE=1). Judge mode: add
"Reply with only the JSON object; it must match references/verdict.schema.json" and give the
schema's absolute path. Validate and gate exactly as above.judge: unavailable with the reason; never gate on it.same-provider fallback (Claude). It still gates, but callers must report
it as such: it loses the cross-provider independence the judge exists for.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.
agents/openai.yaml (opens in a new tab)references/adversarial-prompt.md (opens in a new tab)references/adversarial.md (opens in a new tab)references/adversarial.schema.json (opens in a new tab)references/advise-prompt.md (opens in a new tab)references/judge-prompt.md (opens in a new tab)references/verdict.schema.json (opens in a new tab)scripts/ask_codex.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub jairotorregrosa/jaiskills --plugin jaiskills6 skills in this plugin
/agent-sdk-wizardBuild a working Claude Agent SDK agent on Mac or Windows: a preflight and credential step (ant CLI login by default, a Console API key, or a Pro/Max token), then 9 illustrated questions, one at a time, then it writes the agent with a full system prompt (and a well-designed skill when one helps) and runs it. Trigger on "crea un agente", "quiero hacer un agente con el SDK", "ayúdame a armar mi agente", "tengo una idea de agente", "nuevo agente paso a paso", "agent sdk wizard", "build an agent with the Claude Agent SDK", "help me create an agent step by step". Each question is one AskUserQuestion call whose options carry an ASCII diagram in `preview`, in plain language for someone who has never seen an agent. Produces a directory with agente.py or agente.ts, credenciales, .env, README, decisiones.md and a real test run. NOT for the raw Messages API, Managed Agents, or the Claude Code CLI itself; say so and stop./askcodexUse the askcodex CLI to get text and code from OpenAI models (GPT-6 Astra, Sol, Luna and older), generate or edit images, transcribe audio, and inspect available models, subscription usage, or authentication. Trigger for requests such as "ask GPT", "make an image", "pregúntale a GPT", "genera una imagen", "edita esta foto", "transcribe este audio", "qué modelos tengo", or "cuánta cuota queda", and for bounded one-shot tasks (draft, summarize, classify or extract into schema-checked JSON, generate an asset) worth a second model's answer. Not for critiquing repo work, plans or diffs: use second-opinion, which reads the repo./managed-agents-wizardWalk a person from an idea to a Claude Managed Agents agent that runs on its own, and stay with them through debugging. Explains each concept at the moment it matters (Agent, Environment, Session, Deployment, vault, memory store, outcome), asks the real decisions as illustrated AskUserQuestion choices, designs the system prompt in Simplified Technical English, finds MCP connectors, sets up credentials without the secret ever reaching the chat, writes the files, applies them with the `ant` CLI, runs a capped test session, and diagnoses failed sessions from their events. Trigger on "crea un agente en Managed Agents", "managed agents wizard", "quiero un agente que corra solo", "agente programado", "agente que revise mis repos cada lunes", "mi sesión se quedó pegada", "por qué falló mi agente", "debug my managed agent session", "explícame la traza", "set up a scheduled Claude agent", "deploy an agent on a cron". Not for the Claude Agent SDK (use agent-sdk-wizard), the raw Messages API, or Claude Code itself./metapromptGenerate a complete, ready-to-paste prompt engineered for a specific target model (Claude Fable 5.1 / Opus 5.5 / Sonnet 5.5 / Haiku 5.5, GPT-6.1 / GPT-6) and harness (Claude Code CLAUDE.md or skill, Codex AGENTS.md, pi, Amp, eve, AI Gateway, Agent SDK, raw API, chat UI), using per-model and per-harness reference guides. Trigger on "metaprompt", "write me a prompt for", "generate a system prompt", "prompt engineer this", "optimize this prompt for GPT-5 / Opus", "hazme un prompt para", "escríbeme un system prompt", "mejora este prompt", "prompt para Codex / Claude Code". Not for executing the task the prompt describes, not for sending a prompt to another model (use askcodex), and not for building a runnable Claude Agent SDK agent (use agent-sdk-wizard)./motion-designDirect and produce code-driven videos that a person is proud to share: motion graphics, series openers, music and lyric videos, paper and data explainers, product demos, social clips. Runs end to end as a studio crew of parallel subagents coordinated through an ORCHESTRATION.md file: brief, writers' room, style frames, music/VO/SFX, deterministic render, critique loop, social exports. Use when the user says "make a video", "motion graphics", "animate this", "an opening for my series", "trailer", "title sequence", "explainer video", "Remotion video", "intro animada", "hazme un video", "opening de mi serie", "tráiler", "preséntame en 15 segundos", "video musical", "lyric video", "explainer de 60 s", "video para LinkedIn / Reels / TikTok", "kinetic typography", "render an MP4", "anima este paper / estos datos", or says a video "se ve genérico" or needs "más sabor". Not for static images or slide decks.
Other plugins' skills for the same job