keep-a-changelog¶
Add a new version entry to CHANGELOG.md, or restructure the entire file, following
the Keep a Changelog format and
Semantic Versioning.
File header¶
# 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).
Version block format¶
Omit any section that has no entries. Do not add empty sections.
Section rules¶
You MUST use only these standard Keep a Changelog section names, in this order when multiple sections are present:
| Section | When to use |
|---|---|
Added |
New features or capabilities |
Changed |
Changes to existing behavior |
Deprecated |
Features marked for future removal |
Removed |
Features removed in this release |
Fixed |
Bug fixes |
Security |
Security-related fixes or improvements |
Commit to section mapping heuristics¶
feat:/add/new-> Addedrefactor:/change/rename/move/update/improve-> Changedfix:/bug/patch-> Fixedremove:/delete/drop-> Removeddeprecate:-> Deprecatedsecurity:/cve/vuln-> Securitydocs:/chore:/ci:/test:- omit unless user-facing.
When a commit message is ambiguous, infer intent from the diff or file name.
Net change principle¶
A changelog describes what changed for users between releases, not the
internal development history. You SHOULD review the overall diff from the
last release tag to HEAD and consolidate commits that do not represent
independent user-facing changes:
- A feature added in one commit and later re-implemented in another produces a single changelog entry describing the final result, not two entries for each attempt.
- A change that was introduced and then reverted within the same version range SHOULD be omitted -- it had no net user-facing effect.
- Multiple commits that together implement one feature or fix SHOULD be consolidated into one changelog bullet.
Workflow - new version entry¶
- Read
CHANGELOG.mdto identify the last released version and its date. - Run
git log --oneline <last-tag>..HEADto list all commits since that tag. If no tag exists for the last version, usegit log --onelineand filter manually. - Run
date +%Y-%m-%dto get today's release date. Do not hardcode it. - Determine the new version number. If the version is not specified, ask the user:
- MAJOR bump: breaking changes or major redesign.
- MINOR bump: new features, backward-compatible.
- PATCH bump: bug fixes only.
- Map commits to sections using the heuristics above, then apply the net change principle to consolidate.
- Prepend the new version block immediately after the file header (before the previous latest version).
- You MUST NOT remove or alter any existing version entries.
Workflow - restructure entire CHANGELOG.md¶
- Read the full
CHANGELOG.mdand note all existing version blocks. - Rewrite the file preserving all versions and dates but enforcing the correct header and intro paragraph, consistent section names and ordering, and the bullet style in "Style rules" below.
Style rules¶
- Write in English throughout.
- Start each bullet with a capital letter; use the present tense; omit a trailing period.
Example:
Add retry logic for HTTP requests - Keep bullets concise - one line per entry where possible.
- Wrap code identifiers, file paths, and module names in backticks.
- Output SHOULD be plain Markdown (no HTML) using only ASCII punctuation, without emoji, em dashes, or excess bold/italic text.
- When release facts cannot be determined from
CHANGELOG.md, git history, or user input, output MUST NOT guess; instead state "Insufficient information".