git-tag
Installation
SKILL.md
git-tag
Create a new git tag whose name is the next semver version after the latest existing tag.
When to use
- When the user asks to create a release tag, version tag, or git tag
- When the user wants to bump the major / minor / patch version
- When the user runs
/git-tag
Argument
The argument selects which component to increment. Only major, minor, or patch are accepted. If the argument is omitted, default to patch. Anything else must be rejected with a clear error message — never silently fall back.
Instructions
- Verify the working tree is on the default branch. This is a hard requirement: tags published from feature branches confuse downstream consumers, so abort early if it is not satisfied.
- Determine the default branch with
git symbolic-ref refs/remotes/origin/HEAD(typically resolves toorigin/mainororigin/master). Iforigin/HEADis not set, fall back togit remote show originand parse theHEAD branchline. - Compare against
git rev-parse --abbrev-ref HEAD. If they differ, stop and tell the user which branch they are on and which one they need to switch to. Do not switch branches automatically — the user may have uncommitted work.
- Determine the default branch with