gemini
The Gemini skill integrates Google's Gemini CLI into Claude Code for handling large-context tasks exceeding 200k tokens, such as comprehensive code reviews, architectural plan analysis, and multi-file codebase examination. Use this skill when processing entire codebases, extensive documentation sets, or complex analysis requiring Gemini's advanced reasoning capabilities, particularly with Gemini 3 Pro for superior software engineering performance.
git clone --depth 1 https://github.com/davila7/claude-code-templates /tmp/gemini && cp -r /tmp/gemini/cli-tool/components/skills/ai-research/gemini ~/.claude/skills/geminiSKILL.md
# 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:** ```bash # 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: ```bash # 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: ```bash 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." ### 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, $2-4/M input | | `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 | Best price ($0.15/M), 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) ```bash # 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 Revie
Use this agent when creating specialized Claude Code agents for the claude-code-templates components system. Specializes in agent design, prompt engineering, domain expertise modeling, and agent best practices. Examples: <example>Context: User wants to create a new specialized agent. user: 'I need to create an agent that specializes in React performance optimization' assistant: 'I'll use the agent-expert agent to create a comprehensive React performance agent with proper domain expertise and practical examples' <commentary>Since the user needs to create a specialized agent, use the agent-expert agent for proper agent structure and implementation.</commentary></example> <example>Context: User needs help with agent prompt design. user: 'How do I create an agent that can handle both frontend and backend security?' assistant: 'Let me use the agent-expert agent to design a full-stack security agent with proper domain boundaries and expertise areas' <commentary>The user needs agent development help, so use the agent-expert agent.</commentary></example>
Use this agent to create blog articles for aitmpl.com from Claude Code Templates components. Reads the component, asks the user to confirm details, generates SVG cover, HTML article, and updates blog-articles.json. Examples: <example>Context: User wants a blog for a component. user: 'Create a blog article for cli-tool/components/hooks/security/secret-scanner.json' assistant: 'I'll use the blog-writer agent to create the full blog article with cover image and proper structure' <commentary>The user wants a blog article from a component, use blog-writer for the full pipeline.</commentary></example>
Runs pre-deploy build checks on the dashboard. Validates Astro build, checks for common esbuild/JSX issues, verifies API endpoints compile, and reports errors with fixes. Use before merging PRs that touch dashboard/.
Regenerates the component catalog (docs/components.json) by running the Python script. Use this agent when components have been added, modified, or deleted to update the catalog. Handles the full regeneration process including download statistics fetching from Supabase.
CLI interface design specialist. Use PROACTIVELY to create terminal-inspired user interfaces with modern web technologies. Expert in CLI aesthetics, terminal themes, and command-line UX patterns.
Use this agent when creating CLI commands for the claude-code-templates components system. Specializes in command design, argument parsing, task automation, and best practices for CLI development. Examples: <example>Context: User wants to create a new CLI command. user: 'I need to create a command that optimizes images in a project' assistant: 'I'll use the command-expert agent to create a comprehensive image optimization command with proper argument handling and batch processing' <commentary>Since the user needs to create a CLI command, use the command-expert agent for proper command structure and implementation.</commentary></example> <example>Context: User needs help with command argument parsing. user: 'How do I create a command that accepts multiple file patterns?' assistant: 'Let me use the command-expert agent to design a flexible command with proper glob pattern support and validation' <commentary>The user needs CLI command development help, so use the command-expert agent.</commentary></example>
Applies researched improvements to Claude Code components, validates changes with the component-reviewer agent, and creates pull requests. The only agent that modifies files and creates PRs.
Migrates components (agents, commands, skills, hooks, settings, MCPs) from external GitHub repositories to claude-code-templates, validates them with component-reviewer, and regenerates the catalog