# Git Hotspot AI
A lightweight CLI tool for analyzing git hotspots and triggering AI post-processing tasks.
## Features
- **Git Hotspot Analysis**: Identify the most frequently modified files in your repository
- **Flexible Filtering**: Filter by time range, file patterns, and minimum commit counts
- **AI Task Integration**: Trigger AI-powered analysis tasks on hotspot files
- **Configurable Output**: Select top files by percentage or absolute count
- **Dry Run Mode**: Preview results without executing AI tasks
## Installation
### From Source
```bash
git clone https://github.com/yourusername/git-hotspot-ai.git
cd git-hotspot-ai
pip install -e .
```
### Development Installation
```bash
git clone https://github.com/yourusername/git-hotspot-ai.git
cd git-hotspot-ai
pip install -e ".[dev]"
```
## Usage
### Basic Usage
```bash
# analyze current directory
git-hotspot-ai
# analyze specific repository
git-hotspot-ai --repo /path/to/repo
# show top 20 files
git-hotspot-ai --top 20
# show top 15% of files
git-hotspot-ai --top 15%
# dry run (preview without AI tasks)
git-hotspot-ai --dry-run
```
### Advanced Options
```bash
# analyze files modified in the last 6 months
git-hotspot-ai --since "6 months ago"
# ignore test files and documentation
git-hotspot-ai --ignore "tests/*,docs/*,*.md"
# only consider files with at least 5 commits
git-hotspot-ai --min-commits 5
# run specific AI tasks
git-hotspot-ai --tasks "annotate,structure,performance"
```
### Command Line Options
| Option | Description | Default |
|--------|-------------|---------|
| `--repo` | Path to git repository | Current directory |
| `--top` | Top files to select (count or percentage) | `10%` |
| `--tasks` | Comma-separated AI tasks | `annotate,structure,skills,performance,mvp` |
| `--since` | Git time filter (e.g., "6 months ago") | None |
| `--dry-run` | Preview without AI tasks | False |
| `--ignore` | Glob patterns to ignore | Empty |
| `--min-commits` | Minimum commit count | 1 |
## AI Tasks
The tool supports the following AI tasks:
- **annotate**: Add code annotations and comments
- **structure**: Analyze and improve code structure
- **skills**: Identify required skills and expertise
- **performance**: Analyze performance characteristics
- **mvp**: Generate MVP recommendations
## How It Works
1. **Git Analysis**: Uses `git log --numstat` to collect file modification statistics
2. **Scoring**: Combines commit count and line changes to score files
3. **Filtering**: Applies time range, ignore patterns, and minimum commit filters
4. **Selection**: Selects top files based on percentage or count
5. **AI Dispatch**: Triggers configured AI tasks on selected files
## Scoring Algorithm
Files are scored using the formula:
```
score = commit_count + 0.1 * line_changes
```
This balances the frequency of changes with the magnitude of changes.
## Examples
### Find Most Active Files
```bash
# top 10 most active files
git-hotspot-ai --top 10
# top 5% of files with at least 3 commits
git-hotspot-ai --top 5% --min-commits 3
```
### Analyze Recent Changes
```bash
# files modified in last 3 months
git-hotspot-ai --since "3 months ago"
# recent changes excluding tests
git-hotspot-ai --since "1 month ago" --ignore "test_*,*_test.py"
```
### Development Workflow
```bash
# preview what would be analyzed
git-hotspot-ai --dry-run --top 20
# run AI analysis on top files
git-hotspot-ai --top 20 --tasks "annotate,structure"
```
## Development
### Running Tests
```bash
pytest
```
### Code Formatting
```bash
black git_hotspot_ai/
isort git_hotspot_ai/
```
### Type Checking
```bash
mypy git_hotspot_ai/
```
## Contributing
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests
5. Submit a pull request
## License
MIT License - see LICENSE file for details.
## Changelog
### 0.1.0
- Initial release
- Basic git hotspot analysis
- CLI interface
- AI task dispatch framework
Raw data
{
"_id": null,
"home_page": "https://github.com/yourusername/git-hotspot-ai",
"name": "git-hotspot-ai",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Your Name",
"author_email": "Your Name <your.email@example.com>",
"download_url": "https://files.pythonhosted.org/packages/75/fd/f5c14c5872e73629705cc48691e262c649698da3d666d1caba6040fe31c5/git_hotspot_ai-0.8.0.tar.gz",
"platform": null,
"description": "# Git Hotspot AI\n\nA lightweight CLI tool for analyzing git hotspots and triggering AI post-processing tasks.\n\n## Features\n\n- **Git Hotspot Analysis**: Identify the most frequently modified files in your repository\n- **Flexible Filtering**: Filter by time range, file patterns, and minimum commit counts\n- **AI Task Integration**: Trigger AI-powered analysis tasks on hotspot files\n- **Configurable Output**: Select top files by percentage or absolute count\n- **Dry Run Mode**: Preview results without executing AI tasks\n\n## Installation\n\n### From Source\n\n```bash\ngit clone https://github.com/yourusername/git-hotspot-ai.git\ncd git-hotspot-ai\npip install -e .\n```\n\n### Development Installation\n\n```bash\ngit clone https://github.com/yourusername/git-hotspot-ai.git\ncd git-hotspot-ai\npip install -e \".[dev]\"\n```\n\n## Usage\n\n### Basic Usage\n\n```bash\n# analyze current directory\ngit-hotspot-ai\n\n# analyze specific repository\ngit-hotspot-ai --repo /path/to/repo\n\n# show top 20 files\ngit-hotspot-ai --top 20\n\n# show top 15% of files\ngit-hotspot-ai --top 15%\n\n# dry run (preview without AI tasks)\ngit-hotspot-ai --dry-run\n```\n\n### Advanced Options\n\n```bash\n# analyze files modified in the last 6 months\ngit-hotspot-ai --since \"6 months ago\"\n\n# ignore test files and documentation\ngit-hotspot-ai --ignore \"tests/*,docs/*,*.md\"\n\n# only consider files with at least 5 commits\ngit-hotspot-ai --min-commits 5\n\n# run specific AI tasks\ngit-hotspot-ai --tasks \"annotate,structure,performance\"\n```\n\n### Command Line Options\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--repo` | Path to git repository | Current directory |\n| `--top` | Top files to select (count or percentage) | `10%` |\n| `--tasks` | Comma-separated AI tasks | `annotate,structure,skills,performance,mvp` |\n| `--since` | Git time filter (e.g., \"6 months ago\") | None |\n| `--dry-run` | Preview without AI tasks | False |\n| `--ignore` | Glob patterns to ignore | Empty |\n| `--min-commits` | Minimum commit count | 1 |\n\n## AI Tasks\n\nThe tool supports the following AI tasks:\n\n- **annotate**: Add code annotations and comments\n- **structure**: Analyze and improve code structure\n- **skills**: Identify required skills and expertise\n- **performance**: Analyze performance characteristics\n- **mvp**: Generate MVP recommendations\n\n## How It Works\n\n1. **Git Analysis**: Uses `git log --numstat` to collect file modification statistics\n2. **Scoring**: Combines commit count and line changes to score files\n3. **Filtering**: Applies time range, ignore patterns, and minimum commit filters\n4. **Selection**: Selects top files based on percentage or count\n5. **AI Dispatch**: Triggers configured AI tasks on selected files\n\n## Scoring Algorithm\n\nFiles are scored using the formula:\n```\nscore = commit_count + 0.1 * line_changes\n```\n\nThis balances the frequency of changes with the magnitude of changes.\n\n## Examples\n\n### Find Most Active Files\n\n```bash\n# top 10 most active files\ngit-hotspot-ai --top 10\n\n# top 5% of files with at least 3 commits\ngit-hotspot-ai --top 5% --min-commits 3\n```\n\n### Analyze Recent Changes\n\n```bash\n# files modified in last 3 months\ngit-hotspot-ai --since \"3 months ago\"\n\n# recent changes excluding tests\ngit-hotspot-ai --since \"1 month ago\" --ignore \"test_*,*_test.py\"\n```\n\n### Development Workflow\n\n```bash\n# preview what would be analyzed\ngit-hotspot-ai --dry-run --top 20\n\n# run AI analysis on top files\ngit-hotspot-ai --top 20 --tasks \"annotate,structure\"\n```\n\n## Development\n\n### Running Tests\n\n```bash\npytest\n```\n\n### Code Formatting\n\n```bash\nblack git_hotspot_ai/\nisort git_hotspot_ai/\n```\n\n### Type Checking\n\n```bash\nmypy git_hotspot_ai/\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests\n5. Submit a pull request\n\n## License\n\nMIT License - see LICENSE file for details.\n\n## Changelog\n\n### 0.1.0\n- Initial release\n- Basic git hotspot analysis\n- CLI interface\n- AI task dispatch framework\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Analyze git hotspots and trigger AI post-processing",
"version": "0.8.0",
"project_urls": {
"Homepage": "https://github.com/yourusername/git-hotspot-ai",
"Issues": "https://github.com/yourusername/git-hotspot-ai/issues",
"Repository": "https://github.com/yourusername/git-hotspot-ai"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "14b7086873e9f0662cc13268aab2c0db038873980e11fb6a978f21b530a866c9",
"md5": "6639c4939dc96ac2a35b44255fd1fe82",
"sha256": "3708e81a80963e7fcf9443cc85273d844229c387d5d0bd8a71f771103363ad0c"
},
"downloads": -1,
"filename": "git_hotspot_ai-0.8.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6639c4939dc96ac2a35b44255fd1fe82",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 17205,
"upload_time": "2025-10-22T11:14:03",
"upload_time_iso_8601": "2025-10-22T11:14:03.274667Z",
"url": "https://files.pythonhosted.org/packages/14/b7/086873e9f0662cc13268aab2c0db038873980e11fb6a978f21b530a866c9/git_hotspot_ai-0.8.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "75fdf5c14c5872e73629705cc48691e262c649698da3d666d1caba6040fe31c5",
"md5": "2160bf23dbf05570d6bc6052e321842a",
"sha256": "3a2a5650aa65b5643a17dea459a8050ee61f11362034f303add2d5c723b0f2a0"
},
"downloads": -1,
"filename": "git_hotspot_ai-0.8.0.tar.gz",
"has_sig": false,
"md5_digest": "2160bf23dbf05570d6bc6052e321842a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 19380,
"upload_time": "2025-10-22T11:14:04",
"upload_time_iso_8601": "2025-10-22T11:14:04.566425Z",
"url": "https://files.pythonhosted.org/packages/75/fd/f5c14c5872e73629705cc48691e262c649698da3d666d1caba6040fe31c5/git_hotspot_ai-0.8.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-22 11:14:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yourusername",
"github_project": "git-hotspot-ai",
"github_not_found": true,
"lcname": "git-hotspot-ai"
}