Create a tagged release with a changelog generated from conventional commits since the last tag. Supports both GitHub and GitLab.
When to use
- After merging all planned changes to the main branch and ready to release.
- When you want to preview a release with
--dry-runbefore creating it.
When NOT to use
- When there are no new commits since the last tag.
- When the working tree has uncommitted changes. Use
/commitfirst. - When CI/CD checks are failing. Use
/checksto diagnose first.
Arguments
This skill accepts optional arguments after /release:
- No arguments: auto-detect the next version based on commit types.
- A version (e.g.
1.2.0): use that exact version. --dry-run: show what would be released without creating anything.
Steps
-
Gather initial context. Run these in parallel:
git remote get-url originto detect the git platform.git describe --tags --abbrev=0to find the latest tag (if no tags, use root commit).git status --porcelainto check for uncommitted changes.- Determine the CLI tool from the remote URL:
github.commeansgh,gitlabmeansglab. Verify withwhich <tool>. - If the working tree is dirty, stop and warn the user.
-
Gather all commits since the last tag:
- Run
git log --oneline <last-tag>..HEAD(orgit log --onelineif no tags). - If there are no new commits, say so and stop.
- Run
-
Determine the next version:
- If the user provided a version, use that.
- Otherwise, parse the last tag as semver and bump based on commit types:
- Any
BREAKING CHANGEor!in type: bump major. - Any
feat: bump minor. - Only
fix,perf,refactor,chore,docs,style,test,build,ci: bump patch.
- Any
- If the last tag is not semver, ask the user for the version.
-
Generate the changelog by grouping commits by type:
## What's new ### Features - <subject> (<short-hash>) ### Bug fixes - <subject> (<short-hash>) ### Performance - <subject> (<short-hash>) ### Other changes - <subject> (<short-hash>) ### Breaking changes - <description>Rules for the changelog:
- Only include sections that have commits.
- Use the commit subject as the description.
- Include the short hash for reference.
- List breaking changes in their own section with details from the commit body/footer.
-
If
--dry-runwas passed, show the version and changelog and stop. -
If the project has tests, lint, or build commands, run them to verify everything passes before releasing. If they fail, stop and tell the user.
-
Present the version and changelog to the user for approval before creating anything.
-
After user approval:
- Create an annotated tag:
git tag -a v<version> -m "v<version>". - Push the tag:
git push origin v<version>. - Create the release:
- GitHub:
gh release create v<version> --title "v<version>" --notes-file <tmpfile>. - GitLab:
glab release create v<version> --notes-file <tmpfile>.
- GitHub:
- Clean up the temp file after the command completes, whether it succeeded or failed.
- Create an annotated tag:
-
Show the release URL when done.
Rules
- Always detect the git platform from the remote URL. Never assume GitHub or GitLab.
- Always present the changelog to the user before creating the tag or release.
- Never create a tag or release without explicit user approval.
- Never release if there are no new commits since the last tag.
- Never release if the working tree is dirty. Run
git statusand warn if there are uncommitted changes. - Always write release notes to a temp file to avoid shell escaping issues. Clean up the temp file on both success and failure.
- If the required CLI tool (
ghorglab) is not installed, stop and tell the user.
Related skills
/commit- Ensure all changes are committed before releasing./checks- Verify CI/CD passes before creating a release./pr- Merge outstanding PRs before releasing.
