This prompt is for release engineers and API platform teams who need an automated, auditable gate in their CI/CD pipeline to validate that a proposed version bump—major, minor, or patch—correctly follows semantic versioning rules. The job-to-be-done is compliance verification: given a structured diff of schema changes between two API specification versions and a proposed new version, the prompt produces a compliance report that maps each change to the semver rule it triggers, provides a justification, and delivers a final pass/fail verdict. The ideal user is someone who already has a machine-readable diff of their API schemas (OpenAPI, GraphQL, or gRPC) and needs a deterministic, rule-based assessment before cutting a release, not a human reading a changelog.
Prompt
Semantic Versioning Compliance Check Prompt

When to Use This Prompt
Define the job-to-be-done, the ideal user, required inputs, and the boundaries where this prompt stops being the right tool.
To use this prompt effectively, you must provide a structured diff as input—a list of change objects that include the affected path, the change type (e.g., 'field_added_required', 'type_changed', 'endpoint_removed'), and the before/after values. The prompt also requires the proposed version string (e.g., '2.1.0') and a reference to the semver rules you want enforced (typically the semver 2.0.0 specification). The output is a JSON report with a verdict field ('compliant' or 'non-compliant'), a rule_mappings array that ties each change to the specific semver rule it triggers, and a justification for each mapping. This structure makes the output directly consumable by a CI gate that can block a release pipeline or flag it for human review.
Do not use this prompt for generating consumer-facing changelogs, drafting deprecation notices, or assessing the downstream impact on specific API consumers. Those are separate sibling workflows that require different context, tone, and output structures. This prompt also assumes the diff is accurate and complete; it does not detect missing changes or validate the diff itself. If your schema diff tool has known gaps—such as not detecting implicit type coercion risks or failing to flag field reordering in JSON—you must address those upstream before this prompt can produce a reliable verdict. For high-risk releases, always pair the automated verdict with a human review step, especially when the diff includes changes that are technically non-breaking but behaviorally significant, such as bugfixes that alter response values without changing the schema.
Use Case Fit
Where the Semantic Versioning Compliance Check prompt delivers reliable results and where it introduces unacceptable risk.
Good Fit: Structured Schema Diffs
Use when: you have a machine-readable diff between two API schema versions (OpenAPI, GraphQL, protobuf) and need a rule-based semver classification. The prompt excels at mapping structural changes to major/minor/patch rules with justifications. Guardrail: always provide the full before/after schema, not just a summary, to prevent hallucinated change detection.
Bad Fit: Behavioral Changes Without Schema Impact
Avoid when: the change is purely behavioral—bugfixes that alter output, performance regressions, or auth policy changes that don't touch the contract. The prompt cannot infer semver impact from runtime behavior alone. Guardrail: pair this prompt with a separate behavioral change review before finalizing version bumps.
Required Inputs: Complete Before/After Specs
What to watch: the prompt depends on accurate, complete schema representations. Missing endpoints, omitted field changes, or partial diffs produce incorrect compliance reports. Guardrail: validate that both schema versions are complete and parseable before invoking the prompt. Reject runs with truncated or malformed input.
Operational Risk: Edge Cases in Bugfix Classification
What to watch: bugfixes that change observable behavior (e.g., correcting a response field from always-null to sometimes-populated) can break consumers who depended on the bug. The prompt may classify these as patch when they are effectively breaking. Guardrail: flag any bugfix that alters existing field behavior for human review, regardless of the prompt's classification.
Operational Risk: Deprecation vs. Removal Ambiguity
What to watch: the prompt may treat a newly deprecated field as a minor change, but consumers on strict validation may break immediately if the field disappears from examples or documentation. Guardrail: require explicit deprecation policy context in the prompt input, including whether deprecation-without-removal counts as minor or major for your organization.
Bad Fit: Multi-Service Ecosystem Changes
Avoid when: a single version bump must account for coordinated changes across multiple services, databases, and client SDKs. The prompt analyzes one contract at a time and cannot assess cross-service compatibility. Guardrail: use this prompt per-service, then run a separate consumer impact analysis across the ecosystem before finalizing the version.
Copy-Ready Prompt Template
A copy-ready prompt for validating version bumps against schema changes and producing a structured semver compliance report.
This prompt template is designed to be pasted directly into your AI system, forming the core instruction set for a semantic versioning compliance check. It instructs the model to act as a release engineer, comparing a set of schema changes against a declared version bump. The goal is not just a pass/fail verdict, but a detailed, rule-by-rule justification that maps each change to major, minor, or patch criteria, making the reasoning auditable for your release pipeline.
textYou are a release engineer validating a version bump against a set of API schema changes. Your task is to produce a structured semver compliance report. # INPUTS - [CURRENT_SCHEMA]: The existing API schema before changes. - [PROPOSED_SCHEMA]: The new API schema after changes. - [DECLARED_VERSION_BUMP]: The version change the team intends to release (e.g., "1.2.0 to 1.3.0"). - [CHANGE_LOG]: A human-readable list of intended changes. # CONSTRAINTS - Apply strict Semantic Versioning 2.0.0 rules. - A MAJOR bump is required for any incompatible API change (e.g., removing a field, changing a field type, making an optional field required). - A MINOR bump is required for new, backward-compatible functionality (e.g., adding a new optional field or endpoint). - A PATCH bump is required for backward-compatible bug fixes that do not change the public API contract. - If a bug fix changes the API's observable behavior for a consumer, it is a BREAKING CHANGE and requires a MAJOR bump. - Justify every finding with a specific reference to the schema diff. # OUTPUT_SCHEMA { "compliance_verdict": "COMPLIANT" | "NON_COMPLIANT", "declared_bump": "[DECLARED_VERSION_BUMP]", "required_bump": "MAJOR" | "MINOR" | "PATCH", "findings": [ { "change_description": "String describing the schema change.", "change_type": "ADDITION" | "REMOVAL" | "MODIFICATION", "location": "Path to the changed element in the schema (e.g., 'paths./users.get.parameters[0].name').", "semver_impact": "MAJOR" | "MINOR" | "PATCH", "justification": "Explanation of why this change maps to the stated semver impact, referencing specific rules." } ], "summary": "A concise explanation of the verdict, highlighting the most impactful finding." } # RISK_LEVEL - HIGH. An incorrect verdict can lead to broken consumer integrations. If the schemas are complex or the diffs are ambiguous, flag the finding for human review by setting a `requires_human_review` boolean to true in the finding object.
To adapt this template, replace the square-bracket placeholders with real data before execution. The [CURRENT_SCHEMA] and [PROPOSED_SCHEMA] should be the full OpenAPI or GraphQL schema strings. The [DECLARED_VERSION_BUMP] is a simple string, and [CHANGE_LOG] provides crucial human intent that the model can cross-reference against the raw diff. For high-stakes releases, ensure the OUTPUT_SCHEMA is enforced with your model's JSON mode or a downstream validator to prevent malformed reports from blocking your CI/CD pipeline.
Prompt Variables
Required inputs for the Semantic Versioning Compliance Check prompt. Each placeholder must be populated before the prompt is sent. Validation notes describe how to verify the input is well-formed before execution.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[CURRENT_VERSION] | The semver string of the release being validated | 2.4.1 | Must match semver 2.0.0 regex: ^(0|[1-9]\d*).(0|[1-9]\d*).(0|[1-9]\d*)(-[a-zA-Z0-9.]+)?(+[a-zA-Z0-9.]+)?$ |
[PREVIOUS_VERSION] | The semver string of the prior release for comparison | 2.4.0 | Must be strictly less than [CURRENT_VERSION] when compared as semver; null allowed for initial release |
[CHANGE_LOG] | Structured list of changes between versions with type, scope, and description | See change-log-schema.json | Must be valid JSON array; each entry requires 'type' (feat/fix/refactor/docs/test/chore), 'scope' (package or module), 'description' (string), and optional 'breaking' (boolean) |
[API_SPEC_DIFF] | Machine-readable diff of API specifications between versions | See openapi-diff-output.json | Must be valid JSON conforming to OpenAPI Diff output schema; null allowed if no API surface changes exist |
[DEPENDENCY_MANIFEST] | Current dependency declarations with version ranges | package.json or Cargo.toml content | Must be valid JSON or TOML; parse check required; null allowed for non-package projects |
[PUBLIC_INTERFACE_MAP] | List of public-facing modules, classes, functions, or endpoints | ["src/api/v2/users.ts", "src/export/index.ts"] | Must be a non-empty JSON array of strings; each entry must match a file path or fully-qualified symbol name in the repository |
[CONSUMER_USAGE_DATA] | Telemetry or import data showing which public interfaces are used externally | See consumer-usage.json | Must be valid JSON; null allowed when usage data is unavailable, but report must flag reduced confidence |
[OUTPUT_SCHEMA] | Target JSON schema for the compliance report output | See semver-report-schema.json | Must be valid JSON Schema draft-07 or later; parse check required; must include required fields: version_bump_justification, change_classifications, overall_verdict |
Implementation Harness Notes
How to wire the Semantic Versioning Compliance Check Prompt into a CI/CD release pipeline with validation, retries, and automated gating.
This prompt is designed to act as a pre-release gate in a CI/CD pipeline. It should be invoked after a schema diff is generated (for example, from an OpenAPI, GraphQL, or gRPC specification comparison) but before the release tag is created. The harness is responsible for preparing the diff input, calling the model, validating the structured output, and deciding whether to block the release, flag it for human review, or allow it to proceed. The primary integration point is a shell script or CI job step that runs git diff or a dedicated schema-diff tool, pipes the result into the prompt, and captures the JSON verdict.
The implementation should follow a validate-retry-escalate pattern. First, parse the model's JSON output and validate it against a strict schema that requires fields like recommended_bump (one of major, minor, patch), breaking_changes (array of objects with location and justification), and confidence_score (0.0-1.0). If validation fails or the output is malformed, retry the prompt once with an explicit error message appended to the input. If the retry also fails, the pipeline should escalate to a human reviewer via a PR comment or ticketing system rather than silently passing or failing. For model choice, use a model with strong structured output capabilities (such as gpt-4o or claude-3.5-sonnet) and set temperature=0 to maximize determinism.
Logging and traceability are critical for audit and debugging. The harness should log the full prompt input (the schema diff), the raw model response, the parsed JSON output, and the final gate decision (pass/fail/escalate) as artifacts attached to the CI run. This creates an audit trail for release managers and allows post-mortem analysis of false positives or missed breaking changes. Additionally, implement a manual override mechanism—a file in the repository (e.g., .semver-overrides.json) that allows teams to document intentional breaking changes that should not block the release, along with a justification. The harness should check this file before failing the build.
To prevent prompt drift and ensure reliability, treat the prompt template as a versioned artifact stored alongside the application code. Use a dedicated test suite with golden diffs that have known, expected semver outcomes (e.g., adding an optional field should yield minor, removing a required field should yield major). Run these tests in CI whenever the prompt template changes. For high-risk repositories, consider running the check in advisory mode initially—posting the report as a PR comment without blocking merges—until the team has calibrated the prompt's accuracy and tuned the override list. Avoid wiring the prompt directly to an automated git tag command without human review for the first several release cycles.
Expected Output Contract
Fields, format, and validation rules for the JSON response returned by the Semantic Versioning Compliance Check Prompt. Use this contract to parse, validate, and integrate the model's output into a release pipeline.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
compliance_report | object | Top-level object must exist and be parseable as JSON | |
compliance_report.version_bump | string | Must be exactly one of: 'major', 'minor', 'patch', or 'none'. Enum check required. | |
compliance_report.confidence | number | Float between 0.0 and 1.0 inclusive. Reject if out of range or non-numeric. | |
compliance_report.changes | array | Must be a non-empty array. Each element must match the change object schema below. | |
compliance_report.changes[].change_description | string | Non-empty string describing the schema change. Max 500 characters. | |
compliance_report.changes[].change_type | string | Must be one of: 'breaking', 'additive', 'fix', 'deprecation', or 'internal'. Enum check required. | |
compliance_report.changes[].semver_impact | string | Must be one of: 'major', 'minor', 'patch', or 'none'. Must be consistent with change_type per semver rules. | |
compliance_report.changes[].justification | string | Non-empty string explaining the semver rule applied. Must reference a specific semver principle or spec section. | |
compliance_report.changes[].affected_consumers | array | If present, each element must be a non-empty string. Null allowed if no consumers are affected. | |
compliance_report.edge_case_notes | array | If present, each element must be a string. Use for bugfixes that change behavior or ambiguous cases. Null allowed. | |
compliance_report.human_review_required | boolean | Must be true if any change has semver_impact 'major' or if confidence is below 0.8. Gate check required before auto-approval. |
Common Failure Modes
What breaks first when using a Semantic Versioning Compliance Check Prompt and how to guard against it.
Misclassifying Bugfixes as Patch Changes
Risk: The model classifies a bugfix that alters externally observable behavior as a PATCH change, when it should be MINOR or MAJOR. This happens when the prompt lacks a strict definition of 'internal implementation detail' versus 'behavioral contract.' Guardrail: Include a rule in the prompt that any change affecting a documented behavior, API response, or error code cannot be a PATCH, even if labeled a 'bugfix' by the developer.
Hallucinating Breaking Changes in Additive Modifications
Risk: The model flags a new optional field or a new endpoint as a MAJOR change, misunderstanding that additive, backward-compatible changes are MINOR. This often occurs when the diff is large and the model overcorrects for caution. Guardrail: Add explicit definitions and counter-examples in the prompt clarifying that adding new, non-mandatory elements is a MINOR change. Use a post-processing validation script to check for false-positive MAJOR classifications.
Ignoring Deprecation as a Minor Change
Risk: The model treats a field deprecation as a PATCH or does not flag it, missing the requirement for a MINOR version bump. This happens when the prompt focuses narrowly on 'breaking' versus 'non-breaking' without explicitly categorizing deprecation. Guardrail: Include a dedicated rule in the [CONSTRAINTS] section that any deprecation of a public API surface element requires a MINOR version increment, regardless of whether it is immediately breaking.
Schema-Only Analysis Without Behavioral Context
Risk: The prompt analyzes only the structural schema diff and misses breaking behavioral changes, such as a stricter validation rule, a reduced rate limit, or a change in default sorting order. Guardrail: Require the [INPUT] to include a behavioral changelog or commit messages alongside the schema diff. Instruct the model to cross-reference schema changes with documented behavioral intent.
Inconsistent Severity Classification Across Large Diffs
Risk: When analyzing a large diff with dozens of changes, the model's classification becomes inconsistent, applying different logic to similar changes. This is a common attention-dilution failure in long contexts. Guardrail: Chunk the diff by endpoint or resource and run the prompt iteratively. Use a final aggregation prompt that reconciles the independent reports, checking for classification consistency across chunks.
Evaluation Rubric
Criteria for testing the semantic versioning compliance report before integrating it into a release pipeline. Each row defines a pass standard, a failure signal, and a concrete test method.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Change-to-Level Mapping | Every schema change is assigned exactly one semver level (MAJOR, MINOR, PATCH) with a rule citation | A breaking change is labeled MINOR or PATCH; a non-breaking addition is labeled MAJOR; a change is unlabeled | Run against a golden diff set with known breaking, additive, and fix-only changes; assert 100% label accuracy |
Justification Grounding | Every assigned level includes a justification that references the specific change element and the semver rule applied | Justification is missing, generic ('it breaks compatibility'), or references a rule that contradicts the assigned level | Parse output JSON; assert justification field is non-empty, contains a rule keyword from the semver spec, and references the changed element by name |
False Positive Rate | Zero false positives for MAJOR-level assignments on a known-safe diff (e.g., adding an optional field) | A MAJOR bump is recommended for a backward-compatible addition or a bugfix that doesn't change the contract | Run against a curated set of 10 safe diffs; assert no MAJOR assignments in the output |
False Negative Rate | Zero false negatives for MAJOR-level assignments on a known-breaking diff (e.g., removing a required field) | A breaking change is assigned MINOR or PATCH, or is missing from the report entirely | Run against a curated set of 10 breaking diffs; assert every breaking change is flagged as MAJOR |
Edge Case: Bugfix with Behavioral Change | A bugfix that alters observable behavior but not the contract schema is classified as PATCH with a note about behavioral impact | The bugfix is classified as MAJOR or MINOR solely because downstream behavior changes; or the behavioral note is missing | Provide a diff where a default value changes or a validation rule tightens without schema change; assert PATCH level with a non-empty behavioral_note field |
Edge Case: Deprecation Annotation | A new deprecation annotation on an existing field is classified as MINOR with a deprecation notice | Deprecation is classified as PATCH (ignored) or MAJOR (over-escalated); or no deprecation notice is generated | Provide a diff adding a 'deprecated: true' annotation; assert MINOR level and presence of a deprecation_notice field in the output |
Output Schema Validity | The output JSON matches the [OUTPUT_SCHEMA] exactly: all required fields present, correct types, no extra fields | Output is missing required fields, contains fields with wrong types, or includes hallucinated fields not in the schema | Validate output against the JSON Schema using a validator in the test harness; assert validation passes with no errors |
Multi-Change Aggregation | The final recommended bump level is the maximum severity across all individual change assessments | The final bump level is lower than the most severe individual change; or the aggregation logic is inconsistent across runs | Provide a diff with one MAJOR and two PATCH changes; assert the recommended_bump field is 'MAJOR' |
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 OpenAPI or GraphQL diff. Use a frontier model with a simple system message: "You are a semantic versioning compliance checker. Analyze the schema diff and produce a semver report." Skip strict output schema validation initially. Focus on getting correct major/minor/patch classifications for obvious changes.
Watch for
- The model conflating bugfixes that change behavior with patch-level changes
- Missing justification for why a change maps to a specific semver level
- Over-classifying internal refactors as minor bumps
- No distinction between public API surface changes and internal implementation changes

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