name: gemini-second-opinion description: 获取Gemini对最近上下文或指定主题的独立分析 argument-hint: [要评审的主题或上下文] allowed-tools: Bash
Gemini 第二意见命令
获取Gemini对主题、计划或工作的独立视角。
使用方法
/google-ecosystem:gemini-second-opinion [主题]
参数
$ARGUMENTS(可选):要评审的主题或上下文。如果为空,则评审一般上下文。
示例
/google-ecosystem:gemini-second-opinion 这个数据库模式是否正确归一化?/google-ecosystem:gemini-second-opinion 评审我在这个模块中的错误处理方法/google-ecosystem:gemini-second-opinion 我应该在这个项目中使用微服务还是单体架构?/google-ecosystem:gemini-second-opinion 验证我的安全评估
执行
构建评审提示
topic="${ARGUMENTS:-the current context}"
prompt="REVIEW MODE (read-only): Provide an independent analysis.
TOPIC: $topic
Please provide:
1. **Your Assessment**: What is your independent view on this?
2. **Potential Issues**: What concerns or risks do you see?
3. **Alternative Approaches**: What other options should be considered?
4. **Recommendations**: What would you suggest?
5. **Confidence Level**: How confident are you in this assessment? (High/Medium/Low)
Be direct and specific. If you disagree with an apparent approach, say so clearly.
DO NOT modify any files. This is analysis only."
执行查询
result=$(gemini "$prompt" --output-format json)
解析响应
response=$(echo "$result" | jq -r '.response // "No response received"')
tokens=$(echo "$result" | jq '.stats.models | to_entries | map(.value.tokens.total) | add // 0')
model=$(echo "$result" | jq -r '.stats.models | keys[0] // "unknown"')
# 检查错误
error=$(echo "$result" | jq -r '.error.message // empty')
if [ -n "$error" ]; then
echo "Error: $error"
exit 1
fi
输出格式
呈现Gemini的视角:
# Gemini 第二意见
**主题**: {topic}
**模型**: {model}
---
{response}
---
*由Gemini CLI进行的独立分析 | {tokens} 个令牌*
使用案例
验证计划
在执行重大更改之前,获取Gemini的意见:
/google-ecosystem:gemini-second-opinion 我计划将身份验证重构为使用JWT而不是会话。好主意吗?
交叉检查分析
在Claude提供分析后,验证:
/google-ecosystem:gemini-second-opinion Claude在auth.ts中识别了3个安全问题。还有其他的吗?
架构决策
获取技术选择的输入:
/google-ecosystem:gemini-second-opinion 这个应该使用GraphQL还是REST?
代码评审补充
为代码评审添加另一个视角:
/google-ecosystem:gemini-second-opinion 这个错误处理方法是否稳健?
备注
- 使用“REVIEW MODE”前缀确保只读分析
- 提供结构化输出,包括评估、问题、替代方案
- 包含置信度以提高透明度
- 两个AI视角比一个能发现更多问题