version-update
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVersion Update Skill
版本更新Skill
<purpose>Cross-stack semantic version update for node/rust/python with conditionalhandoff.git-commit
- Update one semantic version across node, rust, and python version-bearing files.
- Keep discovered manifest files and inline version markers synchronized.
- Prefer the installed skill for the final git add/commit/push flow.
git-commit - Fall back to local direct git execution only when is unavailable.
git-commit
<trigger_conditions>
| User intent | Activate |
|---|---|
| "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 |
| "rewrite this release runbook" | no |
</trigger_conditions>
<supported_targets>
package.jsonCargo.tomlpyproject.tomlsetup.py- python declarations
__version__ - inline code patterns
.version('x.y.z')
</supported_targets>
<scripts><purpose>支持条件式移交的跨Node/Rust/Python栈语义化版本更新工具。git-commit
- 跨Node、Rust和Python项目的版本承载文件统一更新语义化版本。
- 保持已发现的清单文件和内联版本标记同步。
- 在最终的git add/commit/push流程中优先使用已安装的Skill。
git-commit - 仅当不可用时,才回退到本地直接执行git命令。
git-commit
<trigger_conditions>
| 用户意图 | 是否激活 |
|---|---|
| "将此包版本升级到1.4.0" | 是 |
| "更新版本并提交" | 是 |
| "提升此crate的补丁版本" | 是 |
| "仅提交git" | 否,请使用 |
| "重写此发布手册" | 否 |
</trigger_conditions>
<supported_targets>
package.jsonCargo.tomlpyproject.tomlsetup.py- Python中的声明
__version__ - 内联代码模式
.version('x.y.z')
</supported_targets>
<scripts>Available scripts
可用脚本
| Script | Purpose |
|---|---|
| Detect stacks ( |
| Discover version-bearing files |
| Extract current semver (`file |
| Calculate next semver |
| Apply version to discovered/selected files |
| Detect whether a usable project-local |
| Fallback direct commit helper when |
| Fallback direct push helper when |
<git_integration>
- Run before the final git step.
scripts/git-commit-detect.sh - The detector checks, in order: ,
skills/git-commit,.agents/skills/git-commit, and.claude/skills/git-commitinside the current repository..codex/skills/git-commit - Use only when the detector returns
git-commit.installed|... - When handing off to , pass only the files changed by
git-commitand useversion-updateunless the user requested a different message.chore: bump version to x.y.z - If the detector returns , use the local fallback scripts in
missing|....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 , let
installed|...own push confirmation. Otherwise usegit-commitonly after explicit user request.scripts/git-push.sh
</git_integration>
<version_rules>
| Argument | Action | Example |
|---|---|---|
| Patch +1 | |
| Minor +1 | |
| Major +1 | |
| Explicit set | |
</version_rules>
<workflow>| 脚本 | 用途 |
|---|---|
| 检测技术栈( |
| 发现承载版本信息的文件 |
| 提取当前语义化版本(输出格式:`file |
| 计算下一个语义化版本 |
| 将新版本应用到已发现/选定的文件 |
| 检测当前仓库的Skill目录中是否存在可用的项目本地 |
| 当 |
| 当 |
<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 | |
| 次版本号+1 | |
| 主版本号+1 | |
| 显式设置版本 | |
</version_rules>
<workflow>Workflow
工作流程
bash
undefinedbash
undefined1) 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"
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 (or explicit semver validated)
version-bump.sh - updated all intended files
version-apply.sh - reviewed
git diff - run before choosing the git path
scripts/git-commit-detect.sh - The detector searched only ,
skills/git-commit,.agents/skills/git-commit, and.claude/skills/git-commitinside the current repository.codex/skills/git-commit - If the detector returns , the final git step is handed off with the narrowed version-update scope
installed|... - If the detector returns , the fallback
missing|...is used with only the version-update filesscripts/git-commit.sh - 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 without reason
installed|... - Force-pushing protected branches
- "仅更新版本,暂不提交"
触发条件检查:
- 至少保留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 - 若检测器返回,则最终Git步骤已移交并限定在version-update的范围内
installed|... - 若检测器返回,则已使用备选
missing|...且仅处理version-update修改的文件scripts/git-commit.sh - 仅在用户请求时执行可选的推送操作
禁止操作:
- 未读取当前版本就开始更新
- 存在多个版本文件时仅更新其中一个
- 在检测器返回无合理理由的情况下使用备选Git脚本
installed|... - 强制推送受保护分支