Semver Helper
by @avegancafe
Semantic Versioning 2.0.0 reference guide. Quick decision trees and examples for choosing MAJOR, MINOR, or PATCH version bumps.
clawhub install semver-helperπ About This Skill
name: semver-helper description: Semantic Versioning 2.0.0 reference guide. Quick decision trees and examples for choosing MAJOR, MINOR, or PATCH version bumps. author: Gelmir tags: [semver, versioning, release]
Semver Helper
Quick reference for Semantic Versioning 2.0.0 decisions.
The Golden Rule
Given version MAJOR.MINOR.PATCH, increment:
| Level | Bump When | Reset Lower? | |-------|-----------|--------------| | MAJOR (X.0.0) | Breaking changes (incompatible API changes) | Yes, MINOR and PATCH β 0 | | MINOR (0.X.0) | New features (backwards compatible) | Yes, PATCH β 0 | | PATCH (0.0.X) | Bug fixes (backwards compatible) | No |
Quick Decision Tree
Did you change anything users depend on?
ββ No (internal only) β PATCH
ββ Yes
ββ Did you remove/change existing behavior?
ββ Yes β MAJOR
ββ No (only added new stuff)
ββ Is the new stuff visible to users?
ββ Yes β MINOR
ββ No β PATCH
Real Examples
π΄ MAJOR (Breaking)
Examples:
removeUser() β deleteUser() rename{id: 1} to {data: {id: 1}}π‘ MINOR (Feature)
Examples:
createUser() alongside existing user functions--format json flag to CLIπ’ PATCH (Fix)
Examples:
Version Progression Examples
| Changes | Version Bump |
|---------|--------------|
| fix: null pointer | 1.2.3 β 1.2.4 |
| feat: add auth | 1.2.3 β 1.3.0 |
| breaking: remove old API | 1.2.3 β 2.0.0 |
| fix: bug + feat: new thing | 1.2.3 β 1.3.0 (MINOR wins) |
| fix: bug + breaking: remove API | 1.2.3 β 2.0.0 (MAJOR wins) |
Pre-releases
Use suffixes for testing before stable:
2.0.0-alpha.1 β Very early, unstable2.0.0-beta.2 β Feature complete, testing2.0.0-rc.1 β Release candidate, final testingPre-releases sort before their stable version:
1.0.0-alpha < 1.0.0-beta < 1.0.0-rc < 1.0.0
Common Edge Cases
| Situation | Bump | Why | |-----------|------|-----| | Fix a bug that was introduced *this version* | PATCH | Still a fix | | Deprecate a feature (but keep it working) | MINOR | New "deprecated" state is info | | Change undocumented/internal behavior | PATCH | Users shouldn't depend on it | | Security fix that requires API change | MAJOR | Breaking for security | | Rewriting internals, same behavior | PATCH | Invisible to users | | Adding tests/docs only | PATCH | No code change |
Anti-Patterns
β Don't bump MAJOR for big new features (unless breaking)
β Don't bump MINOR for bug fixes
β Don't bump PATCH for new functionality
β Don't keep old numbers when bumping: 1.2.3 β 2.2.3 is wrong
Cheat Sheet
Users' code breaks? β MAJOR
Users get new toys? β MINOR
Users get fixes? β PATCH