npm-publish

npm-publish is a skill for Claude Code from strzhao/autopilot. It costs 114 tokens per session (1,255 once invoked), scanned A, original, MIT.

A setup guide for automatically publishing an npm package through GitHub Actions to npmjs.com. npmjs.com is a registry where JavaScript packages are shared, and GitHub Actions runs automated tasks from a repository.

In plain words
What is it for?
Use it to add or troubleshoot automated npm releases, including OIDC-based publishing and CI/CD setup.
Why use it?
It removes the need to publish packages manually or store an npm password token in automation by using OIDC Trusted Publishing, a tokenless identity check.

Skill for Claude Code

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

Part of the npm-toolkit plugin — 2 skills shipped together

Good fit Use it to add or troubleshoot automated npm releases, including OIDC-based publishing and CI/CD setup.

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

Made for: Claude Code.

Or install npm-toolkit, the plugin that ships this one along with the rest of its 2 skills.

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-publish

README.md
[![agentmods](https://agentmods.dev/badge/skills/strzhao/autopilot/npm-publish/github.svg)](https://agentmods.dev/skills/strzhao/autopilot/npm-publish)
Your own site
<a href="https://agentmods.dev/skills/strzhao/autopilot/npm-publish"><img src="https://agentmods.dev/badge/skills/strzhao/autopilot/npm-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-publish

Your own site · 80×15
<a href="https://agentmods.dev/skills/strzhao/autopilot/npm-publish"><img src="https://agentmods.dev/badge/skills/strzhao/autopilot/npm-publish.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 114 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,255 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.00114 $0.01255
Opus 5.5 $0.00046 $0.00502
Sonnet 5.5 $0.00023 $0.00251
Haiku 4.5 $0.00011 $0.00126

Measured 1mo ago against content hash e4f2904c37e8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

plugins/npm-toolkit/skills/npm-publish/SKILL.md · 166 lines

How it starts

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

npm 自动发布配置指南

将 npm 包通过 GitHub Actions + OIDC Trusted Publishing 自动发布,无需管理 npm token。

核心知识

Node 版本要求

OIDC Trusted Publishing 需要 npm CLI >= 11.5.1。各 Node 版本对应的 npm:

Node 版本 npm 版本 是否支持 Trusted Publishing
Node 20 npm 10.x 不支持
Node 22 npm 10.9.x 不支持
Node 24 npm 11.x+ 支持

必须使用 Node 24,这是最常见的失败原因。

Private 仓库限制

--provenance 签名仅支持 public 仓库。Private 仓库使用 --provenance 会报错:

Error verifying sigstore provenance bundle: Unsupported GitHub Actions source repository visibility: "private"

Private 仓库需要去掉 --provenance flag。

配置流程

第一步:确认 package.json 配置

确保 package.json 包含以下关键字段:

{
  "name": "@scope/package-name",
  "version": "1.0.0",
  "files": ["dist", "README.md"],
  "publishConfig": {
    "access": "public"
  }
}
  • scoped 包(@xxx/yyy)需要 publishConfig.access: "public",否则默认 restricted
  • files 字段控制发布内容,避免发布 src、node_modules 等

第二步:创建 GitHub Actions Workflow

创建 .github/workflows/publish.yml:

Public 仓库(推荐,带 provenance):

name: Publish to npm

on:
  release:
    types: [published]

jobs:
  publish:
    runs-on: ubuntu-latest
    environment: npm
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: actions/checkout@v4

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

      - run: npm ci
      - run: npm run build
      - run: npm publish --provenance --access public

Private 仓库(不带 provenance):

name: Publish to npm

on:
  release:
    types: [published]

jobs:
  publish:
    runs-on: ubuntu-latest
    environment: npm
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: actions/checkout@v4

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

      - run: npm ci
      - run: npm run build
      - run: npm publish --access public

Read the full file on GitHub · 166 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago First seen · 166 lines · 114 tokens per session scan A e4f2904c37e8

Subscribe to this mod's changes

npm-publish is a skill published in the GitHub repository strzhao/autopilot (32 stars, last pushed 7d ago), licensed MIT. It adds 114 tokens to every session and 1,255 once invoked, about $0.0005 per session on Opus 5.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