Update `CHANGELOG.md` and `README.md` after a version upgrade by analyzing recent git commits and comparing versions.
Update CHANGELOG.md and README.md after a version upgrade by
analyzing recent git commits and comparing versions.
Run the prerequisite checks first, then follow the steps below.
package.jsoncat package.json | grep '"version"'
CHANGELOG.mdhead -20 CHANGELOG.md | grep -E "^\#\# \*\*\[" | head -1
If versions match: STOP — documentation is already up to date.
# Get last documented version (e.g., "1.6.0")
LAST_VERSION=$(head -20 CHANGELOG.md | grep -E "^\#\# \*\*\[" | head -1 | sed -E 's/.*\[([0-9.]+)\].*/\1/')
# Find when this version was tagged or committed
git log --all --oneline --grep="$LAST_VERSION" -1
# Get all commits since that version
git log --oneline --since="<commit-hash-or-date>" --no-merges
# Get diff stats since last documented version
git --no-pager diff <last-version-commit>..HEAD --stat
# Get detailed changes for specific files
git --no-pager diff <last-version-commit>..HEAD -- src/
If no significant changes: STOP.
Analyze recent changes using the git commands above.
Update CHANGELOG.md at the top of the file using this template:
<details>
<summary>
## **[VERSION] - YYYY/MM/DD** => _HH:MM_
</summary>
- Change description 1
- Change description 2
- Update dependencies
- <u>Test coverage **_100%_**</u>
</details>
<br/>
Order entries as: Breaking changes → Features → Fixes → Docs → Refactor → Dependencies
README.md only if:
STOP HERE — DO NOT COMMIT. The user will commit manually.
| Field | Format |
|---|---|
| Date | DD/MM/YYYY (European format) |
| Time | HH:MM (24-hour format) |
| Commit messages | English |
| CHANGELOG details | French allowed |
| Action verbs | Add, Fix, Remove, Update, Enhance, Refactor |