Inferensys

Prompt

Version-to-Version Migration Guide Drafting Prompt

A practical prompt playbook for generating complete version-to-version migration guides from structured breaking change inventories, code comparisons, and version diffs. Designed for technical writers and platform teams who need consistent, comprehensive migration documentation that covers prerequisites, step-by-step instructions, troubleshooting, and rollback plans.
Wide-angle shot of a modern WeWork open floor plan with creative walls covered in AI system architecture diagrams, product team collaborating in standing desk area with industrial lighting.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the ideal scenario, required inputs, and boundaries for using the migration guide drafting prompt.

Use this prompt when you are a technical writer, platform engineer, or release manager who has already completed the discovery phase of a version migration. You must have a finalized inventory of breaking changes, prepared before/after code comparisons, identified deprecated surfaces, and estimated the effort required for downstream consumers. The prompt assembles these structured inputs into a publication-ready migration guide that includes an overview, breaking change summary, prerequisites, step-by-step instructions, code comparisons, a troubleshooting section, and a rollback plan. It is designed to enforce internal consistency, such as ensuring every breaking change listed in the summary has a corresponding step in the instructions and a code example.

Do not use this prompt if you are still in the discovery phase of a migration. It will not analyze raw code diffs, changelogs, or OpenAPI specifications to identify breaking changes; that work should be done with a dedicated prompt like the 'Breaking Change Enumeration Prompt Template' or 'API Surface Diff Analysis Prompt.' Similarly, avoid this prompt for migrations that involve only additive, non-breaking changes, as its structure and validation logic assume the presence of breaking changes that require consumer action. Using it for a simple feature release will produce an overly complex document with empty or irrelevant sections. The prompt also assumes a single source of truth for your inputs; if your breaking change inventory is scattered across multiple tickets and documents, consolidate it first.

Before executing this prompt, validate that your inputs are complete and accurate. A missing code comparison or an unverified deprecation date will propagate errors into the final guide. After generation, you should run a 'Migration Guide Completeness Audit Prompt' to cross-reference the output against your source inventory and a 'Before/After Code Comparison Prompt' to verify that every code sample compiles against its target version. For high-risk migrations, always require a human review step to confirm that rollback instructions are safe and that troubleshooting guidance covers known edge cases from your test plan.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Version-to-Version Migration Guide Drafting Prompt delivers value and where it introduces unacceptable risk. Use these cards to decide if this prompt fits your current release workflow.

01

Good Fit: Structured Release with a Complete Breaking Change Inventory

Use when: You have a finalized, machine-readable list of every breaking change, deprecated surface, and behavioral alteration. The prompt synthesizes a coherent guide from structured inputs. Guardrail: Feed the prompt a validated JSON array of breaking changes from the Breaking Change Enumeration Prompt to prevent hallucinated or omitted changes.

02

Bad Fit: Undocumented or Exploratory Upgrades

Avoid when: The full scope of breaking changes is unknown, still under investigation, or exists only in unstructured commit logs. The prompt will invent plausible but incorrect migration steps to fill gaps. Guardrail: Use the API Surface Diff Analysis Prompt and Breaking Change Enumeration Prompt first. Do not run this drafting prompt until the input inventory is complete and reviewed.

03

Required Inputs: Structured Diffs, Not Just Changelogs

Risk: Feeding only a high-level changelog produces a vague, untestable guide that misses parameter-level and behavioral changes. Guardrail: The prompt requires structured inputs for each breaking change: affected surface, severity, before/after code snippets, and replacement mappings. Validate inputs with the Migration Guide Completeness Audit Prompt before drafting.

04

Operational Risk: Stale or Incomplete Rollback Instructions

Risk: The prompt may generate generic rollback steps that do not account for data migrations, stateful changes, or irreversible schema updates. Guardrail: Pair this prompt's output with the Migration Rollback Plan Documentation Prompt. Every forward step in the guide must have a verified, tested rollback counterpart before publication.

05

Operational Risk: Untested Code Examples in Production Guides

Risk: Generated code snippets may use outdated syntax, incorrect imports, or fail against the target version. Guardrail: Run all generated code examples through an automated test harness against the actual target library version. Use the Before/After Code Comparison Prompt to generate testable pairs and validate compilation before merging into the guide.

06

Bad Fit: Guides Requiring Consumer-Specific Customization

Avoid when: Each downstream consumer needs a unique migration path based on their usage patterns. A single static guide will be either too generic or misleading. Guardrail: Use the Migration Effort Estimation Prompt to generate per-consumer effort reports. Reserve this drafting prompt for the general reference guide and link to consumer-specific analysis for detailed steps.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template with square-bracket placeholders for drafting a complete version-to-version migration guide from structured inputs.

This prompt template is designed to produce a full migration guide document when provided with a structured inventory of breaking changes, version identifiers, code examples, and platform context. It is not a generic summarizer—it expects precise inputs and produces a document with an overview, breaking change summary, prerequisites, step-by-step instructions, code comparisons, troubleshooting, and a rollback plan. The template uses square-bracket placeholders so you can wire it directly into an automated documentation pipeline or a human-in-the-loop authoring tool.

text
You are a technical writer producing a version-to-version migration guide for a software platform, API, or SDK. Your output must be accurate, internally consistent, and actionable for a developer audience. Do not invent changes, features, or timelines not present in the provided inputs.

## INPUTS

[BREAKING_CHANGE_INVENTORY]
(A structured list of every breaking change. Each entry must include: change ID, severity, affected surface, deprecated pattern, replacement pattern, and required consumer action.)

[BEFORE_AFTER_CODE_EXAMPLES]
(Side-by-side code blocks for each breaking change, annotated with behavioral differences, error handling changes, and import path updates. Each example must be tagged with the corresponding change ID.)

[VERSION_INFO]
(Source version, target version, release dates, deprecation timeline, and end-of-support dates.)

[PLATFORM_CONTEXT]
(Programming languages, frameworks, deployment environments, and any platform-specific constraints that affect migration steps.)

[KNOWN_ISSUES]
(Documented unresolved issues, edge cases, and planned fix timelines. Each issue must include a workaround if one exists.)

[ROLLBACK_TRIGGERS]
(Conditions that should cause a consumer to abort or reverse the migration, such as data consistency failures, performance regressions, or critical bug discoveries.)

## OUTPUT STRUCTURE

Produce a complete migration guide with the following sections in order:

1. **Overview**: One paragraph explaining what this migration covers, which versions are involved, and the primary motivation for upgrading. Include a severity summary (e.g., "This migration includes 3 critical breaking changes, 5 moderate changes, and 2 deprecation notices").

2. **Breaking Change Summary Table**: A table with columns: Change ID, Severity, Affected Surface, Required Action, and Link to Detailed Section. Every entry in [BREAKING_CHANGE_INVENTORY] must appear in this table.

3. **Prerequisites**: A numbered checklist of everything the consumer must do before starting migration. Derive these from [PLATFORM_CONTEXT] and [VERSION_INFO]. Include minimum version requirements, required permissions, dependency upgrades, configuration backups, and environment preparation. Every prerequisite must be verifiable.

4. **Step-by-Step Migration Instructions**: For each breaking change in [BREAKING_CHANGE_INVENTORY], produce a subsection with:
   - Change description and rationale
   - Before/after code comparison from [BEFORE_AFTER_CODE_EXAMPLES]
   - Step-by-step migration actions
   - Verification criteria (how to confirm the change was applied correctly)
   - Rollback step (how to reverse this specific change if it fails)
   Order changes by severity (critical first) and dependency (changes that must be done before others).

5. **Troubleshooting**: Common error scenarios derived from [KNOWN_ISSUES] and the error handling changes in [BEFORE_AFTER_CODE_EXAMPLES]. For each scenario, provide the symptom, probable cause, and resolution steps.

6. **Rollback Plan**: A complete rollback procedure triggered by [ROLLBACK_TRIGGERS]. Include pre-migration state capture instructions, step-by-step reversal, data consistency checks, and post-rollback verification.

7. **Known Issues**: A section listing each entry from [KNOWN_ISSUES] with description, affected scenarios, workaround, and planned fix timeline.

## CONSTRAINTS

- Every breaking change in [BREAKING_CHANGE_INVENTORY] must appear in the summary table and have a corresponding detailed section.
- Every code example in [BEFORE_AFTER_CODE_EXAMPLES] must be used exactly once and linked to the correct change ID.
- Do not fabricate error codes, timelines, or replacement APIs.
- If a breaking change has no direct replacement, state that explicitly and provide workaround guidance.
- If [KNOWN_ISSUES] is empty, state "No known issues at time of publication" rather than omitting the section.
- Use consistent terminology from [PLATFORM_CONTEXT] throughout.
- Cross-reference all sections so that a reader can navigate from summary table to detailed steps to rollback instructions without broken links.

## OUTPUT FORMAT

Output the complete migration guide as a single Markdown document. Use appropriate heading levels, code fences with language tags, and tables.

To adapt this template, replace each square-bracket placeholder with structured data from your release pipeline. The [BREAKING_CHANGE_INVENTORY] should be the output of a breaking change enumeration prompt or an API surface diff analysis. The [BEFORE_AFTER_CODE_EXAMPLES] should come from a dedicated code comparison prompt that validates both snippets compile against their respective versions. If you are wiring this into an automated pipeline, validate the output against a completeness audit prompt that cross-references the generated guide against the original breaking change inventory to catch omissions. For high-risk migrations where correctness is critical, always route the final guide through human review before publication.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Version-to-Version Migration Guide Drafting Prompt. Each placeholder must be populated with structured data before the prompt can produce a reliable guide. Validate inputs against source-of-truth systems to prevent hallucinated breaking changes or incorrect code examples.

PlaceholderPurposeExampleValidation Notes

[SOURCE_VERSION]

The version string consumers are migrating from

v2.4.1

Must match a released version tag in the repository. Parse check against git tags or package registry.

[TARGET_VERSION]

The version string consumers are migrating to

v3.0.0

Must be a released version newer than SOURCE_VERSION. Semver comparison required.

[BREAKING_CHANGE_INVENTORY]

Structured list of every breaking change between versions

JSON array of change objects with severity, surface, and affected endpoints

Cross-reference against API diff analysis output. Every documented breaking change must appear. Null not allowed.

[DEPRECATED_SURFACES]

Endpoints, methods, parameters, or fields deprecated in this version range

JSON array with surface path, deprecation date, sunset date, and replacement mapping

Validate against OpenAPI spec deprecation annotations. Missing entries trigger a completeness failure.

[CODE_EXAMPLES_BEFORE_AFTER]

Side-by-side code comparisons for each breaking change in the target language

JSON array of objects with deprecated_snippet, replacement_snippet, and annotations

Each snippet must compile against its respective version. Functional equivalence check where intended.

[REPLACEMENT_API_MAP]

Mapping from every deprecated surface to its replacement or workaround

JSON object keyed by deprecated surface path with replacement endpoint and parameter translation

No deprecated surface may lack a mapping entry. Null replacement allowed only with documented workaround.

[MIGRATION_PREREQUISITES]

Minimum version requirements, permissions, and preconditions before migration begins

Structured list with requirement description and verification command

Each prerequisite must be actionable and verifiable. Parse check for missing verification steps.

[ROLLBACK_PLAN]

Step-by-step reversal instructions for each forward migration step

Ordered list of rollback steps with triggers, state capture, and post-rollback verification

Every forward migration step must have a corresponding rollback step where applicable. Null allowed for irreversible steps with explicit warning.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the migration guide drafting prompt into a documentation pipeline with validation, retries, and human review gates.

This prompt is designed to be the final assembly step in a migration documentation pipeline, not a standalone tool. It expects structured inputs—a breaking change inventory, before/after code comparisons, a deprecation timeline, and replacement API mappings—that should be produced by upstream prompts or deterministic tooling. Wiring it directly to raw changelogs or commit diffs will produce an incomplete, hallucination-prone guide. The harness must validate that every required input section is populated before the prompt is invoked, and that the output guide references every breaking change enumerated in the source inventory.

The implementation harness should follow a validate → generate → audit → repair → review loop. First, validate that all input sections ([BREAKING_CHANGE_INVENTORY], [BEFORE_AFTER_EXAMPLES], [DEPRECATION_TIMELINE], [REPLACEMENT_MAPPINGS]) are non-empty and structurally complete. Second, invoke the model with the prompt template, capturing the raw output and the model version in logs. Third, run an automated audit using the Migration Guide Completeness Audit Prompt against the generated guide, cross-referencing it with the original breaking change inventory to detect omissions, broken cross-references, or hallucinated endpoints. Fourth, if the audit fails, feed the audit report back into a repair loop (using the Output Repair and Validation Prompts pillar patterns) with a maximum of two retries before escalating. Fifth, route any guide that passes automated audit to a human technical writer for final review, particularly for tone, troubleshooting accuracy, and rollback plan coherence.

For model choice, prefer a model with strong instruction-following and long-context handling, such as Claude 3.5 Sonnet or GPT-4o, given the volume of structured input this prompt consumes. Set temperature low (0.1–0.3) to reduce creative drift in technical instructions. Log every generation attempt, the audit report, the repair count, and the final human review outcome. Do not publish a migration guide that has not passed both the automated completeness audit and human review. The highest-risk failure mode is a guide that omits a breaking change—consumers following it will encounter undocumented failures. The second-highest is a guide that includes hallucinated endpoints or flags that do not exist in either version, which erodes trust in all future migration documentation.

IMPLEMENTATION TABLE

Expected Output Contract

Fields, format, and validation rules for the generated migration guide. Use this table to build a post-processing validator or schema check before publishing the guide.

Field or ElementType or FormatRequiredValidation Rule

guide_title

string

Must match pattern 'Migrating from [SOURCE_VERSION] to [TARGET_VERSION]'. Parse check for placeholder substitution.

overview_summary

string

Length between 50 and 500 characters. Must contain the target version string. Schema check.

breaking_changes_section

array of objects

Array length must equal the count of items in [BREAKING_CHANGE_INVENTORY]. Each object must have 'severity', 'surface', and 'description' fields. Cross-reference check against input.

prerequisites_list

array of strings

Minimum 1 item. Each string must start with a verb. Null or empty array not allowed. Schema check.

step_by_step_instructions

array of objects

Each object must contain 'step_number' (integer), 'action' (string), and 'verification' (string). 'step_number' must be sequential starting at 1. Parse check.

before_after_code_blocks

array of objects

Each object must have 'title', 'before_code', and 'after_code' fields. 'before_code' and 'after_code' must be non-empty strings. Citation check: each block must map to an item in [BREAKING_CHANGE_INVENTORY].

rollback_plan

object

Must contain 'pre_migration_state_capture' (string) and 'reversal_steps' (array of strings). Approval required if [CRITICAL_SERVICES] flag is true.

troubleshooting_section

array of objects

If present, each object must have 'symptom', 'cause', and 'resolution' fields. All fields must be non-empty strings. Null allowed if no known issues.

PRACTICAL GUARDRAILS

Common Failure Modes

When drafting version-to-version migration guides from structured inputs, these failures surface most often in production. Each card identifies a specific breakage pattern and the guardrail that catches it before publication.

01

Silent Omission of Breaking Changes

What to watch: The prompt produces a polished guide that skips one or more breaking changes present in the source changelog or API diff. This happens when the input is long, the change list is dense, or the model prioritizes narrative flow over completeness. Guardrail: Run a completeness audit prompt after generation that extracts every claimed breaking change from the guide and diffs it against the structured breaking-change inventory. Flag any inventory item missing from the guide before human review.

02

Stale or Hallucinated Code Examples

What to watch: Before/after code snippets look plausible but don't compile against the actual library versions they claim to represent. The model may invent method signatures, import paths, or parameter names that never existed in either version. Guardrail: Add a post-generation validation step that extracts every code block, identifies the claimed source and target versions, and runs each snippet through a syntax checker or linter configured for those versions. Flag any block that fails compilation for human correction.

03

Broken Cross-References Between Sections

What to watch: The guide references a section, step number, or anchor that doesn't exist. For example, 'See Step 4 for rollback instructions' when Step 4 was renumbered or removed during generation. This erodes trust and causes consumer confusion during high-stakes upgrades. Guardrail: After generation, extract all internal references (step numbers, section titles, anchor links) and validate each target exists in the final document. Reject the draft if any reference is dangling.

04

Inconsistent Severity or Impact Language

What to watch: The guide describes one breaking change as 'critical, requires immediate action' and another with identical blast radius as 'minor update.' Inconsistent severity labeling causes consumers to misprioritize migration work and may lead to skipped steps. Guardrail: Run a severity classification prompt on the breaking change inventory before guide generation. Use the resulting severity tiers as a constraint in the drafting prompt, and validate that the final guide's language matches the pre-classified severity for each change.

05

Missing Rollback Instructions for Irreversible Steps

What to watch: The guide includes database migrations, config changes, or API cutovers without corresponding rollback procedures. If a consumer follows the guide and encounters a failure mid-migration, they have no documented path back to a working state. Guardrail: Require a paired rollback step for every forward migration step that mutates state. Use a structured output schema that enforces a rollback field per step, and validate that no mutation step has an empty or placeholder rollback entry.

06

Prerequisite Assumptions Not Validated

What to watch: The guide assumes the consumer is on a specific patch version, has certain permissions, or has completed a prior migration. When these assumptions are wrong, the first step fails and the consumer is blocked with no diagnosis. Guardrail: Include a mandatory prerequisites section in the prompt template with explicit version floor, required permissions, and dependency checks. After generation, run a validation prompt that extracts every assumption and checks it against the source-of-truth version compatibility matrix.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the quality of a generated migration guide before shipping. Each criterion targets a specific failure mode common in version-to-version documentation.

CriterionPass StandardFailure SignalTest Method

Breaking Change Coverage

Every entry in [BREAKING_CHANGE_INVENTORY] appears in the guide

A breaking change from the inventory is missing from the guide

Parse guide sections, extract referenced change IDs, diff against inventory

Code Example Compilability

All before/after code blocks compile against their respective versions

A code block uses a removed method, wrong import, or invalid syntax

Run each code block through a syntax checker or compiler for the target language

Cross-Reference Integrity

All internal links and section references resolve correctly

A link points to a missing anchor or a referenced section does not exist

Parse all internal links, validate target anchors exist in the output document

Deprecation Timeline Accuracy

All dates match [DEPRECATION_SCHEDULE] exactly

A sunset date, announce date, or removal date differs from the source schedule

Extract all dates from guide, compare field-by-field with source schedule

Replacement API Mapping Completeness

Every deprecated surface has a documented replacement or explicit workaround

A deprecated endpoint or method has no migration path described

Cross-reference deprecated surfaces with replacement sections, flag null mappings

Rollback Step Coverage

Every forward migration step has a corresponding rollback instruction where applicable

An irreversible step lacks a rollback or state-capture instruction

Pair forward steps with rollback steps, flag steps marked irreversible without justification

Prerequisite Verifiability

Every prerequisite is stated as a concrete, checkable condition

A prerequisite uses vague language like 'ensure your system is ready'

Scan prerequisites section for non-actionable statements, flag any without a verification command

Known Issues Traceability

Every known issue links to a bug tracker entry or internal issue ID

A known issue describes a problem without a tracking reference

Parse known issues section, validate each entry contains a reference to [ISSUE_TRACKER]

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a simplified [BREAKING_CHANGE_LIST] and a single [TARGET_LANGUAGE] for code examples. Skip strict output schema validation and focus on generating a readable first draft. Remove the rollback plan and troubleshooting sections to reduce scope.

Prompt snippet

code
Generate a migration guide from version [OLD_VERSION] to [NEW_VERSION] covering these breaking changes: [BREAKING_CHANGE_LIST]. Include an overview, prerequisites, and step-by-step instructions with before/after code in [TARGET_LANGUAGE].

Watch for

  • Missing code comparisons for edge-case breaking changes
  • Overly generic instructions that skip specific parameter renames
  • Hallucinated error codes or deprecation dates not present in the input
Prasad Kumkar

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.