gemini-peer-review by jezweb/claude-skills
npx skills add https://github.com/jezweb/claude-skills --skill gemini-peer-review将 Gemini 作为编码同行进行咨询,以获取关于代码质量、架构决策、调试或安全评审的第二意见。
API 密钥:将 GEMINI_API_KEY 设置为环境变量。如果没有密钥,请从 https://aistudio.google.com/apikey 获取。
export GEMINI_API_KEY="your-key-here"
根据用户请求确定模式(review, architect, debug, security, quick)
将目标文件读入上下文
使用来自 references/prompt-templates.md 的 AI-to-AI 模板构建提示词
将提示词写入文件 .claude/artifacts/gemini-prompt.txt(避免 shell 转义问题)
调用 API — 生成一个 Python 脚本,该脚本:
GEMINI_API_KEY广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
.claude/artifacts/gemini-prompt.txt 读取提示词https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent 发送 POST 请求{"contents": [{"parts": [{"text": prompt}]}], "generationConfig": {"temperature": 0.3, "maxOutputTokens": 8192}}candidates[0].content.parts[0].text 提取文本将脚本写入 .claude/scripts/gemini-review.py 并运行它。
评审特定文件中的错误、逻辑错误、安全漏洞、性能问题和最佳实践违规。
读取目标文件,使用代码评审模板构建提示词,使用 gemini-2.5-flash 调用。
获取关于设计决策的反馈,并进行权衡分析。包含项目上下文(CLAUDE.md,相关源文件)。
读取项目上下文,使用架构模板构建提示词,使用 gemini-2.5-pro 调用。
在 2 次以上修复尝试失败后,分析错误。Gemini 能以全新的视角查看代码,不受你调试上下文偏见的影响。
读取有问题的文件,使用调试模板构建提示词(包含错误信息和之前的尝试),使用 gemini-2.5-flash 调用。
扫描代码中的安全漏洞(注入、认证绕过、数据暴露)。
读取目标目录的源文件,使用安全模板构建提示词,使用 gemini-2.5-pro 调用。
无需文件上下文的快速问题。内联构建提示词,写入文件,使用 gemini-2.5-flash 调用。
| 模式 | 模型 | 原因 |
|---|---|---|
| review, debug, quick | gemini-2.5-flash | 快速,适用于直接分析 |
| architect, security-scan | gemini-2.5-pro | 对于复杂的权衡分析有更好的推理能力 |
如果出现错误,请检查当前模型 ID — 它们经常变化:
curl -s "https://generativelanguage.googleapis.com/v1beta/models?key=$GEMINI_API_KEY" | python3 -c "import sys,json; [print(m['name']) for m in json.load(sys.stdin)['models'] if 'gemini' in m['name']]"
适用场景:
避免用于:
关键:始终使用 AI-to-AI 提示词格式。将完整的提示词写入文件 — 切勿通过 bash 参数内联传递代码(shell 转义会破坏它)。
构建提示词时:
--- filename --- 分隔符.claude/artifacts/gemini-prompt.txt| 时机 | 读取 |
|---|---|
| 为任何模式构建提示词时 | references/prompt-templates.md |
每周安装次数
200
仓库
GitHub 星标数
650
首次出现
2026年2月18日
安全审计
安装于
opencode170
github-copilot166
codex165
gemini-cli165
cursor163
claude-code158
Consult Gemini as a coding peer for a second opinion on code quality, architecture decisions, debugging, or security reviews.
API Key : Set GEMINI_API_KEY as an environment variable. Get a key from https://aistudio.google.com/apikey if you don't have one.
export GEMINI_API_KEY="your-key-here"
Determine mode from user request (review, architect, debug, security, quick)
Read target files into context
Build prompt using the AI-to-AI template from references/prompt-templates.md
Write prompt to file at .claude/artifacts/gemini-prompt.txt (avoids shell escaping issues)
Call the API — generate a Python script that:
GEMINI_API_KEY from environment.claude/artifacts/gemini-prompt.txthttps://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent{"contents": [{"parts": [{"text": prompt}]}], "generationConfig": {"temperature": 0.3, "maxOutputTokens": 8192}}candidates[0].content.parts[0].textWrite the script to .claude/scripts/gemini-review.py and run it.
Review specific files for bugs, logic errors, security vulnerabilities, performance issues, and best practice violations.
Read the target files, build a prompt using the Code Review template, call with gemini-2.5-flash.
Get feedback on design decisions with trade-off analysis. Include project context (CLAUDE.md, relevant source files).
Read project context, build a prompt using the Architecture template, call with gemini-2.5-pro.
Analyse errors when stuck after 2+ failed fix attempts. Gemini sees the code fresh without your debugging context bias.
Read the problematic files, build a prompt using the Debug template (include error message and previous attempts), call with gemini-2.5-flash.
Scan code for security vulnerabilities (injection, auth bypass, data exposure).
Read the target directory's source files, build a prompt using the Security template, call with gemini-2.5-pro.
Fast question without file context. Build prompt inline, write to file, call with gemini-2.5-flash.
| Mode | Model | Why |
|---|---|---|
| review, debug, quick | gemini-2.5-flash | Fast, good for straightforward analysis |
| architect, security-scan | gemini-2.5-pro | Better reasoning for complex trade-offs |
Check current model IDs if errors occur — they change frequently:
curl -s "https://generativelanguage.googleapis.com/v1beta/models?key=$GEMINI_API_KEY" | python3 -c "import sys,json; [print(m['name']) for m in json.load(sys.stdin)['models'] if 'gemini' in m['name']]"
Good use cases :
Avoid using for :
Critical : Always use the AI-to-AI prompting format. Write the full prompt to a file — never pass code inline via bash arguments (shell escaping will break it).
When building the prompt:
--- filename --- separators.claude/artifacts/gemini-prompt.txt| When | Read |
|---|---|
| Building prompts for any mode | references/prompt-templates.md |
Weekly Installs
200
Repository
GitHub Stars
650
First Seen
Feb 18, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode170
github-copilot166
codex165
gemini-cli165
cursor163
claude-code158
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
111,800 周安装