---
name: package-release
description: Cut a versioned release of a skills repo and publish it to npm and GitHub. Use when asked to publish, release, ship a new version, bump the version, or tag a release of an agent-skills package. Covers semver for skills, the pre-publish audit, npm scoped publishing, GitHub releases, and rollback.
license: MIT
compatibility: Requires Node.js 18+, npm 9+ with an authenticated account (npm whoami), git, and an authenticated gh CLI for the GitHub release step. Scoped packages need --access public on first publish or npm rejects them as private.
metadata:
  author: software-factory
  version: "1.1"
allowed-tools: Bash(npm:*) Bash(npx skills *) Bash(git:*) Bash(gh release *) Bash(node:*)
title: package-release
canonical_url: https://skilld.dev/gh/aditya-deokar/software-factory/package-release
last_updated: 2026-10-30T17:45:51.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install aditya-deokar/software-factory/package-release`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/package-release`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/aditya-deokar/software-factory/package-release) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/package-release`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/package-release --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/package-release --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Package release

Publishing a skills package is not publishing a library. Nobody imports it.
People install the files and an agent reads them, so the failure mode is not a
broken build, it is a skill that silently stops firing. The audit below exists
because of that.

## Semver for skills

Version the package on what happens to the agent, not on lines changed.

| Change | Bump |
|---|---|
| Removed a skill, or renamed one | major |
| Narrowed a description so it fires in fewer cases | major |
| Removed a step the user depended on | major |
| Changed the workflow contract users copy into their repos (`AGENTS.md`, required PR fields) | major |
| Added a skill | minor |
| Broadened a description | minor |
| Added a section, reference file, or script | minor |
| Fixed a typo, a broken path, a wrong flag | patch |
| Loosened `compatibility` wording with no behaviour change | patch |

A renamed skill is a major bump even though it looks cosmetic. The folder name
is the install path and the invocation handle, so a rename breaks every
existing install.

Bump the per-skill `metadata.version` too. Package version tracks the bundle;
skill version tells a user whether the one skill they installed changed.

## Pre-publish audit

Stop and fix anything that fails. Do not publish past a red line here.

1. `npx skills add . --list` lists every skill you expect, with no warnings.
2. `npm pack --dry-run` shows the `skills/` tree and no junk: no `.git`, no
   `node_modules`, no `__pycache__`, no `.artifacts`.
3. Every vendored skill still has its `LICENSE` file in its folder.
4. `NOTICE.md` (or equivalent) matches what is actually vendored. A skill added
   since the last release and missing from the notice is a licensing bug.
5. Repo tests pass, if there are any.
6. `README` install commands name the real owner and package. This is the most
   commonly stale thing in a skills repo.
7. Working tree is clean and rebased on the latest default branch.

## Publish

```bash
npm whoami                                  # confirm the right account
npm version <major|minor|patch> -m "release: v%s"
npm publish --access public                 # --access public is required for scoped packages
git push --follow-tags
gh release create "v$(node -p "require('./package.json').version")" \
  --title "v$(node -p "require('./package.json').version")" \
  --notes-file CHANGELOG-latest.md
```

`npm version` commits and tags in one step, so run it on a clean tree.
`--follow-tags` pushes the commit and its tag together; a plain `git push`
leaves the tag behind and the GitHub release then points at nothing.

Scoped packages default to restricted. Without `--access public` the first
publish fails with a paid-plan error that reads like a billing problem and is
not one.

## Verify after publishing

Do not trust a successful publish. Check the thing a user would hit.

```bash
npm view <package> version                  # registry agrees with your tag
cd "$(mktemp -d)" && npx skills add <owner>/<repo> --list
```

Install from the published source into a scratch directory and confirm the
skills list. This catches the case where the package published fine but the
repo layout means the CLI finds nothing.

## Rollback

npm forbids republishing a version number, ever. There is no overwrite.

- Within 72 hours and with no dependents, `npm unpublish <pkg>@<version>` works.
- After that, `npm deprecate <pkg>@<version> "<reason, and what to use>"`. The
  version stays installable, and anyone installing it sees the warning.
- Either way, publish a fixed patch version. That is the actual remedy.
- Delete the bad git tag and GitHub release so the history does not point at a
  version nobody should install:
  `git tag -d vX.Y.Z && git push origin :refs/tags/vX.Y.Z`

## Release notes people read

Group by skill, not by commit. A user of this package cares about one or two
skills and wants to know whether theirs moved.

```markdown
## v1.2.0

### Added
- `cross-platform-shell` - PowerShell and Git Bash portability rules.

### Changed
- `visual-diff` - scripts are now resolved from the skill directory.
  Bodies that hardcoded a relative script path stopped working after install.

### Fixed
- `worktree-isolation` - the port check assumed lsof, which Windows does not have.
```

Say what broke and why it changed. "Various improvements" tells a reader
nothing and makes them diff the package themselves.
