Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 36 additions & 45 deletions .claude/skills/release/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,59 @@
---
name: release
description: Bump version, build, test, commit, tag, push, and publish to npm. Use when the user asks to release, publish, cut a release, or bump the version.
description: Cut a release or trigger a preview publish via the scripts/publish flow. Use when the user asks to release, publish, cut a release, bump the version, or preview-publish a branch.
---

# Release

## Usage
- `/release patch` / `minor` / `major` — semver bump from current version
- `/release 0.2.0` or `/release 0.2.0-rc.1` — exact version
The publish flow lives in `scripts/publish` and is driven by the unified
`.github/workflows/publish.yaml` workflow. There are two modes:

## Workflow
- **Release** — a versioned cut that publishes to npm + crates.io, creates a
GitHub release with binaries, and tags `v<version>`.
- **Preview publish** — a branch snapshot published to npm only, under a
branch-named dist-tag, using fast debug builds. No git tag, no crates.io
release, no GitHub release.

## Release

### 1. Preflight
```bash
git branch --show-current # must be main
git status --porcelain # must be clean
git fetch origin main && git rev-parse HEAD && git rev-parse origin/main # must match
just release --version 0.2.0 # exact version
just release --version 0.2.0-rc.1 # rc (npm tag `rc`, prerelease)
just release --patch # semver bump from latest git tag
```
Stop and report if any check fails.

### 2. Determine version
- `patch` / `minor` / `major`: strip any prerelease suffix from current `package.json` version, then bump (e.g. `0.1.0-rc.1` + patch = `0.1.1`)
- Exact version (e.g. `0.2.0`, `0.3.0-rc.1`): use as-is
`just release` runs `scripts/publish/src/local/cut-release.ts`, which:
1. Resolves the version and the `latest` flag (auto-detected from git tags).
2. Validates the working tree is clean and prints a plan to confirm.
3. Rewrites `Cargo.toml` + every publishable `package.json` version.
4. Runs a local core build + type-check fail-fast (`--skip-checks` to skip).
5. Commits + pushes the version bump.
6. Triggers `publish.yaml` with the version, which builds release binaries,
publishes npm + crates.io, uploads release assets, and tags `v<version>`.

### 3. Determine npm tag
- Check the latest stable (non-prerelease) version published on npm: `npm view antiox versions --json`
- If the target version has a prerelease suffix (contains `-`): use `--tag rc`
- If the target version is stable and greater than the current latest stable on npm: use `--tag latest`
- If the target version is stable but older than the current latest on npm: stop and warn the user (this would move the `latest` tag backwards)
Flags: `--latest` / `--no-latest`, `--dry-run` (mutate files only), `-y`.

Show the user: current version, target version, npm tag. Ask to confirm.
## Preview publish

### 4. Build and test
```bash
pnpm build
pnpm check-types
pnpm test
just preview-publish <branch>
```
Stop if any step fails.

### 5. Bump version
Update `version` in `package.json` to the target version.

### 6. Commit, tag, push
```bash
git add package.json
git commit -m "release: v<version>"
git tag v<version>
git push origin main
git push origin v<version>
```
Dispatches `publish.yaml` on the branch with no version. The context resolver
computes `version = 0.0.0-<sanitized-branch>.<sha>` and `npm_tag = <sanitized-branch>`,
builds a debug sidecar, and publishes every package to npm under that tag.
Install a preview with:

### 7. Trigger GitHub release workflow
```bash
gh workflow run release.yml -f version=<version> -f npm-tag=<latest|rc>
npm install @rivet-dev/agent-os-core@<sanitized-branch>
```
This dispatches the `release.yml` workflow, which checks out the tag, builds, publishes to npm, and creates a GitHub release.

### 8. Report
Show the user: final commit hash, tag, and the link to the triggered workflow run.
## Notes

## Rules
- Never skip git checks unless the user explicitly asks.
- Never force-push.
- Always build + test before publishing.
- Never publish to npm locally; always use the GitHub release workflow.
- Never publish to npm or crates.io locally; always go through `publish.yaml`.
- Platform binary packages publish with `npm publish` (preserves the `0755`
executable bit). `workspace:*` deps are rewritten to literal versions by the
full `bump-versions` pass before publish, so `npm publish` resolves them.
- `SIDECAR_PLATFORMS` (workflow env + `scripts/publish` discovery) is the single
source of truth for which platform binary packages are built and published.
- If anything fails, stop and report — do not retry automatically.
Loading
Loading