Detect Breaking API Changes Prompt: Diff a Surface, Get the Semver Bump
A detect breaking API changes prompt diffs two API surfaces in any language and returns the breaking list, the right semver bump, and a consumer migration note.
You changed a function signature, added two methods, and renamed a constant. Is that a minor release or a major one? Get it wrong and either you've shipped a breaking change as a minor, or you've scared every consumer into a migration they didn't need. A detect breaking API changes prompt diffs the old surface against the new one and tells you: here's what broke, here's the semver bump, here's the note your consumers need.
The existing tooling is language-locked. .NET has analyzers, some ecosystems have surface-diffing binaries, and all of them need a build and only work for one language. For a polyglot repo, or a quick check before you publish, none of that helps. So the bump gets decided by gut feeling, which is how a "patch" ends up removing a public method.
A prompt fills the gap because it reasons about the declarations, not a compiled artifact. Two API surfaces in, a classified diff and the correct semver bump out, in any language.
Why semver gets decided wrong
Semver is simple in theory and slippery in practice. The rule is "the most severe change wins," but a real diff mixes ten safe additions with one signature change, and the additions make it feel minor. They don't. One breaking change in a sea of safe ones is still a major release. The cognitive trap is averaging the changes instead of taking the maximum.
The stance worth holding. Underbumping is worse than overbumping, every time. A consumer who updates to your "minor" and finds their build broken loses trust in your versioning permanently. An over-cautious major they didn't strictly need costs them a glance at a changelog. When the prompt is unsure between two bumps, it should pick the higher one. Conservative semver is the polite default.
What a detect breaking API changes prompt does
A detect breaking API changes prompt is a surface differ that reads two API versions and returns a classified change list, the correct semver bump, and a consumer migration note. It works without a build.
Use it to:
- Diff the public surface across two versions: exported functions, types, signatures, constants
- Classify every change as breaking, non-breaking, or deprecated
- Add a consumer-impact statement for each change
- Recommend the correct semver bump, justified by the diff
- Generate a migration note in the format consumers need to update
- Catch the breaking change buried among safe additions
The "most severe change wins" logic is what people get wrong by hand.
Anatomy of the prompt
Variables
{{old_surface}} → the previous public API
{{new_surface}} → the new public API
{{language}} → for declaration syntax
{{current_version}} → to compute the next version
Prompt
Role: you are an API breaking-change detector.
Task: diff {{old_surface}} against {{new_surface}}.
Rules:
- Classify each change: breaking | non-breaking | deprecated.
- The semver bump is the most severe change, not the average.
- When unsure between two bumps, pick the higher.
Output contract
Return: change table + semver bump + migration note.
1. Capture both surfaces
Put the old and new public declarations in {{old_surface}} and {{new_surface}}. Just the surface, exports and signatures, not the implementation.
2. Name the language
{{language}} tells the prompt how to read declarations. A Go interface and a TypeScript type have different breaking rules; the prompt needs to know which.
3. Read the bump and its justification
The output recommends a bump with a reason tied to a specific change. If the justification points at a removed export, that's your major, no matter how many additions surround it.
4. Ship the migration note
For breaking bumps, the prompt writes the consumer-facing note. That's what goes in the release so your users know exactly what to change.
Semver tools and prompts both face ambiguous cases: is a widened return type breaking? Sometimes, for consumers who pattern-match on it. The safe default is to treat ambiguity as breaking and bump major. A consumer annoyed by an unnecessary major recovers in minutes. A consumer broken by an underbump remembers it for a year. State this in the rules so the prompt errs conservative.
Prompt-craft patterns for surface diffing
Pass surfaces, not implementations. The public API is what consumers depend on. Pasting full implementations buries the signal and tempts the model to flag internal refactors that consumers never see. Surface in, surface reasoning out.
Make "most severe wins" an explicit rule. Models, like people, average. Without the rule, a diff with one break and nine additions sometimes gets called minor. State that the bump equals the worst change.
Force a migration note for every breaking change. A breaking diff with no migration note is half a job. The note is what makes the major release usable instead of a wall the consumer hits.
Prompt vs language-specific analyzer
A purpose-built analyzer is precise. It compiles both versions and computes the surface diff exactly, with no judgment involved. The catch is it's locked to one language and needs a build, which rules it out for a polyglot repo or a quick pre-publish check.
| Concern | Prompt-based | Language analyzer |
|---|---|---|
| Language coverage | Any, from declarations alone | One, with tooling support |
| Build required | No | Usually yes |
| Precision | Reasoned, very good on clear surfaces | Exact |
| Best for | Polyglot repos, fast checks, draft notes | A single-language library with CI integration |
The sensible pattern is to use both where you can: let the prompt draft the classification and the migration note in seconds, then back the critical packages with the analyzer in CI for the exact diff. One caveat about the prompt path. It reasons rather than compiles, so for anything consumers truly depend on, pair the bump with a consumer-side test rather than trusting the surface read alone. Pin the model version once the classifications look right. A detector that drifted toward calling breaking changes "non-breaking" after an update is the worst kind of regression, because it ships an underbump that erodes trust in your versioning before anyone notices the pattern.
Variables you'll set
| Variable | Required | What it is |
|---|---|---|
{{old_surface}} | Yes | The previous public API |
{{new_surface}} | Yes | The new public API |
{{language}} | Recommended | For declaration syntax rules |
{{current_version}} | Optional | To compute the next version |
Getting started
- Copy the structure into your model of choice.
- Put the old and new public declarations in
{{old_surface}}and{{new_surface}}. - Set
{{language}}so the prompt reads declarations correctly. - Run it and read the semver bump with its justification.
- Treat any ambiguous change as breaking and bump higher.
- Ship the generated migration note in your release.
To diff a surface and publish the migration note with the classifier and publisher steps already wired, the Breaking Change Detection Harness Agent Pack runs the full flow.
Browse the developer prompt packs →The Breaking Change Detection Harness Agent Pack does this end-to-end: an {{old_surface}} and {{new_surface}} pair feeds a breaking-change-classifier prompt that tags every change, a semver-migration-notes step writes the consumer-ready note, and a publisher prompt formats it for release. It's part of The Complete AI Prompts Bundle, a one-time lifetime license to the whole catalog plus packs added later, worth it if you publish more than one versioned package.
Breaking-change detection is the publish-side bookend to the upgrade side. The Dependency Upgrade Harness Agent Pack handles the consumer's view, planning the bumps your breaking changes force on them. Before you cut the release, the monorepo impact analysis prompt maps which internal packages the surface change touches. For staged moves across a framework, see the framework migration prompt. New to buying packs? Read how to choose a reusable AI prompt pack.
See the dependency upgrade pack →Common questions
What does a detect breaking API changes prompt return?
How does a prompt decide the right semver bump?
Why not use a language-specific breaking-change tool?
Get the prompt packs this guide is built on
Ready-to-paste prompts with documented variables and usage guides for ChatGPT, Claude, and Gemini. One-time payment, own it forever.
More prompt guides

Gemini vs Claude for Long-Context Code: Window or Accuracy
The honest framing of Gemini vs Claude for long-context code isn't which model is smarter. It's a tradeoff between two different things: how much code you can fit in one prompt, and how often the mode…

An OKR Drafting Prompt That Catches Vanity Key Results
An OKR drafting prompt has to fight the model's strongest instinct: handing back something that sounds like a goal but can't be measured. Ask any model for key results and you'll get "increase user en…

A Technical Design Doc Prompt That Holds the RFC Structure
A technical design doc prompt earns its keep when it stops every author from inventing a new doc structure. Context, the options you considered, why you picked one, what breaks, how you roll it out. S…