rust-npm-publish
Installation
SKILL.md
Rust npm Publish
Teach agents how to distribute Rust-compiled binaries via npm using the platform package pattern. This is the same pattern used by tools like SWC, Turbopack, and similar Rust-to-npm distribution pipelines.
When to Use This Skill
Activate when any of the following are true:
- The repository has both
Cargo.tomlandpackage.jsonat root - Scripts directory contains
*publish*or*platform*files - The user asks about publishing Rust binaries to npm
- Platform-specific npm packages exist (
@scope/cli-darwin-arm64, etc.)
The Pattern
Instead of shipping one npm package with pre-built binaries for all platforms, publish
platform-specific packages as optionalDependencies. npm installs only the one
matching the user's OS/CPU.
Related skills