rust-npm-publish

rust-npm-publish is a skill for Claude Code, Codex from onsager-ai/dev-skills. It costs 132 tokens per session (2,065 once invoked), scanned A, original, MIT.

A guide for publishing Rust programs through npm, including separate packages for different operating systems and CPU types. npm is the package registry commonly used to distribute JavaScript tools.

In plain words
What is it for?
Use it to set up or troubleshoot npm publishing for Rust binaries, add supported platforms, manage workspace packages, and synchronize versions.
Why use it?
It coordinates versions, package relationships, binaries, and publish steps that can otherwise get out of sync across platforms.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to set up or troubleshoot npm publishing for Rust binaries, add supported platforms, manage workspace packages, and synchronize versions.

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

Made for: Claude Code, Codex.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/onsager-ai/dev-skills/rust-npm-publish"><img src="https://agentmods.dev/badge/skills/onsager-ai/dev-skills/rust-npm-publish.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 132 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,065 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.00132 $0.02065
Opus 5 $0.00066 $0.01033
Sonnet 5 $0.00026 $0.00413
Haiku 4.5 $0.00013 $0.00206

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

Security

Grade A, and why

rust-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 10d ago.

The scan reads SKILL.md. This mod also ships 15 executable files (examples/clawden.config.ts, examples/lean-spec.config.ts, templates/add-platform-deps.ts, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/rust-npm-publish/SKILL.md · 211 lines

How it starts

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

Rust npm Publishing

Distribute Rust binaries to npm using the optionalDependencies platform package pattern.

When to Use This Skill

Activate when any of the following are true:

  • Publishing Rust binaries to npm or debugging publish pipeline failures
  • Setting up publish.config.ts, bin.js, or platform package manifests
  • Managing version sync across workspace packages and Cargo.toml
  • Working with workspace:* protocol or prepare/restore scripts
  • Scripts matching *publish*, *platform*, *version*, or *sync* exist

Decision Tree

What does the user need?

Setting up publishing for the first time?
  → The Pattern section + Configuration + Templates

Running the publish pipeline?
  → Publish Pipeline section
  → Full details: references/publish-pipeline.md

Adding a new platform?
  → Adding a New Platform section
  → Platform reference: references/platform-matrix.md

Version sync / bump?
  → Versioning section
  → Full strategy: references/version-strategy.md
  → workspace:* details: references/workspace-protocol.md

Debugging a failure?
  → references/troubleshooting.md

The Pattern

@scope/my-tool                    ← main package (thin JS wrapper + bin.js)
├── optionalDependencies:
│   ├── @scope/my-tool-darwin-arm64   ← macOS ARM (M-series)
│   ├── @scope/my-tool-darwin-x64     ← macOS Intel
│   ├── @scope/my-tool-linux-x64      ← Linux x86_64
│   └── @scope/my-tool-windows-x64    ← Windows x86_64

Each platform package contains only the pre-compiled binary for that target. npm installs only the one matching the user's OS/CPU at install time.

Same approach used by SWC, Turbopack, esbuild, and similar tools.

Configuration

Each repo provides a publish.config.ts (see examples/):

export default {
  scope: '@myorg',
  binaries: [{ name: 'my-cli', scope: 'cli', cargoPackage: 'my-cli-rs' }],
  platforms: ['darwin-x64', 'darwin-arm64', 'linux-x64', 'windows-x64'],
  mainPackages: [{ path: 'packages/cli', name: 'my-cli' }],
  cargoWorkspace: 'Cargo.toml',
  repositoryUrl: 'https://github.com/myorg/my-project',
};

Read the full file on GitHub · 211 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. 10d ago First seen · 211 lines · 132 tokens per session scan A de55c5b3bdc9

Subscribe to this mod's changes

rust-npm-publish is a skill published in the GitHub repository onsager-ai/dev-skills (5 stars, last pushed 28d ago), licensed MIT. It adds 132 tokens to every session and 2,065 once invoked, about $0.0007 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.

Related

Other skills, from other repositories