A Ruby script that generates a performance review summary by analyzing your GitHub PRs across all Artsy repositories. Uses Claude API to intelligently group related PRs into projects and themes.
- Fetches all your PRs from Artsy org repos over the last 6 months
- Uses Claude API to intelligently bucket related PRs into projects
- Generates a clean markdown report with statistics
- Caches PR data to avoid re-fetching (cache valid for 24 hours)
- Includes retry logic and graceful degradation
- Ruby (built-in on macOS)
ghCLI installed and authenticated- Claude API key from Anthropic
- Get your Claude API key from https://console.anthropic.com/
- Export it as an environment variable:
export ANTHROPIC_API_KEY="sk-ant-..."ANTHROPIC_API_KEY="sk-ant-..." GITHUB_USERNAME="..." ./pr_performance_review.rbYou can customize the script with environment variables:
# Change GitHub username
export GITHUB_USERNAME="your-username"
# Change time period in months (default: 6)
export MONTHS_BACK=12
# Change organization (default: artsy)
export GITHUB_ORG="your-org"
./pr_performance_review.rbThe script generates:
performance_review_YYYYMMDD.md- Main markdown reportpr_cache.json- Cached PR data (valid for 24 hours)error_log.txt- Error log (if any errors occur)
The markdown report includes:
- Summary Statistics - Total PRs, merged, open, repos, projects
- Major Projects - High impact projects with grouped PRs
- Additional Initiatives - Medium impact work
- Miscellaneous Contributions - One-off fixes and improvements
- Technical Breakdown - PR counts by repository
- Fetch Data: Uses
ghCLI to fetch all your PRs from Artsy repos - Cache: Saves PR data to avoid re-fetching (24 hour cache)
- Analyze: Sends PR data to Claude API for intelligent grouping
- Generate: Creates a formatted markdown report
- PR data is cached for 24 hours in
pr_cache.json - To force a refresh, delete the cache file before running
- The script will tell you if it's using cached data
The script includes robust error handling:
- Missing API key → exits with clear message
- GitHub API errors → skips failed repos, continues
- Claude API errors → retries 3 times, falls back to simple grouping
- All errors logged to
error_log.txt
# Performance Review Summary
**Period**: July 2025 - January 2026 (6 months)
**Engineer**: mattzikherman
## Summary Statistics
- **Total PRs**: 109
- **Merged**: 100
- **Repositories**: 12
- **Projects**: 9
## Major Projects
### 1. Message Templates Feature
**Impact**: High | **Repos**: force, gravity, metaphysics | **PRs**: 8
Implementation of a comprehensive message template system...
**Pull Requests:**
- ✓ [force#1234] Add message template UI - https://github.com/...
- ✓ [gravity#5678] API endpoints - https://github.com/...
...Make sure you've exported your API key:
export ANTHROPIC_API_KEY="sk-ant-..."- Check that your GitHub username is correct
- Verify you have PRs in the specified time period
- Make sure
ghCLI is authenticated:gh auth status
- Check your internet connection
- Claude API may be experiencing issues
- Try running with a smaller time period:
export MONTHS_BACK=3
Expected runtime:
- ~30-60 seconds to fetch PRs (100 PRs across 20 repos)
- ~15-30 seconds for Claude API analysis
- Total: ~1-2 minutes
Potential v2 features:
- Interactive mode to adjust groupings
- HTML/PDF output formats
- Comparison to previous periods
- Automated monthly generation via GitHub Actions