Generate a weekly summary of your merged PRs and commits
Generates a weekly summary of merged PRs or commits, categorizing work into features, bugs, and tech debt.
/plugin marketplace add chmouel/claude-code-plugins/plugin install weekly-review@chmouel-cc-pluginsdaysGenerate a comprehensive summary of your work from the past 7-10 days, prioritizing merged GitHub PRs and falling back to git commits when PRs aren't available. Automatically categorizes work into tech debt, bug fixes, and new features.
Days: $ARGUMENTS (defaults to 7 if not provided, maximum 10)
Parse the number of days from $ARGUMENTS, or use 7 as default.
Goal: Verify git/GitHub configuration and determine time range for analysis
Actions:
Create a todo list with all phases:
Parse arguments to determine days (default: 7, max: 10)
Check if GitHub CLI is available and authenticated:
gh auth status
Get git user email using: git config user.email
Decision Point:
gh is available and authenticated → set mode to "GitHub PRs"gh is not available or not authenticated → set mode to "Git Commits"Error Handling:
I couldn't find your git email configuration.
To set your email, run:
git config --global user.email "your-email@example.com"
Or for this repository only:
git config user.email "your-email@example.com"
Verify we're in a git repository
Goal: Gather merged PRs (preferred) or commits from the specified time range
Actions:
Calculate the date range:
List merged PRs authored by the current user:
gh pr list --state merged --author @me --json number,title,mergedAt,labels,body,url --limit 100
Filter PRs to only those merged in the date range
For each merged PR, collect:
gh pr diff <number> --name-onlygh pr view <number> --json commits --jq '.commits | length'Error Handling:
No merged PRs found by @me in the past N days.
This could mean:
- You haven't merged any PRs recently
- PRs were merged by someone else (even if you authored them)
- You might want to check a specific branch
Actions:
Calculate the date range:
Collect commits using:
git log --all --author="<user-email>" --since="N days ago" --pretty=format:"%H|%s|%ar|%ad" --date=short --no-merges
For each commit, get the diff stats:
git show <commit-hash> --stat --pretty=format:"" --numstat
Error Handling:
No commits found by <email> in the past N days.
This could mean:
- You haven't committed anything recently
- Your git email might be different
- Your commits are on a different branch
Store commit information:
Goal: Analyze PRs/commits to categorize work and understand patterns
Actions:
For each PR, analyze the title, labels, and body to categorize:
Tech Debt indicators:
Bug Fix indicators:
New Functionality indicators:
Extract key themes from PR titles and descriptions:
Calculate statistics:
Actions:
For each commit, analyze the commit message and diff to categorize:
Tech Debt indicators:
Bug Fix indicators:
New Functionality indicators:
Extract key themes from commit messages:
Calculate statistics:
Goal: Present a clear, actionable summary of the week's work
Actions:
# Weekly Review (<start-date> to <end-date>)
**Source**: GitHub Pull Requests
## Summary
You merged <N> pull requests over the past <N> days, containing <M> commits and changing <X> files.
## Key Accomplishments
- [2-5 bullet points of major work, derived from PR analysis]
- [Focus on user-facing impact and significant changes]
- [Group related PRs into single bullets]
## Work Breakdown
### New Functionality (<N> PRs, X%)
[Brief description of new features added based on PR titles/descriptions]
### Bug Fixes (<N> PRs, X%)
[Brief description of bugs fixed based on PR titles/descriptions]
### Tech Debt & Maintenance (<N> PRs, X%)
[Brief description of refactoring and cleanup work]
## Detailed Analysis
**Tech Debt**: [1-2 sentence summary of refactoring work, patterns improved, code quality enhancements, mentioning specific PRs]
**Bug Fixes**: [1-2 sentence summary of issues resolved, areas of the codebase stabilized, mentioning specific PRs]
**New Functionality**: [1-2 sentence summary of new capabilities added, features implemented, mentioning specific PRs]
## Merged Pull Requests
### New Features
- #123: Add user authentication system - <url>
- #125: Implement dashboard analytics - <url>
### Bug Fixes
- #124: Fix race condition in data loader - <url>
### Tech Debt
- #126: Refactor database connection pooling - <url>
---
**Next Steps**:
- Review any open PRs that build on this work
- Update project documentation if needed
- Plan next week's priorities based on patterns observed
Actions:
# Weekly Review (<start-date> to <end-date>)
**Source**: Git Commits (no GitHub PR data available)
## Summary
You shipped <N> commits over the past <N> days, changing <N> files with <+X/-Y> lines.
## Key Accomplishments
- [2-5 bullet points of major work, derived from commit analysis]
- [Focus on user-facing impact and significant changes]
- [Group related commits into single bullets]
## Work Breakdown
### New Functionality (<N> commits, X%)
[Brief description of new features added]
### Bug Fixes (<N> commits, X%)
[Brief description of bugs fixed]
### Tech Debt & Maintenance (<N> commits, X%)
[Brief description of refactoring and cleanup work]
## Detailed Analysis
**Tech Debt**: [1-2 sentence summary of refactoring work, patterns improved, code quality enhancements]
**Bug Fixes**: [1-2 sentence summary of issues resolved, areas of the codebase stabilized]
**New Functionality**: [1-2 sentence summary of new capabilities added, features implemented]
## Commit Timeline
[Show commits grouped by day or by category, with commit messages and hashes]
---
**Next Steps**:
- Review any open PRs related to this work
- Update project documentation if needed
- Consider using GitHub PRs for better weekly reviews (install gh CLI)
- Plan next week's priorities based on patterns observed
Present the report to the user
Mark the final phase as completed
Throughout all phases:
gh auth logingh) installed and authenticated