repo-summarizer

Branch: main Commit: 266a8980 Generated: 2026-01-10 22:42:20

Summary

▼

repo-summarizer

Overview

The repo-summarizer project is a comprehensive tool designed for summarizing code repositories, focusing on providing a streamlined and efficient process for analyzing and presenting codebase information. It addresses the need for automated code repository analysis by automating the selection of files, applying summarization techniques, and generating detailed reports. The primary purpose is to provide developers and maintainers with insights into their codebase, enabling them to understand the structure, complexity, and functionality of their projects. The project solves the problem of manual code review and analysis by automating the selection of relevant files, applying heuristic and LLM-based techniques, and generating HTML reports for easy consumption. The domain it addresses is software development, specifically the analysis and documentation of code repositories. Key capabilities include heuristic and LLM-based file selection, a map-then-reduce summarization pipeline, persistent caching for file summaries, and interactive triage processes. The main technologies used are Python, with some utility functions provided by other languages like C++. The architectural approach is monolithic, with a clear separation of concerns into different modules such as core, triage, rendering, and summarization. The target users are developers, maintainers, and analysts who need to understand and document their codebases. The major components work together to provide a cohesive and efficient solution, with the entry point being the main.py file. The src/core module contains fundamental data models and configuration, while the src/triage module handles file selection and heuristic scoring. The src/utils module provides helper functions for various utilities, and the src/rendering module generates HTML reports. The src/summarization module implements a map-then-reduce pipeline for summarization, and the src/llm module includes LLM-based model discovery and optimization. The src/cache module provides a persistent cache for file summaries, and the src/cli module defines the command-line interface for orchestrating the full pipeline.

Quick Start

Run the repository summarizer with the command python main.py repo-url

Architecture

Pattern: Monolithic

Entry Points

  • main.py: The entry point for the repository summarizer, providing the main function to run the application

Extension Points

  • location: src/utils/init.py
  • how: Extend with additional utility functions for different use cases
  • location: src/cli.py
  • how: Extend with additional command-line options or subcommands

File Reference

File Purpose
main.py
pyproject.toml
requirements.txt
src/init.py Entry point for the repository summarizer, providing the main function to run the application.
src/cli.py "This file defines the command-line interface (CLI) for the repository summarizer, including parsing arguments and orchestrating the full pipeline...
src/core/init.py Contains fundamental data models, configuration, and path management for the repository summarizer.
src/core/models.py Contains data models representing the fundamental entities used throughout the codebase.
src/core/paths.py Centralizes path configuration for repository summarizer, ensuring consistent output locations.
src/llm/init.py Contains the LLM module for repository summarizer, including model client, discovery, selection, and optimization.
src/llm/model_discovery.py This file contains functions and classes for discovering and managing local GGUF files, categorizing them by role and size, and printing...
src/llm/param_optimizer.py Automatically detects hardware capabilities and model characteristics to provide optimal parameters for inference performance.
src/rendering/init.py Contains the rendering and output generation module for the repository summarizer.
src/rendering/artifacts.py This file defines classes and functions for managing and saving artifacts related to repository summarization, including saving and loading...
src/rendering/html_report.py This file contains functions and classes for rendering an HTML report based on structured artifacts and a reusable HTML template.
src/summarization/init.py Contains the summarization module for the repository summarizer, including a map-then-reduce pipeline, LLM prompts, batched file processing, and...
src/summarization/batching.py This file implements a batched summarization mechanism for repository files, optimizing for efficient LLM calls and caching.
src/summarization/prompts.py This file contains functions and constants for generating optimized prompts for code repository summarization, adhering to specific design...
src/triage/init.py Provides heuristic-based and LLM-based file selection for repository analysis, supporting two-stage triage processes.
src/triage/scanner.py This file contains functions and classes for scanning and building file metadata schema in a repository, including language detection, file...
src/triage/schema.py Defines data models for repository file metadata, including categories, flags, and file metadata.
src/triage/triage.py This file contains functions for file triage and heuristic scoring within a repository analysis system.
src/utils/init.py Contains helper functions for various utilities such as file hashing and caching, language/extension detection, CLI formatting and output, and Git...
src/utils/cache.py This file defines a persistent cache for file summaries using SQLite, keyed by file content hash, prompt version, model identifier, and chunking...
src/utils/extensions.py Maps file extensions to languages and provides utility functions for determining file types.
src/utils/formatting.py Provides CLI formatting utilities for repository summarizer, including colored output, frames, and banners.

Repository Info

  • URL: https://github.com/sstraccialini/repo-summarizer.git
  • Languages: Python: 68.8%, HTML: 31.2%
  • Config Files: requirements.txt, pyproject.toml

Interactive Diagram

▼
Use the controls within the diagram to expand/collapse folders and export the visualization.

File Selection (25 selected)

▼

Triage method: heuristic | Total scanned: 66

Selected Files (25)

  • requirements.txt
  • pyproject.toml
  • src/cli.py
  • main.py
  • src/__init__.py
  • src/core/models.py
  • src/core/paths.py
  • src/triage/triage.py
  • src/triage/schema.py
  • src/utils/extensions.py
  • src/core/__init__.py
  • src/llm/__init__.py
  • src/rendering/__init__.py
  • src/summarization/__init__.py
  • src/triage/__init__.py
  • src/utils/__init__.py
  • src/utils/formatting.py
  • src/utils/cache.py
  • src/rendering/artifacts.py
  • src/rendering/html_report.py
  • src/summarization/prompts.py
  • src/summarization/batching.py
  • src/triage/scanner.py
  • src/llm/model_discovery.py
  • src/llm/param_optimizer.py

Optional Files (20)

  • src/rendering/visualizer.py
  • SUMMARY.md
  • README.md
  • src/llm/model_client.py
  • src/llm/model_selector.py
  • src/triage/repo_scanner.py
  • src/utils/git_utils.py
  • .repo_summarizer_cache/6fb0cc1dcd39346e/summaries.db
  • src/rendering/summary_template.html
  • src/summarization/doc_builder.py
  • src/utils/commit_analyzer.py
  • src/llm/model_catalog.py
  • src/utils/stdio.py
  • src/rendering/interactive_template.html
  • src/core/config.py
  • LICENSE
  • SUMMARY.html
  • INSTALL.md
  • src/.DS_Store
  • .gitignore

Repository Metadata

▼

File Summaries (25 files)

▼

Each file has an individual summary artifact in the cache's files/ directory for traceability.