| name | gemini-assistant |
| description | Coordinate between Claude and Gemini for complex tasks. Gemini excels at ingesting large codebases (100KB+), finding patterns across many files, and verification queries. Use when context would overflow Claude, for codebase-wide analysis, or implementation verification. Invoke via 'gemini -p' CLI with @ syntax for file inclusion. Always critically review Gemini's output. Falls back to Claude if Gemini is unavailable. |
Skill: Gemini Assistant
Purpose
Delegate large-context analysis tasks to Gemini CLI when Claude's context window is insufficient or when you need rapid pattern-matching across entire codebases.
When to Use This Skill
Use Gemini when:
- Analyzing entire codebases or large directories (100KB+ of files)
- Comparing multiple large files simultaneously
- Need to understand project-wide patterns or architecture
- Verifying if specific features, patterns, or security measures exist
- Checking for coding patterns across the entire codebase
- Current context would overflow with the required files
When NOT to Use
- Small, focused tasks that fit in current context
- Tasks requiring execution, code changes, or file modifications
- When you need precise, step-by-step reasoning
- For tasks where accuracy is more important than breadth
Fallback Protocol
If Gemini is unavailable (rate limits, errors, not installed), fall back to Claude:
-
Check for Gemini errors:
- "API rate limit exceeded" → Wait or fall back
- "command not found: gemini" → Gemini CLI not installed
- Connection errors → Network issue, fall back
- Empty or garbled response → Retry once, then fall back
-
Claude fallback strategy:
- Break the task into smaller chunks that fit Claude's context
- Use targeted file reads instead of directory-wide analysis
- Prioritize most critical files first
- Use grep/glob to narrow scope before reading
-
Inform the user:
- Explain Gemini is unavailable
- Describe the adapted approach
- Note any limitations of the fallback
See workflows/fallback-to-claude.md for detailed fallback procedures.
Routing Logic
Analyze user intent and route to appropriate workflow:
Codebase Analysis → workflows/analyze-codebase.md
- "Summarize the architecture"
- "What does this codebase do?"
- "Give me an overview of the project"
- "Analyze the project structure"
Implementation Verification → workflows/verify-implementation.md
- "Has [feature] been implemented?"
- "Is [pattern] used in the codebase?"
- "Check if [security measure] exists"
- "Verify [functionality] is present"
Pattern Search → workflows/search-patterns.md
- "Find all [pattern] in the code"
- "Search for [usage] across files"
- "Locate [specific code pattern]"
- "List all [type of code]"
File Comparison → workflows/compare-files.md
- "Compare [file1] and [file2]"
- "What's the difference between these implementations?"
- "Analyze dependencies between files"
Dependency Audit → workflows/audit-dependencies.md
- "Find unused dependencies"
- "Which packages aren't being used?"
- "Audit the package.json"
Duplication Detection → workflows/detect-duplication.md
- "Find duplicated code"
- "What code is copy-pasted?"
- "Find repeated patterns to refactor"
Documentation Drafts → workflows/draft-documentation.md
- "Generate API documentation"
- "Write an architecture doc"
- "Create onboarding guide"
Migration Analysis → workflows/migration-analysis.md
- "What breaks if we upgrade [library]?"
- "Impact of migrating to [framework]?"
- "Analyze migration from X to Y"
CLI Syntax Reference
Basic invocation:
gemini -p "Your prompt here"
File/directory inclusion with @ syntax (paths relative to CWD):
gemini -p "@src/main.py Explain this file"
gemini -p "@package.json @src/index.js Analyze dependencies"
gemini -p "@src/ Summarize the architecture"
gemini -p "@src/ @tests/ Analyze test coverage"
gemini -p "@./ Give me an overview"
gemini --all_files -p "Analyze project structure"
Context Files
context/gemini-capabilities.md - What Gemini excels at and limitations
context/cli-reference.md - Complete CLI syntax and options
Issue Tracking
Log problems encountered with Gemini in ISSUES.md to improve this skill over time. Include:
- The command that failed
- What went wrong (accuracy, timeout, rate limit, etc.)
- How it was resolved
- Suggestions for improvement
Critical Notes
- Always review Gemini's output - It's good at breadth, Claude is better at precision
- Paths are relative - The @ syntax uses paths relative to where gemini command runs
- Read-only tool - Gemini CLI is for analysis, not execution or modification
- Claude orchestrates - Results come back to Claude for final processing and action
- Fallback ready - If Gemini fails, Claude can handle the task with adapted strategy