npm-publishing

Guide npm package publishing with package.json configuration and provenance tracking.

4|Updated Dec 8, 2025
One-click install
npx skills add https://github.com/mcclowes/lea --skill npm-publishing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: npm-publishing
Source: https://github.com/mcclowes/lea/tree/main/.claude/skills/npm-publishing
Command: npx skills add https://github.com/mcclowes/lea --skill npm-publishing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Guidance for publishing npm packages with proper versioning, exports, and provenance to ensure safe, reproducible releases.

Core Features & Use Cases

  • Semantic versioning: Versioning strategies and tagging
  • Exports & provenance: Modern exports field and provenance enabled publishing
  • Publish workflow: Pre-publish checks and packaging rules

Quick Start

Prepare a package.json and perform a dry-run publish to verify configuration.

Frequently Asked Questions about npm-publishing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I publish an npm package with semantic versioning?

Semantic versioning for npm packages involves incrementing version numbers in package.json following major.minor.patch format based on changes, then using `npm publish` to release. Set version manually or use `npm version` to auto-increment and create git tags for trackable releases.

What is the exports field in package.json and why do I need it?

The exports field defines entry points for ESM and CommonJS consumers, replacing the main field. It ensures users import the correct module format and prevents access to internal files, enabling modern packaging with explicit public APIs and dual-module support.

How do I verify my package configuration before publishing to npm?

Run `npm publish --dry-run` to simulate publication without uploading, validating package.json syntax, access permissions, and file inclusion. This catches configuration errors early and confirms your package meets npm registry requirements before actual release.

What is npm provenance and how do I enable it during publishing?

Npm provenance tracks the build environment and attestation of package origin for security. Enable it by publishing from trusted environments with `npm publish --provenance` to generate cryptographic evidence that proves package authenticity and reproducibility.

Can I publish scoped packages to npm, and what's the process?

Yes, scoped packages use the `@scope/package-name` format in package.json. Configure `publishConfig.access` to 'public' for public scopes, then run `npm publish` with appropriate registry credentials and permissions for your organization scope.