npm-oidc-publish

npm-oidc-publish is a skill for Claude Code from sailingnaturali/claude-skills. It costs 67 tokens per session (795 once invoked), scanned A, original, MIT.

A guide for publishing JavaScript packages to npm from GitHub Actions using OIDC, a short-lived identity check, instead of storing a permanent npm password or token in CI. It covers npm trusted publishing and the setup needed for new packages.

In plain words
What is it for?
Setting up release-triggered GitHub Actions workflows that install dependencies, run tests, build packages when needed, and publish them to npm with provenance information.
Why use it?
It removes the need to keep a long-lived npm token or one-time password in an automated release workflow. It also explains the setup order and the temporary 404 errors that can occur while npm updates its registry.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the npm-oidc-publish plugin — 1 skill shipped together

Good fit Setting up release-triggered GitHub Actions workflows that install dependencies, run tests, build packages when needed, and publish them to npm with provenance information.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sailingnaturali/claude-skills/npm-oidc-publish
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.

Any agent
npx skills add sailingnaturali/claude-skills --skill npm-oidc-publish
Clone the repo
git clone --depth 1 https://github.com/sailingnaturali/claude-skills

Made for: Claude Code.

Or install npm-oidc-publish, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for npm-oidc-publish

README.md
[![agentmods](https://agentmods.dev/badge/skills/sailingnaturali/claude-skills/npm-oidc-publish/github.svg)](https://agentmods.dev/skills/sailingnaturali/claude-skills/npm-oidc-publish)
Your own site
<a href="https://agentmods.dev/skills/sailingnaturali/claude-skills/npm-oidc-publish"><img src="https://agentmods.dev/badge/skills/sailingnaturali/claude-skills/npm-oidc-publish/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for npm-oidc-publish

Your own site · 80×15
<a href="https://agentmods.dev/skills/sailingnaturali/claude-skills/npm-oidc-publish"><img src="https://agentmods.dev/badge/skills/sailingnaturali/claude-skills/npm-oidc-publish.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 795 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00067 $0.00795
Opus 5 $0.00034 $0.00398
Sonnet 5 $0.00013 $0.00159
Haiku 4.5 $0.00007 $0.00080

Measured 12d ago against content hash 922217f07a3c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

npm-oidc-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 12d 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.

npm-oidc-publish/skills/npm-oidc-publish/SKILL.md · 68 lines

How it starts

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

Publish to npm with OIDC trusted publishing

npm "trusted publishing" lets a GitHub Actions workflow npm publish without a long-lived NPM_TOKEN — it authenticates via OIDC and stamps provenance automatically. Works for any package; nothing language- or framework-specific.

The workflow

.github/workflows/publish.yml:

name: publish
on: { release: { types: [published] } }
permissions:
  contents: read
  id-token: write      # <- this is what enables OIDC
jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: 24 }   # npm >= 11.5 supports OIDC; node 24 is safe
      - run: npm ci                    # needs a committed package-lock.json
      - run: npm test
      - run: npm publish               # no token, no --otp; provenance is automatic
  • Scoped public package? add "publishConfig": { "access": "public" } to package.json (and a "files" array so the build actually ships).
  • A TypeScript build runs via "prepare": "npm run build" on npm publish.

The chicken-and-egg (every new package hits this)

You cannot configure a trusted publisher for a package that doesn't exist on npm yet, and the OIDC publish needs that config to exist. So the first publish is manual:

  1. npm publish locally → enter your 2FA OTP (npm publish --otp=<code>). This creates 0.1.0.
  2. On npmjs.com → the package → Settings → Trusted Publisher → GitHub Actions: set the repo (owner/repo), the workflow filename (publish.yml), and leave the environment blank (unless you actually use one).
  3. From then on it's hands-free: gh release create vX.Y.Z --notes "..." triggers the workflow and publishes via OIDC.

If the workflow's npm publish fails with ENEEDAUTH ("requires you to be logged in"), the trusted publisher isn't configured yet, or the workflow filename / repo doesn't match what you registered on npm — it's a config problem, not code. (npm ci + npm test passing then npm publish failing is the tell.)

Read the full file on GitHub · 68 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. 12d ago First seen · 68 lines · 67 tokens per session scan A 922217f07a3c

Subscribe to this mod's changes

npm-oidc-publish is a skill published in the GitHub repository sailingnaturali/claude-skills (2 stars, last pushed 6d ago), licensed MIT. It adds 67 tokens to every session and 795 once invoked, about $0.0003 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.