Changelog Generator
Generate a grouped changelog from git history.
Arguments
$ARGUMENTS - Optional: git ref to start from (tag, commit, branch). Defaults to the most recent tag.
Steps
1. Determine the starting point
# Use argument or find last tag
SINCE="${ARGUMENTS:-$(git describe --tags --abbrev=0 2>/dev/null || echo 'HEAD~50')}"
echo "Generating changelog since: $SINCE"
2. Gather commits
git log "$SINCE"..HEAD --oneline --no-merges
3. Classify commits
Read each commit message and classify into categories:
- Features: New functionality (keywords: add, implement, create, introduce, support)
- Fixes: Bug fixes (keywords: fix, resolve, correct, patch, repair)
- Improvements: Enhancements (keywords: improve, update, enhance, optimize, refactor)
- Docs: Documentation (keywords: doc, readme, comment)
- Chores: Maintenance (keywords: chore, ci, build, deps, config, cleanup)
- Breaking: Breaking changes (keywords: breaking, remove, deprecate, drop)
4. Generate changelog
Format as markdown:
# Changelog
## [Unreleased] — YYYY-MM-DD
### Breaking Changes
- Description of breaking change (commit-hash)
### Features
- Description of new feature (commit-hash)
### Fixes
- Description of bug fix (commit-hash)
### Improvements
- Description of improvement (commit-hash)
### Documentation
- Description of doc change (commit-hash)
### Chores
- Description of maintenance task (commit-hash)
---
Generated from N commits since TAG
5. Output
- Print the changelog to the conversation
- Optionally write to
CHANGELOG.md if user requests
- Can also be used as input for
gh release create
Notes
- Commit messages should be descriptive for best results
- If commits follow conventional format (feat:, fix:, etc.), classification is more accurate
- For releases: pipe output to
gh release create vX.Y.Z --notes-file -
1---2name: changelog3description: Auto-generate a changelog from git commits since the last tag or specified ref4---56# Changelog Generator78Generate a grouped changelog from git history.910## Arguments1112- `$ARGUMENTS` - Optional: git ref to start from (tag, commit, branch). Defaults to the most recent tag.1314## Steps1516### 1. Determine the starting point1718```bash19# Use argument or find last tag20SINCE="${ARGUMENTS:-$(git describe --tags --abbrev=0 2>/dev/null || echo 'HEAD~50')}"21echo "Generating changelog since: $SINCE"22```2324### 2. Gather commits2526```bash27git log "$SINCE"..HEAD --oneline --no-merges28```2930### 3. Classify commits3132Read each commit message and classify into categories:3334- **Features**: New functionality (keywords: add, implement, create, introduce, support)35- **Fixes**: Bug fixes (keywords: fix, resolve, correct, patch, repair)36- **Improvements**: Enhancements (keywords: improve, update, enhance, optimize, refactor)37- **Docs**: Documentation (keywords: doc, readme, comment)38- **Chores**: Maintenance (keywords: chore, ci, build, deps, config, cleanup)39- **Breaking**: Breaking changes (keywords: breaking, remove, deprecate, drop)4041### 4. Generate changelog4243Format as markdown:4445```markdown46# Changelog4748## [Unreleased] — YYYY-MM-DD4950### Breaking Changes5152- Description of breaking change (commit-hash)5354### Features5556- Description of new feature (commit-hash)5758### Fixes5960- Description of bug fix (commit-hash)6162### Improvements6364- Description of improvement (commit-hash)6566### Documentation6768- Description of doc change (commit-hash)6970### Chores7172- Description of maintenance task (commit-hash)7374---7576Generated from N commits since TAG77```7879### 5. Output8081- Print the changelog to the conversation82- Optionally write to `CHANGELOG.md` if user requests83- Can also be used as input for `gh release create`8485## Notes8687- Commit messages should be descriptive for best results88- If commits follow conventional format (feat:, fix:, etc.), classification is more accurate89- For releases: pipe output to `gh release create vX.Y.Z --notes-file -`