/buddy-changesets:init-changesetsfrom buddy-changesets
Use this skill when setting up changesets, adding release CI, upgrading the Changesets CLI across a major, or migrating from another release tool. Also when a release job fails with a Changesets CLI/action version mismatch.
Ships in buddy-changesets. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
changesets/action on GitHub, or direct version/publish elsewhere)changesets/action ↔ CLI version mismatchTrigger phrases: 'add changesets', 'set up releases', 'configure versioning', 'upgrade changesets', shared <org>/.github release workflow.
Not this skill:
changesetssetup-github-repoDetect automatically (do not ask if the filesystem answers it):
| Check | How |
|---|---|
| Package manager | pnpm-lock.yaml, bun.lock/bun.lockb, yarn.lock, package-lock.json |
| Monorepo | pnpm-workspace.yaml, workspaces in root package.json, or bun.workspace.ts |
| Agent plugin repo | root plugin.json, .claude-plugin/, or .agents/universal-plugin.json — the product is skills and commands installed from a marketplace, and the repo may publish nothing to npm |
| Already initialized | .changeset/ directory exists |
| CLI major | @changesets/cli range in root package.json |
| Action major | changesets/action@ ref in the release workflow — follow a uses: to the shared workflow first |
| CI platform | .github/workflows/ → GitHub Actions; .gitlab-ci.yml → GitLab; .circleci/config.yml → CircleCI; bitbucket-pipelines.yml → Bitbucket; azure-pipelines.yml → Azure; Jenkinsfile → Jenkins; .travis.yml → Travis; .drone.yml → Drone; none → ask |
Competing release tools — check package.json deps and config files:
| Tool | Detection |
|---|---|
| semantic-release | dep or .releaserc* / release.config.* / "release" in package.json |
| release-it | dep or .release-it.* / "release-it" in package.json |
| standard-version | dep or .versionrc* / "standard-version" in package.json |
| beachball | dep or beachball.config.json |
| release-please | release-please-config.json / .release-please-manifest.json |
| auto (Intuit) | dep or .autorc* |
| Nx Release | nx in deps and "release" in nx.json |
| lerna | lerna.json |
| bumpp | dep |
| changelogen | dep |
Early exits:
| Condition | Action |
|---|---|
.changeset/ already exists | Skip step 2; audit config/scripts/CI only |
| CLI major ≠ action major, or CLI still v2 | Read references/migration/cli-v3-upgrade.md and upgrade — see the pairing table in step 5. Do not re-run init |
| Competing tool detected | Ask: migrate to changesets? No → stop. Yes → load that tool's migration reference, apply removal, then continue |
| Non-GitHub CI and user expects a Version Packages PR | Explain that pattern is GitHub-only; proceed with the common non-GitHub pattern or stop |
Ask the user:
<org-or-user>/.github? Yes → Option B in step 5. No → inline workflow.fixed groups (same version always)?ignore (private/internal, not published)?npm publish.Skip if .changeset/ already exists.
The CLI is not installed yet, so this fetches it. Use the exact version shown in every variant:
# pnpm
pnpm dlx @changesets/[email protected] init
# bun
bunx @changesets/[email protected] init
# npm / yarn
npx @changesets/[email protected] init
Creates .changeset/config.json and .changeset/README.md.
.changeset/config.jsonReplace the generated config. Set baseBranch to the repo's default branch if not main.
Single package:
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"access": "public",
"baseBranch": "main"
}
Monorepo with grouped packages:
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"access": "public",
"baseBranch": "main",
"fixed": [["package-a", "package-b"]],
"linked": [],
"ignore": ["internal-tools"],
"updateInternalDependencies": "patch"
}
Agent plugin repo (no npm publish):
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"baseBranch": "main",
"privatePackages": { "version": true, "tag": true }
}
Changesets versions a project it never publishes, but it only ever writes a package.json — that is
where the number lives. A plugin repo without one needs a minimal file, nothing more:
{
"name": "my-plugin",
"private": true,
"version": "0.0.1"
}
privatePackages then lets changesets bump and tag it; the tag is what triggers the real release.
Leave "access" out — nothing publishes to npm.
tag: true tags every private workspace project that has a version, so a docs app or an
internal tool would be tagged on each release too. Run <pm-exec> changeset publish-plan --output plan.json and check that only the plugin packages are listed as tag-only. Remove the version
field from any other private project, or list it in "ignore".
Key decisions:
"access": "public" — required to publish scoped packages (@scope/name) publicly"fixed" — packages that must share the exact same version"linked" — packages that share the highest bump type but keep independent versions"ignore" — excluded from changeset versioning (e.g. examples, internal CLIs)"commit": false — default; CI/action controls commits"privatePackages" — { "version": true, "tag": true } versions and tags a private: true
project so a non-npm release can hang off the tagpackage.json{
"scripts": {
"version": "changeset version",
"release": "changeset publish",
"cs": "changeset"
}
}
If a build must run before publish: "release": "<pm> build && changeset publish".
Plugin repo: changesets has no plugin API for other version files, so both halves of the release are scripts around the CLI.
version chains the step that carries the released number out of package.json into the plugin
manifests and the repository's marketplace catalog entries. These are derived and must never be
hand-edited.release stays changeset publish. For a private: true package with privatePackages.tag it
runs no npm publish. It only creates the <name>@<version> git tag (v<version> in a
single-package repo) and records it in the CLI's output report.Detect the toolchain rather than assuming one:
| Detected | version script |
|---|---|
.agents/universal-plugin.json, universal-plugin 0.17 or later | changeset version && universal-plugin plugin version --from-package |
.agents/universal-plugin.json, an older universal-plugin | changeset version && universal-plugin publish sync-version && universal-plugin plugin build (deprecated in 0.17) |
| The repo already has a command that propagates the version | changeset version && <that command> |
| Neither | Offer to adopt universal-plugin (the init-universal-plugin skill), then use the first row. Do not write a sync script |
For a plugin in a subdirectory, add --root <dir> to each universal-plugin call.
plugin version --from-package stamps the package.json version into plugin.json, the vendor
manifests, the marketplace catalogs, and the skill pins.
{
"scripts": {
"version": "changeset version && universal-plugin plugin version --from-package",
"release": "changeset publish",
"cs": "changeset"
}
}
changesets/action refuses a mismatched CLI:
Error: This version of the Changesets action is designed to work with Changesets CLI v3.
Changesets CLI v2 is not supported; use Changesets action v1 instead, which is compatible with CLI v2.
@changesets/cli | changesets/action | Input names |
|---|---|---|
| v2 | @v1 | version:, publish:, commit:, GITHUB_TOKEN env var |
| v3 | @v2 | version-script:, publish-script:, commit-message:, github-token: input |
The renamed inputs are silently ignored under the wrong major, so a half-done bump leaves the action running with no publish script. Change both sides in one commit.
New repos get CLI v3 + action v2. Staying on v2 is not a safe hold: npm 12 changed npm info --json to emit an array (verified with npm 12.1.0 on 2026-11-04), and CLI 2.x reads .versions off the parsed object — it comes back undefined, every version looks unpublished, and the release republishes into npm's E403.
Create .github/workflows/release.yml:
name: release
on:
push:
branches: [main]
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Insert package manager setup here (see below)
- run: <install-command>
- run: <build-command> # remove if no build step
- name: Create Release PR or Publish
uses: changesets/action@v2
with:
version-script: <pm> run version
publish-script: <pm> run release
github-token: ${{ secrets.GITHUB_TOKEN }}
The job publishes to npm through trusted publishing: id-token: write lets npm exchange the job's OIDC identity for a short-lived credential, so no token secret is stored. If the repo cannot use trusted publishing, add the legacy NPM_TOKEN env (see Secrets).
Plugin repo: keep publish-script: <pm> run release and drop id-token: write, since nothing
goes to npm. Without a publish script the action does nothing after the Version Packages PR merges,
so no tag or release ever marks the version. With it, action v2 runs changeset publish and reads
the git-tag events from the CLI's output report (CHANGESETS_OUTPUT). It then pushes each tag
and creates a GitHub release for it (create-github-releases defaults to true). That tag is the
ref users install from.
A marketplace in another repository that pins this plugin by ref or sha needs its own
update. Trigger it from the release, either with a release: published workflow or with a
follow-up step gated on the action's published output. A workflow triggered by
GITHUB_TOKEN does not start other workflows, so a cross-repo release trigger needs a PAT or a
GitHub App token in github-token:.
Replace <pm> and <install-command> from step 1. Package manager setup:
pnpm:
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
bun:
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version: 22
npm/yarn:
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm # or: yarn
Token note: GITHUB_TOKEN is enough for most repos. If branch protection requires CI on the Version Packages PR, use a PAT with repo scope as RELEASE_TOKEN and pass it as the action's github-token: input.
In <user-or-org>/.github, create .github/workflows/release-changeset.yml:
name: release-changeset
on:
workflow_call:
inputs:
node-version:
type: string
default: '22'
outputs:
published:
description: 'Whether packages were published'
value: ${{ jobs.release.outputs.published }}
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
outputs:
published: ${{ steps.changesets.outputs.published }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Add package manager setup, install, build
- name: Create Release PR or Publish
id: changesets
uses: changesets/action@v2
with:
version-script: <pm> run version
publish-script: <pm> run release
github-token: ${{ secrets.GITHUB_TOKEN }}
In each consuming repo:
name: release
on:
push:
branches: [main]
jobs:
release:
uses: <user-or-org>/.github/.github/workflows/release-changeset.yml@main
secrets: inherit
A shared workflow makes the action version a fleet-wide decision. Bumping changesets/action here breaks the release job in every consumer still on the old CLI, and the failure surfaces in their repos, not this one — each on its next push to main, not at merge time. Bump the consumers' CLI in the same pass.
Load the common non-GitHub pattern, then the detected platform's file — both listed in References.
id-token: write
does the rest. Not needed by a plugin repo that publishes nothing to npmNPM_TOKEN — legacy npm automation token, only for CI platforms without npm trusted publishing
(non-GitHub CI) or a package that has not registered a trusted publisher; add it to the
changesets/action step as env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }}RELEASE_TOKEN — optional GitHub PAT, only if branch protection blocks the Version Packages PRAssert the pairing first — the one check that catches a setup which looks complete and fails on its first release:
jq -r '.devDependencies["@changesets/cli"] // .dependencies["@changesets/cli"]' package.json
grep -rn 'changesets/action@' .github/workflows/ # follow a `uses:` to the shared workflow first
cli ^3 needs action@v2 with the -script input names; cli ^2 needs action@v1. A mismatch is the failure, whatever else is green.
@changesets/cli is now a dev dependency, so run its local binary rather than fetching one. <pm-exec> is pnpm exec, npx --no-install, yarn, or bun run:
<pm-exec> changeset add --empty
ls .changeset/
gh workflow list # GitHub only
Plugin repo: confirm the release only tags, and only the plugin packages:
<pm-exec> changeset publish-plan --output plan.json && cat plan.json && rm plan.json
Every entry must be "kind": "tag-only" for a plugin package. A "kind": "npm" entry means a
package is not private, and one more tag-only entry is a private project to remove the version
from or ignore.
On an existing repo with pending changesets, confirm they still parse — this is what proves an upgrade did not strand a release:
<pm-exec> changeset status
Tell the user that changeset files are added via the changesets skill, and that versions and CHANGELOG.md on the Version Packages PR are generated — never hand-edited.
write-changeset's bump-type and summary rules here"commit": true when CI runs changesets/actionplugin.json or a vendor manifest, or running a plugin CLI's own
version command in a changesets repo — it picks a number changesets is about to pick againpublish-script in a plugin repo because nothing goes to npm — the tag and GitHub
release come from that stepLoad one row only, when step 1 detection matches it.
| Detected tool | Migration reference |
|---|---|
| semantic-release | references/migration/semantic-release.md |
| release-it | references/migration/release-it.md |
| standard-version | references/migration/standard-version.md |
| beachball | references/migration/beachball.md |
| release-please | references/migration/release-please.md |
| auto (Intuit) | references/migration/auto.md |
| Nx Release | references/migration/nx-release.md |
| lerna | references/migration/lerna.md |
| bumpp | references/migration/bumpp.md |
| changelogen | references/migration/changelogen.md |
Non-GitHub CI — read references/ci/_common.md first, then the platform file.
| Detected platform | CI reference |
|---|---|
| GitLab | references/ci/gitlab.md |
| CircleCI | references/ci/circleci.md |
| Bitbucket | references/ci/bitbucket.md |
| Azure Pipelines | references/ci/azure-pipelines.md |
| Jenkins | references/ci/jenkins.md |
| Travis CI | references/ci/travis.md |
| Drone | references/ci/drone.md |
readme.md (opens in a new tab)references/ci/_common.md (opens in a new tab)references/ci/azure-pipelines.md (opens in a new tab)references/ci/bitbucket.md (opens in a new tab)references/ci/circleci.md (opens in a new tab)references/ci/drone.md (opens in a new tab)references/ci/gitlab.md (opens in a new tab)references/ci/jenkins.md (opens in a new tab)references/ci/travis.md (opens in a new tab)references/migration/auto.md (opens in a new tab)references/migration/beachball.md (opens in a new tab)references/migration/bumpp.md (opens in a new tab)references/migration/changelogen.md (opens in a new tab)references/migration/cli-v3-upgrade.md (opens in a new tab)references/migration/lerna.md (opens in a new tab)references/migration/nx-release.md (opens in a new tab)references/migration/release-it.md (opens in a new tab)references/migration/release-please.md (opens in a new tab)references/migration/semantic-release.md (opens in a new tab)references/migration/standard-version.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub repobuddy/buddy-changesets --plugin buddy-changesets4 skills in this plugin
/changesetsUse this skill for changeset work on an existing setup — write a changeset for the current change, or review the pending changesets in `.changeset/` before merging. Triggers on 'add a changeset', 'add cs', a missing-changeset CI failure, 'review the changesets', or 'check the changeset wording'./review-changesetsInternal skill: review the pending changesets in `.changeset/` for scope, accuracy, and wording, adding a missing one first. Called by the `changesets` gateway in `review` mode./write-changesetInternal skill: write a changeset file for the current change. Called by the `changesets` gateway in `add` mode, and by `review-changesets` when a pending changeset is missing.