/generate-changelog
Automatically generate a changelog from your commit history and pull requests using conventional commits and Keep a Changelog format.
Quick Start
/agileflow:generate-changelog VERSION=2.5.0 SINCE=v2.4.0Purpose
This command creates professional changelogs by:
- Detecting version from latest git tags automatically
- Collecting commits and merged PRs since last release
- Categorizing changes (Added/Changed/Fixed/Removed/Security)
- Highlighting breaking changes
- Suggesting semantic versions based on changes
- Updating
CHANGELOG.mdwith proper formatting - Optionally creating git tags and GitHub releases
Parameters
| Parameter | Required | Default | Description |
|---|---|---|---|
VERSION | No | auto-detect | Version number (e.g., 2.5.0) |
SINCE | No | last tag | Starting point (e.g., v2.4.0) |
FORMAT | No | keepachangelog | Format style: keepachangelog, simple, github |
AUTO_COMMIT | No | no | Auto-commit changelog updates: yes or no |
Examples
Auto-Detect Everything
/agileflow:generate-changelogUses latest tag as version start, detects next version, and generates changelog.
Specify Exact Versions
/agileflow:generate-changelog VERSION=2.5.0 SINCE=v2.4.0Creates changelog section for version 2.5.0 from commits since v2.4.0.
Use GitHub Format
/agileflow:generate-changelog FORMAT=githubGenerates changelog in GitHub release notes format.
Auto-Commit Changes
/agileflow:generate-changelog AUTO_COMMIT=yesUpdates CHANGELOG.md and commits automatically after your confirmation.
How It Works
The command follows a smart workflow:
1. Version Detection
If VERSION not provided, detects from git:
git describe --tags --abbrev=0 # Gets latest tagThen suggests next version based on changes:
- Major (2.0.0): Breaking changes detected
- Minor (1.X.0): New features (feat:) only
- Patch (1.1.X): Bug fixes (fix:) only
2. Commit Collection
Gathers commits since SINCE point:
git log <SINCE>..HEAD --oneline --no-mergesAlso fetches merged PRs from GitHub:
gh pr list --state merged --json number,title,mergedAt,labels3. Categorization
Automatically categorizes using conventional commits:
| Prefix | Category | Example |
|---|---|---|
feat: | Added | New feature X for users |
fix: | Fixed | Bug where E caused F |
perf: | Changed | Improved performance by 40% |
refactor: | Changed | Restructured API layer |
security: | Security | Patched XSS vulnerability |
feat!: or BREAKING CHANGE: | Changed (with warning) | ⚠️ BREAKING Redesigned API |
4. Changelog Generation
Creates entry in Keep a Changelog format:
## [2.5.0] - 2025-12-22
### Added
- OAuth2 authentication support (#123)
- Dark mode toggle (#137)
### Changed
- ⚠️ **BREAKING**: Redesigned API endpoints (#126)
- Improved query performance by 50% (#125)
### Fixed
- Crash when user is null (#124)
- Memory leak in WebSocket handler (#139)
### Security
- Patched XSS vulnerability in comment rendering (#131)5. User Review and Approval
Shows diff preview and asks for confirmation before updating CHANGELOG.md.
6. Optional Actions
If approved:
- Updates
CHANGELOG.md - Optionally creates git commit
- Can create git tag
- Can create GitHub release
Changelog Format
The command uses Keep a Changelog standard with these sections:
[Unreleased]
Development changes not yet released (always stays at top)
[VERSION] - DATE
Sections for each release:
- Added - New functionality
- Changed - Changes to existing functionality
- Deprecated - Soon-to-be removed functionality
- Removed - Removed functionality
- Fixed - Bug fixes
- Security - Security vulnerability fixes
Breaking Changes
Breaking changes are detected and highlighted prominently:
Detected By:
- Commit with
!after type:feat!: redesign API - Commit with
BREAKING CHANGE:footer - PR labeled with
breaking-change
Displayed As:
### Changed
- ⚠️ **BREAKING**: Redesigned API endpoints. See migration guide. (#126)Output File
The command updates CHANGELOG.md with this structure:
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [2.5.0] - 2025-12-22
### Added
...
## [2.4.0] - 2025-11-15
### Added
...
---
[unreleased]: https://github.com/user/repo/compare/v2.5.0...HEAD
[2.5.0]: https://github.com/user/repo/compare/v2.4.0...v2.5.0
[2.4.0]: https://github.com/user/repo/compare/v2.3.0...v2.4.0Workflow
The complete workflow looks like this:
-
Show Detection Results
Latest tag: v2.4.0 Commits since: 15 (3 Added, 5 Fixed, 2 Changed, 1 Security) Suggested version: 2.5.0 (MINOR - new features) -
Show Changelog Preview
## [2.5.0] - 2025-12-22 ### Added - OAuth2 authentication support (#123) ... -
Ask for Confirmation
Update CHANGELOG.md? (YES/NO) Auto-commit? (YES/NO) Create tag? (YES/NO) -
Apply Changes
- Updates CHANGELOG.md
- Optionally commits:
git commit -m "chore(release): update CHANGELOG for v2.5.0" - Optionally creates tag:
git tag -a v2.5.0 - Optionally creates GitHub release
Integration with CI/CD
You can automate changelog generation in CI:
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version number (e.g., 1.2.0)'
required: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Get all tags
- name: Generate changelog
run: /agileflow:generate-changelog VERSION=${{ github.event.inputs.version }}
- name: Commit changelog
run: |
git config user.name "github-actions"
git config user.email "actions@github.com"
git add CHANGELOG.md
git commit -m "chore(release): update CHANGELOG"
- name: Create tag
run: git tag -a v${{ github.event.inputs.version }} -m "Release v${{ github.event.inputs.version }}"
- name: Push changes
run: git push origin main && git push origin v${{ github.event.inputs.version }}
- name: Create GitHub release
run: gh release create v${{ github.event.inputs.version }} --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}Best Practices
Commit Message Format
Use conventional commits for automatic categorization:
# Good - auto-categorizes as Added
git commit -m "feat: add OAuth2 authentication"
# Good - auto-categorizes as Fixed
git commit -m "fix: crash when user is null"
# Good - breaking change detection
git commit -m "feat!: redesign API endpoints"
# Better - with scope
git commit -m "feat(auth): add OAuth2 support"Semantic Versioning
Follow semantic versioning after releases:
MAJOR.MINOR.PATCH
2 . 5 . 0
- MAJOR: Breaking changes
- MINOR: New features (backwards compatible)
- PATCH: Bug fixes onlyRelease Process
- Generate changelog for next version
- Create git tag with version
- Push tag to trigger CD pipeline
- Create GitHub release with changelog excerpt
- Announce release (blog, social media, newsletter)
Related Commands
/ci-setup- Set up CI/CD workflow/setup-deployment- Configure deployment/agileflow:status- View project status
On This Page
/generate-changelogQuick StartPurposeParametersExamplesAuto-Detect EverythingSpecify Exact VersionsUse GitHub FormatAuto-Commit ChangesHow It Works1. Version Detection2. Commit Collection3. Categorization4. Changelog Generation5. User Review and Approval6. Optional ActionsChangelog Format[Unreleased][VERSION] - DATEBreaking ChangesOutput FileWorkflowIntegration with CI/CDBest PracticesCommit Message FormatSemantic VersioningRelease ProcessRelated Commands