by softaworks
大型代码库和复杂分析任务超出了许多 AI 模型的上下文限制。此技能使 Claude Code 能够利用 Google Gemini CLI 进行全面的代码审查、架构分析,以及处理高达 100 万令牌的上下文。
1. 打开 Claude 聊天界面
2. 点击下方 "📋 复制" 按钮
3. 粘贴到 Claude 聊天框中并发送
4. 输入 "使用 gemini 技能" 开始使用
=== gemini 技能 === 作者: softaworks 描述: 大型代码库和复杂分析任务超出了许多 AI 模型的上下文限制。此技能使 Claude Code 能够利用 Google Gemini CLI 进行全面的代码审查、架构分析,以及处理高达 100 万令牌的上下文。 使用方法: 1. 调用技能: "使用 gemini 技能" 2. 提供相关信息: 根据技能要求提供必要参数 3. 查看结果: 技能会返回处理结果 示例: "使用 gemini 技能,帮我分析一下这段代码"
这种方法适用于所有 Claude 用户,不需要安装额外工具。
productivity
low
Harness the power of Google's Gemini 3 Pro for comprehensive code analysis, plan reviews, and big context processing. This skill enables Claude Code to leverage Gemini CLI for tasks requiring massive context windows (>200k tokens) and state-of-the-art reasoning capabilities.
The Gemini skill provides access to Google's flagship Gemini 3 Pro model through the Gemini CLI, offering:
Use the Gemini skill when:
Activation Keywords: "use Gemini", "run Gemini", "Gemini review", "analyze with Gemini", "big context", ">200k tokens"
The skill acts as an intelligent wrapper around the Gemini CLI, providing:
User Request → Model Selection → Approval Mode → Command Assembly → Execution → Results
The skill handles all complexity around:
| Model | Best For | Performance |
|---|---|---|
gemini-3-pro-preview ⭐ | Complex reasoning, coding, agentic tasks | 76.2% SWE-bench, flagship quality |
gemini-3-flash | Sub-second latency, speed-critical tasks | Distilled from 3 Pro, TPU-optimized |
gemini-2.5-pro | Legacy all-around performance | Mature stability |
gemini-2.5-flash | Cost-efficient, high-volume tasks | $0.15/M tokens |
gemini-2.5-flash-lite | Fastest processing | Maximum speed |
default: Prompts for approval (interactive terminal only)auto_edit: Auto-approves edit tools only (code reviews with suggestions)yolo: Auto-approves all tools (required for background/automated tasks)The skill automatically protects against hung processes by:
--approval-mode yolo for non-interactive shellsgemini -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"
Use Case: Automated code review in CI/CD or Claude Code background tasks
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"
Use Case: Analyzing technical specifications and system designs
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"
Use Case: Understanding large codebases or legacy systems
gemini -m gemini-3-pro-preview --approval-mode default \
"Review the authentication flow for security issues"
Use Case: Interactive sessions where user can approve/reject suggestions in real-time
gemini -m gemini-3-flash --approval-mode yolo \
"Quick security scan for common vulnerabilities"
Use Case: Fast analysis with sub-second latency requirements
gemini -m gemini-3-pro-preview --approval-mode yolo \
--include-directories /path/to/backend \
--include-directories /path/to/frontend \
"Analyze the full-stack application architecture"
Use Case: Projects spanning multiple directories or repositories
| Flag | Description | Example |
|---|---|---|
-m, --model | Select Gemini model | -m gemini-3-pro-preview |
--approval-mode | Control tool approval | --approval-mode yolo |
-y, --yolo | Shorthand for auto-approve | -y |
-i, --prompt-interactive | Execute prompt and continue | -i "Review auth system" |
--include-directories | Add directories to workspace | --include-directories /path |
-s, --sandbox | Run in sandbox mode | -s |
| Mode | Interactive | Background | Auto-edits | Use When |
|---|---|---|---|---|
default | ✅ | ❌ | ❌ | Interactive terminal with manual approval |
auto_edit | ✅ | ⚠️ | ✅ | Code reviews with automatic edit suggestions |
yolo | ✅ | ✅ | ✅ | Background/automated tasks (required) |
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.
✅ DO THIS:
# Use yolo for fully automated execution
gemini -m gemini-3-pro-preview --approval-mode yolo "Review codebase"
# Or wrap with timeout for safety
timeout 300 gemini -m gemini-3-pro-preview --approval-mode yolo "Review codebase"
❌ NEVER DO THIS:
# Will hang indefinitely in background
gemini -m gemini-3-pro-preview --approval-mode default "Review codebase"
# Check if hung
ps aux | grep gemini | grep -v grep
# Kill if necessary
pkill -9 -f "gemini.*gemini-3-pro-preview"
gemini-3-pro-preview: Best quality, 35% better at software engineeringgemini-3-flash: When speed is critical (sub-second latency)gemini-2.5-flash: For cost-optimized high-volume processing ($0.15/M tokens)Be specific and structured:
gemini -m gemini-3-pro-preview --approval-mode yolo \
"Analyze the authentication system for:
1. OWASP Top 10 vulnerabilities
2. JWT token handling security
3. Session management best practices
4. Rate limiting implementation
5. Password hashing strength"
--include-directories to explicitly specify relevant paths--approval-mode yolo for background taskstimeout 300 gemini ...ps aux | grep geminiThe skill handles common errors:
Detection:
ps aux | grep -E "gemini.*gemini-3" | grep -v grep
# Look for: 20+ min runtime, 0% CPU, state 'S'
Resolution:
pkill -9 -f "gemini.*gemini-3-pro-preview"
Prevention: Always use --approval-mode yolo for background tasks
Check if process is waiting for approval:
ps -o pid,etime,pcpu,stat,command -p <PID>
If stat is 'S' and CPU is 0%, kill and restart with --approval-mode yolo
For very large codebases:
gemini-3-flash instead of Pro--include-directories to limit scopegemini --versiongemini-3-pro-preview for best qualityyolo in non-interactive contextsGemini 3 Pro advantages:
The skill seamlessly integrates with Claude Code workflows:
After completion, users can:
gemini-3-deep-think: Ultra-complex reasoning with enhanced thinking capabilitiesKnowledge Cutoff: Gemini 3 models have knowledge through January 2025 Skill Version: Compatible with Gemini CLI v0.16.0+
View Count
0
Download Count
0
Favorite Count
0
Quality Score
68