gemini
This skill should be used when the user wants to invoke Google Gemini CLI for complex reasoning tasks, research, and AI assistance. Trigger phrases include "use gemini", "ask gemini", "run gemini", "call gemini", "gemini cli", "Google AI", "Gemini reasoning", or when users request Google's AI models, need advanced reasoning capabilities, research with web search, or want to continue previous Gemini conversations. Automatically triggers on Gemini-related requests and supports session continuation for iterative development.
What this skill does
# Gemini: Google AI Assistant for Claude Code
---
## DEFAULT MODEL: Gemini 3.1 Pro
**The default model for ALL Gemini invocations is `gemini-3.1-pro-preview`.**
- Always use `gemini-3.1-pro-preview` unless user explicitly requests another model
- This is the highest reasoning model available (released Feb 19, 2026)
- CLI default (without `-m`) is `gemini-3-flash-preview` (fast but less capable)
- Fallback chain: `gemini-3.1-pro-preview` → `gemini-3-pro-preview` → `gemini-2.5-flash`
```bash
# Default invocation - ALWAYS use gemini-3.1-pro-preview
gemini -m gemini-3.1-pro-preview "your prompt here"
```
---
## CRITICAL: Headless Mode with `-p` Flag
**REQUIRED**: Use `-p`/`--prompt` flag for non-interactive (headless) execution in Claude Code.
As of Gemini CLI v0.29.0+, positional prompts default to **interactive mode**. The `-p` flag is the correct way to run in **non-interactive (headless) mode**.
**Examples:**
- `gemini -m gemini-3.1-pro-preview -p "prompt"` (CORRECT - headless mode)
- `gemini -m gemini-3.1-pro-preview "prompt"` (also works when piped, but `-p` is more explicit)
- `gemini -r latest` (session resume)
**Why?** As of v0.29.0, the CLI description states: "Defaults to interactive mode. Use -p/--prompt for non-interactive (headless) mode." The `-p` flag is no longer deprecated.
---
## IMPORTANT: Preview Features & OAuth Free Tier
**For OAuth free tier users in headless mode:**
When `previewFeatures: true` in `~/.gemini/settings.json`, the CLI routes ALL requests to Gemini 3.1 Pro (even `-m gemini-2.5-pro`). Since free tier doesn't have Gemini 3 access, this causes 404 errors.
**Solution**: Disable preview features for reliable headless operation:
```json
// ~/.gemini/settings.json
{
"general": {
"previewFeatures": false
}
}
```
**Plugin Behavior**: This skill automatically falls back to `gemini-2.5-flash` when encountering 404 errors. Flash always works with OAuth free tier.
---
## Trigger Examples
This skill activates when users say phrases like:
- "Use gemini to research this topic"
- "Ask gemini about this design pattern"
- "Run gemini on this analysis"
- "Call gemini for help with this problem"
- "I need Google AI for this task"
- "Get Gemini's reasoning on this"
- "Continue with gemini" or "Resume the gemini session"
- "Gemini, help me with..." or simply "Gemini"
- "Use Gemini 3" or "Use Gemini 2.5"
## When to Use This Skill
This skill should be invoked when:
- User explicitly mentions "Gemini" or requests Gemini assistance
- User needs Google's AI models for reasoning, research, or analysis
- User requests complex problem-solving or architectural design
- User needs research capabilities with web search integration
- User wants to continue a previous Gemini conversation
- User needs an alternative to Codex or Claude for specific tasks
## How It Works
### Detecting New Gemini Requests
When a user makes a request, **default to read-only mode (default approval)** unless they explicitly request file editing:
**Use `gemini-3.1-pro-preview` for ALL tasks with `default` approval mode:**
- Architecture, design, reviews, research
- Explanations, analysis, problem-solving
- Code analysis and understanding
- ANY task where user does NOT explicitly request file editing
**Approval Mode Selection:**
- **`default`** (default): For all tasks - prompts for approval on edits (safe)
- **`auto_edit`**: ONLY when user explicitly requests file editing
- **`plan`**: Read-only mode - no file modifications allowed
- **`yolo`**: When user explicitly wants full auto-approval (use with caution)
**⚠️ Explicit Edit Request**: If the user explicitly asks to "edit files", "modify code", "write changes", or "make edits" - ONLY then use `--approval-mode auto_edit` to enable file modifications.
**Fallback Chain** (if primary unavailable):
1. `gemini-3.1-pro-preview` (primary - highest capability)
2. `gemini-2.5-pro` (stable general reasoning)
3. `gemini-2.5-flash` (fast, always available)
**Example requests**: "Design a distributed cache", "Explain CQRS pattern", "Analyze this code"
### Bash CLI Command Structure
**IMPORTANT**: Gemini CLI works differently from Codex - no `exec` subcommand needed. Use positional prompts directly.
#### Default Command (Read-Only) - Use for ALL Tasks
```bash
gemini -m gemini-3.1-pro-preview \
"Design a microservices architecture for e-commerce"
```
#### Explicit Edit Request Only - When User Asks to Edit Files
```bash
gemini -m gemini-3.1-pro-preview \
--approval-mode auto_edit \
"Edit this file to refactor the function"
```
#### For Session Continuation
```bash
# Resume most recent session
gemini -r latest
# Resume specific session by index
gemini -r 3
# Resume and add new prompt
gemini -r latest "Continue our discussion about caching strategies"
```
**Why positional prompts?**
- Simpler, more direct syntax
- Future-proof (recommended by Gemini CLI)
- Works in non-TTY environments (like Claude Code's bash)
- No separate `exec` command needed
### Model Selection Logic
**Use `gemini-3.1-pro-preview` (default for ALL tasks):**
- Code editing, refactoring, implementation
- Designing architecture or system design
- Conducting research or analysis
- Explaining complex concepts
- Planning implementation strategies
- General problem-solving and advanced reasoning
**Fallback to `gemini-2.5-pro` when:**
- Gemini 3.1 Pro unavailable or quota exhausted
- User explicitly requests "Gemini 2.5" or "use 2.5"
- Stable, production-ready tasks
**Fallback to `gemini-2.5-flash` when:**
- Both Gemini 3.1 Pro and 2.5 Pro unavailable
- Fast iterations needed (explicit user request)
- Simple, quick responses (explicit user request)
### Version-Based Model Mapping
When users mention a version number, map to the latest model in that family:
| User Request | Maps To | Actual Model ID |
|--------------|---------|-----------------|
| "use 3" / "Gemini 3" | Latest 3.x Pro | `gemini-3.1-pro-preview` |
| "use 2.5" | 2.5 Pro | `gemini-2.5-pro` |
| "use flash" | 2.5 Flash | `gemini-2.5-flash` |
| No version specified | Latest Pro (ALL tasks) | `gemini-3.1-pro-preview` |
**See**: `references/model-selection.md` for detailed model selection guidance and decision tree.
### Default Configuration
All Gemini invocations use these defaults unless user specifies otherwise:
| Parameter | Default Value | CLI Flag | Notes |
|-----------|---------------|----------|-------|
| Model | `gemini-3.1-pro-preview` | `-m gemini-3.1-pro-preview` | For ALL tasks (highest capability) |
| Model (fallback 1) | `gemini-2.5-pro` | `-m gemini-2.5-pro` | If Gemini 3.1 Pro unavailable |
| Model (fallback 2) | `gemini-2.5-flash` | `-m gemini-2.5-flash` | Always works on free tier |
| Approval Mode (default) | `default` | No flag | Safe default - prompts for edits |
| Approval Mode (editing) | `auto_edit` | `--approval-mode auto_edit` | Only when user explicitly requests editing |
| Sandbox | `false` (disabled) | No flag | Sandbox disabled by default |
| Output Format | `text` | No flag | Human-readable text output |
| Web Search | Enabled when appropriate | `-e web_search` (if needed) | Context-dependent |
**Rationale for Defaults:**
- **Gemini 3.1 Pro for ALL tasks**: Highest capability model, optimized for both reasoning and code
- **Fallback chain**: gemini-3.1-pro-preview → gemini-2.5-pro → gemini-2.5-flash
- **default mode**: Safe default that prompts for approval on edits
- **auto_edit mode**: Only use when user explicitly requests file editing
- **No sandbox**: Claude Code environment assumed trusted
- **Text output**: Default for human consumption (use `--output-format json` for parsing)
**Note**: If you have `previewFeatures: true` in settings, disable it for reliable headless operation (see warning above).
### Error Handling
The skill handles these common errors gracefully:
#### CLI Not Installed
**Error**: `command not found: gemini`
**Message**: "Gemini CLI not installed. Install from: https://github.com/google-gemRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.