Release

From tetherto/qvac · View interactive version

Release is an AI agent skill from the GitHub repository tetherto/qvac. Release a package to NPM. Validates version bump and changelog, finds or starts the release run (addon-auto-release.yml for addons on main, a release branch for patches), monitors CI, verifies publish.

How to use this skill

Skill file

Release Package

Release a package to NPM. Ensures version bump, changelog, release branch, CI pipeline, and npm publish.

The package is identified by the <package-name> argument, which is the directory name under packages/ (e.g., ocr-ggml, sdk, tts-ggml). The skill reads packages/<package-name>/package.json to determine the package type and npm scope.

Usage

/release <package-name> [base-branch]

Where:

For a native addon on main, merging the version bump is what starts the release:

addon-auto-release.yml cuts release-<package>-<version> and starts publish-npm.yml

(see docs/gitflow.md, "Native addon releases from main"). This skill then finds that run

rather than cutting the branch itself.

Workflow

Step 1: Validate prerequisites

  1. Read packages/$ARGUMENTS/package.json to get the current version and npm package name.
  2. Compare version against the latest version published on npm:

```bash

npm view <npm-package-name> version

```

  1. If the local version is not higher than the npm version, stop and ask the user to bump the version first.
  2. Verify the CHANGELOG heading format exactly matches what the publish-release workflow extracts. The workflow uses this awk regex: ^## \[<version>\] — heading must be bracketed (Keep-a-Changelog style). Soft phrasing like "section for 0.1.0" is not enough; the heading line must literally be ## [0.1.0].

Run this exact check (mirrors the regex in .github/workflows/create-github-release.yml):

```bash

version=$(node -p "require('./packages/<package>/package.json').version")

if ! grep -qE "^## \[${version}\]" "packages/<package>/CHANGELOG.md"; then

echo "FAIL: packages/<package>/CHANGELOG.md is missing a '## [${version}]' heading."

echo " A heading like '## ${version}' (no brackets) will NOT match — publish-release will fail."

exit 1

fi

```

If the check fails, fix the heading or generate the section first:

Step 2: Confirm with user

Display a summary and ask for confirmation before proceeding:

Release summary:
  Package: <package>
  Version: <version>
  Branch:  release-<package>-<version>
  Target:  NPM (latest tag)

Proceed? (y/n)

Step 3: Find or start the release run

Native addon on main: the automation covers a package that is not private, has a publish

target, and is tagged ci:addons in packages/<package>/project.json. Do not cut the branch or

dispatch publish-npm.yml yourself.

  1. Find the merge commit that bumped the version (the second command must print <version>)

and the auto-release run for it:

```bash

git fetch origin main

git log --first-parent -1 --format=%H -S'"version": "<version>"' origin/main -- packages/<package>/package.json

git show <merge-commit>:packages/<package>/package.json | grep '"version"'

gh run list --repo tetherto/qvac --workflow addon-auto-release.yml --limit 10

gh run list --repo tetherto/qvac --workflow publish-npm.yml --branch release-<package>-<version> --limit 1

```

  1. If a publish-npm.yml run exists on release-<package>-<version>, go to Step 4 with it.
  2. If the branch exists but has no run, read the reason in the latest auto-release summary.

dependency publishes.

recover it with the commands in item 4. Otherwise report the reason and stop. A reused

hand-cut branch never starts on its own: if the recovery waits for a dependency, run it

again once the dependency publishes.

  1. If there is no branch, the bump merged before the automation existed or its run failed.

Show the plan, then start it. A branch already at <merge-commit> is reused:

```bash

gh workflow run addon-auto-release.yml --repo tetherto/qvac -f sha=<merge-commit> -f dry_run=true

gh workflow run addon-auto-release.yml --repo tetherto/qvac -f sha=<merge-commit>

```

Any other package on main (for example ci:libs), or a patch on release-*:

  1. Ensure we're on the base branch and up to date:

```bash

git checkout <base-branch>

git pull origin <base-branch>

```

Where <base-branch> is main, or release-<package>-<base-version> for a patch.

  1. Create the release branch:

```bash

git checkout -b release-<package>-<version>

```

  1. Push the release branch to remote (required for workflow dispatch to find the ref):

```bash

git push origin release-<package>-<version>

```

  1. Trigger the release workflow manually. Pushing the branch does not start it: a branch with no new commits never matches the workflow's paths filter. These packages publish through publish-npm.yml:

```bash

gh workflow run publish-npm.yml --repo tetherto/qvac --ref release-<package>-<version> -f packages=<package>

```

This workflow:

Step 4: Monitor CI pipeline

Use /loop to poll the pipeline status every 2 minutes:

/loop 2m Check the CI pipeline status for the release branch release-<package>-<version>. Run: gh run list --branch release-<package>-<version> --limit 5. If all runs completed successfully, report SUCCESS and stop. If any run failed, report the failure details. If still running, report progress.

Step 5: Verify npm publish

Once CI completes successfully:

  1. Check that the package was published to npm:

```bash

npm view @qvac/<package>@<version> version

```

(Note: some packages may not have the @qvac/ scope — check package.json for the actual package name)

  1. Check that the GitHub release was created:

```bash

gh release view <package>-v<version>

```

  1. Report final status to user:

```

Release complete:

Package: <npm-package-name>@<version>

NPM: published

GitHub Release: <package>-v<version>

Branch: release-<package>-<version>

```

Step 6: Verify public access

Verify the published package is publicly accessible without authentication by installing it in a clean temp directory with no npm token:

# Create a temp directory and install without any auth
TMPDIR=$(mktemp -d)
cd $TMPDIR
echo "registry=https://registry.npmjs.org/" > .npmrc
npm install <npm-package-name>@<version> --ignore-scripts --no-package-lock

If the install succeeds, the package is publicly accessible. If it fails with a 401/403, the package may still be private — flag this to the user.

Sanity checks on the installed package:

# Verify the tarball contents look correct
npm pack <npm-package-name>@<version> --pack-destination $TMPDIR
tar tf $TMPDIR/<tarball-filename> | head -20

# Check that key files are present in the installed package:
ls $TMPDIR/node_modules/<npm-package-name>/
# Expected: package.json, README.md, index.js (or similar entry point), prebuilds/ (for addons)

# Verify package.json version matches
node -e "console.log(require('$TMPDIR/node_modules/<npm-package-name>/package.json').version)"

Clean up:

rm -rf $TMPDIR

If any check fails, report the issue to the user before proceeding.

Step 7: Switch back to main

git checkout main

Error handling

Important notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.