codebase-analysis

robbyt's avatarfrom robbyt

Deep architectural analysis using Gemini's codebase_investigator tool. Trigger when user needs architecture overview ("analyze this codebase", "map dependencies"), onboarding to unfamiliar code, understanding legacy systems, or identifying technical debt.

⭐31stars🔀0forks📁View on GitHub🕐Updated Dec 20, 2025

When & Why to Use This Skill

This Claude skill leverages Gemini's codebase_investigator tool to perform deep architectural analysis and structural mapping of complex software projects. It provides developers with automated insights into component relationships, dependency chains, and system design, making it an essential tool for maintaining code quality and understanding large-scale software ecosystems.

Use Cases

  • Rapid Developer Onboarding: Quickly familiarize new team members with unfamiliar codebases by generating comprehensive architectural overviews and component relationship maps.
  • Legacy System Auditing: Analyze complex legacy systems to identify hidden dependencies, deprecated patterns, and structural bottlenecks without manual code traversal.
  • Technical Debt Assessment: Systematically detect inconsistent conventions, missing documentation, and overly complex dependency chains to prioritize refactoring efforts.
  • Dependency Management: Map direct and transitive dependencies to identify circular references, outdated packages, and potential impacts on bundle size or security.
  • Flow Mapping and Documentation: Automatically trace specific logic flows, such as authentication or data processing, to create accurate architectural documentation.
namecodebase-analysis
descriptionDeep architectural analysis using Gemini's codebase_investigator tool. Trigger when user needs architecture overview ("analyze this codebase", "map dependencies"), onboarding to unfamiliar code, understanding legacy systems, or identifying technical debt.

Codebase Analysis via Gemini

Use Gemini's codebase_investigator tool for deep architectural analysis.

Quick Start

gemini "Use codebase_investigator to analyze this project. Do not make any changes. Respond with analysis only." --allowed-tools codebase_investigator -o text 2>&1

When to Use

  • Onboarding to unfamiliar codebases
  • Understanding legacy systems
  • Mapping component relationships
  • Finding hidden dependencies
  • Architecture documentation
  • Technical debt assessment

Examples

Full project analysis:

gemini "Use codebase_investigator to analyze this project. Report on:
- Overall architecture
- Key dependencies
- Component relationships
- Potential issues
Do not make any changes. Respond with analysis only." --allowed-tools codebase_investigator -o text

Flow mapping:

gemini "Use codebase_investigator to map the authentication flow. Identify all components involved. Do not make any changes. Respond with analysis only." --allowed-tools codebase_investigator -o text

Dependency analysis:

gemini "Use codebase_investigator to analyze dependencies:
- Direct vs transitive
- Outdated packages
- Circular dependencies
- Bundle size impact
Do not make any changes. Respond with analysis only." --allowed-tools codebase_investigator -o text

Technical debt:

gemini "Use codebase_investigator to identify technical debt:
- Deprecated patterns
- Inconsistent conventions
- Missing documentation
- Complex dependency chains
Do not make any changes. Respond with analysis only." --allowed-tools codebase_investigator -o text

Iterative Analysis

Use sessions for multi-turn investigation:

# Initial analysis
gemini "Use codebase_investigator to analyze this project. Do not make any changes. Respond with analysis only." --allowed-tools codebase_investigator -o text

# Follow-up (continues session)
echo "What patterns did you find in the auth module? Do not make any changes. Respond with analysis only." | gemini --allowed-tools codebase_investigator -r 1 -o text

# Deeper dive
echo "Are there security concerns with that pattern? Do not make any changes. Respond with analysis only." | gemini --allowed-tools codebase_investigator -r 1 -o text

Notes

  • Gemini must not make any changes, provide feedback ONLY.
  • Gemini respects .gitignore - it cannot read files matching gitignore patterns
  • Can take 5-10 minutes for large codebases
  • Requires sandbox bypass: use dangerouslyDisableSandbox: true
  • Use sessions for iterative exploration
  • See references/setup.md for troubleshooting