version

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Version 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:
major
,
minor
, or
patch
(default: patch) plugin-name: Plugin to version (default: auto-detect from cwd or prompt)
Examples:
/version patch git
/version minor settings-sync
/version major
/version [bump-type] [plugin-name]
bump-type:
major
minor
patch
(默认值:patch) plugin-name: 要升级版本的插件(默认值:从当前工作目录自动检测或提示用户输入)
示例:
/version patch git
/version minor settings-sync
/version major

Procedure

操作流程

Step 1: Identify Plugin

步骤1:识别插件

If plugin name not provided:
  1. Check if cwd is inside a plugin directory
  2. If not, list available plugins and ask user
bash
ls plugins/
如果未提供插件名称:
  1. 检查当前工作目录是否位于某个插件目录内
  2. 若不是,则列出所有可用插件并询问用户
bash
ls plugins/

Step 2: Read Current Version

步骤2:读取当前版本

bash
cat plugins/<name>/.claude-plugin/plugin.json | grep version
Parse the current version (e.g.,
1.2.3
).
bash
cat plugins/<name>/.claude-plugin/plugin.json | grep version
解析当前版本(例如:
1.2.3
)。

Step 3: Calculate New Version

步骤3:计算新版本

Based on bump type:
  • major:
    1.2.3
    2.0.0
  • minor:
    1.2.3
    1.3.0
  • patch:
    1.2.3
    1.2.4
根据升级类型计算:
  • major
    1.2.3
    2.0.0
  • minor
    1.2.3
    1.3.0
  • patch
    1.2.3
    1.2.4

Step 4: Show Changes and Confirm

步骤4:展示变更并确认

Present to user:
undefined
向用户展示以下内容:
undefined

Version 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:
  1. Plugin manifest:
    plugins/<name>/.claude-plugin/plugin.json
    Update the
    "version"
    field.
  2. Marketplace catalog:
    .claude-plugin/marketplace.json
    Update the version for this plugin in the
    plugins
    array.
获得批准后,在以下文件中更新版本号:
  1. 插件清单:
    plugins/<name>/.claude-plugin/plugin.json
    更新
    "version"
    字段。
  2. 市场目录:
    .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 -1
bash
git log -1 --oneline
git tag -l "v*-<name>" | tail -1

Rules

规则

  1. NEVER push — Only commit and tag locally, never push
  2. ALWAYS confirm — Never bump without user approval
  3. Semantic versioning — Follow MAJOR.MINOR.PATCH strictly
  4. Update both files — plugin.json AND marketplace.json
  5. Tag format — Use
    v<version>-<plugin-name>
    for multi-plugin repos
  1. 禁止推送 — 仅在本地创建提交和标签,绝不推送至远程仓库
  2. 必须确认 — 未经用户批准,绝不执行版本升级
  3. 语义化版本 — 严格遵循MAJOR.MINOR.PATCH格式
  4. 更新两个文件 — 必须同时更新plugin.json和marketplace.json
  5. 标签格式 — 多插件仓库中使用
    v<version>-<plugin-name>
    格式

Output Format

输出格式

undefined
undefined

Version 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
git push --follow-tags
to publish.
undefined
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
git push --follow-tags
to publish.
undefined