gemini-guide
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGemini Guide
Gemini 指南
Look up Gemini API documentation and SDK patterns when building with Google Gemini. This skill brings Gemini docs TO Claude — it does not call Gemini.
| Skill | Direction | Tool |
|---|---|---|
| gemini-guide (this) | Gemini docs -> Claude | Local docs, WebFetch |
| gemini-peer-review | Code -> Gemini | gemini-coach CLI |
在使用Google Gemini进行开发时,查阅Gemini API文档和SDK模式。该技能将Gemini文档集成到Claude中——它不会调用Gemini。
| 技能 | 方向 | 工具 |
|---|---|---|
| gemini-guide(本技能) | Gemini 文档 -> Claude | 本地文档、WebFetch |
| gemini-peer-review | 代码 -> Gemini | gemini-coach CLI |
Documentation Sources
文档来源
Check in this priority order:
| Priority | Source | Best For |
|---|---|---|
| 1 | Local cached docs ( | Most topics — 24 JS, 24 Python, 7 common topics |
| 2 | GitHub codegen_instructions | Always-current SDK patterns — fetch |
| 3 | Google AI docs via WebFetch | When local docs don't cover it — |
按以下优先级顺序查阅:
| 优先级 | 来源 | 适用场景 |
|---|---|---|
| 1 | 本地缓存文档( | 大多数主题——包含24个JavaScript主题、24个Python主题、7个通用主题 |
| 2 | GitHub codegen_instructions | 实时更新的SDK模式——获取 |
| 3 | 通过WebFetch获取Google AI文档 | 本地文档未覆盖的内容—— |
Lookup Workflow
查阅流程
When the user asks about a Gemini topic:
- Check corrections first: Read references/deprecated-patterns.md — know what NOT to suggest before writing any code
- Map the query to a topic: Read references/topic-index.md to find the right local doc file
- Read the local doc: The file path will be
~/Documents/google-gemini-context/{path from topic index} - If local doc seems stale: Fetch the GitHub codegen_instructions.md for latest SDK patterns
- Synthesise: Combine the documentation into a clear answer with working code examples. Always use the CORRECT patterns from step 1.
当用户询问Gemini相关主题时:
- 先检查修正内容:阅读references/deprecated-patterns.md——在编写任何代码前,先了解哪些内容是不应该推荐的
- 将查询映射到对应主题:阅读references/topic-index.md以找到正确的本地文档文件
- 读取本地文档:文件路径为
~/Documents/google-gemini-context/{主题索引中的路径} - 若本地文档过时:获取GitHub上的codegen_instructions.md以获取最新的SDK模式
- 整合内容:将文档内容整合成清晰的答案,并附上可运行的代码示例。务必遵循步骤1中的正确模式。
Quick Corrections
快速修正
These are the most common mistakes. Apply these even without reading the full references:
| Claude Might Suggest | Correct |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 4 safety categories | 5 categories (include |
| |
| |
| Daily rate limits | No daily limits — only per-minute (RPM, TPM) |
以下是最常见的错误。即使未阅读完整参考内容,也应遵循这些修正规则:
| Claude可能建议的写法 | 正确写法 |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 4个安全类别 | 5个类别(包含 |
| |
| |
| 每日调用限制 | 无每日限制——仅存在每分钟调用限制(RPM,TPM) |
Correct Initialisation (JS)
正确初始化方式(JS)
javascript
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({}); // auto-reads GEMINI_API_KEY env var
const response = await ai.models.generateContent({
model: "gemini-2.5-flash",
contents: "Your prompt"
});javascript
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({}); // 自动读取GEMINI_API_KEY环境变量
const response = await ai.models.generateContent({
model: "gemini-2.5-flash",
contents: "Your prompt"
});Correct Initialisation (Python)
正确初始化方式(Python)
python
from google import genai
client = genai.Client() # auto-reads GEMINI_API_KEY env var
response = client.models.generate_content(
model="gemini-2.5-flash",
contents="Your prompt"
)python
from google import genai
client = genai.Client() # 自动读取GEMINI_API_KEY环境变量
response = client.models.generate_content(
model="gemini-2.5-flash",
contents="Your prompt"
)Local Docs Structure
本地文档结构
All at :
~/Documents/google-gemini-context/| Directory | Contents |
|---|---|
| 24 topic files — quickstart, function-calling, streaming, structured-output, etc. |
| 24 topic files — same topics as JavaScript |
| 7 cross-language files — safety, pricing, rate-limits, errors, auth, regions, openai-compat |
| REST endpoint docs |
| Current model IDs, capabilities, token limits, rate limits |
| Full correction reference (source for deprecated-patterns.md) |
| Comprehensive SDK guide (608 lines, JS + Python) |
| Keyword index mapping topics to files |
所有文档均位于 :
~/Documents/google-gemini-context/| 目录 | 内容 |
|---|---|
| 24个主题文件——快速入门、函数调用、流式传输、结构化输出等 |
| 24个主题文件——与JavaScript主题一致 |
| 7个跨语言文件——安全、定价、调用限制、错误处理、认证、区域、OpenAI兼容 |
| REST端点文档 |
| 当前模型ID、功能、令牌限制、调用限制 |
| 完整修正参考(deprecated-patterns.md的数据源) |
| 全面的SDK指南(608行,包含JS和Python) |
| 关键词索引,将主题映射到对应文件 |
Current Models
当前可用模型
| Model | ID | Best For |
|---|---|---|
| Gemini 2.5 Pro | | Complex reasoning, advanced coding |
| Gemini 2.5 Flash | | Most tasks (recommended default) |
| Gemini 2.5 Flash-Lite | | Budget, low latency |
| Gemini 2.0 Flash | | Fast inference |
| Text Embedding | | Semantic search, RAG (768 dims) |
For full model details including token limits and rate limits, read .
~/Documents/google-gemini-context/MODELS.md| 模型 | ID | 适用场景 |
|---|---|---|
| Gemini 2.5 Pro | | 复杂推理、高级编码 |
| Gemini 2.5 Flash | | 大多数任务(推荐默认使用) |
| Gemini 2.5 Flash-Lite | | 低成本、低延迟 |
| Gemini 2.0 Flash | | 快速推理 |
| Text Embedding | | 语义搜索、RAG(768维度) |
如需了解完整的模型详情,包括令牌限制和调用限制,请阅读。
~/Documents/google-gemini-context/MODELS.mdMaintenance
维护说明
The local docs at were curated in January 2025. When information seems wrong or outdated:
~/Documents/google-gemini-context/- Check the GitHub codegen_instructions.md (always current)
- Verify model IDs against
https://ai.google.dev/gemini-api/docs/models - Flag stale docs to the user
本地文档整理于2025年1月。当信息看起来错误或过时:
~/Documents/google-gemini-context/- 检查GitHub上的codegen_instructions.md(始终为最新内容)
- 对照验证模型ID
https://ai.google.dev/gemini-api/docs/models - 向用户标记过时文档
Reference Files
参考文件
| When | Read |
|---|---|
| Mapping a query to a documentation file | references/topic-index.md |
| Checking for deprecated patterns before writing code | references/deprecated-patterns.md |
| 场景 | 查阅文件 |
|---|---|
| 将查询映射到对应文档文件 | references/topic-index.md |
| 在编写代码前检查已弃用模式 | references/deprecated-patterns.md |