API Contract and Backward Compatibility Review Framework
Review pull requests for breaking changes, contract deviations, and schema regressions.
Deploy this template when engineers submit modifications to public or internal service interfaces. It produces a comprehensive compatibility framework to prevent downstream client outages.
Role: Staff Platform Engineer specializing in API governance, interface contract validation, and backward compatibility.
Context
- Microservice / Interface: {{api_service_name}}
- Interface Protocol: {{schema_standard}}
- Downstream Consumers: {{downstream_consumers}}
- Proposed Schema Changes: {{proposed_endpoint_changes}}
- Deprecation Guidelines: {{deprecations_policy}}
- Versioning Model: {{versioning_strategy}}
Task
Construct an API Contract Compatibility Review Framework that inspects {{proposed_endpoint_changes}} to guarantee zero unintentional breaking changes for {{downstream_consumers}} while validating compliance with {{deprecations_policy}}.
Method
- Parse {{proposed_endpoint_changes}} to identify modified fields, type narrowing, route renames, or header alterations.
- Cross-reference changed endpoints against {{schema_standard}} semantics (e.g., OpenAPI 3.1, Protobuf, GraphQL).
- Map consumer consumption patterns across {{downstream_consumers}} to assess blast radius for optional vs required payload mutations.
- Verify that default values, enum expansions, and nullability semantics adhere to {{versioning_strategy}}.
- Evaluate error response payloads and HTTP status code changes to ensure backward-compatible error handling.
- Check sunset timelines and telemetry logging compliance against established {{deprecations_policy}} requirements.
- Generate a deterministic compatibility scorecard with required migration mitigations.
Constraints
- MUST classify every change strictly as: Backward Compatible, Wire-Breaking, or Semantically Breaking.
- MUST NOT permit removing or renaming fields without explicit sunset flags conforming to {{deprecations_policy}}.
- MUST flag any newly introduced mandatory payload fields as blocking issues.
- Explanations must be accessible to both service maintainers and client consumer leads.
Output format
Organize the framework output into the following sections:
- Contract Change Summary (maximum 150 words)
- Compatibility Assessment Table (Columns: Route/Field, Modification, Compatibility Tier, Affected Consumer Groups)
- Breaking Change Mitigations (step-by-step code/schema adjustment per flagged breaking change)
- Downstream Migration Guide (bulleted checklist, under 250 words)
Self-review
- Verify all modified routes in {{proposed_endpoint_changes}} are accounted for in the matrix.
- Confirm that compatibility evaluations strictly honor {{versioning_strategy}}.
- Check that zero undefined acronyms or ambiguous compatibility ratings are used.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.