Project case study Personal project

AI Repo Analyzer.

AI Repo Analyzer is a high-performance command-line tool written in Rust that automates architectural discovery for complex, unfamiliar codebases. By synthesizing local Git repository history, recursive syntax tree inspections, language distributions, and security policies with Google Gemini AI models via the Rig framework, the tool translates millions of lines of code into structured technical reports and architectural context.

Role
Tools & AI Systems Engineer
Domain
Developer tooling · Static analysis · AST & Git intelligence · Automated technical reporting

System at a glance

What the system does

01

Deep Git commit & contributor forensics

02

Multi-language code metrics & complexity

03

Framework & project type detection

04

Rig-powered automated technical reporting

Architecture flow

From intent to verified state.

  1. 01

    The CLI parses GitHub URLs, validates auth tokens, and queries the GitHub REST API for high-level repository metadata.

  2. 02

    The local Git subsystem clones or updates the repository via git2 to analyze branch topologies and commit histories.

  3. 03

    Specialized analyzer modules parse file trees, count lines of code, classify tech stacks, and audit security configurations.

  4. 04

    The AI integration layer structures extracted metrics into concise prompts passed to Google Gemini via the Rig framework.

  5. 05

    The analyzer formats combined static and AI insights into terminal summaries and exports structured JSON or YAML reports.

01 / Static code analysis

Multi-dimensional code metrics and structure parsing

Extracting ground-truth architectural indicators directly from project file systems.

01.1

Recursive filesystem traversal

Leverages walkdir to stream file structures, filtering ignore patterns and analyzing size distributions across large codebases.

01.2

Language and metric extraction

Accurately computes lines of code (LOC), file counts, and language percentages across multi-language enterprise repositories.

01.3

Project type & stack identification

Inspects package manifests (package.json, Cargo.toml, requirements.txt) to classify project types (CLI, web app, library, backend).

02 / Git forensics

Commit velocity, churn, and contributor dynamics

Deriving development health and maintenance patterns from local commit graphs.

02.1

Local git2 engine

Directly traverses commit graphs, merge bases, and diffs to evaluate code churn and development velocity without external tool dependencies.

02.2

Contributor collaboration models

Identifies top contributors, commit cadences, and collaboration hotspots over the repository's lifetime.

02.3

Release & issue telemetry

Pulls and correlates GitHub releases, tags, open issues, and pull request activity to assess overall project maturity and health.

03 / AI reasoning

Rig agent framework and Gemini model orchestration

Grounding large language model generation in verified codebase metrics.

03.1

Rig framework integration

Implements typed agent workflows using Rust's rig-core to orchestrate interactions with Google Gemini generative models.

03.2

Grounded architectural synthesis

Injects verified code metrics, configuration facts, and dependency graphs into model prompts to prevent hallucinations.

03.3

Automated technical documentation

Generates comprehensive technical overviews covering system architecture, key modules, and technical debt risk factors.

04 / Data export & I/O

Structured data pipeline and CLI ergonomic design

Engineering for scriptability, CI/CD pipelines, and high-volume analysis.

04.1

Concurrent asynchronous pipeline

Leverages Tokio for non-blocking GitHub API queries while offloading compute-heavy Git operations to worker threads.

04.2

Flexible structured export

Supports both human-readable terminal output and machine-consumable JSON/YAML schemas via Serde for integration into CI/CD pipelines.

04.3

Resilient rate-limit handling

Implements exponential backoff and authenticated token support to navigate GitHub REST API rate limits reliably.

Continue exploring

More systems, protocols, and practical tools.