This prompt is designed for release engineers and CI/CD pipeline maintainers who need a consistent, automated method for determining the next semantic version number. The core job-to-be-done is translating a set of changes—represented as commit messages, code diffs, or structured change summaries—into a single version bump recommendation (major, minor, or patch) with clear, auditable reasoning. The ideal user is someone integrating this decision into an automated release workflow, where a human might still approve the final version but needs a reliable, rule-based starting point to eliminate manual guesswork and inconsistency. Required context includes the project's current version and a complete, accurate record of the changes since that version was tagged.
Prompt
Semantic Version Bump Recommendation Prompt

When to Use This Prompt
Determines the next semantic version number from a batch of concrete changes, providing a rule-based recommendation with explicit rationale.
You should not use this prompt when the project does not follow semantic versioning (SemVer) rules, as the output will be meaningless or misleading. It is also inappropriate when you lack concrete change evidence, such as a full commit log or diff, because the model will be forced to hallucinate a recommendation. Furthermore, this prompt is not a replacement for business-level judgment about marketing version names (e.g., 'v2.0' as a branding milestone) or for decisions that must weigh customer-facing impact beyond the technical contract of an API. For high-risk releases, such as those in regulated infrastructure or with wide-breaking changes, the prompt's output should be treated as a strong recommendation that requires explicit human review and approval before a release is cut.
To get the most value, provide the prompt with structured input, such as a list of conventional commit messages or a summary of features, fixes, and breaking changes. The prompt will then apply the SemVer rules: a breaking change mandates a major bump, a new feature mandates a minor bump, and all other changes default to a patch bump. The next step after receiving the recommendation is to validate it against your own changelog and release notes, ensuring no breaking change was missed. Avoid using this prompt for pre-release or build metadata generation unless you explicitly include those rules in the [CONSTRAINTS] field, as the default logic focuses on the core major.minor.patch sequence.
Use Case Fit
Where the Semantic Version Bump Recommendation Prompt delivers reliable results and where it should be replaced by a different workflow.
Good Fit: Structured Change Analysis
Use when: You have a structured list of changes (from conventional commits, parsed PRs, or a formal changelog) and need a semver recommendation grounded in explicit rules. Guardrail: Provide the prompt with a categorized input schema (breaking, feat, fix) rather than raw, unstructured text to prevent misclassification.
Bad Fit: Raw Commit History
Avoid when: The primary input is a raw, unprocessed git log. The model will struggle to separate user-facing changes from internal refactors, chores, and noise. Guardrail: Use a dedicated commit-parsing and categorization prompt or script to pre-process the history into a structured change list before calling this prompt.
Required Input: Categorized Change Evidence
Risk: Without clear evidence of breaking changes, new features, and bug fixes, the model may default to a safe but incorrect patch bump or hallucinate a major bump. Guardrail: The prompt must receive a structured input block with explicit lists for BREAKING_CHANGES, FEATURES, and FIXES. An empty list must be explicitly stated as [].
Operational Risk: Pre-Release and Build Metadata
Risk: The model may incorrectly handle pre-release suffixes (e.g., -alpha.1 to -alpha.2) or strip build metadata, leading to version ordering errors in package managers. Guardrail: Include explicit constraints in the prompt for incrementing pre-release versions and preserving build metadata. Post-process the output with a semver regex validator.
Operational Risk: Ambiguous Breaking Changes
Risk: A change might be technically breaking but have zero known consumers, or it might be a bug fix that some users relied on. The model cannot resolve this ambiguity. Guardrail: The prompt should flag ambiguous cases for human review instead of making an assumption. Route these cases to a human-in-the-loop approval step before the version is finalized.
Bad Fit: Monorepo with Independent Versioning
Avoid when: A single repository contains multiple packages with independent versions. A single, flat version recommendation is meaningless. Guardrail: Decompose the workflow. Use a package-specific change grouping prompt first, then run this semver recommendation prompt once per changed package with its isolated change list.
Copy-Ready Prompt Template
A copy-ready prompt for generating a semantic version bump recommendation with evidence-grounded rationale.
This prompt template is designed to be pasted directly into your AI harness. It instructs the model to act as a release engineer, analyzing a structured change summary to recommend the next semantic version. The prompt enforces strict adherence to the SemVer 2.0.0 specification and requires the model to ground its recommendation in specific evidence from the input.
textYou are a release engineer specializing in semantic versioning (SemVer 2.0.0). Your task is to analyze the provided change summary and recommend the next version number. # INPUT [CHANGE_SUMMARY] # CURRENT VERSION [CURRENT_VERSION] # OUTPUT SCHEMA You must respond with a single valid JSON object. Do not include any text outside the JSON block. { "recommended_version": "string (the new semantic version, e.g., 1.5.2)", "bump_type": "MAJOR | MINOR | PATCH | PRE_RELEASE | BUILD", "rationale": "string (a concise explanation grounded in specific changes from the input)", "breaking_changes": ["list of strings describing each breaking change found"], "new_features": ["list of strings describing non-breaking new features"], "bug_fixes": ["list of strings describing backward-compatible bug fixes"] } # CONSTRAINTS 1. **Strict SemVer:** If any change is marked as BREAKING, you MUST recommend a MAJOR bump. If there are new, backward-compatible features, you MUST recommend a MINOR bump. If there are only backward-compatible bug fixes, you MUST recommend a PATCH bump. 2. **Pre-release Handling:** If the [CURRENT_VERSION] is a pre-release (e.g., 2.0.0-rc.1), recommend the next pre-release version (e.g., 2.0.0-rc.2) unless the input indicates a final release, in which case recommend the stable version (e.g., 2.0.0). 3. **Build Metadata:** Preserve or increment build metadata (e.g., +20240101) only if specified in the [CONSTRAINTS]. Otherwise, strip it from the recommendation. 4. **Evidence Grounding:** Every entry in `breaking_changes`, `new_features`, and `bug_fixes` must be directly traceable to a specific item in the [CHANGE_SUMMARY]. Do not invent or assume changes. 5. **Uncertainty:** If the [CHANGE_SUMMARY] is empty or ambiguous, set `bump_type` to "PATCH" as a safe default and state the assumption in the `rationale`.
To adapt this template, replace the [CHANGE_SUMMARY] and [CURRENT_VERSION] placeholders with real data. The [CHANGE_SUMMARY] should be a structured list of changes, ideally with each item tagged as BREAKING, FEATURE, or FIX. For high-risk releases, such as those for critical infrastructure or public APIs, you should add a [RISK_LEVEL] constraint and route the model's output to a human approval queue before any automated version bump is applied. Always validate the output JSON against the schema and log the rationale for auditability.
Prompt Variables
Each placeholder must be populated before the prompt is sent. Incomplete or malformed inputs produce unreliable version recommendations.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[COMMIT_HISTORY] | Raw commit messages or structured log since the last tag | git log v1.2.3..HEAD --oneline | Must contain at least one commit. Empty history should abort the prompt. |
[DIFF_SUMMARY] | Structured or natural-language summary of code changes | Added optional | Check for presence of breaking change keywords if [BREAKING_CHANGE_FLAG] is false. |
[CURRENT_VERSION] | The latest released semantic version tag | 1.2.3 | Must match semver regex. Pre-release tags allowed only if [PRE_RELEASE_MODE] is true. |
[BREAKING_CHANGE_FLAG] | Boolean indicating if a breaking change was detected by prior analysis | Must be true or false. If true, [DIFF_SUMMARY] must contain evidence of a breaking change. | |
[FEATURE_COUNT] | Integer count of new features or additions identified | 3 | Must be >= 0. A value of 0 with [BREAKING_CHANGE_FLAG] false should produce a PATCH bump. |
[PRE_RELEASE_MODE] | Boolean indicating if the project uses pre-release identifiers | If true, output must include a pre-release label. If false, output must be a plain semver core. | |
[BUILD_METADATA] | Optional build metadata string to append to the version | build.42 | Null allowed. If provided, must not contain leading '+' and must be dot-separated identifiers. |
Implementation Harness Notes
How to wire the semantic version bump recommendation prompt into a CI/CD pipeline or release workflow with validation, retries, and human approval gates.
The semantic version bump recommendation prompt is designed to sit inside a release pipeline, not to be called in isolation. It expects structured input from prior change analysis steps—typically a commit diff, a list of merged PRs, or a breaking change detection report. The prompt should be invoked after change analysis but before the release is tagged. Its output is a version recommendation with rationale, which downstream systems can use to update package manifests, trigger changelog generation, or populate release metadata. Do not use this prompt on raw, unprocessed git logs; the input must already be filtered to the changes relevant to the upcoming release.
Wire the prompt into a pipeline stage that assembles the [CHANGE_SUMMARY] input from prior steps. For example, a CI job might run git log --oneline v1.2.3..HEAD, pass the output through a breaking change detection prompt, and then feed the structured results into this version bump prompt. Validate the output against a semver regex (^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$). If the output fails validation, retry once with a repair prompt that includes the validation error. If the second attempt also fails, escalate to a human reviewer. For high-risk releases—those touching authentication, payment, or data migration paths—always require human approval before the version bump is applied, regardless of validation success. Log the full prompt input, model response, validation result, and reviewer decision for auditability.
Model choice matters here. Use a model with strong instruction-following and structured output capabilities, such as Claude 3.5 Sonnet or GPT-4o, because the prompt requires precise reasoning about semver rules and edge cases. Avoid smaller or older models that may conflate minor and patch bumps or mishandle pre-release identifiers. If your pipeline runs in a constrained environment, consider caching the prompt prefix (the system instructions and semver rules) to reduce latency and cost. The output schema should be enforced via tool calling or structured output mode where available, rather than relying on free-text parsing. Finally, pair this prompt with a downstream verification step: after the version bump is applied, run a changelog accuracy prompt to confirm that all breaking changes, features, and fixes in the source diff are reflected in the release documentation.
Expected Output Contract
The model must return a JSON object matching this schema. Any deviation is a validation failure. Use this table to configure your output parser, validator, and retry logic.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
recommended_version | string (semver) | Must match semver regex ^(0|[1-9]\d*).(0|[1-9]\d*).(0|[1-9]\d*)(-[a-zA-Z0-9.]+)?(+[a-zA-Z0-9.]+)?$ | |
current_version | string (semver) | Must match the input [CURRENT_VERSION] exactly or fail with version_mismatch error | |
bump_type | string (enum) | Must be one of: 'major', 'minor', 'patch', 'pre-release', 'none'. Reject any other value. | |
rationale_summary | string | Length between 20 and 500 characters. Must contain at least one reference to a specific change category (breaking, feature, fix, deprecation). | |
breaking_changes | array of objects | Each object must have 'description' (string, min 10 chars) and 'affected_surface' (string, non-empty). Array may be empty if bump_type is not 'major'. | |
feature_additions | array of strings | Each string must be non-empty and between 5 and 200 characters. Array may be empty if no features detected. | |
fixes | array of strings | Each string must be non-empty and between 5 and 200 characters. Array may be empty if no fixes detected. | |
confidence_score | number | Must be a float between 0.0 and 1.0 inclusive. Scores below 0.7 should trigger human review flag. | |
evidence_commit_shas | array of strings | Each string must match a 7-40 character hex hash. If provided, each SHA must appear in the input [COMMIT_HISTORY]. | |
pre_release_identifier | string or null | Required when bump_type is 'pre-release'. Must match regex ^[a-zA-Z0-9.]+$. Set to null for non-pre-release bumps. | |
build_metadata | string or null | If provided, must match regex ^[a-zA-Z0-9.]+$. Set to null if no build metadata is applicable. | |
deprecation_notices | array of objects | Each object must have 'deprecated_surface' (string) and 'suggested_replacement' (string or null). Array may be empty. | |
migration_required | boolean | Must be true if bump_type is 'major' and breaking_changes array is non-empty, otherwise false. Mismatch triggers validation failure. |
Common Failure Modes
What breaks first when you ask a model to recommend a semantic version bump from code changes, and how to guard against it.
Over-Bumping to Major for Minor API Changes
What to watch: The model flags a parameter reordering or an internal type change as a breaking change, recommending a major version bump when the public contract is intact. This creates unnecessary customer alarm and migration churn. Guardrail: Require the prompt to distinguish between public API surface changes and internal refactors. Pair the prompt with a diff filter that isolates only exported interfaces, public method signatures, and documented schemas before the model evaluates breakage.
Missing Breaking Changes in Non-Code Artifacts
What to watch: The model only analyzes source code diffs and misses breaking changes in environment variables, configuration file formats, or database migration scripts. A minor version bump is recommended when a major bump is required. Guardrail: Expand the input context to include configuration file diffs, migration scripts, and environment variable changes. Add a specific instruction to scan for changes to default values, required new keys, and deprecated configuration paths.
Ignoring Pre-Release and Build Metadata Rules
What to watch: The model recommends a clean version like 2.0.0 when the change set includes pre-release identifiers or build metadata that should be preserved or incremented according to the project's conventions. Guardrail: Include the current version string with any existing pre-release or build metadata in the prompt. Add explicit instructions to follow the project's pre-release progression rules and to never strip existing metadata without explicit permission.
Hallucinating Features from Commit Messages
What to watch: A commit message says 'add support for X' but the actual diff only contains a TODO comment or a stub. The model recommends a minor version bump based on the commit message rather than the code change evidence. Guardrail: Instruct the model to ground every feature claim in the actual code diff, not the commit message. Add a verification step that requires the model to cite the specific file and line range where the feature implementation exists before counting it toward a minor bump.
Inconsistent Bump Logic Across Multi-Commit Releases
What to watch: A release contains three features and one breaking change. The model oscillates between recommending a minor bump and a major bump depending on how the commits are ordered in the prompt, revealing a recency or ordering bias. Guardrail: Structure the prompt to categorize all changes first, then apply a deterministic rule: if any change is categorized as breaking, the bump is major; else if any change is a feature, the bump is minor; else the bump is patch. This prevents ordering effects from swaying the final recommendation.
Misclassifying Deprecations as Breaking Changes
What to watch: The model treats a new deprecation warning as a breaking change and recommends a major version bump, even though the deprecated API still functions. This forces an unnecessarily urgent migration timeline on consumers. Guardrail: Add a clear definition to the prompt: a breaking change requires that existing consumer code will fail to compile or behave differently without modification. A deprecation with continued backward compatibility is a minor change. Require the model to justify any breaking classification with a concrete failure scenario.
Evaluation Rubric
Test your prompt implementation against these criteria before deploying to production. Run each test case and verify the expected output.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Version Format Compliance | Output version string strictly matches semver 2.0.0 format (MAJOR.MINOR.PATCH) with optional pre-release and build metadata | Output contains non-numeric segments, missing parts, or invalid pre-release identifiers | Regex validation against semver.org pattern; parse with node-semver or equivalent library |
Breaking Change Detection | MAJOR bump recommended when any commit or diff contains BREAKING CHANGE footer, ! prefix, or API signature removal | MAJOR bump not recommended despite clear breaking change evidence in input | Provide curated diff set with known breaking changes; verify MAJOR recommendation and evidence citation |
Feature Addition Detection | MINOR bump recommended when new backward-compatible functionality is added without breaking changes | PATCH bump recommended when feature additions are present; MINOR bump recommended when only fixes exist | Provide diff set with only feat commits; verify MINOR recommendation and feature count accuracy |
Fix-Only Detection | PATCH bump recommended when input contains only bug fixes, performance improvements, or non-functional changes | MINOR or MAJOR bump recommended for fix-only change set | Provide diff set with only fix commits; verify PATCH recommendation and absence of feature or breaking claims |
Pre-Release Handling | Pre-release labels preserved or incremented according to input context; existing pre-release version handled correctly | Pre-release label dropped, reset to 0, or incorrectly incremented without evidence | Provide input with existing pre-release version; verify output maintains or correctly increments pre-release segment |
Rationale Grounding | Every version component decision (MAJOR, MINOR, PATCH) is supported by at least one specific commit or diff reference | Rationale contains unsupported claims, hallucinated commit hashes, or vague statements without evidence | Spot-check rationale entries against input commits; verify each claim maps to at least one concrete change |
Edge Case: No Changes | Output indicates no version bump needed or returns current version unchanged when diff is empty or contains only non-functional changes | Version bumped despite empty or irrelevant change set | Provide empty diff or whitespace-only changes; verify output recommends no bump or explicitly states no changes warrant version change |
Edge Case: Ambiguous Changes | Output flags ambiguity, requests clarification, or provides bounded recommendation with confidence level when change type is unclear | Confident recommendation made for genuinely ambiguous change without noting uncertainty | Provide diff with borderline change (e.g., refactor that could be interpreted as fix or feature); verify output acknowledges ambiguity |
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
Use the base prompt with a single commit range and minimal output schema. Drop the pre-release and build metadata edge cases. Accept a plain-text rationale instead of structured evidence.
codeAnalyze the following commit log and recommend the next semantic version bump. Commits: [COMMIT_LOG] Return JSON: {"from_version": "string", "to_version": "string", "bump_type": "major|minor|patch", "rationale": "string"}
Watch for
- Over-bumping to major when a deprecation notice is present but no actual breaking change
- Missing
feat:commits buried in merge commits - Treating every refactor as a patch when internal API surfaces changed

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