agentleFS
hiapplycohiapplyco/claude-skills/skills/gemini-codebase-analysis/SKILL.md

gemini-codebase-analysis

Skill0 starsChanged 11 months agoMITView on GitHub

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. Available templates: - architecture - Full architectural analysis - security - Security vulnerability assessment - performance - Performance analysis - quality - Code quality assessment - dependencies - Dependency analysis - onboarding - Developer onboarding guide The analyzer collects: - Source code files (.py, .js, .ts, .java, .go, .rs, etc.) - Config…

  • Reads credentials
  • Installs packages

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After running the analyzer, the output can be:

    line 106

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
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:
    export GEMINI_API_KEY="your-api-key"
  2. Python SDK: Install the Google GenAI SDK:
    pip install google-genai

Usage

Basic Analysis with Custom Query

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
# 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

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)

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

Options

OptionDescription
repo_pathPath to the repository to analyze (required)
queryAnalysis question (required if no template)
--template, -tUse predefined analysis template
--output, -oSave output to file
--model, -mGemini model (default: gemini-2.5-pro)
--max-sizeMax context size in MB (default: 50)
--context, -cAdditional context to include
--jsonOutput 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

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.