StoicBuilder

HandbookIX the CuriaSemantic versioning

IXthe Curia, Work as a team

Semantic versioning

1 min readUpdated 28 November

In plain words

Semantic versioning numbers releases MAJOR.MINOR.PATCH: raise PATCH for bug fixes, MINOR for new features that break nothing, and MAJOR when existing users must change something to keep working.

Where you see it

Harbor publishes a JavaScript SDK on npm so customers can upload files from their own apps. Adding a method takes it from 2.3.1 to 2.4.0; renaming uploadFile to upload means 3.0.0. A customer's package.json range of ^2.3.1 accepts any 2.x.x from 2.3.1 up, but never 3.0.0.

package.json rangesconfig
"^2.3.1" 2.3.1 up to, not including, 3.0.0: minors and patches"~2.3.1" 2.3.1 up to, not including, 2.4.0: patches only"2.3.1" exactly 2.3.1
npm saves ^ ranges by default, trusting each package to follow the rules. A package that breaks things in a minor release breaks you too.

What goes wrong

  1. A breaking change in a minor release

    Removing a field or renaming a function in 2.4.0 breaks every customer on a ^2 range the next time they install. If anyone has to change their code, it's a major version.

  2. Staying on 0.x forever

    Under SemVer, anything in 0.x may change at any time, and npm treats ^0.3.1 as patches only. Once people depend on the package, release 1.0.0 and start keeping the promise.

  3. Forgetting that behaviour is part of the API

    Changing a default, an error code or the shape of a response breaks callers as surely as renaming a function. Count those as breaking changes too.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
Look at every change since the last release of our SDK and tell me whether the next version is a major, minor or patch release under SemVer, quoting the change that decides it. Treat removed or renamed exports, changed defaults and changed response shapes as breaking.

Quick check

Sign in to earn +10 XP for it

Harbor's SDK is at 2.3.1. The next release fixes a bug and adds an optional parameter to upload(). What version is it?

Got a prompt that touches semantic versioning?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.