Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
oakoss avatar

Package Publishing

  • 77 installs
  • 14 repo stars
  • Updated March 2, 2026
  • oakoss/agent-skills

Helps with ai & agent building tasks during AI-assisted development.

About

package-publishing is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.

  • package-publishing
  • AI & Agent Building
  • AI-coding skill

Package Publishing by the numbers

  • 77 all-time installs (skills.sh)
  • +3 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #5,386 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oakoss/agent-skills --skill package-publishing

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs77
repo stars14
Last updatedMarch 2, 2026
Repositoryoakoss/agent-skills

What it does

Helps with ai & agent building tasks during AI-assisted development.

Files

SKILL.mdMarkdownGitHub ↗

Package Publishing

Overview

Covers modern npm package authoring: package.json configuration with the exports field, dual ESM/CJS builds, TypeScript type declarations, and secure publishing workflows with provenance.

When to use: Configuring package entry points, setting up conditional exports, building dual-format packages, publishing scoped packages, or troubleshooting module resolution.

When NOT to use: Application-level bundling (Vite/webpack app configs), monorepo workspace orchestration (Turborepo/Nx), private registry setup (Verdaccio/Artifactory).

Quick Reference

PatternField / CommandKey Points
Entry pointexports in package.jsonReplaces main/module; encapsulates internals
CJS fallbackmainLegacy consumers without exports support
ESM entrymoduleBundler convention; not used by Node.js
Type declarationstypes condition in exportsMust be listed first in each condition block
Subpath exports"./utils": { ... }Clean public API; blocks deep imports
Conditional exportsimport/require conditionsToggle ESM vs CJS per consumer
Package type"type": "module"Makes .js files ESM; use .cjs for CommonJS
Side effects"sideEffects": falseEnables tree-shaking in bundlers
Peer depspeerDependenciesShared runtime deps (React, Vue, etc.)
Engine constraints"engines": { "node": ">=18" }Document minimum Node.js version
Files allowlist"files": ["dist"]Controls what gets published to npm
Prepublish check"prepublishOnly": "npm run build"Ensure build runs before publish
Dry runnpm pack --dry-runPreview package contents before publishing
Provenance--provenance flag or trusted publishersCryptographic build attestation
Scoped publish--access publicRequired for first publish of scoped packages

Common Mistakes

MistakeCorrect Pattern
Putting types after default in exportstypes must be the first condition in every export block
Missing "./package.json" in exportsInclude "./package.json": "./package.json" for tooling compatibility
Different APIs for import vs requireSame API surface; write ESM source, transpile to CJS
Using main without exports for new packagesUse exports as the primary entry point definition
Forgetting "type": "module" with .js ESM outputSet "type": "module" or use .mjs extension explicitly
Publishing src/ or node_modules/Use "files" allowlist to include only dist/
No prepublishOnly scriptAdd build step to prevent publishing stale artifacts
Using default export for librariesPrefer named exports for consistent cross-tooling behavior
Not testing with npm pack before publishAlways dry-run to verify package contents and size
Omitting peerDependencies for framework pluginsDeclare shared runtime dependencies as peers
Publishing without provenanceEnable provenance for supply-chain transparency
Using .d.ts for CJS when package is "type": "module"Use .d.cts for CJS type declarations, .d.ts or .d.mts for ESM

Delegation

  • Build tooling setup: Use Explore agent to examine tsup/unbuild/rollup configs
  • Type resolution debugging: Use Task agent with "Are the Types Wrong?" (attw)
  • Publish pipeline review: Delegate to code-reviewer agent

References

  • Package.json configuration: exports, main, types, files, engines, peerDependencies
  • Build scripts, prepublishOnly, npm pack, provenance, scoped packages
  • Dual ESM/CJS builds, conditional exports, type declarations

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.