Release Tag Version
Follow this workflow only for this repository.
Package Targets
Select one package at the start of each run:
lib:
- package name:
mobx-keystone
- package.json:
packages/lib/package.json
- changelog:
CHANGELOG.md
- publish dir:
packages/lib
- build command:
pnpm lib:build
- test command:
pnpm lib:test
- unreleased format:
## Unreleased
yjs:
- package name:
mobx-keystone-yjs
- package.json:
packages/mobx-keystone-yjs/package.json
- changelog:
packages/mobx-keystone-yjs/CHANGELOG.md
- publish dir:
packages/mobx-keystone-yjs
- build command:
pnpm yjs-lib:build
- test command:
pnpm yjs-lib:test
- unreleased format:
## Unreleased
loro:
- package name:
mobx-keystone-loro
- package.json:
packages/mobx-keystone-loro/package.json
- changelog:
packages/mobx-keystone-loro/CHANGELOG.md
- publish dir:
packages/mobx-keystone-loro
- build command:
pnpm loro-lib:build
- test command:
pnpm loro-lib:test
- unreleased format:
## Unreleased
Global release branch: master
Release commit message format: <package-name>@v<version> (example: mobx-keystone@v1.2.3)
Release tag format: <package-name>@v<version> (example: mobx-keystone@v1.2.3)
Post-publish prep commit format: chore(<package-name>): prepare next release
Repository Guard
- After branch sync checks pass, verify this is the
mobx-keystone repository by checking:
packages/lib/package.json exists and "name": "mobx-keystone",
packages/mobx-keystone-yjs/package.json exists and "name": "mobx-keystone-yjs",
packages/mobx-keystone-loro/package.json exists and "name": "mobx-keystone-loro".
- If checks fail, stop and tell the user this skill is project-specific and cannot run in the current repository.
Interaction Contract
- Always ask the user which package to release first (
lib, yjs, loro).
- Always inspect the selected package changelog unreleased entries first.
- Always compute and explain a semver recommendation (
major, minor, or patch).
- Always present all three bump options and the resulting versions.
- Always ask the user to choose bump type, even if one option is recommended.
- Never perform writes (file edits, commit, tag, push) before explicit user confirmation.
- The release/tag commit must not keep
## Unreleased in the changelog.
- After successful publish, re-add
## Unreleased as the top changelog section and commit it as next-release preparation.
- Ask for a final confirmation before push.
- Never run
npm publish directly; always hand off publish to the user with exact commands and wait for user confirmation before continuing.
Semver Recommendation Rules
- Recommend
major for breaking changes (API removals, incompatible behavior changes, migration-required changes).
- Recommend
minor for backward-compatible features.
- Recommend
patch for bug fixes, docs, tests, refactors, and performance-only changes.
- If multiple categories appear, recommend the highest impact bump.
Required Workflow
- Verify current branch is
master:
git branch --show-current
- If branch is not
master, stop and ask user to switch to master before running release.
- Ensure local
master is synced with origin/master:
git fetch origin
git pull --ff-only origin master
- Run repository guard checks.
- Ask which package to release (
lib, yjs, loro).
- Resolve selected package paths (
package.json, changelog, publish dir).
- Read current version from selected package
package.json.
- Check for an
## Unreleased section in the selected package changelog.
- If the section is absent or present but has no bullet entries, stop: tell the user there is nothing to release and ask them to add changelog entries under
## Unreleased first.
- Parse the unreleased changelog bullets.
- Propose
major, minor, and patch next versions from current version.
- Tell the user:
- current version,
- unreleased summary,
- recommended bump with rationale,
- all three selectable bump options.
- Ask the user to select bump type.
- After selection, compute target version and draft the exact edits to apply (do not write files yet):
- Update selected package
package.json version to <target-version>.
- Remove
## Unreleased from the release/tag commit so it is not part of the published changelog version.
- Insert a new section
## <target-version> at the top of the changelog.
- Move unreleased bullets into the new version section.
- Show planned diff summary and ask for confirmation to apply edits and execute pre-push steps.
- If confirmed, run release commands in order:
- Ensure working tree is clean or only has intended release files.
- Apply/verify release edits.
- Run pre-publish checks:
pnpm lint
pnpm <selected-package-build-command>
pnpm <selected-package-test-command>
- Compute:
release-tag = <selected-package-name>@v<target-version>
release-commit-message = <selected-package-name>@v<target-version>
prep-commit-message = chore(<selected-package-name>): prepare next release
- Verify tag
<selected-package-name>@v<target-version> does not already exist locally or on origin.
- Commit:
git commit -m "<selected-package-name>@v<target-version>".
- Tag:
git tag "<selected-package-name>@v<target-version>".
- Ask for final confirmation before push+manual-publish handoff+post-publish changelog prep.
- If confirmed, finish release agent-side:
- Push commit and tag to
origin master.
- Hand off publish to the user:
- Tell the user to run:
cd <selected-publish-dir>
npm publish
- Ask the user to share the publish result and explicitly confirm when done.
- After the user confirms publish succeeded:
- Re-add
## Unreleased as the top changelog section and leave it empty.
- Commit the changelog-only prep commit using
chore(<selected-package-name>): prepare next release.
- Push the prep commit to
origin master.
- Report exact outputs for release commit SHA, tag, user-provided publish result, and post-publish prep commit SHA.
Command Template
# first, verify current branch is master
if [ "$(git branch --show-current)" != "master" ]; then
echo "Not on master; aborting release."
exit 1
fi
# then sync local master with origin/master
git fetch origin
git pull --ff-only origin master
# choose PACKAGE=lib|yjs|loro
# inspect selected package
# lib
cat packages/lib/package.json
rg -n "^## Unreleased|^## [0-9]" CHANGELOG.md
# yjs
cat packages/mobx-keystone-yjs/package.json
rg -n "^## Unreleased|^## [0-9]" packages/mobx-keystone-yjs/CHANGELOG.md
# loro
cat packages/mobx-keystone-loro/package.json
rg -n "^## Unreleased|^## [0-9]" packages/mobx-keystone-loro/CHANGELOG.md
# after user selects bump and confirms writes
# edit selected changelog + selected package.json
# remove `## Unreleased` from changelog in the release commit
# create `## X.Y.Z` at top and move unreleased bullets there
# package checks (choose based on PACKAGE)
# lib: pnpm lib:build && pnpm lib:test
# yjs: pnpm yjs-lib:build && pnpm yjs-lib:test
# loro: pnpm loro-lib:build && pnpm loro-lib:test
pnpm lint
if git rev-parse -q --verify "refs/tags/<package-name>@vX.Y.Z" >/dev/null; then echo "tag exists locally"; fi
if git ls-remote --exit-code --tags origin "refs/tags/<package-name>@vX.Y.Z" >/dev/null 2>&1; then echo "tag exists on origin"; fi
git add <selected-changelog> <selected-package-json>
git commit -m "<package-name>@vX.Y.Z"
git tag "<package-name>@vX.Y.Z"
# ask for final confirmation before running push and manual publish handoff
git push origin master
git push origin "<package-name>@vX.Y.Z"
# then instruct the user to run publish manually:
# cd <selected-publish-dir>
# npm publish
# wait for user confirmation that publish succeeded
# after successful publish, re-add top `## Unreleased` and commit prep
git add <selected-changelog>
git commit -m "chore(<package-name>): prepare next release"
git push origin master
Stop Conditions
- If selected package is not one of
lib/yjs/loro, stop and ask again.
- If current branch is not
master, stop and ask user to switch to master before releasing.
- If the selected changelog has no
## Unreleased section, or the section exists but has no bullet entries, stop and tell the user there is nothing unreleased to publish; ask them to add entries under ## Unreleased first.
- If
master cannot be fast-forwarded, stop and ask user how to proceed.
- If tag
<selected-package-name>@v<target-version> already exists, stop and ask user for tag strategy.
- If publish fails, do not retry destructive changes automatically; report error and ask.
- If the user has not yet confirmed manual
npm publish success, do not continue to post-publish changelog prep.
- If post-publish re-add/commit/push of
## Unreleased fails, report the exact state and ask before taking follow-up actions.
1---2name: release-tag-version3description: Release workflow for this repository. Ask the user to choose lib, yjs, or loro first, analyze unreleased changelog entries, recommend a semver bump, then update changelog and version, create package-specific commit and tag names, push, then hand off manual publish to the user.4---56# Release Tag Version78Follow this workflow only for this repository.910## Package Targets1112Select one package at the start of each run:1314- `lib`:15 - package name: `mobx-keystone`16 - package.json: `packages/lib/package.json`17 - changelog: `CHANGELOG.md`18 - publish dir: `packages/lib`19 - build command: `pnpm lib:build`20 - test command: `pnpm lib:test`21 - unreleased format: `## Unreleased`22- `yjs`:23 - package name: `mobx-keystone-yjs`24 - package.json: `packages/mobx-keystone-yjs/package.json`25 - changelog: `packages/mobx-keystone-yjs/CHANGELOG.md`26 - publish dir: `packages/mobx-keystone-yjs`27 - build command: `pnpm yjs-lib:build`28 - test command: `pnpm yjs-lib:test`29 - unreleased format: `## Unreleased`30- `loro`:31 - package name: `mobx-keystone-loro`32 - package.json: `packages/mobx-keystone-loro/package.json`33 - changelog: `packages/mobx-keystone-loro/CHANGELOG.md`34 - publish dir: `packages/mobx-keystone-loro`35 - build command: `pnpm loro-lib:build`36 - test command: `pnpm loro-lib:test`37 - unreleased format: `## Unreleased`3839Global release branch: `master`4041Release commit message format: `<package-name>@v<version>` (example: `mobx-keystone@v1.2.3`)4243Release tag format: `<package-name>@v<version>` (example: `mobx-keystone@v1.2.3`)4445Post-publish prep commit format: `chore(<package-name>): prepare next release`4647## Repository Guard4849- After branch sync checks pass, verify this is the `mobx-keystone` repository by checking:50 - `packages/lib/package.json` exists and `"name": "mobx-keystone"`,51 - `packages/mobx-keystone-yjs/package.json` exists and `"name": "mobx-keystone-yjs"`,52 - `packages/mobx-keystone-loro/package.json` exists and `"name": "mobx-keystone-loro"`.53- If checks fail, stop and tell the user this skill is project-specific and cannot run in the current repository.5455## Interaction Contract5657- Always ask the user which package to release first (`lib`, `yjs`, `loro`).58- Always inspect the selected package changelog unreleased entries first.59- Always compute and explain a semver recommendation (`major`, `minor`, or `patch`).60- Always present all three bump options and the resulting versions.61- Always ask the user to choose bump type, even if one option is recommended.62- Never perform writes (file edits, commit, tag, push) before explicit user confirmation.63- The release/tag commit must not keep `## Unreleased` in the changelog.64- After successful publish, re-add `## Unreleased` as the top changelog section and commit it as next-release preparation.65- Ask for a final confirmation before push.66- Never run `npm publish` directly; always hand off publish to the user with exact commands and wait for user confirmation before continuing.6768## Semver Recommendation Rules6970- Recommend `major` for breaking changes (API removals, incompatible behavior changes, migration-required changes).71- Recommend `minor` for backward-compatible features.72- Recommend `patch` for bug fixes, docs, tests, refactors, and performance-only changes.73- If multiple categories appear, recommend the highest impact bump.7475## Required Workflow76771. Verify current branch is `master`:78 - `git branch --show-current`79 - If branch is not `master`, stop and ask user to switch to `master` before running release.802. Ensure local `master` is synced with `origin/master`:81 - `git fetch origin`82 - `git pull --ff-only origin master`833. Run repository guard checks.844. Ask which package to release (`lib`, `yjs`, `loro`).855. Resolve selected package paths (`package.json`, changelog, publish dir).866. Read current version from selected package `package.json`.877. Check for an `## Unreleased` section in the selected package changelog.88 - If the section is absent or present but has no bullet entries, stop: tell the user there is nothing to release and ask them to add changelog entries under `## Unreleased` first.898. Parse the unreleased changelog bullets.909. Propose `major`, `minor`, and `patch` next versions from current version.9110. Tell the user:92 - current version,93 - unreleased summary,94 - recommended bump with rationale,95 - all three selectable bump options.9611. Ask the user to select bump type.9712. After selection, compute target version and draft the exact edits to apply (do not write files yet):98 - Update selected package `package.json` version to `<target-version>`.99 - Remove `## Unreleased` from the release/tag commit so it is not part of the published changelog version.100 - Insert a new section `## <target-version>` at the top of the changelog.101 - Move unreleased bullets into the new version section.10213. Show planned diff summary and ask for confirmation to apply edits and execute pre-push steps.10314. If confirmed, run release commands in order:104 - Ensure working tree is clean or only has intended release files.105 - Apply/verify release edits.106 - Run pre-publish checks:107 - `pnpm lint`108 - `pnpm <selected-package-build-command>`109 - `pnpm <selected-package-test-command>`110 - Compute:111 - `release-tag = <selected-package-name>@v<target-version>`112 - `release-commit-message = <selected-package-name>@v<target-version>`113 - `prep-commit-message = chore(<selected-package-name>): prepare next release`114 - Verify tag `<selected-package-name>@v<target-version>` does not already exist locally or on `origin`.115 - Commit: `git commit -m "<selected-package-name>@v<target-version>"`.116 - Tag: `git tag "<selected-package-name>@v<target-version>"`.11715. Ask for final confirmation before push+manual-publish handoff+post-publish changelog prep.11816. If confirmed, finish release agent-side:119 - Push commit and tag to `origin master`.12017. Hand off publish to the user:121 - Tell the user to run:122 - `cd <selected-publish-dir>`123 - `npm publish`124 - Ask the user to share the publish result and explicitly confirm when done.12518. After the user confirms publish succeeded:126 - Re-add `## Unreleased` as the top changelog section and leave it empty.127 - Commit the changelog-only prep commit using `chore(<selected-package-name>): prepare next release`.128 - Push the prep commit to `origin master`.12919. Report exact outputs for release commit SHA, tag, user-provided publish result, and post-publish prep commit SHA.130131## Command Template132133```bash134# first, verify current branch is master135if [ "$(git branch --show-current)" != "master" ]; then136 echo "Not on master; aborting release."137 exit 1138fi139140# then sync local master with origin/master141git fetch origin142git pull --ff-only origin master143144# choose PACKAGE=lib|yjs|loro145146# inspect selected package147# lib148cat packages/lib/package.json149rg -n "^## Unreleased|^## [0-9]" CHANGELOG.md150151# yjs152cat packages/mobx-keystone-yjs/package.json153rg -n "^## Unreleased|^## [0-9]" packages/mobx-keystone-yjs/CHANGELOG.md154155# loro156cat packages/mobx-keystone-loro/package.json157rg -n "^## Unreleased|^## [0-9]" packages/mobx-keystone-loro/CHANGELOG.md158159# after user selects bump and confirms writes160# edit selected changelog + selected package.json161# remove `## Unreleased` from changelog in the release commit162# create `## X.Y.Z` at top and move unreleased bullets there163164# package checks (choose based on PACKAGE)165# lib: pnpm lib:build && pnpm lib:test166# yjs: pnpm yjs-lib:build && pnpm yjs-lib:test167# loro: pnpm loro-lib:build && pnpm loro-lib:test168pnpm lint169if git rev-parse -q --verify "refs/tags/<package-name>@vX.Y.Z" >/dev/null; then echo "tag exists locally"; fi170if git ls-remote --exit-code --tags origin "refs/tags/<package-name>@vX.Y.Z" >/dev/null 2>&1; then echo "tag exists on origin"; fi171git add <selected-changelog> <selected-package-json>172git commit -m "<package-name>@vX.Y.Z"173git tag "<package-name>@vX.Y.Z"174175# ask for final confirmation before running push and manual publish handoff176git push origin master177git push origin "<package-name>@vX.Y.Z"178179# then instruct the user to run publish manually:180# cd <selected-publish-dir>181# npm publish182# wait for user confirmation that publish succeeded183184# after successful publish, re-add top `## Unreleased` and commit prep185git add <selected-changelog>186git commit -m "chore(<package-name>): prepare next release"187git push origin master188```189190## Stop Conditions191192- If selected package is not one of `lib`/`yjs`/`loro`, stop and ask again.193- If current branch is not `master`, stop and ask user to switch to `master` before releasing.194- If the selected changelog has no `## Unreleased` section, or the section exists but has no bullet entries, stop and tell the user there is nothing unreleased to publish; ask them to add entries under `## Unreleased` first.195- If `master` cannot be fast-forwarded, stop and ask user how to proceed.196- If tag `<selected-package-name>@v<target-version>` already exists, stop and ask user for tag strategy.197- If publish fails, do not retry destructive changes automatically; report error and ask.198- If the user has not yet confirmed manual `npm publish` success, do not continue to post-publish changelog prep.199- If post-publish re-add/commit/push of `## Unreleased` fails, report the exact state and ask before taking follow-up actions.