---
name: publish-npm-version
description: >-
  Cuts the next release of the unified Prisma CLI: bumps the root package.json version (on the Prisma 8 RC line: 8.0.0-rc.N → rc.N+1), propagates it to every lockstep workspace package, and opens a PR titled "chore(release): bump to <next-version>". When the maintainer merges the PR, the `Publish to npm` workflow ships @prisma/cli-engine and @prisma/cli under dist-tag `latest` (RC versions get a pre-release GitHub Release). Use when a maintainer asks to "cut the next RC", "cut the next release", "bump to the next version", "open a release PR", or "prepare a publish PR".
title: publish-npm-version
canonical_url: https://skilld.dev/gh/prisma/prisma-cli/publish-npm-version
last_updated: 2026-10-08T07:34:05.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install prisma/prisma-cli/publish-npm-version`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/publish-npm-version`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/prisma/prisma-cli/publish-npm-version) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/publish-npm-version`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/publish-npm-version --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/publish-npm-version --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Publish next npm version

## Audience

Maintainers of the unified Prisma CLI with permission to push branches
and open PRs in prisma/prisma-cli. The skill runs locally, never as a
GitHub Action — a locally opened PR triggers CI normally, which is the
point of a reviewable release PR.

## Background reading

Read [`docs/oss/versioning.md`](../../docs/oss/versioning.md) first. It
covers the source-of-truth model (root `package.json` `version`), the
lockstep guarantee (`@prisma/compute` excluded by ruling), the Prisma 8 RC
line, the dist-tag convention, and the release procedure this skill is
one step of. One note specific to this
repo: the lockstep excludes `@prisma/compute` by operator ruling.

## Pre-flight

No requirement to be on `main` or have a clean tree — all work happens
in a fresh worktree off `origin/main`. Confirm `git fetch origin main`
succeeds; if not, stop and surface the issue.

## Procedure

1. **Fetch and determine the target version.**

   ```bash
   git fetch origin main
   CURRENT=$(git show origin/main:package.json | node -e 'process.stdout.write(JSON.parse(require("fs").readFileSync(0,"utf8")).version)')
   NEXT=$(node -e "import('./scripts/determine-version-utils.ts').then(m => process.stdout.write(m.computeNextReleaseVersion(process.argv[1])))" "$CURRENT")
   echo "$CURRENT → $NEXT"
   ```

   `$NEXT` names the branch and PR; step 3 recomputes the authoritative
   value inside the fresh worktree and the two must agree.

2. **Create a fresh worktree off `origin/main`.**

   ```bash
   git worktree add -b "release/$NEXT" "../release-$NEXT" origin/main
   cd "../release-$NEXT"
   ```

3. **Bump.** `pnpm install --frozen-lockfile --ignore-scripts` if the
   worktree has no `node_modules`, then `pnpm bump-version`. Confirm the
   version it wrote matches `$NEXT`; on mismatch the worktree's value is
   authoritative — remove worktree and branch, restart from step 1.

4. **Check the lockfile moved.** `pnpm bump-version` refreshes
   `pnpm-lock.yaml` itself, because internal deps are pinned
   `workspace:<version>` and a stale lockfile fails every later frozen
   install with `ERR_PNPM_OUTDATED_LOCKFILE`. If it is missing from the
   diff, stop — the bump did not finish.

5. **Sanity-check the diff.** Only `package.json` files and
   `pnpm-lock.yaml`; manifests change exactly `version` +
   `workspace:<old> → workspace:<new>`; the excluded
   `packages/compute/package.json` is untouched.

6. **Commit** everything in one commit:

   ```text
   chore(release): bump to <version>
   ```

7. **Push the branch** to `origin`.

8. **Open the PR** with `gh pr create`. Use the title:

   ```text
   Bump to version <version>
   ```

   Body: previous → new version; link
   [`docs/oss/versioning.md`](../../docs/oss/versioning.md); note that
   **merging this PR ships the release** — the squashed push to `main`
   changes the root version with the release marker, the `Publish to
   npm` workflow publishes `@prisma/cli-engine` then `@prisma/cli`
   under `latest`, and a GitHub Release (pre-release on the RC line) is
   created with generated notes. This repo has no committed
   release-notes file gate; review the generated notes on the Release
   after merge.

9. **Stop and report** the PR URL and the worktree path. Do not merge —
   the merge is the human gate that triggers the publish. The
   maintainer removes the worktree after merge
   (`git worktree remove ../release-<version>`).

## Idempotency

`pnpm bump-version` reads the root version from `git show
HEAD:package.json`, so re-running in the same worktree cannot
double-bump. The skill as a whole is not idempotent: step 2 fails if
the branch/worktree already exist — remove them
(`git worktree remove ../release-$NEXT`; `git branch -D
release/$NEXT`) or continue inside the existing worktree from step 3.
Do not stack bumps.

## Out of scope

- **Merging the PR** (human gate; merging is the publish trigger).
- **Patch releases.** On the RC line a fix is just the next `rc.N`.
- **Beta tags** — hand-cut via `workflow_dispatch` of `Publish to npm`
  with the `beta` dist-tag; this skill always advances the release
  version.
- **`@prisma/compute`** — excluded from the lockstep by operator ruling
  (2026-08-10); it versions and publishes independently
  (`publish-compute.yml`) pending extraction to another repo.
