second-opinions
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseIf you are Codex or Gemini CLI, stop and do not use this skill.
如果你是Codex或Gemini CLI,请停止操作,不要使用此skill。
Second Opinions
第二意见评审
Run independent reviews using OpenAI Codex (via MCP) and/or Google Gemini (via CLI) for second opinions from different model families.
Modes: (default), , -- selected via .
bothcodexgeminiAskUserQuestion使用OpenAI Codex(通过MCP)和/或Google Gemini(通过CLI)执行独立评审,获取来自不同模型家族的第二意见。
模式: (默认)、、——通过选择。
bothcodexgeminiAskUserQuestionWhen To Use
使用场景
- Before opening a PR or merging a branch.
- Before committing significant changes.
- Plan or architecture review from multiple perspectives.
- Security, performance, or correctness audit.
- 发起PR或合并分支之前。
- 提交重大代码变更之前。
- 从多视角进行方案或架构评审。
- 安全性、性能或正确性审计。
When Not To Use
不适用场景
- Trivial changes you can verify directly.
- When the user asked for your own judgment only.
- Do not send secrets, credentials, or tokens in prompts.
- 可直接验证的微小变更。
- 用户仅要求你提供自身判断时。
- 不要在提示词中发送密钥、凭证或令牌。
Workflow
工作流程
1. Gather Context
1. 收集上下文
Use to collect review parameters in one call. Combine applicable questions (max 4).
AskUserQuestionTool (always ask):
header: "Review tool"
question: "Which tool should run the review?"
options:
- "Both Codex and Gemini (Recommended)" -> run both in parallel
- "Codex only" -> mcp__codex__codex
- "Gemini only" -> gemini CLIScope (always ask):
header: "Review scope"
question: "What should be reviewed?"
options:
- "Uncommitted changes" -> git diff HEAD + untracked files
- "Branch diff vs main" -> git diff <branch>...HEAD
- "Specific commit" -> follow up for SHAFocus (always ask):
header: "Review focus"
question: "Any specific focus areas?"
options:
- "General review"
- "Security & auth"
- "Performance"
- "Error handling"使用在一次调用中收集评审参数。可组合相关问题(最多4个)。
AskUserQuestion工具(必问):
header: "Review tool"
question: "Which tool should run the review?"
options:
- "Both Codex and Gemini (Recommended)" -> run both in parallel
- "Codex only" -> mcp__codex__codex
- "Gemini only" -> gemini CLI评审范围(必问):
header: "Review scope"
question: "What should be reviewed?"
options:
- "Uncommitted changes" -> git diff HEAD + untracked files
- "Branch diff vs main" -> git diff <branch>...HEAD
- "Specific commit" -> follow up for SHA评审重点(必问):
header: "Review focus"
question: "Any specific focus areas?"
options:
- "General review"
- "Security & auth"
- "Performance"
- "Error handling"2. Preview and Validate
2. 预览与验证
Auto-detect default branch for branch diffs:
bash
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo mainShow diff stats for the selected scope. If empty, stop and tell the user. If >2000 lines changed, warn and ask whether to proceed or narrow scope.
自动检测分支对比的默认分支:
bash
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo main展示所选范围的差异统计信息。如果无差异,停止操作并告知用户。如果变更行数超过2000行,发出警告并询问用户是否继续或缩小范围。
3. Dispatch Reviews
3. 发起评审
Project context: If a exists in the repo root, always include it in the review prompt so reviewers check against project conventions.
CLAUDE.mdRun the selected tool(s). When running both, issue and calls in a single message for parallel execution. Both are read-only operations with no shared state.
mcp__codex__codexBash(gemini ...)See references/codex.md for Codex MCP patterns.
See references/gemini.md for Gemini CLI patterns.
Do not pre-check tool availability. If a tool fails, report the install instructions from the error handling table and run only the available tool.
项目上下文: 如果仓库根目录存在,请务必将其包含在评审提示词中,以便评审者对照项目规范进行检查。
CLAUDE.md运行选定的工具。如果同时运行两个工具,请在同一条消息中调用和以实现并行执行。两者均为只读操作,无共享状态。
mcp__codex__codexBash(gemini ...)关于Codex MCP的使用模式,请参考references/codex.md。
关于Gemini CLI的使用模式,请参考references/gemini.md。
无需预先检查工具可用性。如果某工具运行失败,请根据错误处理表格中的说明告知用户安装方法,仅运行可用的工具。
4. Present Results
4. 展示结果
When running both, present with clear headers:
undefined如果同时运行两个工具,请使用清晰的标题展示结果:
undefinedCodex Review
Codex Review
<codex findings>
<codex findings>
Gemini Review
Gemini Review
<gemini findings>
<gemini findings>
Summary
Summary
Where the two reviews agree and differ.
Prioritized action items.
When running a single tool, present its findings directly with your assessment of which findings are valid vs uncertain.Where the two reviews agree and differ.
Prioritized action items.
如果仅运行单个工具,请直接展示其评审结果,并对结果的有效性或不确定性给出你的评估。Error Handling
错误处理
| Error | Action |
|---|---|
| Run Gemini only, |
| Run Codex only. |
| Both unavailable | Stop and inform the user |
| Gemini extension missing | Install: |
| Empty diff | Stop: no changes to review |
| Timeout | Suggest narrowing the scope |
| One tool fails | Present the other's results, note the failure |
| 错误 | 处理操作 |
|---|---|
| 仅运行Gemini |
| 仅运行Codex |
| 两者均不可用 | 停止操作并告知用户 |
| 缺少Gemini扩展 | 安装: |
| 差异内容为空 | 停止操作:无变更可评审 |
| 超时 | 建议缩小评审范围 |
| 其中一个工具运行失败 | 展示另一个工具的结果,并说明该工具运行失败 |
Examples
示例
Both tools (default):
User: /second-opinions
Agent: [asks 3 questions: tool, scope, focus]
User: picks "Both", "Branch diff", "Security"
Agent: [detects default branch = main, shows diff --stat]
Agent: [auto-includes CLAUDE.md, dispatches mcp__codex__codex + gemini in parallel]
Agent: [presents both reviews, highlights agreements/differences]Single tool:
User: /second-opinions
Agent: [asks 3 questions: tool, scope, focus]
User: picks "Codex only", "Uncommitted", "General"
Agent: [shows diff --stat]
Agent: [calls mcp__codex__codex with review prompt]
Agent: [presents findings with assessment]Large diff warning:
User: /second-opinions
Agent: [asks questions] -> user picks "Both", "Uncommitted", "General"
Agent: [shows diff --stat: 45 files, +3200 -890]
Agent: "Large diff (3200+ lines). Proceed, or narrow the scope?"
User: "proceed"
Agent: [runs both reviews]双工具模式(默认):
User: /second-opinions
Agent: [询问3个问题:工具、范围、重点]
User: 选择“双工具”、“分支差异”、“安全性”
Agent: [检测到默认分支为main,展示diff --stat结果]
Agent: [自动包含CLAUDE.md,并行调用mcp__codex__codex和gemini]
Agent: [展示两份评审结果,突出共识与差异]单工具模式:
User: /second-opinions
Agent: [询问3个问题:工具、范围、重点]
User: 选择“仅Codex”、“未提交变更”、“通用评审”
Agent: [展示diff --stat结果]
Agent: [调用mcp__codex__codex并传入评审提示词]
Agent: [展示评审结果并给出评估]大差异警告:
User: /second-opinions
Agent: [询问问题] -> 用户选择“双工具”、“未提交变更”、“通用评审”
Agent: [展示diff --stat结果:45个文件,+3200 -890]
Agent: “差异内容过大(超过3200行)。是否继续,还是缩小评审范围?”
User: “继续”
Agent: [运行双工具评审]