AgentSkillsCN

second-opinion

通过 Codex CLI 获取 OpenAI 模型的第二意见。适用于验证架构决策、审查代码安全、对比不同实现方案,或当多模型共识能够带来更高价值时使用。触发条件:获取第二意见、用其他模型进行验证、向 Codex 提问、进行多模型分析、比较不同视角、开展架构评审、进行安全审计、或在需要外部验证时进行代码审查。

SKILL.md
--- frontmatter
name: second-opinion
description: "Get second opinion from OpenAI models via Codex CLI. Use when validating architectural decisions, reviewing code security, comparing implementation approaches, or when multi-model consensus adds value. Triggers: get second opinion, validate with another model, ask Codex, multi-model analysis, compare perspectives, architectural review, security audit, code review needing external validation."

Second Opinion via Codex CLI

Get external AI perspective from OpenAI models (GPT-5.3 Codex) to validate decisions or compare approaches.

Quick Patterns

Simple Question

bash
codex exec -m gpt-5.3-codex --output-last-message /tmp/claude/answer.txt "Your question here"
cat /tmp/claude/answer.txt

Structured Analysis (Recommended)

IMPORTANT: When using --output-schema, ALL objects (including nested ones) must have:

  • "additionalProperties": false
  • "required": [...] with all property names
bash
cat > /tmp/claude/schema.json << 'EOF'
{
  "type": "object",
  "properties": {
    "assessment": { "type": "string" },
    "strengths": { "type": "array", "items": { "type": "string" } },
    "concerns": { "type": "array", "items": { "type": "string" } },
    "recommendation": { "type": "string" }
  },
  "required": ["assessment", "strengths", "concerns", "recommendation"],
  "additionalProperties": false
}
EOF

codex exec -m gpt-5.3-codex --output-schema /tmp/claude/schema.json \
  --output-last-message /tmp/claude/result.json \
  "Analyze [topic]. Provide structured assessment."

cat /tmp/claude/result.json

Nested Objects Example

bash
# Nested objects MUST also have additionalProperties: false
cat > /tmp/claude/nested_schema.json << 'EOF'
{
  "type": "object",
  "properties": {
    "summary": { "type": "string" },
    "details": {
      "type": "object",
      "properties": {
        "score": { "type": "string" },
        "items": { "type": "array", "items": { "type": "string" } }
      },
      "required": ["score", "items"],
      "additionalProperties": false
    }
  },
  "required": ["summary", "details"],
  "additionalProperties": false
}
EOF

Use Cases

Architecture Review

bash
codex exec -m gpt-5.3-codex --output-last-message /tmp/claude/arch.txt \
  "Review this architecture decision: [description].
   Assess: scalability, maintainability, security risks, alternatives."

Security Audit

bash
codex exec -m gpt-5.3-codex --output-last-message /tmp/claude/security.txt \
  "Security review of [file/code]:
   - Input validation
   - Authentication/authorization
   - Data exposure risks
   Provide specific vulnerabilities and fixes."

Code Review

bash
codex exec -m gpt-5.3-codex --output-last-message /tmp/claude/review.txt \
  "Review [file] for: bugs, performance issues, maintainability.
   Provide line-level recommendations."

Key Options

OptionPurpose
-m gpt-5.3-codexDefault model (recommended)
-m o4-miniSimple tasks (faster, cheaper)
--output-schema file.jsonStructured JSON output
--output-last-message file.txtSave response to file
-i image.pngInclude image for analysis

Presenting Results

  1. Label as "Second opinion (OpenAI/Codex)"
  2. Compare with your own analysis
  3. Highlight agreement and disagreement
  4. Synthesize recommendation based on both perspectives

Prerequisites

Verify Codex is available before use:

bash
codex --version || echo "Codex CLI not installed"

If auth fails, user needs: codex login or set OPENAI_API_KEY.