Gemini API Dev
google-gemini/gemini-skills
A skill your agent uses when writing code that calls the Gemini API for text generation, multi-turn chat, multimodal understanding, image generation, video generation, speech generation (TTS), voice…
Reviews and corrects Gemini API integration code against Google's published practices, covering SDK choice, safety settings, finishReason checks, tools, streaming and thinking.
$ npx skills add takeshy/obsidian-gemini-helper --skill gemini-best-practices -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install takeshy/obsidian-gemini-helper gemini-best-practices --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/takeshy/obsidian-gemini-helper.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/gemini-best-practices .claude/skills/gemini-best-practices && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "gemini-best-practices" agent skill from https://github.com/takeshy/obsidian-gemini-helper/tree/master/.agents/skills/gemini-best-practices into .claude/skills/gemini-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gemini-best-practices", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/takeshy/obsidian-gemini-helper/tree/master/.agents/skills/gemini-best-practicesType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add takeshy/obsidian-gemini-helper --skill gemini-best-practices -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install takeshy/obsidian-gemini-helper gemini-best-practices --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/takeshy/obsidian-gemini-helper.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/gemini-best-practices .agents/skills/gemini-best-practices && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "gemini-best-practices" agent skill from https://github.com/takeshy/obsidian-gemini-helper/tree/master/.agents/skills/gemini-best-practices into .agents/skills/gemini-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gemini-best-practices", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add takeshy/obsidian-gemini-helper --skill gemini-best-practices -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install takeshy/obsidian-gemini-helper gemini-best-practices --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/takeshy/obsidian-gemini-helper.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/gemini-best-practices .cursor/skills/gemini-best-practices && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "gemini-best-practices" agent skill from https://github.com/takeshy/obsidian-gemini-helper/tree/master/.agents/skills/gemini-best-practices into .cursor/skills/gemini-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gemini-best-practices", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/takeshy/obsidian-gemini-helper.git --path .agents/skills/gemini-best-practices--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add takeshy/obsidian-gemini-helper --skill gemini-best-practices -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install takeshy/obsidian-gemini-helper gemini-best-practices --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/takeshy/obsidian-gemini-helper.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/gemini-best-practices .gemini/skills/gemini-best-practices && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "gemini-best-practices" agent skill from https://github.com/takeshy/obsidian-gemini-helper/tree/master/.agents/skills/gemini-best-practices into .gemini/skills/gemini-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gemini-best-practices", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install takeshy/obsidian-gemini-helper gemini-best-practicesInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add takeshy/obsidian-gemini-helper --skill gemini-best-practices -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/takeshy/obsidian-gemini-helper.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/gemini-best-practices .github/skills/gemini-best-practices && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "gemini-best-practices" agent skill from https://github.com/takeshy/obsidian-gemini-helper/tree/master/.agents/skills/gemini-best-practices into .github/skills/gemini-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gemini-best-practices", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add takeshy/obsidian-gemini-helper --skill gemini-best-practices -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install takeshy/obsidian-gemini-helper gemini-best-practices --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/takeshy/obsidian-gemini-helper.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/gemini-best-practices .opencode/skills/gemini-best-practices && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "gemini-best-practices" agent skill from https://github.com/takeshy/obsidian-gemini-helper/tree/master/.agents/skills/gemini-best-practices into .opencode/skills/gemini-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gemini-best-practices", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
gemini-best-practicesReviews and corrects Gemini API integration code against Google's published practices, covering SDK choice, safety settings, finishReason checks, tools, streaming and thinking.
The checklist starts with the right package: `@google/genai` from npm, never the deprecated `@google/generative-ai`, with API keys read from environment variables. Every `generateContent`, `generateContentStream` and `chats.create` call must carry `safetySettings`, and the code must inspect `finishReason` on response candidates, handling SAFETY, RECITATION and MAX_TOKENS differently from a normal STOP, for both streaming and non-streaming responses.
Other sections cover passing `systemInstruction` in config and re-specifying it per chat session, passing tools through `config.tools` with proper SDK types, and the rule that `googleSearch` and `fileSearch` cannot be combined with function declarations in one request. For streaming it favors the SDK Chat for thought signatures and processing every part of each chunk. Thinking is on by default for recent Gemini models, with notes on `thinkingBudget`, `thinkingLevel` and Pro models that require it. It is aimed at a specific file, `src/core/gemini.ts`, and new API calls.
Read from SKILL.md and the folder at commit 0e2b8d0. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Gemini API Best Practices loads about 1.1k tokens when it runs. Until then it costs about 49 tokens; SKILL.md has 343 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from takeshy/obsidian-gemini-helper at commit 0e2b8d0, republished under its MIT licence (© takeshy). 343 words, ~1,073 tokens.
.claude/skills/gemini-best-practices/SKILL.md (or your agent's skills folder).When reviewing or modifying Gemini API integration code, ensure compliance with Google's official best practices from google-gemini/gemini-skills.
@google/genai (npm)@google/generative-ai (old package)All API calls (generateContent, generateContentStream, chats.create) MUST include safetySettings in the config:
import { HarmCategory, HarmBlockThreshold, type SafetySetting } from "@google/genai";
const DEFAULT_SAFETY_SETTINGS: SafetySetting[] = [
{ category: HarmCategory.HARM_CATEGORY_HARASSMENT, threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE },
{ category: HarmCategory.HARM_CATEGORY_HATE_SPEECH, threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE },
{ category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE },
{ category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE },
];Always check finishReason on response candidates:
SAFETY - Response blocked by safety filters; inform user to rephraseRECITATION - Blocked due to potential copyrighted content recitationMAX_TOKENS - Output truncated; consider informing userSTOP - Normal completionimport { FinishReason } from "@google/genai";
// Check candidates[0].finishReason after each response
if (candidate.finishReason === FinishReason.SAFETY) {
// Handle blocked response
}For non-streaming: check response.candidates[0].finishReason before using response.text.
For streaming: check finishReason in chunk candidates.
systemInstruction in config (not as a chat message)config.tools arrayTool, FunctionDeclaration) without forced as castsgoogleSearch and fileSearch are first-class Tool propertiesfileSearch CANNOT be combined with functionDeclarations in the same requestgoogleSearch CANNOT be combined with functionDeclarationsgenerateContentStream or chat.sendMessageStream for streamingai.chats.create()) for automatic thought signature handlingthinkingBudget: 0 disables thinking (except models that require it)thinkingLevel instead of thinkingBudgetpart.thought boolean on content partsCurrent models (use these):
gemini-3.1-pro-preview - Flagship, 1M contextgemini-3-flash-preview - Fast, balancedgemini-3.1-flash-lite-preview - Cost-efficientgemini-2.5-pro / gemini-2.5-flash - Still availableDeprecated models (NEVER use):
gemini-2.0-*, gemini-1.5-*, gemini-1.0-*, gemini-pro@google/genai instead of as castsTool interface supports googleSearch, fileSearch, functionDeclarations, codeExecution, urlContextFinishReason, HarmCategory, HarmBlockThreshold) as values, not just typessafetySettings: DEFAULT_SAFETY_SETTINGS included in configfinishReason checked on response candidatessystemInstruction passed in config (not as message)as Tool type assertionsformatError()© takeshy, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .agents/skills/gemini-best-practices of takeshy/obsidian-gemini-helper.
Open the folder on GitHubat commit 0e2b8d0
Gemini API Best Practices next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Gemini API Best Practices this skilltakeshy/obsidian-gemini-helper | 117 | — | ~1.1k | Automated safety check: Pass | MIT | |
| Gemini API Devgoogle-gemini/gemini-skills | 4.3k | — | ~5.1k | Automated safety check: Pass | Apache-2.0 | |
| Gemini API DevAyuilos/Miffan | 217 | — | ~1.4k | Automated safety check: Pass | AGPL-3.0 | |
| Gemini API DevJetBrains/skills | 366 | — | ~1.6k | Automated safety check: Pass | None | |
| Gemini Interactions APIJetBrains/skills | 366 | — | ~2.5k | Automated safety check: Pass | None | |
| Gemini Live API Devgoogle-gemini/gemini-skills | 4.3k | — | ~4.6k | Automated safety check: Pass | Apache-2.0 |
google-gemini/gemini-skills
A skill your agent uses when writing code that calls the Gemini API for text generation, multi-turn chat, multimodal understanding, image generation, video generation, speech generation (TTS), voice…
Ayuilos/Miffan
A skill your agent uses when building applications with Gemini API hosted models, including Gemini and Gemma 4, working with multimodal content (text, images, audio, video), implementing function…
JetBrains/skills
A skill your agent uses when building applications with Gemini models, Gemini API, working with multimodal content (text, images, audio, video), implementing function calling, using structured…
JetBrains/skills
A skill your agent uses when writing code that calls the Gemini API for text generation, multi-turn chat, multimodal understanding, image generation, streaming responses, background research tasks…
google-gemini/gemini-skills
A skill your agent uses when building real-time, bidirectional streaming applications with the Gemini Live API, or migrating legacy Live models (2.0/2.5/3.1) to Gemini 3.8 Live.
Ayuilos/Miffan
A skill your agent uses when writing code that calls the Gemini API for text generation, multi-turn chat, multimodal understanding, image generation, video generation, streaming responses…
takeshy/obsidian-gemini-helper
Add a new function calling tool (vault operation) for the Gemini chat.
takeshy/obsidian-gemini-helper
Guides the agent through every file that must change to register a new node type in the Obsidian Gemini Helper workflow engine, then through lint and build checks.
Works with
Categories
Reviews and corrects Gemini API integration code against Google's published practices, covering SDK choice, safety settings, finishReason checks, tools, streaming and thinking. The checklist starts with the right package: `@google/genai` from npm, never the deprecated `@google/generative-ai`, with API keys read from environment variables.create` call must carry `safetySettings`, and the code must inspect `finishReason` on response candidates, handling SAFETY, RECITATION and MAX_TOKENS differently from a normal STOP, for both streaming and non-streaming responses.
Gemini API Best Practices fits situations like: auditing a project's Gemini calls for missing safety settings or finishReason handling; adding a new Gemini API call to the core client module; migrating code off the deprecated Gemini SDK package.
Run `npx skills add takeshy/obsidian-gemini-helper --skill gemini-best-practices -a claude-code`. Or copy the skill folder (.agents/skills/gemini-best-practices in takeshy/obsidian-gemini-helper) into .claude/skills/gemini-best-practices in your project. Claude Code loads it when a task matches its description.
Run `npx skills add takeshy/obsidian-gemini-helper --skill gemini-best-practices -a codex`. Or copy the skill folder (.agents/skills/gemini-best-practices in takeshy/obsidian-gemini-helper) into .agents/skills/gemini-best-practices in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add takeshy/obsidian-gemini-helper --skill gemini-best-practices -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gemini-best-practices, .gemini/skills/gemini-best-practices, .github/skills/gemini-best-practices and .opencode/skills/gemini-best-practices in your project.
SKILL.md names no scripts, command-line tools or credentials: Gemini API Best Practices is instructions for the agent only. Our summary lists: A project that calls the Gemini API with the `@google/genai` SDK; A Gemini API key held in an environment variable.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Gemini API Best Practices is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.1k tokens (SKILL.md is roughly 4.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Gemini API Best Practices: Gemini API Dev (google-gemini/gemini-skills, 4.3k stars), Gemini API Dev (Ayuilos/Miffan, 217 stars), Gemini API Dev (JetBrains/skills, 366 stars) and Gemini Interactions API (JetBrains/skills, 366 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
takeshy (a GitHub user) maintains it in takeshy/obsidian-gemini-helper, which has 117 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 6, 2026.
Source: takeshy/obsidian-gemini-helper on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.