AI-Driven Git Repository Analysis and Narrative Generation.
Project description
๐ Git AI Reporter (DevSummary AI)
Transform your Git history into intelligent, audience-aware documentation using AI
Features โข Quick Start โข Documentation โข Contributing โข Roadmap
๐ Overview
Git AI Reporter (DevSummary AI) is an AI-driven command-line tool that analyzes Git repository history and automatically generates high-quality development documentation. Using Google's Gemini models and a sophisticated three-tier AI architecture, it transforms raw commit data into polished, audience-specific narratives.
What It Does
Git AI Reporter solves the critical challenge of development visibility by automatically generating:
- ๐ฐ
NEWS.md: Narrative, stakeholder-friendly development summaries - ๐
CHANGELOG.txt: Structured, Keep a Changelog compliant change lists with emoji categorization - ๐
DAILY_UPDATES.md: Daily development activity summaries
Instead of manually crafting release notes or dumping raw git logs, Git AI Reporter intelligently analyzes your commits, identifies patterns, and creates professional documentation that serves both technical and non-technical audiences.
โจ Features
๐ฏ Core Capabilities
- Multi-Lens Analysis: Analyzes commits at three granularities (individual, daily, weekly)
- Intelligent Filtering: Automatically identifies and excludes trivial commits
- Context-Aware Summaries: Groups related changes and identifies development themes
- Emoji Categorization: Visual indicators for different change types (โจ Features, ๐ Fixes, etc.)
- Configurable Models: Three-tier AI architecture optimizing for speed, cost, and quality
๐๏ธ Architecture Highlights
- Clean Architecture: Strict separation of domain, application, and infrastructure layers
- Robust JSON Handling: "Airlock" pattern for handling imperfect LLM outputs
- Smart Caching: Minimize API costs with intelligent response caching
- Type-Safe: 100% type annotated with strict mypy checking
- Test Coverage: Comprehensive test coverage with deterministic testing
๐ Quick Start
Prerequisites
- Python 3.12 or higher
- Git installed and accessible
- Google Gemini API key
Installation
From PyPI (Recommended)
# Install from PyPI
pip install git-ai-reporter
# Or using uv
uv pip install git-ai-reporter
From Source
Using uv
# Clone the repository
git clone https://github.com/paudley/git-ai-reporter.git
cd git-ai-reporter
# Create virtual environment and install
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -e .
Using pip
# Clone and install
git clone https://github.com/paudley/git-ai-reporter.git
cd git-ai-reporter
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install in development mode
pip install -e .
Configuration
- Set up your API key:
# Copy the example environment file
cp .env.example .env
# Edit .env and add your Gemini API key
echo 'GEMINI_API_KEY="your-api-key-here"' >> .env
- Get a Gemini API Key:
- Visit Google AI Studio
- Create a new API key
- Add it to your
.envfile
Basic Usage
# Analyze the last 4 weeks of the current repository
git-ai-reporter
# Analyze a specific repository for 2 weeks
git-ai-reporter --repo-path /path/to/repo --weeks 2
# Analyze a specific date range
git-ai-reporter --start-date "2024-01-01" --end-date "2024-01-31"
# Debug mode with verbose output
git-ai-reporter --debug
# Skip cache and re-analyze everything
git-ai-reporter --no-cache
๐ง How It Works
Three-Tier AI Architecture
Git AI Reporter employs a sophisticated multi-tier AI system that balances performance, cost, and quality:
graph LR
A[Git Repository] --> B[Git Analysis Engine]
B --> C[Tier 1: Analyzer<br/>gemini-2.5-flash]
C --> D[Tier 2: Synthesizer<br/>gemini-2.5-pro]
D --> E[Tier 3: Narrator<br/>gemini-2.5-pro]
E --> F[NEWS.md & CHANGELOG.txt]
-
Tier 1 - Analyzer (gemini-2.5-flash)
- High-volume, fast analysis of individual commits
- Generates concise summaries and categorizations
- Optimized for speed and cost-efficiency
-
Tier 2 - Synthesizer (gemini-2.5-pro)
- Identifies patterns across multiple commits
- Groups related changes and finds themes
- Creates daily and weekly consolidations
-
Tier 3 - Narrator/Changelogger (gemini-2.5-pro)
- Generates polished, audience-specific content
- Adopts different "personas" for different outputs
- Ensures format compliance and narrative quality
Multi-Lens Analysis Strategy
The system analyzes your repository through three complementary lenses:
- ๐ Micro View: Individual commit analysis with intelligent filtering
- ๐ Mezzo View: Daily consolidation showing net changes per 24-hour period
- ๐ Macro View: Weekly overview providing complete context for narratives
Intelligent Commit Filtering
Automatically excludes trivial commits based on:
- Conventional commit prefixes (
chore:,docs:,style:) - File path patterns (documentation, configuration files)
- Change size and complexity thresholds
๐ Project Structure
git-ai-reporter/
โโโ src/git_ai_reporter/
โ โโโ analysis/ # Git repository analysis engine
โ โ โโโ git_analyzer.py # Multi-lens commit analysis
โ โโโ cache/ # Intelligent caching layer
โ โโโ orchestration/ # Pipeline coordination
โ โโโ services/ # External service integrations
โ โ โโโ gemini.py # Three-tier AI processing
โ โโโ summaries/ # Summary generation logic
โ โโโ utils/ # Robust JSON handling & utilities
โ โโโ writing/ # Artifact generation
โโโ tests/ # Comprehensive test suite
โ โโโ cassettes/ # VCR recordings for deterministic testing
โ โโโ snapshots/ # Output validation snapshots
โ โโโ fixtures/ # Static test data
โโโ docs/ # Additional documentation
๐งช Development
Setting Up Development Environment
# Install development dependencies
uv pip install -e .[dev]
# Run the full test suite
pytest
# Run with coverage report
pytest --cov=src/git_ai_reporter --cov-report=html
# Type checking
mypy src/
# Linting and formatting
ruff check .
ruff format .
Testing Philosophy
Git AI Reporter employs a sophisticated testing strategy:
- Deterministic Testing: Using pytest-recording for API mocking
- Snapshot Testing: Validating output consistency
- Property-Based Testing: Using Hypothesis for edge cases
- Parallel Execution: Tests run concurrently for speed
- Comprehensive Test Coverage: Extensive test coverage for core functionality
Updating Tests
Re-recording API Mocks
# Delete the old cassette
rm tests/cassettes/test_name.yaml
# Re-run to record new interaction
pytest tests/test_file.py::test_name
Updating Snapshots
# Update snapshots after intentional changes
pytest --snapshot-update
๐ Performance
| Metric | Current | Target | Status |
|---|---|---|---|
| Core Test Coverage | Comprehensive | Comprehensive | โ |
| Type Coverage | Complete | Complete | โ |
| API Response Time | ~2s/commit | <500ms | ๐ก |
| Cache Hit Rate | 70% | >80% | ๐ก |
| Memory Usage | <500MB | <200MB | ๐ก |
๐ฃ๏ธ Roadmap
See PENDING.md for the detailed enhancement roadmap. Key priorities:
Phase 1 (Immediate)
- โก Async/await migration for 3-4x performance improvement
- ๐ Incremental processing for 90% faster regular updates
- โ Achieved comprehensive core functionality test coverage
Phase 2 (Short-term)
- ๐ฆ Batch API processing for 70% cost reduction
- ๐ง Smart caching with 80%+ hit rate
- ๐จ Rich CLI with progress bars and syntax highlighting
Phase 3 (Medium-term)
- ๐ Plugin architecture for extensibility
- ๐ Multi-repository analysis support
- ๐ Context-aware summarization
๐ค Contributing
We welcome contributions! Please see our Contributing Guide for details.
Quick Contribution Guide
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
pytest) - Commit with conventional commits (
feat: add amazing feature) - Push and create a Pull Request
Development Standards
- Code Style: Ruff formatted with 88-character lines
- Type Hints: Required for all functions
- Docstrings: Google-style for all public APIs
- Testing: New features require tests
- Documentation: Update relevant docs
๐ Documentation
- Coding Guidelines - Development standards and practices
- Testing Guidelines - Comprehensive testing approach
- CLAUDE.md - AI assistant configuration and project context
- Contributing Guide - How to contribute to the project
๐ Security
- API keys are never logged or cached
- All external data is validated
- Robust error handling prevents information leakage
- See SECURITY.md for reporting vulnerabilities
๐ License
This project is licensed under the MIT License (SPDX: MIT) - see the LICENSE file for details.
All source code files include SPDX license identifiers for automated license detection.
๐ Acknowledgments
- Keep a Changelog for changelog standards
- Conventional Commits for commit conventions
- Google Gemini team for the excellent AI models
- The Python community for amazing tools and libraries
๐ฎ Support
- ๐ Report bugs
- ๐ก Request features
- ๐ง Contact maintainer
- ๐ฌ Join discussions
โญ Star History
If you find this project useful, please consider giving it a โญ!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file git_ai_reporter-0.1.0.tar.gz.
File metadata
- Download URL: git_ai_reporter-0.1.0.tar.gz
- Upload date:
- Size: 139.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
208b0a7e882912b6ed29610333a702adb26e71a8838afe14dab0faec6a741c71
|
|
| MD5 |
45b97a68003e0d04450c7c3c4263dc25
|
|
| BLAKE2b-256 |
766507a2294cca411d32ba6a3d5cadc559bd1c5497e42b207c5f644495ecc018
|
File details
Details for the file git_ai_reporter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: git_ai_reporter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 171.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fb003ae49c42cb9edc1735c40fb1f2f433923ff2b763b5a9a927263a0cc9e82
|
|
| MD5 |
ac86ea69a2030d7a089de28bb41652c9
|
|
| BLAKE2b-256 |
df48e936166398cff0098c70b8ed6df1a9886d2bbd315dbf658c6a18d9a54336
|