npm-trusted-publishing

npm-trusted-publishing is a skill for Claude Code from pr-pm/prpm. It costs 33 tokens per session (766 once invoked), scanned A, original, MIT.

Guidance for publishing npm packages from GitHub Actions using OIDC trusted publishing, which replaces long-lived authentication tokens with a linked workflow identity.

In plain words
What is it for?
Use it to configure GitHub Actions permissions, npm trusted publishers, provenance, repository metadata, and publishing for monorepos.
Why use it?
It helps secure automated releases and add provenance records showing where a published package was built.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it to configure GitHub Actions permissions, npm trusted publishers, provenance, repository metadata, and publishing for monorepos.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pr-pm/prpm/npm-trusted-publishing
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 pr-pm/prpm --skill npm-trusted-publishing
Clone the repo
git clone --depth 1 https://github.com/pr-pm/prpm

Made for: Claude Code.

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-trusted-publishing

README.md
[![agentmods](https://agentmods.dev/badge/skills/pr-pm/prpm/npm-trusted-publishing.svg)](https://agentmods.dev/skills/pr-pm/prpm/npm-trusted-publishing)
Your own site
<a href="https://agentmods.dev/skills/pr-pm/prpm/npm-trusted-publishing"><img src="https://agentmods.dev/badge/skills/pr-pm/prpm/npm-trusted-publishing.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 766 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 93
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
How audits are shown
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.00033 $0.00766
Opus 5 $0.00016 $0.00383
Sonnet 5 $0.00007 $0.00153
Haiku 4.5 $0.00003 $0.00077

Measured 8d ago against content hash 9c4ab60c8d28, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

npm-trusted-publishing 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 8d 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.

.claude/skills/npm-trusted-publishing/SKILL.md · 117 lines

How it starts

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

NPM Trusted Publishing

Overview

Set up secure npm publishing from GitHub Actions using OIDC trusted publishing instead of long-lived NPM_TOKEN secrets.

When to Use

  • Setting up npm publish workflow in GitHub Actions
  • Migrating from NPM_TOKEN to trusted publishing
  • Adding provenance attestations to packages
  • Publishing monorepo packages

Quick Reference

Requirement Implementation
GitHub Actions permission id-token: write
package.json field repository.url matching GitHub repo
npm publish flag --provenance
npmjs.com setup Configure trusted publisher per package

Implementation

1. GitHub Actions Workflow

permissions:
  contents: write
  id-token: write  # Required for OIDC

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: "20"
          registry-url: "https://registry.npmjs.org"

      - run: npm ci
      - run: npm run build

      # No NODE_AUTH_TOKEN needed - uses OIDC
      - run: npm publish --access public --provenance

2. package.json Repository Field

{
  "name": "@scope/package",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/owner/repo.git",
    "directory": "packages/subpackage"
  }
}

Monorepo note: Include directory field for packages not at repo root.

3. npmjs.com Configuration

For each package, go to Settings > Publishing access and add:

  • Repository: owner/repo
  • Workflow: publish.yml (or your workflow filename)
  • Environment: (optional)

Common Mistakes

Mistake Fix
Missing --provenance flag Add to npm publish command
Wrong URL format Use git+https://github.com/...
Missing id-token: write Add to workflow permissions
Forgot npmjs.com setup Configure trusted publisher in package settings
Using NODE_AUTH_TOKEN Remove - OIDC handles auth
Outdated npm version Add npm install -g npm@latest step (see below)

Read the full file on GitHub · 117 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. 8d ago First seen · 117 lines · 33 tokens per session scan A 9c4ab60c8d28

Subscribe to this mod's changes

npm-trusted-publishing is a skill published in the GitHub repository pr-pm/prpm (120 stars, last pushed 2mo ago), licensed MIT. It adds 33 tokens to every session and 766 once invoked, about $0.0002 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-30.

Related

Other skills, from other repositories

lov-release-via-cicd

A release workflow for Node, Tauri, Vite, shell, and GitHub Release projects. It checks or configures automated versioning and publishing, including macOS signing and notarisation when relevant.

lovstudio/skills · 47 tokens

ci-cd-pipelines

When designing GitHub Actions workflows, optimizing pipeline speed, implementing deployment gates.

sawrus/agent-guides · 0 tokens

production-release-gating

Stop every push/merge to main from shipping to production — deploy only on a real release. Use when a merge to main unexpectedly deploys to prod, when you want production to deploy only on a semantic-release version (not every commit), when setting up preview-on-feature-branch but gated-prod-on-main, wiring a Vercel…

stealth-factory/skills · 191 tokens

data-platform-ci-cd-and-release-management

Guides agents through CI/CD and release management for data platforms. Use when promoting pipeline code, SQL models, contracts, infra, or configuration across environments with validation gates, staged rollout, and rollback awareness.

vaquarkhan/data-engineering-agent-skills · 50 tokens

cosmosmith-devops-release

Prepare build, CI, environment, deployment, monitoring, rollback, and release readiness for a Cosmosmith project. Use when tasks approach release, when setup/deploy commands are missing, or when current platform docs are needed.

devnomad-byte/cosmosmith · 51 tokens

deployment-composer

Compose deployment workflows from smaller skills and repo signals, including trunk-based releases, CI quality gates, provider deployment, post-deploy verification, rollback, and failed-check diagnosis. Use when the user asks for a deployment plan, release workflow, ship-to-staging/production environments, or a smart…

shipshitdev/skills · 81 tokens