An experimental exploration of AI-assisted PR automation
Status: Pre-alpha research prototype | Not published to PyPI | Use at your own risk
This is a personal experiment in automated pull request workflows. It's a rapidly evolving prototype exploring how AI can help with PR feedback loops. Think of it as a research project into the future of development automation, not a production tool.
This is not ready for production use. Current status:
- Prototype stage: Core concepts being explored, APIs changing daily
- Limited testing: Only tested on my personal projects
- Hardcoded assumptions: Many parts assume my specific development setup
- Incomplete features: Most advertised features are partially implemented
- No package distribution: Not published to PyPI, installation from source only
This project explores:
- Automated PR iteration: Can AI meaningfully reduce the manual work in PR feedback loops?
- Multi-tool orchestration: Unifying disparate development tools under one interface
- AI cost awareness: Tracking the environmental impact of AI-assisted development
- Human-AI collaboration patterns: Where automation helps vs. where it gets in the way
What if PR automation could handle the tedious parts while you focus on architecture and design?
# The dream (not yet reality):
$ pullitzer monitor
๐ง Auto-fixing formatting/linting...
๐ค Generating test fixes...
โ
All checks passing
# Current reality:
$ pullitzer monitor
โ ๏ธ Some features work
โ ๏ธ Some features break
โ ๏ธ Your mileage will varyNote: Most of these are partially implemented or experimental.
- ๐ PR Automation - Basic PR creation works, monitoring is buggy
- ๐ง Auto-Fix - Works for simple Python/JS formatting, everything else is manual
- ๐ค AI Integration - Stub implementation, requires significant configuration
- ๐ Status Tracking - Basic terminal output, no fancy dashboards yet
- ๐ Iterative Fixing - Concept proven, implementation incomplete
- ๐ฏ Multi-Language - Python works okay, JS partially, others untested
- ๐ Carbon Tracking - Experimental integration with ecologits
This experimental prototype has significant limitations:
- GitHub-only: Hardcoded for GitHub, no GitLab/Bitbucket support
- Limited language support: Really only tested with Python
- Flaky monitoring: The monitoring loop often gets stuck or misses updates
- Incomplete AI integration: AI features are mostly stubbed out
- No error handling: Expect crashes on unexpected inputs
- Assumes specific tools: Expects black, ruff, prettier to be installed
- macOS-focused: Developed on macOS, untested on Linux/Windows
# Clone the repository (fork and update URL as needed)
git clone https://github.com/[YOUR-USERNAME]/pullitzer.git
cd pullitzer
# Install in development mode
pip install -e .
# Or with experimental carbon tracking
pip install -e ".[carbon]"Note: Requires Python 3.8+ and various development tools that may not be documented.
# These commands might work:
pullitzer pr create --title "feat: awesome feature"
pullitzer monitor # Often gets stuck
pullitzer status # Basic functionality
# These are experimental:
pullitzer fix # Your mileage may vary
pullitzer monitor --pr 123 # Hardcoded assumptions
# Custom commands (use your own tools):
pullitzer fix --command "make lint" # Recommended approachTip: You're probably better off using your existing linting scripts directly.
Pullitzer uses a two-tier approach to fixing PR issues:
- Formatting: Black, Prettier, terraform fmt
- Linting: Ruff, ESLint with auto-fix
- Imports: isort for Python
- Test Failures: Logic errors, assertion issues
- Best Practices: Copilot suggestions, refactoring
- Security: Vulnerability fixes, secure coding patterns
- Coverage: Generate missing tests
Pullitzer respects your project's existing lint and format tooling. You can specify your own lint/fix commands:
# Use your project's lint script
pullitzer fix --command "python scripts/lint.py"
# Monitor PR with custom fix command
pullitzer monitor --fix-command "npm run lint:fix" --max-iterations 5
# Works with any command
pullitzer fix --command "make format"
pullitzer fix --command "./scripts/fix-all.sh"
pullitzer fix --command "poetry run poe format"This is especially useful when:
- Your project has specific formatting rules
- You use custom linting configurations
- You have a unified lint/format script
- You want full control over the fix process
Create a .pullitzer.yml in your project root:
# .pullitzer.yml
version: 1
monitor:
max_iterations: 5
check_interval: 30
auto_fix: true
fixes:
python:
- black
- ruff
- isort
javascript:
- eslint
- prettier
terraform:
- fmt
ai:
enabled: true
provider: claude # or openai, local
notifications:
slack: https://hooks.slack.com/services/YOUR/WEBHOOK/URL# Create PR first
pullitzer pr create --title "feat: new feature"
# Start monitoring with auto-fixes
pullitzer monitor --watch
# This will:
# 1. Monitor CI status
# 2. Apply fixes automatically
# 3. Re-run until all checks pass# Fix all issues before pushing
pullitzer fix --all
git add -A
git commit -m "feat: new feature"
git push# Analyze PR for complex issues
pullitzer analyze --pr 123
# This generates fix tasks in .pullitzer/tasks/
# Each task includes specific instructions for resolutionname: Pullitzer
on:
pull_request:
types: [opened, synchronize]
jobs:
pullitzer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- run: pip install pullitzer
- run: pullitzer monitor --ci# .pre-commit-config.yaml
repos:
- repo: local
hooks:
- id: pullitzer
name: Pullitzer
entry: pullitzer fix --staged
language: system
pass_filenames: falsePullitzer provides a rich terminal UI for monitoring:
โญโโโโโโโโโโโโโโโโโโโ Pullitzer PR Monitor โโโโโโโโโโโโโโโโโโโโฎ
โ PR #123: feat: add new authentication system โ
โ Branch: feature/auth โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Status: ๐ก In Progress โ
โ โ
โ Checks: โ
โ โ
Linting (Python) 2m 15s โ
โ โ
Linting (JavaScript) 1m 32s โ
โ โ Tests (Backend) 3m 45s โ
โ โณ Tests (Frontend) Running... โ
โ โ
Security Scan 1m 10s โ
โ โ
โ Issues Found: โ
โ ๐ง 2 formatting issues (auto-fixing...) โ
โ ๐งช 1 test failure (generating fix task...) โ
โ ๐ก 3 Copilot suggestions โ
โ โ
โ Coverage: 87.3% (-0.5%) โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
This is actively being experimented on. Expect frequent breaking changes.
git clone https://github.com/[YOUR-USERNAME]/pullitzer.git
cd pullitzer
pip install -e ".[dev]" # May have undocumented dependenciesLimited test coverage. Most functionality is manually tested (when tested at all).
pytest # Some tests might failPullitzer integrates with Ecologits to track the carbon footprint of AI-assisted PR fixes.
Every AI API call consumes energy and produces CO2 emissions. Pullitzer helps you:
- Measure the environmental impact of AI assistance
- Compare AI vs manual fixing carbon costs
- Optimize to reduce unnecessary API calls
- Report on your development's carbon footprint
# View carbon report
pullitzer carbon
# Export as JSON for CI/CD
pullitzer carbon --format json
# Generate markdown report
pullitzer carbon --format markdown๐ Environmental Impact
โโโโโโโโโโโโโโโโโโโโโโโ
Sessions tracked: 12
Total CO2: 0.0234 kg
Total energy: 156.3 Wh
API calls: 47
Equivalent to:
๐ 0.1 km driven
๐ณ 0.001 trees needed/year
๐ฑ 13 phone charges
Enable/disable tracking via environment variable:
# Disable carbon tracking
export PULLITZER_TRACK_CARBON=falseAdd to your README:
Pullitzer can integrate with AI services for complex fixes:
from pullitzer import AIFixer
fixer = AIFixer(provider="claude", api_key="sk-...")
fixer.analyze_and_fix(pr_number=123)fixer = AIFixer(provider="openai", api_key="sk-...")
fixer.analyze_and_fix(pr_number=123)Manage pull requests.
pullitzer pr create # Create new PR for current branch
pullitzer pr update # Update existing PR
pullitzer pr find # Find PR for current branch
pullitzer pr list # List all PRs
pullitzer pr show # Show PR details
# Create options:
--title TEXT PR title
--body TEXT PR body/description
--base TEXT Base branch (default: main)
--draft Create as draft PR
--no-push Do not push branch to remoteMonitor a PR and apply automatic fixes.
pullitzer monitor [OPTIONS]
Options:
--pr INT PR number to monitor (defaults to current branch PR)
--max-iterations INT Maximum fix iterations (default: 5)
--no-fix Monitor only, no auto-fixing
--watch Continue monitoring after completion
--fix-command TEXT Custom lint/fix command (e.g., "python scripts/lint.py")Apply automated fixes for code issues.
pullitzer fix [OPTIONS]
Options:
--all Run all available fixes
--python Fix Python code only
--javascript Fix JavaScript/TypeScript only
--terraform Fix Terraform only
--staged Fix staged files only
--commit Commit fixes automatically
--command TEXT Use custom lint/fix commandCheck PR status without making changes.
pullitzer status [OPTIONS]
Options:
--pr INT PR number (defaults to current branch PR)
--json Output as JSON for scriptingAnalyze PR for complex issues and generate fix tasks.
pullitzer analyze [OPTIONS]
Options:
--pr INT PR number to analyze
--provider TEXT AI provider (claude, openai, local)Show carbon footprint report for AI-assisted fixes.
pullitzer carbon [OPTIONS]
Options:
--format TEXT Output format (text, json, markdown)Apache License 2.0 - Provided as-is with no warranties.
This is a personal experiment. Feel free to fork and adapt for your own use, but I'm not actively maintaining this for others.
This is experimental software created for personal learning and exploration of AI-assisted development workflows. It is:
- Not production-ready
- Not tested beyond my personal projects
- Likely to have bugs and incomplete features
- Subject to breaking changes without notice
Use at your own risk. If you're looking for production PR automation tools, consider established solutions like Renovate, Dependabot, or pre-commit.
"Pullitzer" is a playful nod to the idea that good PRs deserve recognition. This tool won't win any prizes for code quality (it's experimental!), but it represents an exploration into making PR workflows less painful.
This is an experimental project exploring AI-assisted PR automation. Expect rough edges, incomplete features, and frequent changes.