plugins/ls-typescript/skills/npm-publish/SKILL.md
Use when publishing or releasing a new version of an npm/pnpm/yarn/bun package to the registry. Covers package-manager detection, semver bump selection, tagging, pushing, scoped-package access, authentication, and one-time passwords (OTP).
npx skillsauth add LandonSchropp/agent-toolkit npm-publishInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Do these BEFORE bumping the version — fail before creating a commit and tag, not after.
npm whoami. A 401 means you're not logged in: STOP and resolve it before anything else. npm login is interactive (browser-based), so you cannot run it for the user — ask them to (in Claude Code, ! npm login), then re-check npm whoami. Don't bump or commit until this passes.git status. Commit or stash changes first.main.Detect from the lockfile (first match wins) and use that row's commands:
| Lockfile | Bump | Publish |
| ----------------------------- | ----------------------- | -------------- |
| yarn.lock | yarn version --<bump> | yarn publish |
| pnpm-lock.yaml | pnpm version <bump> | pnpm publish |
| bun.lock / bunfig.toml | npm version <bump> | bun publish |
| package-lock.json (or none) | npm version <bump> | npm publish |
Both steps only touch package.json and the registry, so npm version / npm publish are safe fallbacks when a manager's syntax differs (e.g. Yarn Berry publishes with yarn npm publish).
package.json, commits, and creates a v<version> tag.git push --follow-tags. REQUIRED: --follow-tags, or the tag stays on your machine.--access public. REQUIRED for scoped packages (@scope/name): without it npm publishes privately and rejects a free account.npm view <package-name> version.404 on a scoped package is not "deleted" or "wrong name." The registry returns 404 ... PUT .../@scope%2fname when you lack write access — it masks an auth failure. Re-check npm whoami.EOTP (2FA enabled): add --otp=<code> to the publish command. Codes expire in ~30 seconds — ask the user for it and run publish IMMEDIATELY in the same turn, don't gather it then do other work. A repeat EOTP means it expired; ask for a fresh one.EPUBLISHCONFLICT: that version already exists and can't be overwritten. This usually means the local branch is behind — the version was already bumped and published on the default branch. Don't just bump again on stale history; offer to rebase onto the latest default branch first, then bump from there.tools
Use when a finished, reviewed branch is committed and needs to be merged into the default branch in a repo that integrates directly to `main` (not via pull request).
tools
Use when working with a stack of GitHub pull requests — creating branches, keeping the stack in sync, or merging in order. Covers Git Town setup, PR targeting, rebasing, and landing the stack.
tools
Use when writing or modifying tests in a Bun project
tools
Use when a finished worktree's branch has been reviewed and committed and needs to land. Rebases onto the latest default branch, then either fast-forwards it into the default branch (personal direct-to-main repos) or pushes it for a pull request (shared feature-branch repos).