Conventional Commits release
Commit messages carry the release information: feat means a new minor version, fix
a patch, and ! or BREAKING CHANGE: a major. The script turns history into a version
number and a changelog section. It only reads git; it never tags or commits.
When to use
- "What version should I release next?" / "write the changelog for this release"
- "How should I word this commit?"
- Adopting Conventional Commits and semantic versioning in a project
When not to use
- Projects that version by date (CalVer) or never tag releases: the bump logic does not apply.
- Monorepos with independently versioned packages: run per package with
--sinceon that package's tag, or use a dedicated tool (release-please, changesets).
Workflow
-
Collect commits since the last release tag (
scripts/is relative to this skill):python3 scripts/next_version.py --git # since latest v* tag python3 scripts/next_version.py --git --since v1.4.0 # explicit start python3 scripts/next_version.py --git --json # for further processingWithout tags the current version defaults to 0.0.0; pass
--current 1.4.0when the version lives only in a manifest. -
Review the result with the user. Check the
non_conventionallist in--jsonoutput: those commits are not counted toward the bump. Read them; if one is really a feature or a breaking change, say so and propose the corrected bump. -
Polish the notes. The script output is a draft. Rewrite subjects so users understand them (what changed for them, not how), merge duplicates, and put upgrade instructions under "Breaking changes". Keep the version heading format
## [X.Y.Z] - YYYY-MM-DD. -
Update CHANGELOG.md. Insert the section below
## [Unreleased](create that heading if missing), keep older sections intact, and update the compare links at the bottom if the file uses them. -
Bump manifests (
pyproject.toml,package.json, ...) to the same version, then hand over to therelease-checklistskill. Do not create the tag yourself unless the user asks.
Bump rules
| Commits since last tag | 1.x and later | 0.x (default) |
|---|---|---|
any ! or BREAKING CHANGE: | major | minor |
any feat | minor | minor |
only fix, perf, revert | patch | patch |
only docs, chore, ci, test, style, refactor, build | none | none |
--no-zero-major-rule: let a breaking change on 0.x go to 1.0.0.--pre rc: produce1.5.0-rc.1; running again from1.5.0-rc.1gives1.5.0-rc.2. Without--pre, a prerelease is finished:1.5.0-rc.2+ fix gives1.5.0.--fail-if-noneexits 1 when nothing warrants a release (useful in CI).--repo-url https://github.com/OWNER/REPOlinks commit hashes.--include docs,otheralso lists documentation and other commits.
Writing commit messages
Format: type(optional scope)!: imperative summary then an optional body and footers.
See the cheat sheet for types, examples and the
breaking-change footer. When asked to word a commit, read the staged diff
(git diff --cached) and propose one message; do not commit unless asked.
Output
- Current version, bump, next version and tag name.
- The edited changelog section, and which commits you reworded or reclassified.