gemini-consult
# Gemini Consult: Large Codebase Analysis Assistant
What this skill does
# Gemini Consult: Large Codebase Analysis Assistant
Intelligent consultation orchestrator that leverages Google Gemini's CLI for analyzing codebases exceeding typical context limitations.
## Core Purpose
Bridge the gap between context-constrained AI assistants and comprehensive codebase understanding by orchestrating strategic use of Google Gemini's expanded context window.
**Problem it solves:**
- Claude Code's context limits prevent full codebase analysis
- Large file comparisons exceed token budgets
- Project-wide pattern detection requires more context than available
- Architectural decisions need holistic codebase visibility
**Solution approach:**
- Intelligently route appropriate queries to Gemini CLI
- Construct optimal @ syntax queries for maximum insight
- Synthesize Gemini's analysis back into Claude Code workflow
- Preserve session efficiency by avoiding unnecessary context consumption
## When to Use Gemini Consult
**Trigger Conditions (Auto-recommend):**
The skill should activate when:
- User asks about "entire codebase", "whole project", "all files"
- Analysis scope > 5 files or > 100KB combined content
- Comparative analysis needed across distant modules
- Architecture or pattern questions requiring project-wide view
- Security audit or compliance verification across codebase
- Feature implementation verification in large projects
**User Explicit Triggers:**
- "Use Gemini to analyze..."
- "Consult Gemini about..."
- "@gemini check if..."
**When NOT to use:**
- Single file analysis (< 50KB) → Use Claude Code Read tool
- Already have sufficient context loaded
- Real-time debugging or rapid iteration
- Questions answerable from loaded files
## The 3-Phase Consultation Workflow
### Phase 1: Query Assessment & Planning
**Objective:** Determine if Gemini consultation is appropriate and construct optimal query strategy.
**Assessment Checklist:**
```javascript
assessment = {
scope_size: estimate_file_count_and_size(),
analysis_type: identify_analysis_category(),
context_available: check_current_session_context(),
query_complexity: evaluate_question_depth()
}
recommendation = {
use_gemini: scope_size > threshold || analysis_type in ['architecture', 'security_audit', 'cross_project'],
query_strategy: construct_query_plan(),
expected_value: estimate_insight_gain()
}
```
**User Interaction:**
Present recommendation clearly:
"This analysis requires examining **[N files / X MB]** across **[scope]**. I recommend using Gemini CLI because [reason].
I'll construct a query that:
- Includes: [file patterns]
- Focuses on: [specific analysis aspects]
- Returns: [expected insights]
Proceed with Gemini consultation? [Yes / Adjust scope / Use Claude Code only]"
**Query Construction Strategy:**
Based on analysis type, determine optimal @ syntax pattern:
1. **Full Project Analysis:**
```bash
gemini --all_files -p "Analyze complete project architecture"
```
2. **Directory-Scoped Analysis:**
```bash
gemini -p "@src/ @tests/ Compare implementation vs test coverage"
```
3. **Multi-File Comparison:**
```bash
gemini -p "@src/auth/login.js @src/auth/register.js @src/middleware/auth.js Analyze authentication flow consistency"
```
4. **Targeted Pattern Search:**
```bash
gemini -p "@src/**/*.js Find all error handling patterns and identify inconsistencies"
```
### Phase 2: Query Execution & Monitoring
**Objective:** Execute Gemini CLI query and capture comprehensive output.
**Execution Protocol:**
1. **Construct Command:**
```bash
gemini_command = build_query(
scope: assessment.scope,
prompt: refined_user_question,
flags: determine_flags()
)
```
2. **Execute with Monitoring:**
```bash
# Execute via Bash tool
result = bash_execute(gemini_command, timeout=120)
# Monitor for:
# - CLI availability (is gemini installed?)
# - Authentication status (logged in?)
# - Rate limiting (hit quota?)
# - Error messages
```
3. **Capture Output:**
- Full response text
- Any warnings or errors
- File inclusion confirmations
- Token usage statistics (if available)
**Error Handling:**
```javascript
if (error.type === 'CLI_NOT_FOUND') {
return {
status: 'blocked',
message: "Gemini CLI not installed. Install: npm install -g @google/generative-ai",
fallback: "Use Claude Code tools for subset analysis?"
}
}
if (error.type === 'AUTH_REQUIRED') {
return {
status: 'blocked',
message: "Gemini CLI requires authentication. Run: gemini auth login",
fallback: null
}
}
if (error.type === 'RATE_LIMIT') {
return {
status: 'retry',
message: "Gemini API rate limit reached. Retry in [time] or reduce scope?",
fallback: "Split analysis into smaller chunks?"
}
}
if (error.type === 'CONTEXT_OVERFLOW') {
return {
status: 'adjust',
message: "Even Gemini's context exceeded. Analysis scope too large.",
strategy: "Split into multiple focused queries with specific file patterns"
}
}
```
### Phase 3: Synthesis & Integration
**Objective:** Transform Gemini's output into actionable insights for Claude Code workflow.
**Synthesis Process:**
1. **Parse Gemini Response:**
- Extract key findings
- Identify file-specific insights (with line references)
- Categorize recommendations
- Note confidence levels or uncertainties
2. **Contextualize for Current Session:**
```markdown
## Gemini Consultation Results
**Query:** [original question]
**Scope:** [files/directories analyzed]
**Key Findings:**
1. [Finding with file:line references]
2. [Finding with architectural implications]
3. [Finding with security considerations]
**Recommendations:**
- [Actionable item 1]
- [Actionable item 2]
**Follow-up Actions:**
- [ ] Review identified files in Claude Code
- [ ] Implement suggested changes
- [ ] Verify with local testing
```
3. **Store in Cipher (Memory):**
```
cipher_store("Gemini Consultation - [Topic]
Analysis Type: [architecture/security/feature/pattern]
Scope: [file patterns]
Date: [timestamp]
Key Insights:
- [Insight 1 with file references]
- [Insight 2 with implications]
Recommended Actions:
- [Action 1]
- [Action 2]
Query Pattern Used:
```bash
[gemini command]
```
Results archived for future reference.")
```
4. **Present to User:**
Clear, structured output:
"✅ Gemini Analysis Complete
**Analyzed:** [N files across M directories]
**Critical Findings:**
1. **[Category]:** [Finding]
- Files: `src/file1.js:45`, `src/file2.js:89`
- Impact: [High/Medium/Low]
- Action: [Specific recommendation]
2. **[Category]:** [Finding]
...
**Next Steps:**
I've stored these insights in Cipher for future reference. Would you like me to:
A) Deep dive into specific finding [#1, #2, etc.]
B) Implement recommended changes
C) Run focused analysis on subset
D) Continue with different question"
## Analysis Type Patterns
### Architecture Analysis
**Trigger Patterns:**
- "How is [system] architected?"
- "What's the overall structure?"
- "Explain the codebase organization"
**Query Construction:**
```bash
gemini --all_files -p "Analyze the complete architecture:
1. Identify main components and their responsibilities
2. Map data flow between modules
3. Describe architectural patterns used
4. Note any architectural inconsistencies
5. Highlight coupling and dependency issues"
```
**Synthesis Focus:**
- Component diagram (textual representation)
- Dependency graph insights
- Pattern identification
- Architectural recommendations
### Security Audit
**Trigger Patterns:**
- "Security vulnerabilities?"
- "Check for [security issue]"
- "Audit authentication/authorization"
**Query Construction:**
```bash
gemini -p "@src/ @lib/ Perform security audit:
1. Identify potential SQL injection points
2. Check for XSS vulnerabilities
3. Verify authentication implemenRelated 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.