Agent skill

gemini-codebase-analysis

Stars 0
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/hiapplyco/claude-skills/tree/main/skills/gemini-codebase-analysis

SKILL.md

Gemini Codebase Analysis Skill

Analyze entire codebases using Gemini 2.5 Pro's massive context window (1M+ tokens). This skill collects repository files, sends them to Gemini for analysis, and returns comprehensive technical insights.

Prerequisites

  1. API Key: Set your Gemini API key:

    bash
    export GEMINI_API_KEY="your-api-key"
    
  2. Python SDK: Install the Google GenAI SDK:

    bash
    pip install google-genai
    

Usage

Basic Analysis with Custom Query

bash
python /Users/jms/.claude/skills/gemini-codebase-analysis/gemini_codebase_analyzer.py /path/to/repo "Your question about the codebase"

Using Analysis Templates

Available templates:

  • architecture - Full architectural analysis
  • security - Security vulnerability assessment
  • performance - Performance analysis
  • quality - Code quality assessment
  • dependencies - Dependency analysis
  • onboarding - Developer onboarding guide
bash
# Architecture analysis
python /Users/jms/.claude/skills/gemini-codebase-analysis/gemini_codebase_analyzer.py /path/to/repo --template architecture

# Security audit
python /Users/jms/.claude/skills/gemini-codebase-analysis/gemini_codebase_analyzer.py /path/to/repo --template security

Save Output to File

bash
python /Users/jms/.claude/skills/gemini-codebase-analysis/gemini_codebase_analyzer.py /path/to/repo --template architecture -o analysis.md

JSON Output (for programmatic use)

bash
python /Users/jms/.claude/skills/gemini-codebase-analysis/gemini_codebase_analyzer.py /path/to/repo "question" --json

Options

Option Description
repo_path Path to the repository to analyze (required)
query Analysis question (required if no template)
--template, -t Use predefined analysis template
--output, -o Save output to file
--model, -m Gemini model (default: gemini-2.5-pro)
--max-size Max context size in MB (default: 50)
--context, -c Additional context to include
--json Output as JSON

What Gets Analyzed

The analyzer collects:

  • Source code files (.py, .js, .ts, .java, .go, .rs, etc.)
  • Config files (.json, .yaml, .toml, etc.)
  • Documentation (.md, .rst, .txt)
  • Build/DevOps files (Dockerfile, Makefile, etc.)

Automatically excluded:

  • .git, node_modules, vendor, venv
  • Binary files, images, videos
  • Lock files, build outputs
  • Files > 500KB, total context > 50MB

Example Queries

Architecture

  • "How is the application structured?"
  • "What design patterns are used?"
  • "How does data flow through the system?"

Security

  • "Are there any security vulnerabilities?"
  • "How is authentication implemented?"
  • "Are secrets properly managed?"

Performance

  • "Where are the potential bottlenecks?"
  • "Are there any N+1 query issues?"
  • "How is caching implemented?"

Understanding

  • "How does the [X] feature work?"
  • "What happens when a user [action]?"
  • "How are [X] and [Y] connected?"

Integration with Claude Code

After running the analyzer, the output can be:

  1. Printed directly for immediate review
  2. Saved to a file for reference
  3. Output as JSON for further processing

The analysis results are designed to be consumed by Claude Code for:

  • Answering follow-up questions
  • Generating implementation plans
  • Identifying specific code changes needed

Expand your agent's capabilities with these related and highly-rated skills.

hiapplyco/claude-skills

gemini-deep-research

Build Gemini Deep Research agents using the Interactions API. Use when creating autonomous research agents, implementing multi-step information gathering, building research report generators, or integrating Gemini's Deep Research capabilities into applications. Handles polling, streaming, file integration, and report synthesis.

0 0
Explore
hiapplyco/claude-skills

gemini-vision

Generate images and videos using Gemini CLI's vision extension. Use for image generation with Nano Banana (gemini-2.5-flash-image), video generation with Veo 3, webcam capture, and image-to-image transformations. Invokes Gemini CLI commands and returns file paths.

0 0
Explore
mattpocock/skills

obsidian-vault

Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.

111,310 9,758
Explore
mattpocock/skills

edit-article

Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.

111,310 9,758
Explore
mattpocock/skills

handoff

Compact the current conversation into a handoff document for another agent to pick up.

111,310 9,758
Explore
mattpocock/skills

setup-pre-commit

Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.

111,310 9,758
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results