luochang212/skill-zoo/npm-release
Claude Code and agent skill by luochang212/skill-zoo
- community
Checking that the SKILL.md file is still in the repository.
Use when publishing or preparing to publish an npm package from this repository, especially the Skill Zoo CLI package under packages/cli. Also use when npm publish fails because of duplicate versions, npm authentication, browser authentication, dist-tag propagation, tarball contents, bin entry issues, or workspace/lockfile version mismatches.
Install
npx vskill@latest install luochang212/skill-zoo/npm-releaseSKILL.md
npm Release
Overview
Publish an npm package from this repo with local verification, clean package contents, and npm browser authentication. For Skill Zoo today, the npm package is the CLI package in packages/cli; the workspace root is private and is not the package to publish.
Announce at start: "I'm using the npm-release skill to publish the npm package."
Privacy Guardrails
Do not write private npm account details into repo files, skill files, logs, release notes, or final summaries. This includes npm usernames, email addresses, authentication secrets, browser auth URLs, auth IDs, tokens, local npm debug log paths, and machine-specific temporary directories.
It is fine to state generic facts such as "npm required browser authentication" or "the authenticated owner account was permitted." Do not paste the actual authentication URL into a committed file. If a URL is needed transiently, use it only to complete the live browser flow.
When to Use
Use this skill when:
- The user says "publish npm", "release the npm package", "npm publish", "发 npm", or "发布 npm 包"
- The package is in a workspace and you need to identify the real publishable package
npm publishfails with duplicate version, npm authentication, owner, tarball, or bin problems- The user asks whether a package is ready for npm publication
- A release bump needs to update package metadata and lockfile state consistently
Do not use this skill for:
- Desktop app GitHub Releases or Homebrew cask releases; use
app-release - Tauri updater implementation; use
tauri-updater - Publishing a package you have not locally verified
Package Target
For this repo, start with the CLI package:
Confirm the root package is not the target:
If the target changes in the future, publish from the directory whose package.json has the public npm name, bin, files, scripts.prepack, and production dependencies.
Preflight
Check the repo instructions and current working tree first:
Do not revert or overwrite unrelated changes. If publish-relevant files already have user edits, inspect them and work with the current state.
Check npm registry state before changing versions:
If the local version already exists on npm, explain that npm versions are immutable and ask the user which new version to publish before changing files. Do not choose or apply the release version silently.
Version Bump
For the Skill Zoo CLI package, update:
packages/cli/package.jsonbun.lockworkspace entry forpackages/cli
Ask the user to confirm the exact version before editing release files. If they ask for a recommendation, propose the smallest sensible semver bump and explain why, then wait for confirmation before applying it.
After bumping, search for hardcoded old versions that should follow the package version:
Tests should generally depend on CLI_VERSION rather than hardcoding a release version. This prevents a release bump from breaking tests only because an expected metadata string changed.
Required Verification
Run these from packages/cli after any version or release-related change:
The dry-run must show the expected version and tarball contents. For this CLI, expected package contents are small and should normally be:
There is deliberately no dist/index.d.ts. The CLI entry (packages/cli/src/index.ts) is a shebang script that calls runCli() and exports nothing, so the declaration file tsup's --dts emitted contained only the shebang line, which means it was a type contract with no types. It was also unreachable: the package declares bin and no main/exports/types, so a consumer's import ... from "skill-zoo" fails with TS2307 before the file is ever read (wiring up types instead yields TS2306: is not a module). Rather than keep a misleading empty file, the build no longer emits declarations. If the CLI ever grows a programmatic API, re-add declarations and the types/exports wiring together.
If extra source, test, repo, log, or private files appear, fix the files whitelist or ignore rules before publishing.
Mirror CI's steps, not just the package's. The bump touches packages/cli/package.json and bun.lock, and build.yml checks those from the workspace root with steps the package-level list above never runs. Run them locally after the bump too:
When the workflow changes, re-derive the list from it rather than trusting this skill: grep -nE '^\s+-?\s*run:' .github/workflows/build.yml. A step CI runs that the local list omits is a blind spot. On 2026-10-22, adr-kit's 0.24.0 passed every local check and went red on the one CI step that was not in its skill.
Fifth gate: green CI on the pushed release commit. The local checks run on one machine; CI runs on every platform the release must work on. Commit the release, push, and wait for the runs before publishing. Watch by workflow name and the pushed commit's SHA. The command gh run list --limit 1 returns whichever run started last, which can be site (it also runs on a push that touches site/) or a run for another commit, and then reports green while build fails:
Code CI has not seen does not publish. On 2026-10-13 the release-adjacent chore: update version.json for v0.3.52 commit landed on main with a failing Build. If the release commit's run fails, fix forward in a new commit, push, and wait again; never amend or force-push a pushed release commit.
CLI Package Checks
Before publishing a CLI package, verify the executable path matches bin and can start from the built artifact:
For higher confidence, install the actual tarball in a temporary project and run both binary names:
Do not commit generated tarballs or temporary install directories.
Publishing
Publish only after typecheck, tests, build, npm publish --dry-run pass, and the pushed release commit's CI run is green. Before the real npm publish, summarize the package name, version, dist tag, and tarball contents, then ask the user for explicit confirmation.
Log in first. --auth-type=web authenticates npm login, not npm publish. Publishing while unauthenticated fails with a 404 that masks the real cause. Ensure a valid token exists (see "Non-TTY browser authentication") before publishing, and drop --auth-type=web from the publish command.
Working directory does not persist between tool calls. Always include cd <path> in the command itself. Never assume a previous cd still applies. When publishing from a workspace sub-package, use an absolute cd prefix:
Preferred command after user confirmation:
If the machine's default registry is a read-only mirror (e.g. registry.npmmirror.com), the explicit --registry https://registry.npmjs.org/ is required because mirrors do not accept publishes.
Non-TTY browser authentication
Two different steps need browser auth, and npm handles them differently in agent environments (Claude Code, Cowork, CI):
Capture auth URLs from raw output only. Run both commands so their full output lands in a file (a background task's output file), then grep that file for the URL. Never pipe npm login or npm publish themselves through grep, sed, tail, or any other filter: npm goes quiet while it polls for the browser authorization, and a filter's block buffer then holds the URL line indefinitely, so the attempt has to be killed and rerun raw.
Login. npm login --auth-type=web prints the full https://www.npmjs.com/login?next=/login/cli/<id> URL even without a TTY, so no script wrapper is needed. Just open the printed "Login at:" URL:
Publish 2FA (EOTP). When the account requires 2FA for publishing, npm publish fails with EOTP and prints its auth URL redacted as *** (https://www.npmjs.com/auth/cli/***). Only this step needs a real TTY to reveal the URL. Use script -q /dev/null, and feed it a leading newline because npm's TTY prompt ("Press ENTER to open in the browser...") otherwise blocks before it polls for authentication:
Extract the URL, open it in the user's browser, and keep the background process alive while they authenticate. If script is unavailable (e.g. a sandbox blocks pty allocation), fall back to --otp <6-digit TOTP>.
Success looks like:
Post-Publish Verification
Registry reads can lag after publish. About a minute is typical, and adr-kit saw 130 seconds on 2026-10-22 after a PUT 202 with the notice "Your package is being processed and may take a few minutes to become available". Poll the exact version every 10 seconds for up to three minutes before concluding the publish failed, then verify both the specific version and the dist tag:
Treat npm dist-tag ls as the clearer signal for latest when npm view skill-zoo version appears stale immediately after publication.
The final user summary should include:
- Published package and version
- Verification commands that passed
- Registry confirmation, including
latestif applicable - Local files changed and still uncommitted
Do not include private account identifiers, browser auth URLs, npm auth IDs, authentication secrets, debug log paths, or temporary directory paths in the final summary.
Failure Handling
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/npm-release/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/luochang212/skill-zoo/npm-release)