release-manager Skill
为本仓库准备或完成 semver 发版。当 Codex 需要从 `main` 创建或继续 `release-vX.Y.Z` 分支、按 `major`/`minor`/`patch` 升级库版本、核对 `lib/package.json`、`lib/jsr.json`、`lib/src/version.ts`、`package-lock.json` 中的库条目、`lib/README.md` 中的版本引用以及 `examples/src/samples/*/sandbox/package.json` 中的独立 sandbox 依赖引用保持同步、按需更新 `lib/CHANGELOG.md`、`MIGRATION.md`、`SECURITY.md` 和 README 等发版文档、运行发版校验、创建 c 时使用。
安装方式:把技能目录放入 ~/.claude/skills/(Claude Code)或在 claude.ai 设置中启用;也可复制右侧安装命令一键添加。
技能指令原文(SKILL.md)
Release Manager
Drive every step through node scripts/release.mts from the repo root on Node 24 (nvm use), npm only. Commands are idempotent: after any fix, rerun the same command. Exit 1 is an error: do what stderr says. Exit 2 is a decision: ask the user with the options printed on stdout, then rerun with the chosen flag.
Invoking the skill authorizes steps 1–6 (branch, files, commit, push, PR, tag push). Steps 7–8 publish and merge: ask first.
Input
$ARGUMENTS is major, minor or patch. If it is empty and the current branch is release-vX.Y.Z, resume: the bump is whatever turns git show origin/main:lib/package.json into X.Y.Z. Otherwise ask for the bump; do not infer it from commits.
Steps
prepare: createsrelease-vX.Y.Zfromorigin/mainor resumes it, bumps version files vianpm run version(lib/package.json,lib/jsr.json,lib/src/version.ts,package-lock.json), moves[Unreleased]into## [X.Y.Z] -, pins sandbox deps to^MAJOR, and runs the version sync check.
- On any other branch it exits 2.
--branch renameturns that branch into the release branch, so its commits ship in this release.--branch newbranches fromorigin/mainand leaves it alone. - Empty
[Unreleased]: it prints the commits since the last tag. Write user-facing entries under[Unreleased]in the existing style (### Added/### Changed/### Fixed, short lowercase bullets, backticked API names), then rerun. - Branch behind
origin/mainwith its own commits: ask the user whether to merge or rebase, do it, rerun.
- Review docs; edit only what the release needs:
- Read the printed changelog section and tighten wording. Never edit past releases.
- Major: upgrade steps in
MIGRATION.md, the supported versions table inSECURITY.md, and the library row of the compatibility table inskills/lightweight-charts-react-components/SKILL.md. The sync check fails until that range covers the new major; verify recipes withnpm run check:skill-recipes. - Changed peer or engine ranges: the matching rows of that table.
- Minor or patch: keep the skill's reference versions. They are the tested baseline, and only the ranges must cover the release.
lib/README.md: only when install or usage changed. Badges and links carry no version.
check(several minutes, run it in the background): versions, format, lint, typecheck, lib unit tests with the coverage gate, build, jsdoc and md links, knip, plus skill recipes whenskills/changed. Fix failures and rerun. Ifmd linksfails only on external 5xx or timeouts, it is flaky: note it for the user and continue.commit: one commit with the exact messagechore: vX.Y.Z. It refuses non-release files: commit those first as their own conventional commit, or stash them. It also refuses while[Unreleased]has entries, for example a fix added during validation; rerunprepare, which merges them into[X.Y.Z]. Rerunning after later edits amends the same commit.pr: pushes the branch and opens the PRchore: vX.Y.Ztomainwith the changelog section as body, or reuses the open one and refreshes its body from the current changelog. Therelease*branch name triggers the release-notes preview comment. After an amend it exits 2: confirm, then rerun with--force(force-with-lease).tag: creates and pushes annotated tagvX.Y.Z(messagerelease vX.Y.Z) on the pushed release commit. Releases are tagged and published from the branch before merge. If the tag points at an older commit, it exits 2: confirm, then rerun with--move, which is refused once the version is on npm.- Publish, after the user says yes (npm, JSR, GitHub release, examples deploy):
gh workflow run release.yaml --ref vX.Y.Z. Add-f dry-run=truefor a rehearsal. It must run on the tag; a branch ref fails the semver check.gh run list --workflow release.yaml --branch vX.Y.Z --limit 1 --json databaseId,url, thengh run watch --exit-statusin the background.- Failed before the
Releasejob: nothing is published. For flakes, rungh run rerun --failed. For real problems, fix on the branch, thencommit,pr --force,tag --move, and dispatch again. - Failed after
npm publishran: that version is final. Do not move the tag; release a new patch.
- Merge, after the Release run succeeds and the user says yes:
gh pr merge --merge. Use a merge commit, never squash or rebase, so the tagged commit lands onmainunchanged. Thengit switch main && git pull --ff-only && git branch -d release-vX.Y.Z; the remote branch is deleted on merge.
Finish
Report the version, PR URL, tag, Release run URL and result, and any skipped or flaky check.