gemini-guide
npx machina-cli add skill jezweb/claude-skills/gemini-guide --openclawGemini Guide
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 | WebFetch, local docs |
| gemini-peer-review | Code -> Gemini | Direct Gemini API |
Documentation Sources
Check in this priority order:
| Priority | Source | Best For |
|---|---|---|
| 1 | GitHub codegen_instructions | Always-current SDK patterns — fetch https://raw.githubusercontent.com/googleapis/js-genai/refs/heads/main/codegen_instructions.md |
| 2 | Google AI docs via WebFetch | Official docs — https://ai.google.dev/gemini-api/docs/{topic} (append .md.txt for markdown) |
| 3 | Local cached docs (if available at ~/Documents/google-gemini-context/) | Pre-fetched topics — 24 JS, 24 Python, 7 common |
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
- Fetch latest SDK patterns: Get the GitHub codegen_instructions.md for always-current patterns
- Map the query to a topic: Read references/topic-index.md — if local docs exist at
~/Documents/google-gemini-context/, read the matching file; otherwise use WebFetch onhttps://ai.google.dev/gemini-api/docs/{topic}.md.txt - Synthesise: Combine the documentation into a clear answer with working code examples. Always use the CORRECT patterns from step 1.
Quick Corrections
These are the most common mistakes. Apply these even without reading the full references:
| Claude Might Suggest | Correct |
|---|---|
@google/generative-ai | @google/genai |
google-generativeai (Python) | google-genai |
GoogleGenerativeAI | GoogleGenAI |
genAI.getGenerativeModel() | ai.models.generateContent() |
model.startChat() / chat.sendMessage() | ai.chats.create() / chat.send() |
generationConfig | config |
stream=True (method param) | config={"stream": True} |
gemini-pro | gemini-2.5-flash |
gemini-pro-vision | gemini-2.5-flash (unified multimodal) |
| 4 safety categories | 5 categories (include HARM_CATEGORY_CIVIC_INTEGRITY) |
HARM_CATEGORY_DANGEROUS_CONTENT | HARM_CATEGORY_DANGEROUS (no _CONTENT) |
X-Goog-Api-Key (capitalised) | x-goog-api-key (lowercase) |
| Daily rate limits | No daily limits — only per-minute (RPM, TPM) |
Correct Initialisation (JS)
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"
});
Correct Initialisation (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"
)
Local Docs (Optional)
If you have a local cache at ~/Documents/google-gemini-context/, it contains:
| Directory | Contents |
|---|---|
javascript/ | 24 topic files — quickstart, function-calling, streaming, structured-output, etc. |
python/ | 24 topic files — same topics as JavaScript |
common/ | 7 cross-language files — safety, pricing, rate-limits, errors, auth, regions, openai-compat |
rest-api/ | REST endpoint docs |
MODELS.md | Current model IDs, capabilities, token limits, rate limits |
googlegenai-gemini-api.md | Comprehensive SDK guide (608 lines, JS + Python) |
If not available, fall back to WebFetch on Google AI docs (append .md.txt for markdown format).
Current Models
| Model | ID | Best For |
|---|---|---|
| Gemini 2.5 Pro | gemini-2.5-pro | Complex reasoning, advanced coding |
| Gemini 2.5 Flash | gemini-2.5-flash | Most tasks (recommended default) |
| Gemini 2.5 Flash-Lite | gemini-2.5-flash-lite-preview-06-17 | Budget, low latency |
| Gemini 2.0 Flash | gemini-2.0-flash | Fast inference |
| Text Embedding | text-embedding-004 | Semantic search, RAG (768 dims) |
For full model details, check ~/Documents/google-gemini-context/MODELS.md (if available) or https://ai.google.dev/gemini-api/docs/models.
Maintenance
When information seems wrong or outdated:
- 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
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 |
Source
git clone https://github.com/jezweb/claude-skills/blob/main/plugins/dev-tools/skills/gemini-guide/SKILL.mdView on GitHub Overview
Gemini Guide helps you discover Gemini API docs, SDK patterns, and current best practices when working with Google Gemini. It maps topics to local cached docs or live sources, ensuring you use the correct @google/genai patterns and distinguishing deprecated from current API usage.
How This Skill Works
When asked about a Gemini topic, the skill first references corrections to avoid deprecated patterns, fetches the latest SDK patterns from codegen_instructions.md, then maps your query to a topic using local docs or live web sources. It then synthesizes a clear answer with working code examples that reflect the correct patterns from the sources.
When to Use It
- Starting a Gemini integration and needing up-to-date SDK patterns.
- Verifying API usage to avoid deprecated methods.
- Looking up topic-specific docs quickly from local cache or the web.
- Comparing local cached docs with online sources for a topic.
- Building code that imports from @google/genai or google-genai and wants correct patterns.
Quick Start
- Step 1: Trigger the skill with gemini docs or gemini guide.
- Step 2: The tool maps your query to a topic using local docs or the live web source.
- Step 3: Copy and adapt the suggested code using current patterns for JS or Python.
Best Practices
- Check references/deprecated-patterns.md before coding to avoid anti-patterns.
- Always fetch the latest codegen_instructions.md for current SDK patterns.
- Prefer local cached docs at ~/Documents/google-gemini-context/ when available for speed.
- Map queries to the official docs at ai.google.dev/gemini-api/docs/{topic}.md.txt.
- Use correct initialisation and API calls shown in the guide (JS: GoogleGenAI; Python: genai Client).
Example Use Cases
- JS example using the correct init and generateContent call in gemini-2.5-flash.
- Python example using google.genai client and generate_content with the gemini model.
- Lookup using a local cached topic file to speed up a quickstart.
- Correcting a deprecated pattern like @google/generative-ai to @google/genai in your code plan.
- Replacing startChat with ai.chats.create and chat.send for chat-based flows.