with one click
minor-release
// Execute a minor release end-to-end: collect changes, write announcement, bump version, commit, tag, push. Use when: minor-release, 发版, minor release, 发 minor, 新版本, release minor.
// Execute a minor release end-to-end: collect changes, write announcement, bump version, commit, tag, push. Use when: minor-release, 发版, minor release, 发 minor, 新版本, release minor.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | minor-release |
| description | Execute a minor release end-to-end: collect changes, write announcement, bump version, commit, tag, push. Use when: minor-release, 发版, minor release, 发 minor, 新版本, release minor. |
| argument-hint | 主要变更描述(可选,用于生成 announcement) |
端到端执行 minor release:收集变更 → 编写 announcement → quality 检查 → bump + commit + tag + push。
获取当前版本号:
node -p "require('./package.json').version"
获取上一个 tag 以来的所有 commit:
git log --oneline "$(git describe --tags --abbrev=0 HEAD)..HEAD"
按 Conventional Commits type 分类(feat / fix / refactor / perf / chore / ci / docs / test / style)。
过滤出用户可感知的变更(保留 feat / fix / perf / refactor 中影响 UI 或行为的)。去掉纯 chore / ci / docs / test / style。
向用户展示变更摘要,询问:
计算新版本号(当前 minor bump,如 2.3.0 → 2.4.0)。
在 src/config/announcements.ts 的 ANNOUNCEMENTS 对象顶部(第一个属性位置)新增条目:
'v{x.y.z}': {
title: 'v{x.y.z} 更新内容',
items: [
'面向用户的中文描述,每条 ≤30 字',
// ...
],
},
items 编写规范:
输出草稿,展示给用户,等待确认后再继续。
如果 src/config/announcements.ts 有未提交的改动,先独立提交:
git add src/config/announcements.ts
git commit -m "docs(announcements): add v{x.y.z} What's New entry"
pnpm run quality
如果失败:
pnpm exec eslint . --fix && pnpm exec prettier --write .,修完重跑bash scripts/release.sh minor
脚本会自动:
package.json + 同步 app.jsonannouncements.ts 是否有对应版本条目(Phase 2 已添加)git add -A && git commit -m "release: v{x.y.z}"v{x.y.z}y(因为 announcement 已在 3a 提交,此处不应触发;如触发说明有其他改动,需评估)确认 release commit 和 tag:
git log --oneline -3
确认 tag 存在:
git tag -l 'v*' | tail -3
确认远程 push 成功(检查 Phase 3 输出中的 ✅ Released v{x.y.z})。
如果 push 失败(网络问题),提示用户:
git push origin HEAD --tags
| 场景 | 处理 |
|---|---|
pnpm run quality 失败 | 尝试 auto-fix(lint/format);类型错误/测试失败 → BLOCKED |
| release.sh 报 announcements 缺条目 | 回到 Phase 2,确认条目已正确添加并 commit |
| release.sh 报 working tree 不干净 | 评估未提交改动,必要时先 commit 或 stash |
| push 失败 | 本地 tag 已创建,提示用户手动 git push origin HEAD --tags |
| 版本号计算错误 | 以 package.json 中的值为准,用 node -p 验证 |
release.sh 本身release: v$VERSION),不手动 commit 版本文件docs(announcements): add v$VERSION What's New entry--no-verify,不绕过 git hooks/^v\d+\.\d+\.\d+ 更新内容$/ 格式(E2E auto-dismisser 依赖此正则)