Skip to content

commandGit and releases

Tag Release

Picks the next semantic version from commits since the last tag and prepares the annotated tag command for your approval.

npx workspacetemplates add tag-release --tool claude-code

Writes 1 file to .claude/commands/

.claude/commands/tag-release.md14 lines · 1.1 KBFile
---
description: Picks the next semantic version from commits since the last tag and prepares the annotated tag command for your approval.
argument-hint: "[optional forced version, e.g. 2.0.0]"
---

Prepare the next release tag. Requested version, if any: $ARGUMENTS

1. Run `git status --porcelain` and `git branch --show-current`. Warn if the tree is dirty or the branch is not the release branch.
2. Find the latest tag: `git describe --tags --abbrev=0 --match "v*"`. If none exists, propose v0.1.0 and stop to confirm.
3. Read `git log <tag>..HEAD --format="%h %s%n%b"`. Classify: any "BREAKING CHANGE" or "!" means major; any feat means minor; otherwise patch. For versions below 1.0, breaking changes bump minor.
4. If the user gave a version, use it, but say so when it disagrees with your classification.
5. Draft an annotated message: a one-line headline, then bullets grouped as Breaking, Added, Fixed.

Show the bump reasoning with the commits that drove it, then the commands `git tag -a vX.Y.Z -m "..."` and `git push origin vX.Y.Z`. Ask "Create the tag?" Run the tag only after a yes. Push only after a separate yes. Never move or delete an existing tag.

What it does

Choosing a version number by feel leads to breaking changes shipped as patches. This command reads every commit since the latest tag, classifies them and proposes the smallest correct bump.

It writes the tag message from the real changes and prints the exact commands. It will not create or push a tag until you answer.

Example

you › /tag-release

agent › Last tag v1.4.2, 17 commits since. 2 feat, 6 fix, no breaking changes -> v1.5.0.

git tag -a v1.5.0 -m "Saved filters and CSV export"

Create the tag?

Questions

Will it push the tag?
Not on the first yes. Creating locally and publishing are two separate questions.
Does it work without Conventional Commits?
Yes. It reads the commit text and diffs to judge impact, and says how sure it is when subjects are vague.
  • Branch Cleanup

    CommandGit and releases

    Free
  • Changelog Entry

    CommandGit and releases

    Free
  • Cherry Pick Fix

    CommandGit and releases

    Free
  • Commit Message

    CommandGit and releases

    Free