Setup Release Kit
Install the canonical changeset-and-release workflow into the current repo, or upgrade an
existing copy. The canonical files live in this skill's assets/ directory and are copied
verbatim — repo-specific behavior belongs only in package.json scripts and
tag-triggered workflows, never inside the copied scripts.
Scope — say this to the user up front
The kit ends at the pushed tag. It owns: changeset per PR, the CI gate, version bump,
CHANGELOG.md, archiving notes to .changeset/released/<version>/, and pushing the
annotated tag vX.Y.Z. It never deploys or publishes anything. Anything downstream must be
a repo-owned workflow triggered by on: push: tags.
What gets installed
| Asset |
Destination |
Notes |
assets/scripts/changesets.mjs |
scripts/changesets.mjs |
Zero-dependency CLI |
assets/scripts/lib/changesets.mjs |
scripts/lib/changesets.mjs |
Core library |
assets/scripts/release.mjs |
scripts/release.mjs |
Phase 1: release PR |
assets/scripts/release-tag.mjs |
scripts/release-tag.mjs |
Phase 2: push tag |
assets/changeset-readme.md |
.changeset/README.md |
Format reference |
assets/workflows/changeset.yml |
.github/workflows/changeset.yml |
PR gate (no install step needed) |
assets/workflows/release-on-tag.yml |
.github/workflows/release-on-tag.yml |
Optional — offer it |
assets/workflows/deploy-on-tag.yml |
.github/workflows/deploy-on-tag.yml |
Starter stub — offer only if no tag-triggered workflow exists |
The library's test suite lives at tests/changesets.test.mjs in this skill (run with
node --test); it is not installed into target repos.
Plus these package.json scripts (merge, don't clobber):
"changeset": "node scripts/changesets.mjs",
"changeset:add": "node scripts/changesets.mjs add",
"changeset:status": "node scripts/changesets.mjs status",
"changeset:check": "node scripts/changesets.mjs validate",
"changeset:check-pr": "node scripts/changesets.mjs validate --branch-only --require-pending",
"changeset:version": "node scripts/changesets.mjs version",
"release": "node scripts/release.mjs",
"release:tag": "node scripts/release-tag.mjs"
First checks
- Confirm you are at a repo root with
package.json and a git remote. The scripts assume
a main default branch, GitHub, and the gh CLI; flag any mismatch before proceeding.
- Inspect what release tooling exists:
.changeset/, @changesets/cli in dependencies,
CHANGELOG.md, release scripts, tag-triggered workflows, existing tags.
- Pick the mode below and tell the user which one applies before changing anything.
Mode: fresh install (no changeset tooling)
- Copy all non-optional assets to their destinations. Merge the scripts into
package.json; if a script name collides, show the conflict and ask.
- If
package.json has no version, set 0.1.0. If CHANGELOG.md is missing, leave it —
the first release creates it.
- Create the
skip-changeset label if missing:
gh label create skip-changeset --description "PR does not need a changeset" --color ededed
- Check for an existing
on: push: tags workflow. If none, offer the two optional
workflows (release-on-tag.yml generic GitHub Release; deploy-on-tag.yml stub) and
explain the scope line. Never write a real deploy step yourself.
- Verify:
node scripts/changesets.mjs help runs, and changeset:check passes.
- Recommend making the
changeset present check required in branch protection.
Mode: migrate (repo has @changesets/cli or a homegrown scheme)
- Convert any pending notes to the kit's format (
type / category frontmatter +
summary-first body) before replacing tooling. Show the converted notes.
- Remove the old tooling (
@changesets/cli dependency, .changeset/config.json, old
release scripts) and proceed as a fresh install.
- Never rewrite
CHANGELOG.md history — the kit only prepends going forward.
Mode: update (repo already has the kit)
- Detect via the
release-kit v<N> header stamp in scripts/changesets.mjs.
- Diff each installed file against the asset. Show the drift. Local edits to kit files are
a bug by contract — surface them, then overwrite with the canonical copies.
- Leave
package.json scripts, .changeset/*.md notes, archives, and all tag-triggered
workflows untouched.
Finishing
- Land the install as a normal PR on a branch, and give it a changeset (the kit's first!)
or the
skip-changeset label per the user's preference.
- Point the user at
/write-changeset for per-PR notes and /prepare-release for cutting
releases.
- Close by restating the scope line and, if no tag-triggered workflow exists, saying so
plainly: "pushing a tag currently triggers nothing."
Boundaries
- Never deploy, publish, or create tags/releases while installing.
- Never edit the canonical assets to add repo-specific behavior; if a repo genuinely needs
different core behavior, that is a kit version bump in the skills repo, not a fork.
1---2name: setup-release-kit3description: Install or upgrade the portable changeset-and-release workflow (release kit) in a repo — changeset per PR, CI gate, two-phase tag-based releases, archived notes. Use when the user asks to set up, install, add, migrate to, or update the release kit / changeset workflow in a repository.4license: MIT5---67# Setup Release Kit89Install the canonical changeset-and-release workflow into the current repo, or upgrade an10existing copy. The canonical files live in this skill's `assets/` directory and are copied11**verbatim** — repo-specific behavior belongs only in `package.json` scripts and12tag-triggered workflows, never inside the copied scripts.1314## Scope — say this to the user up front1516**The kit ends at the pushed tag.** It owns: changeset per PR, the CI gate, version bump,17`CHANGELOG.md`, archiving notes to `.changeset/released/<version>/`, and pushing the18annotated tag `vX.Y.Z`. It never deploys or publishes anything. Anything downstream must be19a repo-owned workflow triggered by `on: push: tags`.2021## What gets installed2223| Asset | Destination | Notes |24| --- | --- | --- |25| `assets/scripts/changesets.mjs` | `scripts/changesets.mjs` | Zero-dependency CLI |26| `assets/scripts/lib/changesets.mjs` | `scripts/lib/changesets.mjs` | Core library |27| `assets/scripts/release.mjs` | `scripts/release.mjs` | Phase 1: release PR |28| `assets/scripts/release-tag.mjs` | `scripts/release-tag.mjs` | Phase 2: push tag |29| `assets/changeset-readme.md` | `.changeset/README.md` | Format reference |30| `assets/workflows/changeset.yml` | `.github/workflows/changeset.yml` | PR gate (no install step needed) |31| `assets/workflows/release-on-tag.yml` | `.github/workflows/release-on-tag.yml` | **Optional** — offer it |32| `assets/workflows/deploy-on-tag.yml` | `.github/workflows/deploy-on-tag.yml` | **Starter stub** — offer only if no tag-triggered workflow exists |3334The library's test suite lives at `tests/changesets.test.mjs` in this skill (run with35`node --test`); it is not installed into target repos.3637Plus these `package.json` scripts (merge, don't clobber):3839```json40"changeset": "node scripts/changesets.mjs",41"changeset:add": "node scripts/changesets.mjs add",42"changeset:status": "node scripts/changesets.mjs status",43"changeset:check": "node scripts/changesets.mjs validate",44"changeset:check-pr": "node scripts/changesets.mjs validate --branch-only --require-pending",45"changeset:version": "node scripts/changesets.mjs version",46"release": "node scripts/release.mjs",47"release:tag": "node scripts/release-tag.mjs"48```4950## First checks51521. Confirm you are at a repo root with `package.json` and a git remote. The scripts assume53 a `main` default branch, GitHub, and the `gh` CLI; flag any mismatch before proceeding.542. Inspect what release tooling exists: `.changeset/`, `@changesets/cli` in dependencies,55 `CHANGELOG.md`, release scripts, tag-triggered workflows, existing tags.563. Pick the mode below and tell the user which one applies before changing anything.5758## Mode: fresh install (no changeset tooling)59601. Copy all non-optional assets to their destinations. Merge the scripts into61 `package.json`; if a script name collides, show the conflict and ask.622. If `package.json` has no `version`, set `0.1.0`. If `CHANGELOG.md` is missing, leave it —63 the first release creates it.643. Create the `skip-changeset` label if missing:65 `gh label create skip-changeset --description "PR does not need a changeset" --color ededed`664. Check for an existing `on: push: tags` workflow. If none, offer the two optional67 workflows (`release-on-tag.yml` generic GitHub Release; `deploy-on-tag.yml` stub) and68 explain the scope line. Never write a real deploy step yourself.695. Verify: `node scripts/changesets.mjs help` runs, and `changeset:check` passes.706. Recommend making the `changeset present` check required in branch protection.7172## Mode: migrate (repo has @changesets/cli or a homegrown scheme)73741. Convert any pending notes to the kit's format (`type` / `category` frontmatter +75 summary-first body) before replacing tooling. Show the converted notes.762. Remove the old tooling (`@changesets/cli` dependency, `.changeset/config.json`, old77 release scripts) and proceed as a fresh install.783. Never rewrite `CHANGELOG.md` history — the kit only prepends going forward.7980## Mode: update (repo already has the kit)81821. Detect via the `release-kit v<N>` header stamp in `scripts/changesets.mjs`.832. Diff each installed file against the asset. Show the drift. Local edits to kit files are84 a bug by contract — surface them, then overwrite with the canonical copies.853. Leave `package.json` scripts, `.changeset/*.md` notes, archives, and all tag-triggered86 workflows untouched.8788## Finishing8990- Land the install as a normal PR on a branch, and give it a changeset (the kit's first!)91 or the `skip-changeset` label per the user's preference.92- Point the user at `/write-changeset` for per-PR notes and `/prepare-release` for cutting93 releases.94- Close by restating the scope line and, if no tag-triggered workflow exists, saying so95 plainly: "pushing a tag currently triggers nothing."9697## Boundaries9899- Never deploy, publish, or create tags/releases while installing.100- Never edit the canonical assets to add repo-specific behavior; if a repo genuinely needs101 different core behavior, that is a kit version bump in the skills repo, not a fork.