Changelog Writer
Produce a Keep-a-Changelog-formatted entry for commits since the most recent git tag.
Procedure
Run
git describe --tags --abbrev=0to find the most recent tag. If there is no tag, stop and tell the user the repo has no release history yet.Run
git log <tag>..HEAD --oneline --no-mergesto get the commits since the tag.For each commit, parse the conventional-commit type from the start of the subject (
feat,fix,chore,docs,refactor,test,build,ci,perf,style). Anything else becomeschore.Map types to Keep a Changelog categories:
feat→ Addedfix→ Fixedrefactor,perf→ Changeddocs,chore,test,build,ci,style→ Chores (a category Keep a Changelog doesn't define but is common in real projects)
Emit a Markdown block in exactly this shape:
## [Unreleased] ### Added - <subject> (`<short-hash>`) ### Changed - ... ### Fixed - ... ### Chores - ...Omit empty categories. Sort commits within each category alphabetically by subject.
Constraints
- Output only the Markdown block. No preamble, no explanation after.
- Short hashes are the first 7 characters of the commit SHA.
- Do not invent categories. If every commit is a
chore, the block has only a### Choressection.