This prompt is designed for release managers, platform engineers, and technical leads who need to systematically identify breaking changes from raw commit diffs, changelogs, or API specification deltas. The job-to-be-done is converting unstructured or semi-structured change data into a categorized, actionable migration guide that downstream consumers can execute. The ideal user has access to source material such as git diff output between two release tags, an OpenAPI specification diff, or a structured changelog from a project management tool. They need to produce entries that include before/after code comparisons, explicit migration steps, and effort estimates so that teams consuming the API or library can plan their upgrades without reading every commit.
Prompt
Breaking Change Detection and Migration Guidance Prompt Template

When to Use This Prompt
Define the job, ideal user, required inputs, and constraints for the breaking change detection and migration guidance prompt.
Use this prompt when you have concrete source material that contains the actual changes—never rely on the model's parametric knowledge of a library or API, as that knowledge may be outdated or hallucinated. The prompt requires several inputs to be effective: [SOURCE_DIFF] containing the raw text of code or specification changes, [RELEASE_CONTEXT] specifying the old and new version identifiers, and [CONSUMER_PROFILE] describing the typical user of the API (e.g., 'frontend developers using a React SDK' or 'backend services calling a REST API'). Optionally, provide [KNOWN_BREAKING_CHANGES] as a list of changes you already suspect are breaking, which helps the model calibrate its detection threshold. Do not use this prompt for additive feature documentation, internal refactoring notes that don't affect public surfaces, or routine dependency bumps where the upstream changelog is the authoritative source.
The prompt is not a replacement for human review. Breaking change detection has asymmetric risk: a false negative (missing a breaking change) causes production incidents for consumers, while a false positive wastes engineering time on unnecessary migration work. Always pair this prompt with evaluation checks that measure both recall against a known set of breaking changes and precision against a set of non-breaking changes. Before shipping the generated migration guide, have an engineer who worked on the changes review every entry for accuracy. For high-risk releases, run the prompt against multiple models and diff the outputs to surface disagreements that require human judgment.
Use Case Fit
Where the Breaking Change Detection and Migration Guidance prompt works, where it fails, and the operational prerequisites for production use.
Strong Fit: Structured Release Pipelines
Use when: you have a formal release process with tagged commits, structured changelogs, or PR templates that already separate breaking changes from features. Why: the prompt excels at classifying and enriching already-categorized input rather than discovering breaking changes from raw, unstructured diffs.
Poor Fit: Monolithic Raw Diffs
Avoid when: the only input is a single massive diff spanning thousands of files without commit messages or issue context. Risk: the model will hallucinate breaking changes from refactors or miss subtle semantic breaks hidden in type changes. Guardrail: pre-process diffs into per-commit or per-PR chunks with associated metadata before prompting.
Required Inputs
Minimum: commit messages, PR descriptions, or changelog entries that mention the changed surface. Ideal: before/after API surface diffs, deprecation annotations, and linked issue trackers. Guardrail: if the input lacks explicit version or surface identifiers, add a pre-processing step to tag each entry with its affected component and version.
Operational Risk: False Negatives
What to watch: the prompt misses breaking changes that are not explicitly labeled as such in the source material, especially behavioral changes, default value shifts, or error handling modifications. Guardrail: pair this prompt with a regression test diff analyzer and require human sign-off for any release with zero detected breaking changes.
Operational Risk: Migration Effort Inflation
What to watch: the model overestimates migration complexity for unfamiliar frameworks or generates migration steps that do not match the actual consumer codebase. Guardrail: treat generated effort estimates as starting points for engineering review, not as commitments. Validate migration steps against a sample of downstream consumer codebases.
When to Escalate to Human Review
Escalate when: the prompt flags a breaking change in a security-sensitive surface, an authentication flow, a data persistence layer, or a compliance-regulated API. Guardrail: route any breaking change entry tagged with security, auth, data-migration, or compliance to a mandatory human approval queue before publication.
Copy-Ready Prompt Template
A reusable prompt for identifying breaking changes from diffs and changelogs, producing categorized entries with before/after code comparisons, migration steps, and effort estimates.
This prompt template is designed to be copied directly into your AI harness. It accepts a commit diff, changelog draft, or API specification delta and outputs a structured list of breaking changes. Each entry includes a before/after code comparison, step-by-step migration guidance, and an estimated effort level. The template uses square-bracket placeholders for all variable inputs, making it straightforward to wire into a CI/CD pipeline, release automation script, or documentation workflow.
textYou are a release engineering assistant specialized in detecting breaking changes from software diffs and changelogs. Your task is to analyze the provided input and produce a structured, categorized list of breaking changes with migration guidance. ## INPUT [DIFF_OR_CHANGELOG] ## OUTPUT_SCHEMA Return a JSON object with the following structure: { "breaking_changes": [ { "category": "API | Schema | Config | Dependency | Behavior | Deprecation", "severity": "critical | major | minor", "summary": "One-sentence description of what broke", "affected_surface": "Function name, endpoint path, table name, or config key", "before": "Code or configuration example before the change", "after": "Code or configuration example after the change", "migration_steps": ["Ordered list of actions a consumer must take"], "effort_estimate": "trivial | low | medium | high", "effort_rationale": "Why this effort level was assigned", "false_positive_risk": "low | medium | high", "false_positive_note": "Conditions under which this might not be a real breaking change" } ], "non_breaking_notable_changes": [ { "summary": "Description of a notable but non-breaking change", "reason_not_breaking": "Why this does not require consumer action" } ], "analysis_confidence": "high | medium | low", "confidence_rationale": "Explanation of overall confidence level" } ## CONSTRAINTS - Only flag a change as breaking if existing consumer code, configuration, or integration would fail or produce incorrect results without modification. - Do not flag additive features, new optional parameters, or backward-compatible deprecations as breaking. - For each breaking change, provide a concrete before/after example. If the diff does not contain enough context to construct examples, set false_positive_risk to "high" and explain what additional context is needed. - If a change is a deprecation with a future removal date, classify it as breaking only if the removal date has passed or is within [DEPRECATION_WINDOW_MONTHS] months. - Exclude changes that only affect internal implementation details not exposed to consumers. - If no breaking changes are detected, return an empty breaking_changes array with high confidence and a brief rationale. ## EXAMPLES [FEW_SHOT_EXAMPLES] ## RISK_LEVEL [HIGH_RISK_DOMAINS] ## INSTRUCTIONS 1. Parse the input to identify all changes. 2. For each change, determine if it is breaking using the constraints above. 3. Categorize each breaking change and assign severity. 4. Construct before/after examples from the diff context. 5. Write migration steps in imperative form, ordered by required sequence. 6. Assign effort estimates with rationale. 7. Flag any uncertain classifications with false_positive_risk and explanatory notes. 8. Return only the JSON object. Do not include any text outside the JSON.
To adapt this template, replace each square-bracket placeholder with your actual data. [DIFF_OR_CHANGELOG] should contain the raw diff output, changelog draft, or OpenAPI specification delta. [DEPRECATION_WINDOW_MONTHS] sets your team's policy for when a deprecation becomes a breaking change—typically 3 to 6 months. [FEW_SHOT_EXAMPLES] should include 2–3 annotated examples of breaking vs. non-breaking changes from your codebase to calibrate the model's judgment. [HIGH_RISK_DOMAINS] should list areas where false negatives are unacceptable, such as authentication, billing, or data integrity surfaces. For these domains, always route outputs to human review before publication. After copying the template, test it against a known release with documented breaking changes and compare the model's output to your manually curated list. Flag any missed breaking changes or false positives and add them to [FEW_SHOT_EXAMPLES] for the next run.
Prompt Variables
Required and optional inputs for the Breaking Change Detection and Migration Guidance prompt. Validate each placeholder before execution to prevent false positives and missed detections.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[DIFF_OR_CHANGELOG] | Raw diff output, changelog text, or commit history to scan for breaking changes | git diff v1.0.0..v2.0.0 -- . ':(exclude)*.md' | Must contain actual code or API surface changes. Reject if empty, binary-only, or pure documentation changes without code impact. |
[API_SURFACE_DEFINITION] | Current public API surface: exported functions, classes, endpoints, or schema definitions | OpenAPI spec, TypeScript .d.ts files, or all exports list | Required for accurate before/after comparison. Must be parseable. Reject if malformed or from a different version than the target release. |
[PREVIOUS_STABLE_SURFACE] | Public API surface from the previous stable release for comparison baseline | Exported symbols from v1.2.3 tag | Must match the version immediately preceding the target release. Version mismatch produces false positives. Null allowed only for initial release. |
[DEPRECATION_POLICY] | Organization's deprecation policy: notice period, sunset rules, and communication requirements | Deprecation notice required 2 minor versions before removal | Must include minimum notice period and required communication channels. If null, prompt defaults to strict semver interpretation with no grace period. |
[SEMVER_STRICTNESS] | Whether to apply strict semantic versioning rules or allow exceptions for internal surfaces | strict | Accepted values: strict, internal-flexible, pre-release. Controls whether @internal or @alpha annotations are flagged as breaking. Defaults to strict if null. |
[CONSUMER_IMPACT_CONTEXT] | Known downstream consumers, SDKs, or integrations that depend on this API surface | mobile-app v2.x, partner-sdk, internal-dashboard | Optional but strongly recommended. When provided, prompt must estimate impact per consumer. When null, prompt must note that consumer impact is unassessed. |
[OUTPUT_FORMAT] | Desired output structure for breaking change entries | json | Accepted values: json, markdown-table, changelog-entry. Controls whether output is machine-readable or human-readable. Defaults to json if null. |
[CONFIDENCE_THRESHOLD] | Minimum confidence score required to classify a change as breaking | 0.85 | Float between 0.0 and 1.0. Changes below threshold must be flagged as needs-human-review rather than confirmed-breaking. Defaults to 0.80 if null. |
Implementation Harness Notes
How to wire the breaking change detection prompt into a release pipeline with validation, retries, and human review gates.
This prompt is designed to sit inside a CI/CD or release management workflow, not as a one-off chat interaction. The typical integration point is after commit diffs or changelog drafts are available but before the release is published. Feed the prompt a structured diff (e.g., git diff v1.0..v2.0 -- unified) or a raw changelog draft, along with the previous stable API surface as [CONTEXT]. The output is a structured JSON array of breaking changes, each with before/after code snippets, migration steps, and an effort estimate. This output should be treated as a candidate list requiring human review, not as a final artifact.
Validation is the critical next step. Parse the model's JSON output and run it through a schema validator that checks for required fields (breaking_change_description, before_code, after_code, migration_steps, effort_estimate, affected_surfaces). If validation fails, retry the prompt once with the validation errors appended to [CONSTRAINTS] as explicit fix instructions. For high-risk releases (e.g., security patches, database migrations), route the validated output to a human approval queue before it reaches the public changelog. Log the raw prompt, the model response, and the validation result for auditability. Model choice matters here: use a model with strong code-diff reasoning and structured output support, such as gpt-4o or claude-3.5-sonnet, and set response_format to json_object where available.
Avoid wiring this prompt directly to an automated publish step without human review. False positives (flagging additive changes as breaking) and false negatives (missing subtle signature changes) are both common failure modes. Implement a companion eval step: maintain a golden dataset of known breaking and non-breaking changes, run the prompt against it on each prompt revision, and gate deployment on recall ≥ 0.90 and precision ≥ 0.85. If the prompt starts over-flagging deprecation warnings as breaking changes, adjust [CONSTRAINTS] to clarify the distinction. The next step after reading this section is to copy the prompt template, define your input schema, and build the validation harness before integrating it into your release pipeline.
Common Failure Modes
Breaking change detection is a high-stakes classification task. The model must distinguish API contract changes from internal refactors, and false negatives here directly break downstream consumers. These are the most common failure patterns and how to guard against them.
False Negatives on Subtle Signature Changes
What to watch: The model misses breaking changes that don't look like obvious deletions—parameter reordering, default value changes, stricter validation on existing inputs, or changed error codes. These are breaking for consumers but often look like minor tweaks in a diff. Guardrail: Include explicit schema comparison rules in the prompt. Require the model to flag any change to a public contract surface, not just deletions. Add a second-pass check that asks: 'If a consumer compiled against the old version, would their code still work without changes?'
False Positives on Internal Refactors
What to watch: The model flags private method signature changes, internal module reorganization, or non-exported function modifications as breaking changes. This creates noise, erodes trust in the detection system, and wastes release manager review time. Guardrail: Require the prompt to distinguish between public API surfaces and internal implementation. Provide the model with explicit markers (e.g., @public, export, __all__) or ask it to justify why a change is externally visible before classifying it as breaking.
Missing Migration Steps for Detected Changes
What to watch: The model correctly identifies a breaking change but fails to produce actionable migration guidance—no before/after code examples, no effort estimate, no rollback instructions. The entry becomes a warning without a path forward. Guardrail: Structure the output schema to require migration steps as a separate required field. Add a validation check that every breaking change entry has a non-empty migration block. If the model can't infer the fix, it should flag the entry for human authoring rather than leaving it blank.
Version Drift in Before/After Comparisons
What to watch: The model generates before/after code examples that don't match the actual versions being compared—using syntax from the wrong release, referencing APIs that don't exist yet, or showing fixes that aren't available until a later version. Guardrail: Pin the prompt to specific version tags or commit SHAs. Include a constraint that all code examples must be valid for the exact versions under comparison. Add an eval that compiles or parses the before/after snippets against the corresponding version's schema.
Effort Estimation Without Consumer Context
What to watch: The model assigns effort estimates (low/medium/high) based only on the code change itself, ignoring how many consumers are affected, whether the change is in a hot path, or if workarounds exist. This misleads release planning. Guardrail: Separate mechanical change complexity from consumer impact. Ask the model to estimate migration effort in two dimensions: code change scope and blast radius. Require human review for any 'high' effort classification, and ground estimates in usage data when available.
Deprecation Treated as Immediate Breaking Change
What to watch: The model classifies a deprecation notice (with a future removal date) as an immediate breaking change, causing consumers to treat a warning as a hard failure. This creates unnecessary urgency and can lead to rushed migrations. Guardrail: Add explicit categories in the output schema: BREAKING_NOW, DEPRECATED_WITH_TIMELINE, and BEHAVIOR_CHANGE. Require the model to check for deprecation annotations, sunset dates, and replacement APIs before classifying. If a deprecation has a future removal date, it must not be labeled as an immediate breaking change.
Evaluation Rubric
Use these criteria to test the quality of breaking change detection and migration guidance outputs before shipping. Each row defines a pass standard, a failure signal, and a concrete test method.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Breaking Change Classification Accuracy | All entries labeled 'breaking' change a public API signature, schema, or documented contract | Non-breaking deprecation or internal refactor incorrectly flagged as breaking | Manual review of 20 random entries against source diff; false positive rate < 5% |
Before/After Code Comparison Completeness | Every breaking change entry includes a valid before and after code snippet in the target language | Missing before snippet, missing after snippet, or snippets that do not compile | Parse each snippet with language-appropriate AST parser; flag entries where either snippet is absent or unparseable |
Migration Step Actionability | Each migration step contains a concrete action a developer can execute without additional research | Vague instructions like 'update your code' or 'handle the new behavior' without specifics | LLM judge rates each step on actionability scale 1-5; pass threshold >= 4 across all entries |
Effort Estimate Reasonableness | Effort estimates fall within expected ranges: trivial (<1 hour), small (1-4 hours), medium (1-3 days), large (>3 days) | Effort estimate contradicts the scope of change described in the entry | Cross-reference effort label against change complexity heuristics; flag mismatches where a one-line signature change is labeled 'large' |
False Negative Detection | All breaking changes present in the source diff appear in the output with no omissions | A breaking change in the diff is missing from the generated changelog | Diff source commit range against output entries; calculate recall; pass threshold >= 95% |
Migration Path Completeness | Deprecated surfaces include a specific replacement API, method, or pattern | Entry says 'no replacement' when the source code or docs indicate a successor | Check each deprecated entry for a non-null replacement field; validate against source documentation where available |
Schema and Type Change Precision | Schema changes specify the exact field, type change, and whether the change is additive, subtractive, or modifying | Entry describes a schema change without naming the affected field or the old/new types | Validate each schema entry contains a field path string and both old_type and new_type values; flag missing fields |
Cross-Reference Link Validity | All issue references, PR links, and commit SHAs resolve to real artifacts | Broken link, incorrect issue number, or commit SHA that does not exist in the repository | Automated link checker validates every reference URL and commit SHA against the repository API; fail if any 404 or invalid ref |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Start with the base prompt and a single commit diff or changelog entry. Remove the structured output schema and effort estimation fields. Ask the model to list breaking changes in plain bullet points with before/after snippets. Use a lightweight format like:
codeAnalyze this diff for breaking changes: [DIFF_CONTENT] List each breaking change with: - What changed - Before/after code - Suggested migration step
Watch for
- False positives on internal refactors that don't affect the public API
- Missing subtle breaks like behavioral changes or error code shifts
- Overly verbose output without clear categorization

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us