version-update

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Version Update Skill

版本更新Skill

Cross-stack semantic version update for node/rust/python with conditional
git-commit
handoff.
<purpose>
  • Update one semantic version across node, rust, and python version-bearing files.
  • Keep discovered manifest files and inline version markers synchronized.
  • Prefer the installed
    git-commit
    skill for the final git add/commit/push flow.
  • Fall back to local direct git execution only when
    git-commit
    is unavailable.
</purpose>
<trigger_conditions>
User intentActivate
"bump this package to 1.4.0"yes
"update the version and commit it"yes
"increase patch version for this crate"yes
"just make a git commit"no, use
git-commit
"rewrite this release runbook"no
</trigger_conditions>
<supported_targets>
  • package.json
  • Cargo.toml
  • pyproject.toml
  • setup.py
  • python
    __version__
    declarations
  • inline
    .version('x.y.z')
    code patterns
</supported_targets>
<scripts>
支持条件式
git-commit
移交的跨Node/Rust/Python栈语义化版本更新工具。
<purpose>
  • 跨Node、Rust和Python项目的版本承载文件统一更新语义化版本。
  • 保持已发现的清单文件和内联版本标记同步。
  • 在最终的git add/commit/push流程中优先使用已安装的
    git-commit
    Skill。
  • 仅当
    git-commit
    不可用时,才回退到本地直接执行git命令。
</purpose>
<trigger_conditions>
用户意图是否激活
"将此包版本升级到1.4.0"
"更新版本并提交"
"提升此crate的补丁版本"
"仅提交git"否,请使用
git-commit
"重写此发布手册"
</trigger_conditions>
<supported_targets>
  • package.json
  • Cargo.toml
  • pyproject.toml
  • setup.py
  • Python中的
    __version__
    声明
  • 内联
    .version('x.y.z')
    代码模式
</supported_targets>
<scripts>

Available scripts

可用脚本

ScriptPurpose
scripts/stack-detect.sh
Detect stacks (
node
,
rust
,
python
)
scripts/version-find.sh [--plain]
Discover version-bearing files
scripts/version-current.sh [file]
Extract current semver (`file
scripts/version-bump.sh <current> <type>
Calculate next semver
scripts/version-apply.sh <new> [files...]
Apply version to discovered/selected files
scripts/git-commit-detect.sh
Detect whether a usable project-local
git-commit
skill exists in repository skill directories
scripts/git-commit.sh "msg" [files]
Fallback direct commit helper when
git-commit
is not installed
scripts/git-push.sh
Fallback direct push helper when
git-commit
is not installed
</scripts>
<git_integration>
  • Run
    scripts/git-commit-detect.sh
    before the final git step.
  • The detector checks, in order:
    skills/git-commit
    ,
    .agents/skills/git-commit
    ,
    .claude/skills/git-commit
    , and
    .codex/skills/git-commit
    inside the current repository.
  • Use
    git-commit
    only when the detector returns
    installed|...
    .
  • When handing off to
    git-commit
    , pass only the files changed by
    version-update
    and use
    chore: bump version to x.y.z
    unless the user requested a different message.
  • If the detector returns
    missing|...
    , use the local fallback scripts in
    skills/version-update/scripts/
    .
  • If the user asked for version-only work, stop after the version files and diff review. Do not commit or push.
  • If push is requested and the detector returns
    installed|...
    , let
    git-commit
    own push confirmation. Otherwise use
    scripts/git-push.sh
    only after explicit user request.
</git_integration>
<version_rules>
ArgumentActionExample
+1
/
+patch
Patch +1
0.1.13 -> 0.1.14
+minor
Minor +1
0.1.13 -> 0.2.0
+major
Major +1
0.1.13 -> 1.0.0
x.y.z
Explicit set
0.1.13 -> 2.0.0
</version_rules>
<workflow>
脚本用途
scripts/stack-detect.sh
检测技术栈(
node
rust
python
scripts/version-find.sh [--plain]
发现承载版本信息的文件
scripts/version-current.sh [file]
提取当前语义化版本(输出格式:`file
scripts/version-bump.sh <current> <type>
计算下一个语义化版本
scripts/version-apply.sh <new> [files...]
将新版本应用到已发现/选定的文件
scripts/git-commit-detect.sh
检测当前仓库的Skill目录中是否存在可用的项目本地
git-commit
Skill
scripts/git-commit.sh "msg" [files]
git-commit
未安装时,作为提交操作的备选辅助脚本
scripts/git-push.sh
git-commit
未安装时,作为推送操作的备选辅助脚本
</scripts>
<git_integration>
  • 在最终git步骤前运行
    scripts/git-commit-detect.sh
  • 检测器按顺序检查当前仓库内的以下路径:
    skills/git-commit
    .agents/skills/git-commit
    .claude/skills/git-commit
    .codex/skills/git-commit
  • 仅当检测器返回
    installed|...
    时,才使用
    git-commit
  • 移交至
    git-commit
    时,仅传递
    version-update
    修改的文件,且默认使用提交信息
    chore: bump version to x.y.z
    ,除非用户指定其他信息。
  • 若检测器返回
    missing|...
    ,则使用
    skills/version-update/scripts/
    中的本地备选脚本。
  • 若用户仅要求版本更新操作,则在版本文件修改和差异审查后停止,不执行提交或推送。
  • 若用户要求推送且检测器返回
    installed|...
    ,则由
    git-commit
    负责推送确认;否则仅在用户明确请求时使用
    scripts/git-push.sh
</git_integration>
<version_rules>
参数操作示例
+1
/
+patch
补丁版本+1
0.1.13 -> 0.1.14
+minor
次版本号+1
0.1.13 -> 0.2.0
+major
主版本号+1
0.1.13 -> 1.0.0
x.y.z
显式设置版本
0.1.13 -> 2.0.0
</version_rules>
<workflow>

Workflow

工作流程

bash
undefined
bash
undefined

1) detect stack(s)

1) 检测技术栈

scripts/stack-detect.sh
scripts/stack-detect.sh

2) find version-bearing files

2) 发现承载版本信息的文件

scripts/version-find.sh
scripts/version-find.sh

3) read current version

3) 读取当前版本

scripts/version-current.sh
scripts/version-current.sh

output: <file>|<version>

输出格式: <file>|<version>

4) compute next version

4) 计算目标版本

scripts/version-bump.sh 1.2.3 +minor
scripts/version-bump.sh 1.2.3 +minor

-> 1.3.0

-> 1.3.0

5) apply to all discovered files (or selected files)

5) 将新版本应用到所有已发现的文件(或选定文件)

scripts/version-apply.sh 1.3.0
scripts/version-apply.sh 1.3.0

6) review the final diff and changed file list

6) 审查最终差异和修改文件列表

git diff --stat git diff
git diff --stat git diff

7) detect whether a git-commit skill is actually usable

7) 检测是否存在可用的git-commit skill

scripts/git-commit-detect.sh
scripts/git-commit-detect.sh

-> installed|/abs/path/to/current-repo/skills/git-commit

-> installed|/abs/path/to/current-repo/skills/git-commit

or missing|comma,separated,current-repo,paths|reason

或 missing|comma,separated,current-repo,paths|reason

8a) if git-commit is installed and usable, hand off the git step to that skill

8a) 若git-commit已安装且可用,则将git步骤移交至该Skill

target message: chore: bump version to 1.3.0

默认提交信息: chore: bump version to 1.3.0

8b) otherwise, use the local fallback

8b) 否则,使用本地备选脚本

scripts/git-commit.sh "chore: bump version to 1.3.0" package.json
scripts/git-commit.sh "chore: bump version to 1.3.0" package.json

9) optional push only when explicitly requested

9) 仅在明确请求时执行可选的推送操作

scripts/git-push.sh

</workflow>

<stack_targets>

| Stack | Primary files | Additional patterns |
|------|------|------|
| Node | `package.json` | `.version('x.y.z')` in code |
| Rust | `Cargo.toml` (`[package].version`) | `.version('x.y.z')` in code |
| Python | `pyproject.toml`, `setup.py`, `__version__` in `.py` | `.version('x.y.z')` in code |

</stack_targets>

<required>

| Category | Required |
|------|------|
| Input | Parse ARGUMENT as bump rule or explicit semver |
| Discovery | Run `version-find.sh` before applying updates |
| Current state | Read the current version with `version-current.sh` before computing the target version |
| Consistency | Keep all discovered version files synchronized |
| Git detection | Run `scripts/git-commit-detect.sh` before choosing the git path |
| Git scope | If handing off to `git-commit`, constrain it to the version-update file set |
| Safety | Use conventional commit message (`chore: bump version to x.y.z`) unless the user requests otherwise |
| Git | Keep git write operations sequential |

</required>

<scope_boundaries>

- `version-update` owns version discovery, target calculation, file updates, and diff review.
- `git-commit` owns repository inspection, staging discipline, commit creation, and push confirmation when the detector confirms that a repository-local skill is usable.
- The local git scripts are fallback helpers, not the preferred path when `git-commit` is available.

</scope_boundaries>

<examples>
scripts/git-push.sh

</workflow>

<stack_targets>

| 技术栈 | 主要文件 | 额外匹配模式 |
|------|------|------|
| Node | `package.json` | 代码中的`.version('x.y.z')` |
| Rust | `Cargo.toml`(`[package].version`字段) | 代码中的`.version('x.y.z')` |
| Python | `pyproject.toml`、`setup.py`、`.py`文件中的`__version__` | 代码中的`.version('x.y.z')` |

</stack_targets>

<required>

| 类别 | 要求 |
|------|------|
| 输入 | 将ARGUMENT解析为版本升级规则或有效的语义化版本 |
| 发现 | 在应用更新前运行`version-find.sh` |
| 当前状态 | 在计算目标版本前,使用`version-current.sh`读取当前版本 |
| 一致性 | 保持所有已发现的版本文件同步 |
| Git检测 | 在选择Git执行路径前运行`scripts/git-commit-detect.sh` |
| Git范围 | 若移交至`git-commit`,则限制其仅处理version-update修改的文件集 |
| 安全性 | 除非用户要求,否则使用约定式提交信息(`chore: bump version to x.y.z`) |
| Git操作 | 保持Git写入操作按顺序执行 |

</required>

<scope_boundaries>

- `version-update`负责版本发现、目标版本计算、文件更新和差异审查。
- 当检测器确认仓库本地存在可用Skill时,`git-commit`负责仓库检查、暂存规范、提交创建和推送确认。
- 本地Git脚本仅作为备选方案,当`git-commit`可用时不优先使用。

</scope_boundaries>

<examples>

Positive triggers

正向触发示例

  • "bump this repo from 0.8.2 to 0.9.0 and commit it"
  • "increase the patch version for this Python package"
  • "update package.json and Cargo.toml to 2.0.0"
  • "将此仓库版本从0.8.2升级到0.9.0并提交"
  • "提升此Python包的补丁版本"
  • "将package.json和Cargo.toml更新到2.0.0"

Negative triggers

反向触发示例

  • "make a git commit for these docs changes"
  • "summarize our release process"
  • "为这些文档修改提交git"
  • "总结我们的发布流程"

Boundary trigger

边界触发示例

  • "update the version only, do not commit yet"
</examples> <validation>
Trigger checks:
  • At least 3 positive trigger examples remain valid
  • At least 2 negative trigger examples stay out of scope
  • At least 1 boundary example stays explicit about commit vs no-commit
Execution checklist:
  • Current version identified with
    version-current.sh
  • Target version computed via
    version-bump.sh
    (or explicit semver validated)
  • version-apply.sh
    updated all intended files
  • git diff
    reviewed
  • scripts/git-commit-detect.sh
    run before choosing the git path
  • The detector searched only
    skills/git-commit
    ,
    .agents/skills/git-commit
    ,
    .claude/skills/git-commit
    , and
    .codex/skills/git-commit
    inside the current repository
  • If the detector returns
    installed|...
    , the final git step is handed off with the narrowed version-update scope
  • If the detector returns
    missing|...
    , the fallback
    scripts/git-commit.sh
    is used with only the version-update files
  • Optional push executed only when requested
Forbidden:
  • Starting updates without reading current version
  • Updating only one file when multiple version files exist
  • Using the fallback git scripts when the detector already returned
    installed|...
    without reason
  • Force-pushing protected branches
</validation>
  • "仅更新版本,暂不提交"
</examples> <validation>
触发条件检查:
  • 至少保留3个有效的正向触发示例
  • 至少保留2个不在范围内的反向触发示例
  • 至少保留1个明确区分提交与不提交的边界示例
执行检查清单:
  • 使用
    version-current.sh
    识别当前版本
  • 通过
    version-bump.sh
    计算目标版本(或验证用户提供的显式语义化版本)
  • version-apply.sh
    已更新所有目标文件
  • 已审查
    git diff
    结果
  • 在选择Git路径前已运行
    scripts/git-commit-detect.sh
  • 检测器仅搜索当前仓库内的
    skills/git-commit
    .agents/skills/git-commit
    .claude/skills/git-commit
    .codex/skills/git-commit
    路径
  • 若检测器返回
    installed|...
    ,则最终Git步骤已移交并限定在version-update的范围内
  • 若检测器返回
    missing|...
    ,则已使用备选
    scripts/git-commit.sh
    且仅处理version-update修改的文件
  • 仅在用户请求时执行可选的推送操作
禁止操作:
  • 未读取当前版本就开始更新
  • 存在多个版本文件时仅更新其中一个
  • 在检测器返回
    installed|...
    无合理理由的情况下使用备选Git脚本
  • 强制推送受保护分支
</validation>