publish-npm
Installation
SKILL.md
- Run
npm whoami. If it returns 401/unauthorized, stop and ask the user to run! npm loginin this session. - Run
git status. If the working tree is dirty with unrelated changes, stop and ask before continuing. - For each target package, in dependency order (a package's dependencies must publish first — within this repo that means
schemas→core→ adapters): a. Confirmpackage.jsonhas"publishConfig": { "access": "public" }. Scoped@dna-codes/*packages default to restricted and will fail to publish without this. b. Determine the version bump: ask the user whether this is apatch(bug fixes),minor(new backwards-compatible features), ormajor(breaking changes) release if they haven't specified. Then editversioninpackage.jsondirectly using semver (e.g.1.2.3→1.2.4for patch,1.3.0for minor,2.0.0for major). c. Build if the package has a build script:npm run build -w <name> --if-present. d. Test if the package has a test script:npm run test -w <name> --if-present. e. Dry run:npm publish -w <name> --dry-run. Show the tarball contents (file list + size) to the user. f. Publish:npm publish -w <name>. If the user has 2FA, npm will prompt for an OTP — surface that to the user via! npm publish .... - After all publishes succeed:
a. Commit any
publishConfig/versionedits via thecommitskill. b. Create a git tag per package:git tag <pkg-name>@<version>(e.g.@dna-codes/core@0.1.0). c. Ask the user before runninggit pushandgit push --tags.
Do not publish with --force or --tag latest overrides. Do not unpublish.