npm-publish

A controlled workflow for publishing packages to npm, the main registry for JavaScript packages. It prepares trusted publishing, sends a staged release, promotes approved versions, and supports recovery actions.

In plain words
What is it for?
Use it to reserve a package name, configure publishing access, release staged versions, backfill an older version, or deprecate a release.
Why use it?
It reduces the risk of publishing the wrong package or version by requiring checks and human approval between staging and release.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/socketdev/sauce/npm-publish
Any agent
npx skills add SocketDev/sauce --skill npm-publish
Clone the repo
git clone --depth 1 https://github.com/SocketDev/sauce

Made for: Claude Code, Codex.

Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,069 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00072 $0.01069
Opus 5 $0.00036 $0.00535
Sonnet 5 $0.00014 $0.00214
Haiku 4.5 $0.00007 $0.00107

Measured 2d ago against content hash e807a4d9ed74, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

npm-publish scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/socket-release/npm-publish/SKILL.md · 99 lines

How it starts

The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on GitHub.

npm publish (staged)

The kit's npm model: CI STAGES the publish through trusted publishing (OIDC, environment npm-publish); a human PROMOTES it locally after byte-verification. Direct publishing is disabled after bootstrap - staged is the only path. Dry-run is every command's default.

One-time bootstrap

node scripts/socket-release/bootstrap.mts            # plan
node scripts/socket-release/bootstrap.mts --apply    # stand up, stops at gates
node scripts/socket-release/bootstrap.mts --status   # receipts

Steps run in canonical order: preflight → placeholder → npm-access-permissive → github-env → staged-config → trusted-publisher → npm-access-staged-only → verify. Two of them are npm publishing-access steps: PERMISSIVE first (direct + staged enabled, only while the 0.0.0 placeholder is pending, so the one-time direct publish can land), then STAGED-ONLY (direct publishing unchecked in the npm web UI once trusted publishing stands). A re-run never re-widens; verify FAILS a package left permissive and names the fix (node scripts/socket-release/bootstrap.mts npm-access-staged-only --apply).

STOP AND GATE, never improvise, at these moments:

  • reserve name - publishing <name>@0.0.0 is irreversible; only node scripts/socket-release/bootstrap.mts placeholder --apply --reserve <name> performs it: the bootstrap renders the gate.
  • npm web-2FA - the PTY prints APPROVE HERE (expires in minutes): <url>; the operator approves in their browser, the command keeps waiting.
  • placeholder promote - a staged 0.0.0 needs node scripts/socket-release/npm-publish.mts --approve plus the operator's 2FA.
  • npm auth dead - node scripts/socket-release/npm-web-auth.mts login (both lanes run the same router command).

Release cycle

  1. Bump: edit version + CHANGELOG, commit chore: bump version to <version> (load-bearing subject), push.
  2. Stage from CI: the operator dispatches the npm publish workflow from the Actions UI with publish: true (dry-run is the dispatch default; gh workflow run is guard-blocked for agents - the human clicks).
  3. Soak: staged entries are maintainer-visible only. Inspect with pnpm stage list --json - an unauthenticated or wrong-account list reads as EMPTY, not as an error, so identity-check first (node scripts/socket-release/npm-web-auth.mts login).
  4. Promote: node scripts/socket-release/npm-publish.mts --approve - it byte-verifies the staged tarball, promotes through the operator's 2FA, then cuts the git tag + immutable GitHub release once the version resolves live (ORDER RULE - registry first, release marker last).
  5. Verify: the version resolves on the registry and the release exists; a missing tag/release heals with node scripts/socket-release/github-release.mts --tag v<version> --release.

Read the full file on GitHub · 99 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 99 lines · 72 tokens per session scan A e807a4d9ed74

Subscribe to this mod's changes

npm-publish is a skill published in the GitHub repository SocketDev/sauce (2 stars, last pushed 5d ago), licensed MIT. It adds 72 tokens to every session and 1,069 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.