Gemini Skill Guide

Use when the user asks to run Gemini CLI for code review, plan review, or big context (>200k) processing.

How to use it

Claude Code
  1. Run the line below. It pulls the whole folder into ~/.claude/skills/gemini.
  2. Describe your job in plain words. Claude Code follows the skill from there.
Claude Code — installs the whole folder, not just SKILL.md
npx degit jdrhyne/agent-skills/codex/gemini#main ~/.claude/skills/gemini

For one project only, change the path to .claude/skills/gemini.

Claude (web or desktop app)
  1. On this page open ⋯ → Download .md.
  2. Save it as SKILL.md in a folder, zip the folder, then Customize → Skills → + → Create skill → Upload a skill.
  3. Pick the file and Save. Claude shows the name and description and runs a security scan.
  4. Check the skill is switched on.
  5. Start a new chat and describe your job in plain words. The AI follows the skill from there.
ChatGPT or another app
  1. ChatGPT: make a Project and paste it into Instructions.
  2. Neither? Paste it at the top of a new chat — it works for that chat.
Not working?
  • Check which app you pasted it into — the steps above name the right one.
  • Some skills need the paid tier of Claude or ChatGPT.
Step-by-step guide with screenshots · Ask in the forum

Paste into Claude, ChatGPT or Cursor.

Source of Gemini Skill Guide

Show the full text233 lines
namedescriptionpermissions
geminiUse when the user asks to run Gemini CLI for code review, plan review, or big context (>200k) processing. Ideal for comprehensive analysis requiring large context windows. Uses Gemini 3 Pro by default for state-of-the-art reasoning and coding. - exec: "Runs the Gemini CLI only when the user explicitly asks to use Gemini.

Gemini Skill Guide

When to Use Gemini

  • WHEN ASKED TO BE ACTIVATED
  • Code Review: Comprehensive code reviews across multiple files
  • Plan Review: Analyzing architectural plans, technical specifications, or project roadmaps
  • Big Context Processing: Tasks requiring >200k tokens of context (entire codebases, documentation sets)
  • Multi-file Analysis: Understanding relationships and patterns across many files

⚠️ Critical: Background/Non-Interactive Mode Warning

NEVER use --approval-mode default in background or non-interactive shells (like Claude Code tool calls). It will hang indefinitely waiting for approval prompts that cannot be provided.

For automated/background reviews:

  • ✅ Use --approval-mode yolo for fully automated execution
  • ✅ OR wrap with timeout: timeout 300 gemini ...
  • ❌ NEVER use --approval-mode default without interactive terminal

Symptoms of hung Gemini:

  • Process running 20+ minutes with 0% CPU usage
  • No network activity
  • Process state shows 'S' (sleeping)

Fix hung process:

# Check if hung
ps aux | grep gemini | grep -v grep

# Kill if necessary
pkill -9 -f "gemini.*gemini-3-pro-preview"

Running a Task

  1. Ask the user (via AskUserQuestion) which model to use in a single prompt. Available models:

    • gemini-3-pro-preview ⭐ (flagship model, best for coding & complex reasoning, 35% better at software engineering than 2.5 Pro)
    • gemini-3-flash (sub-second latency, distilled from 3 Pro, best for speed-critical tasks)
    • gemini-2.5-pro (legacy option, strong all-around performance)
    • gemini-2.5-flash (legacy option, cost-efficient with thinking capabilities)
    • gemini-2.5-flash-lite (legacy option, fastest processing)
  2. Select the approval mode based on the task:

    • default: Prompt for approval (⚠️ ONLY for interactive terminal sessions)
    • auto_edit: Auto-approve edit tools only (for code reviews with suggestions)
    • yolo: Auto-approve all tools (✅ REQUIRED for background/automated tasks)
  3. Assemble the command with appropriate options:

    • -m, --model <MODEL> - Model selection
    • --approval-mode <default|auto_edit|yolo> - Control tool approval
    • -y, --yolo - Alternative to --approval-mode yolo
    • -i, --prompt-interactive "prompt" - Execute prompt and continue interactively
    • --include-directories <DIR> - Additional directories to include in workspace
    • -s, --sandbox - Run in sandbox mode for isolation
  4. For background/automated tasks, ALWAYS use --approval-mode yolo or add timeout wrapper. NEVER use default in non-interactive shells.

  5. Run the command and capture the output. For background/automated mode:

    # Recommended: Use yolo for background tasks
    gemini -m gemini-3-pro-preview --approval-mode yolo "Review this codebase for security issues"
    
    # Or with timeout (5 min limit)
    timeout 300 gemini -m gemini-3-pro-preview --approval-mode yolo "Review this codebase"
    
  6. For interactive sessions with an initial prompt:

    gemini -m gemini-3-pro-preview -i "Review the authentication system" --approval-mode auto_edit
    
  7. After Gemini completes, inform the user: "The Gemini analysis is complete. You can start a new Gemini session for follow-up analysis or continue exploring the findings."

Safety Boundaries

  • Do not run Gemini unless the user explicitly asked for Gemini or for a second-opinion review that justifies it.
  • Do not use --approval-mode yolo unless the task is non-interactive and the user approved high-autonomy execution.
  • Do not save reports or write files unless the user asked for an artifact.
  • Do not pass secrets, private keys, or unrelated workspace data into prompts.
Quick Reference
Use case Approval mode Key flags
Background code review yolo ✅ -m gemini-3-pro-preview --approval-mode yolo
Background analysis yolo ✅ -m gemini-3-pro-preview --approval-mode yolo
Background with timeout yolo ✅ timeout 300 gemini -m gemini-3-pro-preview --approval-mode yolo
Interactive code review default -m gemini-3-pro-preview --approval-mode default (interactive terminal only)
Code review with auto-edits auto_edit -m gemini-3-pro-preview --approval-mode auto_edit
Automated refactoring yolo -m gemini-3-pro-preview --approval-mode yolo
Speed-critical background yolo ✅ -m gemini-3-flash --approval-mode yolo
Cost-optimized background yolo ✅ -m gemini-2.5-flash --approval-mode yolo
Multi-directory analysis yolo (if background) --include-directories <DIR1> --include-directories <DIR2>
Interactive with prompt auto_edit or default -i "prompt" --approval-mode <mode>
Model Selection Guide
Model Best for Context window Key features
gemini-3-pro-preview ⭐ Flagship model: Complex reasoning, coding, agentic tasks 1M input / 64k output Vibe coding, 76.2% SWE-bench
gemini-3-flash Sub-second latency, speed-critical applications 1M input / 64k output Distilled from 3 Pro, TPU-optimized
gemini-2.5-pro Legacy: Strong all-around performance 1M input / 65k output Thinking mode, mature stability
gemini-2.5-flash Legacy: Cost-efficient, high-volume tasks 1M input / 65k output Thinking mode
gemini-2.5-flash-lite Legacy: Fastest processing, high throughput 1M input / 65k output Maximum speed, minimal latency

Gemini 3 Advantages: 35% higher accuracy in software engineering, state-of-the-art on SWE-bench (76.2%), GPQA Diamond (91.9%), and WebDev Arena (1487 Elo). Knowledge cutoff: January 2025.

Coming Soon: gemini-3-deep-think for ultra-complex reasoning with enhanced thinking capabilities.

Common Use Cases

Code Review (Background/Automated)
# For background execution (Claude Code, CI/CD, etc.)
gemini -m gemini-3-pro-preview --approval-mode yolo \
  "Perform a comprehensive code review focusing on:
   1. Security vulnerabilities
   2. Performance issues
   3. Code quality and maintainability
   4. Best practices violations"

# With timeout safety (5 minutes)
timeout 300 gemini -m gemini-3-pro-preview --approval-mode yolo \
  "Perform a comprehensive code review..."
Plan Review (Background/Automated)
# For background execution
gemini -m gemini-3-pro-preview --approval-mode yolo \
  "Review this architectural plan for:
   1. Scalability concerns
   2. Missing components
   3. Integration challenges
   4. Alternative approaches"
Big Context Analysis (Background/Automated)
# For background execution
gemini -m gemini-3-pro-preview --approval-mode yolo \
  "Analyze the entire codebase to understand:
   1. Overall architecture
   2. Key patterns and conventions
   3. Potential technical debt
   4. Refactoring opportunities"
Interactive Code Review (Terminal Only)
# ONLY use default mode in interactive terminal
gemini -m gemini-3-pro-preview --approval-mode default \
  "Review the authentication flow for security issues"

Following Up

  • Gemini CLI sessions are typically one-shot or interactive. Unlike Codex, there's no built-in resume functionality.
  • For follow-up analysis, start a new Gemini session with context from previous findings.
  • When proposing follow-up actions, restate the chosen model and approval mode.
  • Use AskUserQuestion after each Gemini command to confirm next steps or gather clarifications.

Error Handling

  • Stop and report failures whenever gemini --version or a Gemini command exits non-zero.
  • Request direction before retrying failed commands.
  • Before using high-impact flags (--approval-mode yolo, -y, --sandbox), ask the user for permission using AskUserQuestion unless already granted.
  • When output includes warnings or partial results, summarize them and ask how to adjust using AskUserQuestion.

Troubleshooting Hung Gemini Processes

Detection
# Check for hung processes
ps aux | grep -E "gemini.*gemini-3" | grep -v grep

# Look for these symptoms:
# - Process running 20+ minutes
# - CPU usage at 0%
# - Process state 'S' (sleeping)
# - No network connections
Diagnosis
# Get detailed process info
ps -o pid,etime,pcpu,stat,command -p <PID>

# Check network activity
lsof -p <PID> 2>/dev/null | grep -E "(TCP|ESTABLISHED)" | wc -l
# If result is 0, process is hung
Resolution
# Kill hung Gemini processes
pkill -9 -f "gemini.*gemini-3-pro-preview"

# Or kill specific PID
kill -9 <PID>

# Verify cleanup
ps aux | grep gemini | grep -v grep
Prevention
  • ALWAYS use --approval-mode yolo for background/automated tasks
  • Add timeout wrapper for safety: timeout 300 gemini ...
  • Never use --approval-mode default in non-interactive shells
  • Monitor first run with ps to ensure process completes

Tips for Large Context Processing

  1. Be specific: Provide clear, structured prompts for what to analyze
  2. Use include-directories: Explicitly specify all relevant directories
  3. Choose the right model:
    • Use gemini-3-pro-preview for complex reasoning, coding tasks, and maximum analysis quality (recommended default)
    • Use gemini-3-flash for speed-critical tasks requiring sub-second response times
    • Use gemini-2.5-flash for cost-optimized high-volume processing
  4. Leverage Gemini 3's strengths: 35% better at software engineering tasks, exceptional at agentic workflows and vibe coding
  5. Break down complex tasks: Even with large context, structured analysis is more effective
  6. Return structured findings: Ask Gemini for markdown or JSON that can be quoted directly in the final answer

CLI Version

Requires Gemini CLI v0.16.0 or later for Gemini 3 model support. Check version: gemini --version

1---
2name: gemini
3description: Use when the user asks to run Gemini CLI for code review, plan review, or big context (>200k) processing. Ideal for comprehensive analysis requiring large context windows. Uses Gemini 3 Pro by default for state-of-the-art reasoning and coding.
4permissions:
5 - exec: "Runs the Gemini CLI only when the user explicitly asks to use Gemini."
6---
7 
8# Gemini Skill Guide
9 
10## When to Use Gemini
11- WHEN ASKED TO BE ACTIVATED
12- **Code Review**: Comprehensive code reviews across multiple files
13- **Plan Review**: Analyzing architectural plans, technical specifications, or project roadmaps
14- **Big Context Processing**: Tasks requiring >200k tokens of context (entire codebases, documentation sets)
15- **Multi-file Analysis**: Understanding relationships and patterns across many files
16 
17## ⚠️ Critical: Background/Non-Interactive Mode Warning
18 
19**NEVER use `--approval-mode default` in background or non-interactive shells** (like Claude Code tool calls). It will hang indefinitely waiting for approval prompts that cannot be provided.
20 
21**For automated/background reviews:**
22- ✅ Use `--approval-mode yolo` for fully automated execution
23- ✅ OR wrap with timeout: `timeout 300 gemini ...`
24- ❌ NEVER use `--approval-mode default` without interactive terminal
25 
26**Symptoms of hung Gemini:**
27- Process running 20+ minutes with 0% CPU usage
28- No network activity
29- Process state shows 'S' (sleeping)
30 
31**Fix hung process:**
32```bash
33# Check if hung
34ps aux | grep gemini | grep -v grep
35 
36# Kill if necessary
37pkill -9 -f "gemini.*gemini-3-pro-preview"
38```
39 
40## Running a Task
41 
421. Ask the user (via `AskUserQuestion`) which model to use in a **single prompt**. Available models:
43 - `gemini-3-pro-preview` ⭐ (flagship model, best for coding & complex reasoning, 35% better at software engineering than 2.5 Pro)
44 - `gemini-3-flash` (sub-second latency, distilled from 3 Pro, best for speed-critical tasks)
45 - `gemini-2.5-pro` (legacy option, strong all-around performance)
46 - `gemini-2.5-flash` (legacy option, cost-efficient with thinking capabilities)
47 - `gemini-2.5-flash-lite` (legacy option, fastest processing)
48 
492. Select the approval mode based on the task:
50 - `default`: Prompt for approval (⚠️ ONLY for interactive terminal sessions)
51 - `auto_edit`: Auto-approve edit tools only (for code reviews with suggestions)
52 - `yolo`: Auto-approve all tools (✅ REQUIRED for background/automated tasks)
53 
543. Assemble the command with appropriate options:
55 - `-m, --model <MODEL>` - Model selection
56 - `--approval-mode <default|auto_edit|yolo>` - Control tool approval
57 - `-y, --yolo` - Alternative to `--approval-mode yolo`
58 - `-i, --prompt-interactive "prompt"` - Execute prompt and continue interactively
59 - `--include-directories <DIR>` - Additional directories to include in workspace
60 - `-s, --sandbox` - Run in sandbox mode for isolation
61 
624. **For background/automated tasks, ALWAYS use `--approval-mode yolo`** or add timeout wrapper. NEVER use `default` in non-interactive shells.
63 
645. Run the command and capture the output. For background/automated mode:
65 ```bash
66 # Recommended: Use yolo for background tasks
67 gemini -m gemini-3-pro-preview --approval-mode yolo "Review this codebase for security issues"
68 
69 # Or with timeout (5 min limit)
70 timeout 300 gemini -m gemini-3-pro-preview --approval-mode yolo "Review this codebase"
71 ```
72 
736. For interactive sessions with an initial prompt:
74 ```bash
75 gemini -m gemini-3-pro-preview -i "Review the authentication system" --approval-mode auto_edit
76 ```
77 
787. **After Gemini completes**, inform the user: "The Gemini analysis is complete. You can start a new Gemini session for follow-up analysis or continue exploring the findings."
79 
80## Safety Boundaries
81 
82- Do not run Gemini unless the user explicitly asked for Gemini or for a second-opinion review that justifies it.
83- Do not use `--approval-mode yolo` unless the task is non-interactive and the user approved high-autonomy execution.
84- Do not save reports or write files unless the user asked for an artifact.
85- Do not pass secrets, private keys, or unrelated workspace data into prompts.
86 
87### Quick Reference
88 
89| Use case | Approval mode | Key flags |
90| --- | --- | --- |
91| Background code review | `yolo` ✅ | `-m gemini-3-pro-preview --approval-mode yolo` |
92| Background analysis | `yolo` ✅ | `-m gemini-3-pro-preview --approval-mode yolo` |
93| Background with timeout | `yolo` ✅ | `timeout 300 gemini -m gemini-3-pro-preview --approval-mode yolo` |
94| Interactive code review | `default` | `-m gemini-3-pro-preview --approval-mode default` (interactive terminal only) |
95| Code review with auto-edits | `auto_edit` | `-m gemini-3-pro-preview --approval-mode auto_edit` |
96| Automated refactoring | `yolo` | `-m gemini-3-pro-preview --approval-mode yolo` |
97| Speed-critical background | `yolo` ✅ | `-m gemini-3-flash --approval-mode yolo` |
98| Cost-optimized background | `yolo` ✅ | `-m gemini-2.5-flash --approval-mode yolo` |
99| Multi-directory analysis | `yolo` (if background) | `--include-directories <DIR1> --include-directories <DIR2>` |
100| Interactive with prompt | `auto_edit` or `default` | `-i "prompt" --approval-mode <mode>` |
101 
102### Model Selection Guide
103 
104| Model | Best for | Context window | Key features |
105| --- | --- | --- | --- |
106| `gemini-3-pro-preview` ⭐ | **Flagship model**: Complex reasoning, coding, agentic tasks | 1M input / 64k output | Vibe coding, 76.2% SWE-bench |
107| `gemini-3-flash` | Sub-second latency, speed-critical applications | 1M input / 64k output | Distilled from 3 Pro, TPU-optimized |
108| `gemini-2.5-pro` | Legacy: Strong all-around performance | 1M input / 65k output | Thinking mode, mature stability |
109| `gemini-2.5-flash` | Legacy: Cost-efficient, high-volume tasks | 1M input / 65k output | Thinking mode |
110| `gemini-2.5-flash-lite` | Legacy: Fastest processing, high throughput | 1M input / 65k output | Maximum speed, minimal latency |
111 
112**Gemini 3 Advantages**: 35% higher accuracy in software engineering, state-of-the-art on SWE-bench (76.2%), GPQA Diamond (91.9%), and WebDev Arena (1487 Elo). Knowledge cutoff: January 2025.
113 
114**Coming Soon**: `gemini-3-deep-think` for ultra-complex reasoning with enhanced thinking capabilities.
115 
116## Common Use Cases
117 
118### Code Review (Background/Automated)
119```bash
120# For background execution (Claude Code, CI/CD, etc.)
121gemini -m gemini-3-pro-preview --approval-mode yolo \
122 "Perform a comprehensive code review focusing on:
123 1. Security vulnerabilities
124 2. Performance issues
125 3. Code quality and maintainability
126 4. Best practices violations"
127 
128# With timeout safety (5 minutes)
129timeout 300 gemini -m gemini-3-pro-preview --approval-mode yolo \
130 "Perform a comprehensive code review..."
131```
132 
133### Plan Review (Background/Automated)
134```bash
135# For background execution
136gemini -m gemini-3-pro-preview --approval-mode yolo \
137 "Review this architectural plan for:
138 1. Scalability concerns
139 2. Missing components
140 3. Integration challenges
141 4. Alternative approaches"
142```
143 
144### Big Context Analysis (Background/Automated)
145```bash
146# For background execution
147gemini -m gemini-3-pro-preview --approval-mode yolo \
148 "Analyze the entire codebase to understand:
149 1. Overall architecture
150 2. Key patterns and conventions
151 3. Potential technical debt
152 4. Refactoring opportunities"
153```
154 
155### Interactive Code Review (Terminal Only)
156```bash
157# ONLY use default mode in interactive terminal
158gemini -m gemini-3-pro-preview --approval-mode default \
159 "Review the authentication flow for security issues"
160```
161 
162## Following Up
163 
164- Gemini CLI sessions are typically one-shot or interactive. Unlike Codex, there's no built-in resume functionality.
165- For follow-up analysis, start a new Gemini session with context from previous findings.
166- When proposing follow-up actions, restate the chosen model and approval mode.
167- Use `AskUserQuestion` after each Gemini command to confirm next steps or gather clarifications.
168 
169## Error Handling
170 
171- Stop and report failures whenever `gemini --version` or a Gemini command exits non-zero.
172- Request direction before retrying failed commands.
173- Before using high-impact flags (`--approval-mode yolo`, `-y`, `--sandbox`), ask the user for permission using `AskUserQuestion` unless already granted.
174- When output includes warnings or partial results, summarize them and ask how to adjust using `AskUserQuestion`.
175 
176## Troubleshooting Hung Gemini Processes
177 
178### Detection
179```bash
180# Check for hung processes
181ps aux | grep -E "gemini.*gemini-3" | grep -v grep
182 
183# Look for these symptoms:
184# - Process running 20+ minutes
185# - CPU usage at 0%
186# - Process state 'S' (sleeping)
187# - No network connections
188```
189 
190### Diagnosis
191```bash
192# Get detailed process info
193ps -o pid,etime,pcpu,stat,command -p <PID>
194 
195# Check network activity
196lsof -p <PID> 2>/dev/null | grep -E "(TCP|ESTABLISHED)" | wc -l
197# If result is 0, process is hung
198```
199 
200### Resolution
201```bash
202# Kill hung Gemini processes
203pkill -9 -f "gemini.*gemini-3-pro-preview"
204 
205# Or kill specific PID
206kill -9 <PID>
207 
208# Verify cleanup
209ps aux | grep gemini | grep -v grep
210```
211 
212### Prevention
213- **ALWAYS use `--approval-mode yolo` for background/automated tasks**
214- Add timeout wrapper for safety: `timeout 300 gemini ...`
215- Never use `--approval-mode default` in non-interactive shells
216- Monitor first run with `ps` to ensure process completes
217 
218## Tips for Large Context Processing
219 
2201. **Be specific**: Provide clear, structured prompts for what to analyze
2212. **Use include-directories**: Explicitly specify all relevant directories
2223. **Choose the right model**:
223 - Use `gemini-3-pro-preview` for complex reasoning, coding tasks, and maximum analysis quality (recommended default)
224 - Use `gemini-3-flash` for speed-critical tasks requiring sub-second response times
225 - Use `gemini-2.5-flash` for cost-optimized high-volume processing
2264. **Leverage Gemini 3's strengths**: 35% better at software engineering tasks, exceptional at agentic workflows and vibe coding
2275. **Break down complex tasks**: Even with large context, structured analysis is more effective
2286. **Return structured findings**: Ask Gemini for markdown or JSON that can be quoted directly in the final answer
229 
230## CLI Version
231 
232Requires Gemini CLI v0.16.0 or later for Gemini 3 model support. Check version: `gemini --version`
233 

Discussion