Create a git tag, automatically reading the version number from project config files.
Integrations
upstream:
- skill: gh-commit
receives: Committed commits
downstream:
- skill: gh-push
produces: Tag that needs to be pushed
- skill: gh-release
produces: Tag that can be used to create a release
Out of Scope
Push tag to remote - Use gh-push or push manually
Create Release - Use gh-release
Signed tags - Requires GPG setup, not handled automatically
When to Use
Version is ready to be tagged
Completed a milestone that needs a tag
User requests tagging
Workflow
Phase 1: Detect Version Number
Read version from project config files
Try in order:
File
Method
package.json
.version
Cargo.toml
version = "x.y.z"
tauri.conf.json
"version": "x.y.z"
pyproject.toml
version = "x.y.z"
pubspec.yaml
version:
# Example: read from package.json
grep '"version"' package.json | head -1
Check if tag already exists
git tag -l "v*" | sort -V | tail -5
If v{version} already exists, notify the user and stop
Display the 5 most recent tags for reference
Phase 2: Confirmation
Display summary
Tag to be created: v{version}
Current HEAD commit: git log -1 --oneline
Most recent tag: from the query above
Phase 3: Create Tag
Create lightweight tag
git tag v{version}
Verify
git tag -l "v{version}"
Suggest next steps
Need to push: git push origin v{version} or use gh-push
Need a release: use gh-release
Safety and Escalation
Situation
Action
Tag already exists
Notify user, do not overwrite
Version number not found
Ask user to provide manually
Uncommitted changes exist
Warn, suggest committing first
Working tree dirty
Show git status, let user decide
Verification
# Confirm tag has been created
git tag -l "v*" | sort -V | tail -3
# Confirm tag points to the correct commit
git log -1 --oneline v{version}