microsoft/version-bump
Performs a version bump for roosterjs. Merges changes from master into release, determines the correct SemVer version bump based on public interface changes, and creates a draft PR. Use when asked to do a version bump, release prep, or bump versions.
npx skills add https://github.com/microsoft/roosterjs --skill version-bump
This skill performs a version bump for roosterjs. It merges changes from master into release, determines the correct SemVer version bump based on public interface changes, and creates a draft PR.
Run git status --porcelain. If there is any output (uncommitted changes exist), stop immediately and ask the user to deal with their uncommitted changes first before proceeding.
git checkout master
git pull origin master
If either command fails, stop and report the error.
git checkout release
git pull origin release
If either command fails, stop and report the error.
Search the git log on the release branch for the most recent version bump commit. Version bump commits typically have "Version bump" or "version bump" in their commit message, or modify only versions.json.
git log release --oneline --grep="ersion bump" -1
If not found via message, look for the last commit that modified versions.json:
git log release --oneline -1 -- versions.json
Record the commit hash and date of this commit.
Using the date/hash from Step 4, find all merge commits (PRs) merged into master after that point:
git log master --oneline --merges --after="<date_of_last_bump>"
Alternatively, find commits on master that are not on release:
git log release..master --oneline --merges
If no PRs are found, stop and tell the user: "Version bump is not required since there is no PR merged since the last version bump."
For each PR found in Step 5, create a one-line description with the PR link. Format:
- #<PR_NUMBER> <PR_TITLE> (https://github.com/microsoft/roosterjs/pull/<PR_NUMBER>)
Use gh pr view <number> --json title,number,url to get details if needed. Save these descriptions for use in Step 15.
Create a new branch from release. Use the naming convention u/<username>/bump-<N> where N is incremented, or as specified by the user:
git checkout -b <branch_name> release
Merge master into the new branch, preferring master's changes for any conflicts:
git merge master -X theirs
Check for any remaining conflict markers:
git diff --check
grep -r "<<<<<<" --include="*.ts" --include="*.js" --include="*.json" .
If conflicts remain, stop and report them to the user.
Run a diff between the current branch and master:
git diff master -- . ':!versions.json'
Ignore differences that are only whitespace/formatting (newlines, indentation). You can verify with:
git diff master --stat -- . ':!versions.json'
If there are substantive code differences (not just formatting), show the differences to the user and ask: "There are code differences between this branch and master (other than versions.json). Do you want to continue?"
If the user says no, stop the flow.
The versions.json file has 4 version groups:
| Group | Packages |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| main | roosterjs, roosterjs-content-model-types, roosterjs-content-model-dom, roosterjs-content-model-core, roosterjs-content-model-api, roosterjs-content-model-plugins, roosterjs-color-utils, roosterjs-content-model-markdown |
| legacyAdapter | roosterjs-editor-adapter |
| react | roosterjs-react |
| overrides | Per-package overrides (usually empty) |
The grouping is defined in /tools/buildTools/common.js in the buildConfig object.
SemVer rules:
To determine the bump level:
release and the merged codelib/index.ts barrel files in each package for added/removed/changed exportsIf a major version bump appears needed, show the interface differences to the user and ask: "A major version bump seems needed due to these interface changes. Do you want to bump the major version, or just bump minor instead?"
Update versions.json with the new version numbers for each affected group.
Run the full build and test suite:
yarn build
yarn test:fast
If any errors occur, show the full error output and stop the flow. Do not proceed with a broken build.
git add versions.json
git commit -m "Version bump to <new_versions>"
Include all changed version numbers in the commit message.
git push origin <branch_name>
Create a draft PR targeting the release branch using the gh CLI:
Title: Version bump <group>: <old_version> → <new_version> (list all groups that changed)
Description: Include:
| Group | Old Version | New Version |
| ------------- | ----------- | ----------- |
| main | x.y.z | x.y.z+1 |
| react | x.y.z | x.y.z+1 |
| legacyAdapter | x.y.z | x.y.z+1 |
## Changes included
- #123 Add feature X (https://github.com/microsoft/roosterjs/pull/123)
- #124 Fix bug Y (https://github.com/microsoft/roosterjs/pull/124)
Command:
gh pr create --draft --base release --title "<title>" --body "<description>"
Display the PR URL to the user. Example output:
✅ Version bump PR created successfully!
PR: https://github.com/microsoft/roosterjs/pull/<number>
Take microsoft/version-bump from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.