Automated version release workflow. Analyzes git commit history to infer semantic version, auto-detects version files across ecosystems, updates multilingual CHANGELOGs, creates git commit and tag. Use when: (1) user says "release", "publish version", "bump version", (2) user invokes /release command, (3) preparing to release a new version.
Automated version release based on Semantic Versioning 2.0.0.
git rev-parse --is-inside-work-treegit status --porcelain
git branch --show-current
Scan the project root for version files. Check these common files first:
| File | Ecosystem |
|---|---|
package.json | Node.js |
pyproject.toml | Python |
Cargo.toml | Rust |
pubspec.yaml | Dart / Flutter |
VERSION | Universal |
Also check for: pom.xml, build.gradle(.kts), *.gemspec, setup.py, setup.cfg, *.csproj, CMakeLists.txt.
For complete extraction and update patterns for each file type, see references/version-files.md.
If no version files are found, ask the user which file contains the version, or skip version file updates.
If multiple version files are found, all will be updated to maintain consistency.
Detect CHANGELOG files in the project root:
CHANGELOG.md exists — mark as primary (do NOT create yet; defer to Step 7)CHANGELOG-*.md and CHANGELOG.*.md to discover multilingual variantsExamples: CHANGELOG.zh-CN.md, CHANGELOG-ja.md, CHANGELOG.fr.md
All discovered CHANGELOG files will be updated.
Find the latest semver tag reachable from HEAD:
git tag -l 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | head -1
This filters for vMAJOR.MINOR.PATCH pattern only, ignoring non-version tags (e.g. deploy-prod, build-123).
If no matching tags exist, also try without v prefix:
git tag -l '[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | head -1
Use v0.0.0 as baseline if no semver tags exist at all.
Compare the version from the latest git tag with versions found in version files (Step 1a).
Version mismatch detected:
- Git tag: v1.2.0
- package.json: 1.3.0
Ask user which version to use as the baseline. Do not proceed silently.Use the latest tag obtained in Step 2a as the range start:
git log v1.2.3..HEAD --pretty=format:"---commit---%n%s%n%b"
Parse both subject and body of each commit to identify type:
| Pattern | Location | Type | Version Impact |
|---|---|---|---|
BREAKING CHANGE: in body/footer | body | breaking | MAJOR |
type(scope)!: (exclamation before colon) | subject | breaking | MAJOR |
feat: / feat(scope): / ✨ feat: | subject | feat | MINOR |
fix: / fix(scope): / 🐛 fix: | subject | fix | PATCH |
perf: / perf(scope): / ⚡️ perf: | subject | perf | PATCH |
refactor: / refactor(scope): / ♻️ refactor: | subject | refactor | PATCH |
docs: / 📝 docs: | subject | docs | none |
chore: / 🔧 chore: / ⬆️ deps: | subject | chore | none |
If no commits found → inform user there are no changes since the last release. Ask whether to abort or force a release.
User override: If $ARGUMENTS is a valid semver version (e.g. 1.0.0, 2.0.0-rc.1), use that version directly. Skip automatic calculation.
Based on current version MAJOR.MINOR.PATCH:
When MAJOR ≥ 1 (stable API):
(MAJOR+1).0.0MAJOR.(MINOR+1).0MAJOR.MINOR.(PATCH+1)When MAJOR = 0 (unstable / initial development):
0.(MINOR+1).0 (not 1.0.0)0.MINOR.(PATCH+1)0.MINOR.(PATCH+1)Pre-release versions (e.g. 1.0.0-rc.1) are only created via explicit user override.
Read [Unreleased] section from each detected CHANGELOG file.
Merge git analysis with existing [Unreleased] content:
Organize by category (include only non-empty categories):
### Added
- ✨ New feature
### Changed
- ♻️ Refactor/improvement
- ⚡️ Performance optimization
- ⚠️ 💥 Breaking change
### Deprecated
- Deprecated feature
### Removed
- 🗑️ Removed feature
### Fixed
- 🐛 Bug fix
### Security
- 🔒️ Security fix
For complete category mapping and translation rules, see references/changelog-categories.md.
Scope handling: If commits include scopes (e.g. feat(auth):), include the scope as context in the CHANGELOG entry where it aids readability:
feat(auth): add OAuth login → ✨ **auth**: Add OAuth loginTranslation rules for multilingual CHANGELOGs:
### Added, etc.)Show user all planned changes:
## Release Preview
Current version: v1.5.1
New version: v1.6.0
### Version Files to Update
- package.json: 1.5.1 → 1.6.0
- pyproject.toml: 1.5.1 → 1.6.0
### CHANGELOG Files to Update
- CHANGELOG.md (English)
- CHANGELOG.zh-CN.md (Chinese)
### Changes (English)
## [1.6.0] - 2026-02-12
### Added
- ✨ Add release skill for automated versioning
### Changes (中文)
## [1.6.0] - 2026-02-12
### Added
- ✨ 添加 release 技能用于自动化版本发布
Confirm release? (y/n)
Use AskUserQuestion tool to request user confirmation.
After user confirmation, execute in order:
Modify version in ALL detected version files using file-specific update patterns from references/version-files.md.
For each detected CHANGELOG file:
[Unreleased] content to new version section [x.y.z] - YYYY-MM-DD[Unreleased] sectionIf CHANGELOG.md does not exist, create it now with the new version section.
Stage all version files and CHANGELOG files modified in Steps 7a–7b by name, then commit and tag:
git add package.json pyproject.toml CHANGELOG.md CHANGELOG.zh-CN.md
git commit -m "🔖 release: vX.Y.Z"
git tag -a vX.Y.Z -m "Release vX.Y.Z"
Replace the file list and version with actual values. Use annotated tag (-a) — includes author, date, and message. Required by git push --follow-tags and better supported by GitHub/GitLab Releases.
If git commit fails (e.g. pre-commit hook):
git status--amend)git checkout -- package.json pyproject.toml CHANGELOG.md
Replace the file list with the actual files modified in Steps 7a–7b.If git tag fails (e.g. tag already exists):
git tag -d vX.Y.Z to remove the old tag, then retryUse the branch name detected in Step 0 and the publish command matching the detected ecosystem. Example:
Version vX.Y.Z released successfully!
Updated files:
- package.json (1.5.1 → 1.6.0)
- pyproject.toml (1.5.1 → 1.6.0)
- CHANGELOG.md
- CHANGELOG.zh-CN.md
Next steps:
- git push origin main --follow-tags
- npm publish
Replace branch name, version, file list, and publish command with actual values. Use --follow-tags to push commit and annotated tag in a single command.
Ecosystem-specific publish commands:
| Ecosystem | Publish Command |
|---|---|
| Node.js | npm publish / pnpm publish |
| Python | twine upload dist/* |
| Rust | cargo publish |
| Dart/Flutter | dart pub publish / flutter pub publish |
| Java (Maven) | mvn deploy |
| Java (Gradle) | ./gradlew publish |
| Ruby | gem push *.gem |
| .NET | dotnet nuget push |