Create and manage semantic version tags with release notes
✓Works with OpenClaudeYou are a Git release management expert. The user wants to create and manage semantic version tags with release notes using Git.
What to check first
- Current git tags with
git tag -lto see existing versions - Latest commit hash with
git rev-parse HEADto verify tag target - Remote branches with
git branch -rto ensure you're on the correct base - Existing release notes format in
.github/RELEASE_NOTES.mdorCHANGELOG.mdif present
Steps
- Validate semantic versioning format using regex
^v?[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?(\+[a-zA-Z0-9]+)?$before creating any tag - Create an annotated tag with
git tag -a v[MAJOR].[MINOR].[PATCH] -m "Release v[MAJOR].[MINOR].[PATCH]"— always use annotated tags for releases, not lightweight tags - Append release notes to the tag message by using a heredoc or editor:
git tag -a v1.2.3 -m "$(cat release-notes.txt)"orgit tag -a v1.2.3 -m "Release notes here" - Retrieve commit messages between tags using
git log v[OLD_VERSION]..v[NEW_VERSION] --onelineto auto-generate release note sections - Push annotated tags to remote with
git push origin v[VERSION]orgit push origin --tagsfor all tags - Verify tag details with
git show v[VERSION]to confirm message, tagger, date, and commit SHA - Update a CHANGELOG.md file with new version entry before tagging: prepend section with version header, date, and categorized commit summaries
- Delete incorrect tags locally with
git tag -d v[VERSION]and from remote withgit push origin --delete v[VERSION]before re-creating
Code
#!/bin/bash
set -euo pipefail
VERSION="${1:-}"
CHANGELOG_FILE="CHANGELOG.md"
# Validate semantic version format
validate_version() {
local version="$1"
if [[ ! "$version" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?(\+[a-zA-Z0-9]+)?$ ]]; then
echo "Error: Invalid semantic version format: $version"
echo "Expected format: v1.2.3 or 1.2.3 with optional pre-release and metadata"
exit 1
fi
}
# Normalize version to vX.Y.Z format
normalize_version() {
local version="$1"
[[ "$version" =~ ^v ]] && echo "$version" || echo "v$version"
}
# Extract previous tag for changelog generation
get_
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related Git & Version Control Skills
Other Claude Code skills in the same category — free to download.
Smart Commit
Generate conventional commit messages by analyzing staged changes
Branch Cleanup
Find and delete merged/stale local and remote branches
Git Undo
Safely undo the last git operation (commit, merge, rebase, etc.)
Changelog Generator
Generate CHANGELOG.md from git history using conventional commits
Conflict Resolver
Analyze and suggest resolutions for merge conflicts
Git Bisect Helper
Automate git bisect to find the commit that introduced a bug
PR Description
Generate detailed PR descriptions from branch diff
Commit Splitter
Split a large commit into smaller, logical commits
Want a Git & Version Control skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.