version
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVersion Skill
版本管理Skill
Bump semantic versions for plugins with git tag and commit.
为插件升级语义化版本,并创建Git标签与提交记录。
When to Use
使用场景
- After completing a feature (minor bump)
- After fixing bugs (patch bump)
- After breaking changes (major bump)
- Before releasing a new version
- 完成功能开发后(minor版本升级)
- 修复Bug后(patch版本升级)
- 进行破坏性变更后(major版本升级)
- 发布新版本前
Arguments
参数
/version [bump-type] [plugin-name]bump-type: , , or (default: patch)
plugin-name: Plugin to version (default: auto-detect from cwd or prompt)
majorminorpatchExamples:
/version patch git
/version minor settings-sync
/version major/version [bump-type] [plugin-name]bump-type: 、 或 (默认值:patch)
plugin-name: 要升级版本的插件(默认值:从当前工作目录自动检测或提示用户输入)
majorminorpatch示例:
/version patch git
/version minor settings-sync
/version majorProcedure
操作流程
Step 1: Identify Plugin
步骤1:识别插件
If plugin name not provided:
- Check if cwd is inside a plugin directory
- If not, list available plugins and ask user
bash
ls plugins/如果未提供插件名称:
- 检查当前工作目录是否位于某个插件目录内
- 若不是,则列出所有可用插件并询问用户
bash
ls plugins/Step 2: Read Current Version
步骤2:读取当前版本
bash
cat plugins/<name>/.claude-plugin/plugin.json | grep versionParse the current version (e.g., ).
1.2.3bash
cat plugins/<name>/.claude-plugin/plugin.json | grep version解析当前版本(例如:)。
1.2.3Step 3: Calculate New Version
步骤3:计算新版本
Based on bump type:
- major: →
1.2.32.0.0 - minor: →
1.2.31.3.0 - patch: →
1.2.31.2.4
根据升级类型计算:
- major:→
1.2.32.0.0 - minor:→
1.2.31.3.0 - patch:→
1.2.31.2.4
Step 4: Show Changes and Confirm
步骤4:展示变更并确认
Present to user:
undefined向用户展示以下内容:
undefinedVersion Bump
Version Bump
Plugin: git
Current: 1.2.3
New: 1.3.0
Type: minor
Files to update:
- plugins/git/.claude-plugin/plugin.json
- .claude-plugin/marketplace.json
Git actions:
- Commit: "chore(git): bump version to 1.3.0"
- Tag: v1.3.0-git
Proceed with version bump?
Wait for user confirmation.Plugin: git
Current: 1.2.3
New: 1.3.0
Type: minor
Files to update:
- plugins/git/.claude-plugin/plugin.json
- .claude-plugin/marketplace.json
Git actions:
- Commit: "chore(git): bump version to 1.3.0"
- Tag: v1.3.0-git
Proceed with version bump?
等待用户确认。Step 5: Update Files
步骤5:更新文件
After approval, update version in:
-
Plugin manifest:
plugins/<name>/.claude-plugin/plugin.jsonUpdate thefield."version" -
Marketplace catalog:
.claude-plugin/marketplace.jsonUpdate the version for this plugin in thearray.plugins
获得批准后,在以下文件中更新版本号:
-
插件清单:
plugins/<name>/.claude-plugin/plugin.json更新字段。"version" -
市场目录:
.claude-plugin/marketplace.json在数组中更新该插件的版本号。plugins
Step 6: Create Git Commit and Tag
步骤6:创建Git提交与标签
bash
git add plugins/<name>/.claude-plugin/plugin.json .claude-plugin/marketplace.json
git commit -m "chore(<name>): bump version to <new-version>"
git tag -a "v<new-version>-<name>" -m "Release <name> v<new-version>"bash
git add plugins/<name>/.claude-plugin/plugin.json .claude-plugin/marketplace.json
git commit -m "chore(<name>): bump version to <new-version>"
git tag -a "v<new-version>-<name>" -m "Release <name> v<new-version>"Step 7: Verify
步骤7:验证
bash
git log -1 --oneline
git tag -l "v*-<name>" | tail -1bash
git log -1 --oneline
git tag -l "v*-<name>" | tail -1Rules
规则
- NEVER push — Only commit and tag locally, never push
- ALWAYS confirm — Never bump without user approval
- Semantic versioning — Follow MAJOR.MINOR.PATCH strictly
- Update both files — plugin.json AND marketplace.json
- Tag format — Use for multi-plugin repos
v<version>-<plugin-name>
- 禁止推送 — 仅在本地创建提交和标签,绝不推送至远程仓库
- 必须确认 — 未经用户批准,绝不执行版本升级
- 语义化版本 — 严格遵循MAJOR.MINOR.PATCH格式
- 更新两个文件 — 必须同时更新plugin.json和marketplace.json
- 标签格式 — 多插件仓库中使用格式
v<version>-<plugin-name>
Output Format
输出格式
undefinedundefinedVersion Bump Complete
Version Bump Complete
Plugin: git
Version: 1.2.3 → 1.3.0
Commit: abc1234 chore(git): bump version to 1.3.0
Tag: v1.3.0-git
Run to publish.
git push --follow-tagsundefinedPlugin: git
Version: 1.2.3 → 1.3.0
Commit: abc1234 chore(git): bump version to 1.3.0
Tag: v1.3.0-git
Run to publish.
git push --follow-tagsundefined