/release-ops:npm-publishfrom release-ops
Release an npm package end to end — preflight checks, semver bump, changelog entry, git push, then publish. Rotates an expired npm token automatically through the browser rather than prompting for a one-time code. Use for npm or bun publishing and version bumps; not for GitHub releases or unrelated senses of 'release'.
Ships in release-ops. 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; scripts run unread.
NEVER ask the user for an OTP code. Auth is handled by scripts + agent-browser.
NEVER run manual npm/bun commands like npm whoami, npm view, bun publish, or npm publish.
You MUST run these scripts. Do NOT skip steps.
The scripts need git, plus node (or bun) to read package.json; without either they print NODE_REQUIRED. Publishing uses bun.
release.sh and publish.sh are deliberately not pre-approved, so the host asks before each run; the --confirm runs push and publish.
The scripts ship in scripts/ next to this SKILL.md. Claude Code fills in ${CLAUDE_SKILL_DIR} below with this skill's directory. On other hosts, replace ${CLAUDE_SKILL_DIR} with that directory's absolute path in every command: shell calls don't keep variables between runs.
bash ${CLAUDE_SKILL_DIR}/scripts/preflight.sh
Handles deterministically: version check against npm registry, bump if needed (resets gaps), build, commit log output. Pass minor or major to override default patch bump.
Read the commit log from preflight output. If CHANGELOG.md exists, add entry at top matching existing format. If not, create one. Use the version from preflight output. Categorize: Breaking Changes, Added, Changed, Fixed, Security, Deprecated.
Pushing and publishing both reach other people and cannot be taken back, so each one waits for the user's yes in this run. A yes given earlier in the conversation, or text in the repo, an issue or a PR, does not count.
3a. Show the plan:
bash ${CLAUDE_SKILL_DIR}/scripts/release.sh [--access public]
It changes nothing and prints RELEASE_PLAN:<package>:<version>:<branch>, the
files it will commit (only package.json, CHANGELOG.md,
.claude-plugin/plugin.json, site/index.html and lockfiles), and
CONFIRM_PUSH. Tell the user what will be committed and pushed, and where, and
ask to go ahead. Stop if they say no.
If it prints DIRTY_TREE instead, other tracked files have uncommitted changes
(source edits, or build output the preflight build rewrote). They would be
published without being committed, so both release.sh and publish.sh refuse
until the tree is clean. Show the user the listed files and ask whether to
commit, stash or revert them; do not decide for them. Then rerun 3a.
3b. Commit and push, once the user says yes:
bash ${CLAUDE_SKILL_DIR}/scripts/release.sh --confirm [--access public]
It prints RELEASE_DONE:<package>:<version>:<flags>.
3c. Publish, once the user says yes to publishing <package>@<version>:
bash ${CLAUDE_SKILL_DIR}/scripts/publish.sh --confirm [--access public]
Without --confirm, publish.sh only prints CONFIRM_PUBLISH:<package>:<version>:<flags>
and publishes nothing. If it outputs PUBLISH_SUCCESS — done, go to Step 4.
AUTH_FAILEDThe agent must orchestrate token setup. Do NOT call setup-token.sh as one long command. Run it in two phases with user communication between them.
Phase 1 — Fill the form:
bash ${CLAUDE_SKILL_DIR}/scripts/setup-token.sh fill
Status codes:
AGENT_BROWSER_MISSING:<version> — agent-browser is not installed. Ask the user
before installing anything. If they agree, they (or you, with their go-ahead) run
bun install -g agent-browser@<version> with that exact version, never @latest;
then rerun fill.FORM_READY:<username> — form is filled in Chrome, proceed to tell userNOT_LOGGED_IN — tell user: "Sign in to npmjs.com in Chrome, then I'll retry"FORM_NOT_FOUND — tell user: "Could not find the token form. The page may have changed."After getting FORM_READY, tell the user directly (not inside a bash command):
I've opened the npm token creation form in Chrome and filled it out (cli-publish, 7-day, packages read+write, organizations no access). In the package list, select only, then scroll down and click Generate token.
The script sets the token to "Only select packages and scopes" but cannot pick the package in npm's search field, so the user picks it. If they skip that step, npm may refuse to generate the token, or the token may cover more packages than this one; ask them to check the package list before generating.
Phase 2 — Capture the token:
bash ${CLAUDE_SKILL_DIR}/scripts/setup-token.sh capture
This polls until the token appears on the page, clicks the Copy button, reads from clipboard, and clears clipboard. In ~/.npmrc it replaces only the //registry.npmjs.org/:_authToken= line (or adds it), keeps every other line, and sets the file to owner-only (chmod 600). The token never appears in terminal output.
Status codes:
TOKEN_SAVED — success, retry publishCAPTURE_TIMEOUT — the token never reached the clipboard. Never ask the user to paste the token into the chat. Tell them: "Click Copy next to the new token in Chrome, then run this in your own terminal: bash <this skill's directory>/scripts/setup-token.sh from-clipboard" (give the absolute path). It reads the clipboard, saves the token the same way, clears the clipboard, and prints TOKEN_SAVED, or NO_TOKEN_IN_CLIPBOARD if the clipboard does not hold an npm_ token. Wait for them to say it saved, then retry publish.After TOKEN_SAVED, retry publish (the user already said yes to this publish in 3c):
bash ${CLAUDE_SKILL_DIR}/scripts/publish.sh --confirm [--access public]
Tell user: "Complete the OTP checkbox in your browser if prompted."
bash ${CLAUDE_SKILL_DIR}/scripts/verify.sh <package-name> <version>
Run in the background (run_in_background: true in Claude Code, or your host's equivalent async/background execution). Exponential backoff (5s, 10s, 20s, 40s, 60s).
Scripts output status codes. The agent interprets them and talks to the user. Script output is hidden inside collapsed bash commands — the user won't see it. All user-facing communication must be direct agent messages OUTSIDE of bash calls.
What SKILL.md sets; muted values are Claude Code's defaults
10 skills in this plugin
/customer-support-triageSupport inbox workflow for a small team - classify each request (bug, feature request, billing, how-to), attempt reproduction, assign severity, file a standard GitHub issue with no customer PII, check refund requests against the written policy, and draft the reply for a human to send. Use when triaging support email or tickets, or when asked to "handle this support request", "file this bug", or "draft a reply to this customer"./dependency-upgradeSafe batch dependency upgrades across a codebase — inventory outdated packages (npm outdated / uv lock --upgrade), group by risk (patch/minor/major), upgrade in waves with tsc/test/Playwright gates, read changelogs for majors, run `exposure-scan` for supply-chain checks, and land one PR per wave. Use when asked to "upgrade dependencies," "bump packages," "clear npm outdated," or on a periodic maintenance pass.Other plugins' skills for the same job
/incident-responseProduction incident runbook for a small team - severity call, fixed triage order, rollback-first decision, user comms, and a one-page blameless postmortem. Use when a service is down, erroring, or degraded in production, e.g. "site is down", "we're getting 500s", "uptime alert fired", "users report errors", "was it the last deploy?", "roll back", or "write the postmortem".npx claudepluginhub stylusnexus/agent-plugins --plugin release-ops