Changelog¶
Produce or update CHANGELOG.md in the Keep-a-Changelog format.
Steps¶
git describe --tags --abbrev=0to find the most recent tag. If no tag exists, use the repo's first commit and tell the user there's no prior tag.git log <last-tag>..HEAD --oneline --no-mergesto enumerate commits.- Read the existing
CHANGELOG.mdif present. Match its headings, casing, and date format. If missing, create one with the Keep-a-Changelog header. - Group commits into sections — Added, Changed, Fixed, Removed, Deprecated, Security — by inspecting subject prefixes (
feat:→ Added,fix:→ Fixed,refactor:/perf:→ Changed, etc.). Merge trivial commits into one bullet. - Ask the user for the new version number (semver). Do not guess.
- Insert a new
## [x.y.z] - YYYY-MM-DDsection above the previous release. Move "Unreleased" content in if present. - Show the diff before writing. Write only after confirmation.
Rules¶
- Rewrite commit subjects into user-facing language. "feat: add FOO" → "Added FOO that does X."
- Drop internal-only commits (
chore(deps), CI-only changes) unless they affect consumers. - Do not create a git tag. Do not commit. Hand the finished file back to the user.
Output¶
Print the new section you added, then stop.