- cliff.toml: git-cliff config with semantic-style grouping (no conventional commits required) - CHANGELOG.md: initial changelog generated from full git history - .claude/commands/release-new.md: /release-new [major|minor|patch] skill that bumps version, updates changelog, commits, tags, and pushes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1.4 KiB
1.4 KiB
allowed-tools: Bash(git tag:), Bash(git add:), Bash(git commit:), Bash(git push:), Bash(git log:), Bash(git describe:), Bash(git-cliff:), Bash(git cliff:)
description: Create a new semver release. Usage: /release-new [major|minor|patch]
Context
- Current latest tag: !
git describe --tags --abbrev=0 2>/dev/null || echo "none" - Current branch: !
git branch --show-current - Unreleased commits: !
git log $(git describe --tags --abbrev=0 2>/dev/null || echo "")..HEAD --oneline 2>/dev/null || git log --oneline
Your task
Arguments: $ARGUMENTS (should be "major", "minor", or "patch")
-
Determine next version:
- Get current latest tag (from context above). If none, start at v0.1.0.
- Parse the version as vMAJOR.MINOR.PATCH.
- Bump the appropriate component based on arguments (default: patch if none given).
- New version = vX.Y.Z (with "v" prefix).
-
Update CHANGELOG.md using git-cliff:
git-cliff --config cliff.toml --tag NEW_VERSION -o CHANGELOG.md -
Commit the changelog:
- Stage:
git add CHANGELOG.md - Commit:
git commit -m "chore: release NEW_VERSION"
- Stage:
-
Create annotated tag:
git tag -a NEW_VERSION -m "Release NEW_VERSION" -
Push commit and tag:
git push && git push --tags
Do not ask for confirmation. Execute all steps in sequence. Report what version was released when done.