Release SKILL
Context
- Repo check (
(no repo)means this directory is not under git): !out=$(git rev-parse --show-toplevel 2>/dev/null) || true; printf '%s\n' "${out:-(no repo)}" - Current branch: !
out=$(git branch --show-current 2>/dev/null) || true; printf '%s\n' "${out:-(no branch — detached HEAD, or no repo)}" - Latest tags: !
out=$(git tag --sort=-version:refname 2>/dev/null | head -5) || true; printf '%s\n' "${out:-(no tags yet)}" - Commits since last tag: !
out=$(git log $(git describe --tags --abbrev=0 2>/dev/null)..HEAD --oneline --no-merges 2>/dev/null || git log --oneline -20 2>/dev/null) || true; printf '%s\n' "${out:-(no commits yet)}" - Git status: !
out=$(git status --short 2>/dev/null) || true; printf '%s\n' "${out:-(working tree clean)}" - Remote tracking: !
out=$(git status -sb 2>/dev/null | head -1) || true; printf '%s\n' "${out:-(no repo)}"
Your task
Take the repo from "work is done" to "version bumped, changelog written, commit made, tag created" — with one confirmation from the user.
This skill owns the whole sequence. Do not invoke versioning or changelog;
they cover the same ground standalone and running them here produces duplicate
prompts and a split commit.
Step 0 — Confirm there is a repo
If the repo check in the context reads (no repo), this directory is not under
version control. Say so, point the user at init to create the repo, and stop —
nothing below applies until there is one.
Step 1 — Preflight
Establish that a release is possible before drafting anything:
- Uncommitted changes — if
git status --shortis non-empty, list the files and use AskUserQuestion: "Include them in the release commit / Commit them separately first (stop here) / Cancel". Never sweep unknown changes into a release commit silently. - Branch — if the current branch is not the base branch (
master/main) and not arelease/*branch, say so and use AskUserQuestion: "Release from this branch / Cancel (switch branches first)". - Commits to release — if there are no commits since the last tag, report that and stop. There is nothing to release.
Complete when the working tree's fate is decided and there is at least one commit to release.
Step 2 — Determine the version
Read ${CLAUDE_PLUGIN_ROOT}/skills/versioning/references/version-sources.md.
- Detect the current version and every file that carries it — the first match is authoritative, but all of them get updated.
- Count the commits since the last tag by conventional type and apply the bump
table. Note the
0.xrule when it applies. - If the user named a version or bump type in their request, use that instead.
Hold the result: current version, new version, bump type, one-line reasoning (e.g. "1 feat, 0 fix, 0 breaking"), and the list of files to update.
Step 3 — Draft the changelog section
Read ${CLAUDE_PLUGIN_ROOT}/skills/changelog/references/commit-type-mapping.md
and ${CLAUDE_PLUGIN_ROOT}/skills/changelog/references/keep-a-changelog-1.1.0.md.
- If
CHANGELOG.mddoes not exist, create the Keep a Changelog skeleton in memory and treat every commit since the repo's first as the release's content. - Start from whatever already sits under
## [Unreleased]— those entries were written deliberately and are the source of truth. - Cross-check against the commits since the last tag. Anything user-visible that landed without an Unreleased entry gets drafted now; mention that you added it.
- Categorize, and write the entries as human-facing descriptions.
- Date the section with today's date in ISO 8601 (
YYYY-MM-DD). Get it from the environment context, not from a guess.
Do not write to the file yet.
Step 4 — Confirm, once
Print the plan first — current → new version, the files that will be updated, and the drafted changelog section in full. Then use a single AskUserQuestion call carrying these questions together:
| Header | Question | Options |
|---|---|---|
| Version | X.Y.Z → A.B.C (bump) — reasoning |
Go for it / Change version / Cancel |
| Changelog | The drafted section, as shown above | Looks good / Edit entries |
| Push | Push the commit and tag to the remote afterwards? | No, local only / Yes, push |
Bolded options are the defaults — list them first. "No, local only" is the default for Push: a tag that has been fetched by someone else cannot be retracted cleanly.
If the user picks "Change version" or "Edit entries", apply their input and re-confirm. Nothing is written until this step returns approval.
Step 5 — Apply
In this order, so the tag lands on a commit that contains everything:
Version files — update every file from Step 2 to the new version.
CHANGELOG.md — insert
## [A.B.C] - YYYY-MM-DDbelow## [Unreleased], move the entries into it, and leave## [Unreleased]in place and empty. Update link-reference definitions at the bottom of the file if the changelog uses them.Commit — stage the version files,
CHANGELOG.md, and anything the user opted to include in Step 1, then commit as:chore: release A.B.CVerify with
git status --shortthat nothing intended for the release was left unstaged before moving on.Tag — annotated, on that commit:
git tag -a vA.B.C -m "Release vA.B.C"
Step 6 — Push, only if asked
If the user chose to push in Step 4:
git push && git push --tagsOtherwise print that exact command and say the release is local until it runs.
Step 7 — Report
State plainly:
- Version: current → new
- Files updated
- Commit SHA and subject
- Tag created
- Pushed, or still local (with the command to push)
If any step was skipped or failed, say which and why. Do not report a release as done when the tag or commit did not land.
Integration
- Before this skill:
commit— conventional commits are what the bump and the changelog entries are derived from (commit) - Replaces: running
changelog(Release mode) and thenversioningby hand (changelog, versioning) - Still use
versioningon its own to bump a version without cutting a release (versioning) - Still use
changelogon its own to add entries to## [Unreleased]as you work (changelog) - Pairs with:
branch—release/vX.Y.Zwhen a release needs its own branch (branch)
Rules
- One confirmation, one commit, one tag — never split the release across commits
- Every decision the user has to make goes through AskUserQuestion — the dirty tree, the branch, the version, the changelog, the push. Never ask in prose and wait for a typed reply
- Never tag a commit that does not contain the changelog entry for that version
- Never push without explicit approval in Step 4
- Never re-use an existing tag; if
vA.B.Calready exists, stop and report it - Every version-carrying file moves together — a repo with
plugin.jsonandmarketplace.jsonout of sync is a bug this skill must not create - Dates are ISO 8601 (
YYYY-MM-DD), taken from the environment - This skill keeps no reference of its own:
version-sources.mdbelongs toversioning,commit-type-mapping.mdandkeep-a-changelog-1.1.0.mdtochangelog, and it reads all three across. If one cannot be read, look for it in thereferences/folder beside that skill'sSKILL.md. Never guess a bump or a changelog format because a reference did not load — say what failed and stop - NEVER include co-authoring or attribution references in commits
- Any git command you run during the task must be written so a non-zero exit
cannot abort the step. Use
out=$(<command> 2>/dev/null) || true; printf '%s\n' "${out:-(marker)}", the same form the context block uses. Several git commands report an ordinary, expected answer through a non-zero status —check-ignoreexits1for "not ignored",config --getexits1for "unset",config --unsetexits5for "was not set",rev-parse HEADexits128on a repo with no commits — and an unguarded one of those reads as a crash and stops work that should have continued - Do not re-run a context command just to confirm what is already printed above. Do re-check when its output contradicts itself or carries a shell error — a wrong answer is worth verifying — but re-run it in the guarded form, never bare, or the check fails the same way the original did
- Never put an unquoted glob (
README*,*.md) in a command. Shells disagree about an unmatched one: bash andshpass it through literally, zsh aborts the whole command before it runs and printsno matches found— which no2>/dev/nullcan suppress, because the shell emits it during expansion rather than the command emitting it. The result is a confident wrong answer. List the directory and filter it instead:ls -A | grep -iE "^(readme|license)"