Safe Version Upgrade
Prepare releases without blind repository-wide replacement. Preserve behavior and make every edit reviewable.
Operating rules
- Inspect the repository, package ecosystem, current version sources, release policy, tags, and dirty-worktree state.
- Treat one ecosystem-native manifest as the version authority when the project defines one. Record derived files separately.
- Determine the target from the user's explicit version or release policy. If neither exists, infer a recommendation from actual changes but do not silently choose a major bump.
- Build a change plan listing every file, old value, new value, reason, and validation command.
- Before mutation, preserve the dirty worktree and create a timestamped backup of every file to be edited outside version control. Never discard unrelated user changes.
- Apply narrow, syntax-aware edits. Do not replace arbitrary version-looking strings, dependency versions, API versions, schema versions, fixtures, or historical documentation.
- Generate changelog entries only from verified commits, issues, and diffs. Separate breaking changes, features, fixes, security, deprecations, and migrations. Never invent entries.
- Regenerate lockfiles or generated metadata only with the project's existing package manager and only when the requested release requires it.
- Run parser checks, project tests, version-consistency checks, and packaging/build checks proportionate to risk.
- Show the final diff, commands run, validation results, remaining risks, and exact rollback path.
Authority boundaries
- A request to prepare or bump a version authorizes the scoped file edits and local validation, not publishing a release.
- Do not push, publish packages, create a hosted release, sign artifacts, or change remote state without explicit authorization.
- Do not commit or tag unless the user requested it. If requested, verify the final diff and tests immediately before doing so.
- Never expose tokens, signing keys, registry credentials, or private changelog material.
Ecosystem discovery
Prefer authoritative files already used by the project, such as package.json, pyproject.toml, Cargo.toml, go.mod plus release metadata, .csproj, Gradle files, or a dedicated version file. Follow repository instructions and existing release automation. Verify current official tooling documentation when behavior may have changed.
Completion gate
A release bump is complete only when:
- the declared target is consistent across authoritative and derived files;
- unrelated numbers and dependencies are unchanged;
- changelog claims are traceable to evidence;
- required tests/builds pass or failures are reported with logs;
- no publish, push, tag, or commit occurred outside the user's authorization;
- rollback instructions identify the backup or reversible commit.
1---2name: version-upgrade3description: Safely plan and apply a project release version bump with ecosystem-aware file discovery, previewed diffs, changelog evidence, validation, and rollback. Use.4---56# Safe Version Upgrade78Prepare releases without blind repository-wide replacement. Preserve behavior and make every edit reviewable.910## Operating rules11121. Inspect the repository, package ecosystem, current version sources, release policy, tags, and dirty-worktree state.132. Treat one ecosystem-native manifest as the version authority when the project defines one. Record derived files separately.143. Determine the target from the user's explicit version or release policy. If neither exists, infer a recommendation from actual changes but do not silently choose a major bump.154. Build a change plan listing every file, old value, new value, reason, and validation command.165. Before mutation, preserve the dirty worktree and create a timestamped backup of every file to be edited outside version control. Never discard unrelated user changes.176. Apply narrow, syntax-aware edits. Do not replace arbitrary version-looking strings, dependency versions, API versions, schema versions, fixtures, or historical documentation.187. Generate changelog entries only from verified commits, issues, and diffs. Separate breaking changes, features, fixes, security, deprecations, and migrations. Never invent entries.198. Regenerate lockfiles or generated metadata only with the project's existing package manager and only when the requested release requires it.209. Run parser checks, project tests, version-consistency checks, and packaging/build checks proportionate to risk.2110. Show the final diff, commands run, validation results, remaining risks, and exact rollback path.2223## Authority boundaries2425- A request to prepare or bump a version authorizes the scoped file edits and local validation, not publishing a release.26- Do not push, publish packages, create a hosted release, sign artifacts, or change remote state without explicit authorization.27- Do not commit or tag unless the user requested it. If requested, verify the final diff and tests immediately before doing so.28- Never expose tokens, signing keys, registry credentials, or private changelog material.2930## Ecosystem discovery3132Prefer authoritative files already used by the project, such as `package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod` plus release metadata, `.csproj`, Gradle files, or a dedicated version file. Follow repository instructions and existing release automation. Verify current official tooling documentation when behavior may have changed.3334## Completion gate3536A release bump is complete only when:3738- the declared target is consistent across authoritative and derived files;39- unrelated numbers and dependencies are unchanged;40- changelog claims are traceable to evidence;41- required tests/builds pass or failures are reported with logs;42- no publish, push, tag, or commit occurred outside the user's authorization;43- rollback instructions identify the backup or reversible commit.