agentleFS
pmatospmatos/skills/codex-2nd-opinion/SKILL.md

codex-2nd-opinion

Skill2 starsChanged 4 months agoMITView on GitHub

This skill should be used when the user asks to "get a second opinion", "ask codex", "what does GPT think", "compare with codex", "run codex", "2nd opinion", "second opinion on this code", or wants an independent analysis from OpenAI Codex CLI. Also triggered by the /codex-2nd-opinion command.

  • Reads credentials
  • Installs packages

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run mktemp /tmp/codex-2op-XXXXXX via Bash.

    line 26
  2. Distinctive:

    Write a fully self-contained prompt to the temp file created above.

    line 30
  3. Very specific:

    Only add model/effort flags when the user explicitly asks for a specific one in the triggering message.

    line 55
  4. Distinctive:

    If the command fails (non-zero exit code or empty stdout):

    line 62
  5. Very specific:

    If Codex's response mentions the model it ran under (it usually does in its header lines), include that in parentheses, e.g.

    line 80
  6. Distinctive:

    Remove the temporary input file:

    line 110

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Codex Second Opinion

Invoke OpenAI Codex CLI to get an independent analysis on any discussion, plan, code, or thought. Present both perspectives fairly with a structured comparison.

The model and reasoning effort are NOT hardcoded — they come from the user's Codex configuration (~/.codex/config.toml, project-level .codex/config.toml, or Codex defaults). This matches the philosophy used by OpenAI's own codex-plugin-cc: pass through only when the user explicitly asks for a specific model or effort, otherwise let Codex's own config decide.

Workflow

Step 1: Gather Context

Collect everything needed for a self-contained prompt to Codex (which has ZERO conversation context):

  • The user's question or issue.
  • Claude's current analysis or position on the topic.
  • The actual code or content under discussion — read the relevant files using the Read tool. Do NOT summarize; include the real content.
  • Any constraints, requirements, or prior decisions from the conversation.

Step 1.5: Create Temp File

Run mktemp /tmp/codex-2op-XXXXXX via Bash. Remember the returned path (e.g. /tmp/codex-2op-a8Kx3m) — you will substitute it into later steps.

Step 2: Compose Codex Prompt

Write a fully self-contained prompt to the temp file created above. This file must include:

  1. The actual code/file contents (not summaries or references).
  2. Claude's current analysis of the situation.
  3. The specific question being asked.
  4. Any constraints or context the user has mentioned.

Structure the prompt clearly with markdown headings. End the prompt with:

Please provide your independent analysis. Be specific and reference the code directly.

Step 3: Run Codex

Execute the following command. Codex writes its response to stdout, which the Bash tool captures directly. Use a 600000ms (10 minute) timeout on the Bash tool call — high-reasoning runs can take several minutes.

codex exec \
  --sandbox read-only --ephemeral \
  - < /tmp/codex-2op-XXXXXX  # substitute the actual mktemp path here

Do NOT pass -m / --model or -c model_reasoning_effort=... by default. Codex reads its model and reasoning effort from ~/.codex/config.toml (and any project-level .codex/config.toml). Letting it resolve its own config means the skill works unmodified for any user.

Only add model/effort flags when the user explicitly asks for a specific one in the triggering message. Accepted effort values: none, minimal, low, medium, high, xhigh. Examples:

  • User says "get a second opinion with high reasoning" → add -c model_reasoning_effort=high.
  • User says "ask GPT-5.5 what it thinks" → add -m gpt-5.5.
  • User just says "2nd opinion" → no extra flags.

Step 4: Handle Errors

If the command fails (non-zero exit code or empty stdout):

  • Report the error clearly to the user.
  • Suggest checking:
    • codex is installed and on $PATH (install with npm install -g @openai/codex).
    • The user is authenticated — codex login (ChatGPT account) or OPENAI_API_KEY is set for API-key auth.
    • Network connectivity.
    • The configured model is valid — check ~/.codex/config.toml.
  • Skip to Step 6 (Cleanup).

Step 5: Present and Compare

Present the Bash tool output (Codex's response) under a clear heading:

## Codex's Analysis

If Codex's response mentions the model it ran under (it usually does in its header lines), include that in parentheses, e.g. ## Codex's Analysis (gpt-5.5, high reasoning). Otherwise keep the heading generic — don't guess.

Present the full response without editorializing. Then provide a structured, honest comparison. Follow these rules strictly:

  • Not dismiss Codex's points just because they differ from Claude's.
  • Acknowledge when Codex may be right and Claude may be wrong.
  • Present both perspectives fairly without bias toward Claude's own analysis.

Use this structure:

## Comparison

### Points of Agreement
[Where both analyses align]

### Points of Disagreement
[Present BOTH sides fairly — do not editorialize in Claude's favor]

### Honest Assessment
[Where is Codex stronger? Where is Claude stronger? Be genuinely honest.]

### Recommended Path Forward
[Best synthesis of both analyses]

Then ask the user: "How would you like to proceed? I can follow either analysis, combine specific parts, or take a different direction entirely."

Step 6: Cleanup

Remove the temporary input file:

rm -f /tmp/codex-2op-XXXXXX  # substitute the actual mktemp path here

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.