Open the promotion PR from the development branch to the production branch (`branchStrategy.development` → `branchStrategy.production`; the development branch falls back to `origin/HEAD`, then the first `protectedBranches` entry, then `main`, production to `main`) — checks a clean, up-to-date checkout and green CI gates; in a plugin marketplace repo that versions at release (`plugins/` plus `scripts/check-release-bump.mjs`) it also prepares the version bumps (a release-prep PR) and enforces t...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Release?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ivan-ii-tech-digital-release)
---
name: release
description: Open the promotion PR from the development branch to the production branch (`branchStrategy.development` → `branchStrategy.production`; the development branch falls back to `origin/HEAD`, then the first `protectedBranches` entry, then `main`, production to `main`) — checks a clean, up-to-date checkout and green CI gates; in a plugin marketplace repo that versions at release (`plugins/` plus `scripts/check-release-bump.mjs`) it also prepares the version bumps (a release-prep PR) and enforces the release-bump rule; the PR body comes from the new CHANGELOG sections. Stops at a PR URL. Never merges, not even via merge-pr.
disable-model-invocation: true
model: sonnet
---
Open one promotion PR from `<FROM>` to `<TO>`. In a plugin marketplace repository that versions at release (a `plugins/` directory and `scripts/check-release-bump.mjs` on `origin/<FROM>`) the PR lists each changed plugin with its version and new CHANGELOG sections; in any other repository, a plugin repository whose versions are set by a separate publish step included, it lists the promoted commits and bumps nothing. Follow the steps literally. Every refusal below prints its message and stops: no PR, no fix, no push.
## Step 0: Read the config
```bash
ak-git-sync --print-config
```
It resolves the config (`config.local.json` merged over `config.json`, every fallback applied; no config prints the defaults) and changes nothing. Call `default=` `<FROM>`, `production=` `<TO>`, `require_clean_ci=` `<CI>` and `worktrees_root=` `<WT_ROOT>`. `<FROM>` equals `<TO>` → refuse: `Not releasing: development and production are both <FROM>; set branchStrategy.development and branchStrategy.production in .agent-kit/config.json.` Run every later command from the repository root (`git rev-parse --show-toplevel`).
## Step 1: Clean, current checkout on `<FROM>`
```bash
git fetch origin "<FROM>" "<TO>"
git status --porcelain
git rev-parse --abbrev-ref HEAD
git rev-list --left-right --count "HEAD...origin/<FROM>"
```
- Any `git status --porcelain` output → refuse: `Not releasing: the working tree has uncommitted changes (<n> paths). The gates must run on exactly what <FROM> holds; commit or remove them first.`
- Current branch is not `<FROM>` → refuse: `Not releasing: this checkout is on <branch>, not <FROM>. Run /release from the checkout on <FROM> (normally the primary checkout).`
- The counts read `<ahead> <behind>`. `<behind>` > 0 → refuse: `Not releasing: <FROM> is <behind> commit(s) behind origin/<FROM>. Pull first, then re-run.` `<ahead>` > 0 → refuse: `Not releasing: <FROM> has <ahead> unpushed commit(s); the PR would not contain them. Push through a PR first.`
## Step 2: What changed
```bash
git merge-base "origin/<TO>" "origin/<FROM>" # <MB>
git cat-file -e "origin/<FROM>:plugins" 2>/dev/null && git cat-file -e "origin/<FROM>:scripts/check-release-bump.mjs" 2>/dev/null &&
echo plugin-repo || echo plain-repo
```
`<MB>` is the printed merge-base sha; type it literally in later commands (shell variables do not survive between Bash calls). A repository with `plugins/` but no `scripts/check-release-bump.mjs` is a plain repo here; say in the report: `versions not bumped: a plugin marketplace repo that versions at release copies scripts/check-release-bump.mjs from the public II-Tech-Ivan-Ivanov/agent-kit repository into its own scripts/`.
**Plain repo:** `git diff --quiet "origin/<TO>" "origin/<FROM>"` exits 0 → refuse: `Not releasing: origin/<FROM> has no content that origin/<TO> lacks; nothing to promote.` Otherwise collect the promoted commits with `git log --no-merges --format='%h %s' "<MB>..origin/<FROM>"` and go to Step 3.
**Plugin repo:**
```bash
git diff --name-only <MB> "origin/<FROM>" -- plugins/ | cut -d/ -f2 | LC_ALL=C sort -u
```
Keep each name whose `plugins/<name>/.claude-plugin/plugin.json` still exists on `origin/<FROM>` (a removed plugin has no version to release; name it in the report). The list is empty → refuse: `Not releasing: no plugin under plugins/ changed between origin/<TO> and origin/<FROM>; there is nothing for consumers to update to.`
For each plugin `<p>` read the versions:
```bash
git show "origin/<TO>:plugins/<p>/.claude-plugin/plugin.json" 2>/dev/null | jq -r '.version // empty' # <OLD>, empty = new plugin
git show "origin/<FROM>:plugins/<p>/.claude-plugin/plugin.json" | jq -r .version # <NEW>
```
## Step 3: No promotion PR open yet
First read the project's merge settings: `ak-forge project | jq -r '"\(.squashOption // "") \(.mergeMethod // "")"'`. A non-zero exit → stop with its `ak-forge: …` line. Merge method `rebase_merge` (a GitLab project) → refuse: `Not releasing: this GitLab project merges with rebase_merge, which needs <FROM> to contain <TO>'s tip; after the first promotion it never does (nothing merges <TO> back), so every later promotion would need a rebase of the shared <FROM>; set Settings → Merge requests → Merge method → Merge commit, then re-run.` Merge method `ff` → continue, and say in the report that the promotion fast-forwards <TO>, which works only while <TO> moves by promotion alone. Squash option `always` (a GitLab project) → refuse: `Not releasing: this GitLab project squashes every merge (squash_option always), which would squash the promotion and leave <FROM> diverged from <TO>; change Settings → Merge requests → Squash commits when merging, then re-run.` Anything else (GitHub prints neither) → continue.
```bash
ak-forge pr list --base "<TO>" --head "<FROM>" --state open
```
A non-zero exit or empty output → stop and report ak-forge's `ak-forge: …` stderr line (a failed lookup is never "none open"). `[]` → continue. Any element → stop: `A promotion PR is already open: <ref> <title> <url>. It updates as <FROM> moves; not opening a second one.` (`number`, `title` and `url` of the first element; `<ref>` is `!<number>` when `ak-forge which` prints `gitlab` first, else `#<number>`.)
## Step 4: CI gates (only when `<CI>` is `true`)
Run the check-all skill (ak-quality plugin): every `qualityGates.ci` gate, in order. Any ✗ → refuse: `Not releasing: <FROM> is red locally — failing gate(s): <names>.` followed by each failing gate's decisive error lines. Fixes land on `<FROM>` through a normal PR, never from this skill. "No quality gates configured" counts as green; say so in the report.
## Step 5: Versions (plugin repo only)
Plain repo (Step 2) → skip this step and print one line: `release-bump check skipped: not a plugin marketplace repo (no plugins/ or no scripts/check-release-bump.mjs).` A missing capability is a no-op with a note, never a refusal.
Versions bump only at release: development PRs log changes under a `## Unreleased` CHANGELOG heading and never touch `plugin.json`. Run the repository's own check, the same script CI runs on every PR into the production branch — never re-implement it:
```bash
node scripts/check-release-bump.mjs "origin/<TO>" "origin/<FROM>"
```
**Exit 0** → the bumps are already prepared; continue to Step 6.
**Non-zero** → prepare them now, as a release-prep PR (never a direct commit to `<FROM>`):
1. Plan the bumps:
```bash
node scripts/check-release-bump.mjs --plan "origin/<TO>" "origin/<FROM>"
```
Exit 1 → refuse: `Not releasing: <its FAIL lines>; fix them through a normal PR.` Otherwise each line is `<p><TAB><OLD or "new"><TAB><size><TAB><new>` for a Step 2 plugin still on `<OLD>` (a new plugin keeps its version, size `keep`). No line → refuse: `Not releasing: the release-bump check fails with nothing left to bump: <its FAIL lines>; fix them through a normal PR.`
2. In a temporary worktree, never by switching this checkout: `git worktree add -b release/bump-<YYYYMMDD> "<WT_ROOT>/release-bump-<YYYYMMDD>" origin/<FROM>` (if that branch exists locally or on origin, append `-2`, `-3`, … to the branch and to the path alike). Call the path `<BWT>`.
3. There, apply the plan: `(cd "<BWT>" && node scripts/check-release-bump.mjs --apply "origin/<TO>")`. One commit, subject `release: bump <p>@<new>, <q>@<new>, …`. `(cd "<BWT>" && node scripts/check-release-bump.mjs "origin/<TO>")` must now exit 0; otherwise remove the worktree and branch, and refuse with its FAIL lines. Push with `git -C "<BWT>" push -u origin <branch>`, open a PR into `<FROM>` (`ak-forge pr create`, title and body each written to a temporary file) with that title and a body listing each plugin's `<OLD or "new"> → <new> (<size>)`, then `git worktree remove "<BWT>"` and `git branch -D <branch>` (the PR keeps the remote branch).
Any other failure after `worktree add` (apply, commit, push, `ak-forge pr create`): remove `<BWT>` (`--force` only before the commit, whose edits `--apply` regenerates). Keep the branch when it holds the bump commit, and refuse with the error and the branch name.
4. Stop with: `Release prep PR: <url>. Merge it, then run /release again to open the promotion PR.`
## Step 6: Build the PR
Title and body, each written to a temporary file. The body starts with this warning line, then a line `Promotes <FROM> → <TO>.`:
`**Merge with "Create a merge commit", never squash or rebase:** a squash copies <FROM>'s commits into one new commit on <TO> and splits the two histories.` On GitLab (`ak-forge which` prints `gitlab` first) its bold part reads `**Merge with "Squash commits" unticked:**`. A free GitHub private repository cannot restrict merge methods per branch, so this line and `ak-git-sync`'s squashed-promotion warning are the guard.
**Plain repo:** title `release: <FROM> → <TO>`; body continues with `## Commits` and one `- <subject> (<sha>)` line per Step 2 commit.
**Plugin repo:** title `release: <p>@<NEW>, <q>@<NEW>, …` in the Step 2 order; body continues per plugin with a heading `## <p> <OLD or "new"> → <NEW>` followed by the CHANGELOG sections added since `<OLD>`, headings demoted one level:
```bash
git show "origin/<FROM>:plugins/<p>/CHANGELOG.md" |
awk -v old="<OLD>" '/^## /{v=$(2); gsub(/[][]/, "", v); sub(/^v/, "", v); if (old != "" && v == old) exit; on=1} on' |
sed 's/^#/##/'
```
No `Co-authored-by` trailer of any kind (human or AI) and no tool attribution anywhere in title or body.
## Step 7: Open it
```bash
ak-forge pr create --base "<TO>" --head "<FROM>" --title-file "<title file>" --body-file "<body file>" --no-squash
```
`--no-squash` keeps a GitLab promotion MR's squash box unticked on a `default_on` project (GitHub ignores it). Surface any error verbatim and stop.
## Step 8: Report and stop
```
Release PR: <url>
Title: <title>
Plugins: <p> <OLD> → <NEW>, … (plain repo: Commits: <n>)
Checks: CI gates <k/k passed | skipped (requireCleanCI false) | none configured>; release-bump <PASS | skipped: not a plugin marketplace repo>
```
End with: `Merging is your action: review the PR and merge it yourself once its checks are green — with a merge commit, never squash or rebase, so <FROM> stays an ancestor of <TO>. From the terminal, pass the body explicitly so GitHub writes no default message: gh pr merge <number> --merge --match-head-commit <sha> --subject "<title> (#<number>)" --body "Promotes <FROM> → <TO>." (<sha> the head you reviewed); in the web UI, check the commit message holds no Co-authored-by line.` On GitLab (`ak-forge which` prints `gitlab` first) the terminal part reads instead: `From the terminal: glab mr merge <number> --auto-merge=false --yes --message "Merge branch '<FROM>' into '<TO>'" (no --squash); in the web UI, leave squash and "Delete source branch" unticked (the kit opened the MR with both off, so <FROM> stays) and check the message holds no Co-authored-by line.`
## What this skill never does
- Never merges, approves, or enables auto-merge on the PR — not through `/merge-pr` either.
- Never pushes or commits to `<FROM>` or `<TO>`: version bumps ride the Step 5 release-prep PR on a `release/*` branch, and a failed gate's fix ships through a normal PR into `<FROM>`.