技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
apply-semantic-versioning【数据与研究】Apply semantic versioning (SemVer 2.0.0) to determine the correct version bump based on change analysis. Covers major/minor/patch classification, pre-release identifiers, build metadata, and breaking change detection. Use when preparing a new release to determine the correct version number, after merging changes before tagging, evaluating whether a c…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
由變析定正版升。析變、分主/次/補、算新版、更檔。循 SemVer 2.0.0。
於項根尋讀版檔。
# R packages
grep "^Version:" DESCRIPTION
# Node.js
grep '"version"' package.json
# Rust
grep '^version' Cargo.toml
# Python
grep 'version' pyproject.toml
# Plain file
cat VERSION
析今版為 major.minor.patch。版含預發後綴(如 1.2.0-beta.1)→獨記。
得:今版識為 MAJOR.MINOR.PATCH[-PRERELEASE]。
敗:無版檔→察 VERSION 或 git 標(git describe --tags --abbrev=0)。全無版→初發用 0.1.0,穩公 API 用 1.0.0。
取自末標以來諸變。
# Find the last version tag
git describe --tags --abbrev=0
# List commits since that tag
git log --oneline v1.2.3..HEAD
# If using Conventional Commits, filter by type
git log --oneline v1.2.3..HEAD | grep -E "^[a-f0-9]+ (feat|fix|BREAKING)"
無標→比於初提或知基。
得:諸提附訊可分變類。
敗:git 史不可達或標缺→請開發者述變。按述分。
施 SemVer 分律:
| Change Type | Version Bump | Examples |
|---|---|---|
| Breaking (incompatible API change) | MAJOR | Renamed/removed public function, changed return type, removed parameter, changed default behavior |
| Feature (new backwards-compatible functionality) | MINOR | New exported function, new parameter with default, new file format support |
| Fix (backwards-compatible bug fix) | PATCH | Bug fix, documentation correction, performance improvement with same API |
分律:
特例:
0.x.y)次升或含破。明文得:各變分為破/功/修,全升階定。
敗:變含糊→傾高升。保守主升勝破下游碼之次升。
施升於今版:
| Current | Bump | New Version |
|---|---|---|
| 1.2.3 | MAJOR | 2.0.0 |
| 1.2.3 | MINOR | 1.3.0 |
| 1.2.3 | PATCH | 1.2.4 |
| 0.9.5 | MINOR | 0.10.0 |
| 2.0.0-rc.1 | (release) | 2.0.0 |
請預發標:
1.3.0-alpha.1 為將 1.3.0 之首 alpha1.3.0-beta.1 為首 beta1.3.0-rc.1 為首發候預發序:alpha < beta < rc < (發)。
得:新版號循 SemVer 算。
敗:今版形誤或非 SemVer→先正規。如 1.2 為 1.2.0。
書新版於相關檔。
# R: Update DESCRIPTION
# Change "Version: 1.2.3" to "Version: 1.3.0"
// Node.js: Update package.json
// Change "version": "1.2.3" to "version": "1.3.0"
// Also update package-lock.json if present
# Rust: Update Cargo.toml
# Change version = "1.2.3" to version = "1.3.0"
項有多檔涉版(如 _pkgdown.yml、CITATION、codemeta.json)→皆更。
得:諸版檔一致更為新版號。
敗:檔更敗→撤諸變保一致。永勿留版檔半更態。
提版升後建 git 標。
# Annotated tag (preferred)
git tag -a v1.3.0 -m "Release v1.3.0"
# Lightweight tag (acceptable)
git tag v1.3.0
用項標例:
v1.3.0(最常)1.3.0(無前綴)package-name@1.3.0(單庫多項)得:git 標配新版。
敗:標已存→版未正升。以 git tag -l "v1.3*" 察重標解之再進。
MAJOR.MINOR.PATCH[-PRERELEASE][+BUILD]+build.123)不影版序。1.0.0+build.1 與 1.0.0+build.2 同序manage-changelog —— 維變誌條與版升配plan-release-cycle —— 計發里程定何時版升release-package-version —— R 專發流含版升commit-changes —— 以正訊提版升create-github-release —— 自版標建 GitHub 發