Audit a Pull Request Diff for Breaking API Changes
Separates wire-breaking schema, status code, and migration changes from safe additions, returning a consumer impact table and deprecation plan.
Agent prompt for ChatGPT and Claude
You get: Verdict, consumer Impact Table and safe Additive Changes
Prompt
mkdir -p .agents/skills/audit-a-pull-request-diff-for-breaking-api-changes && curl -sL "https://prompts-gpt.com/prompts/audit-a-pull-request-diff-for-breaking-api-changes/raw" -o .agents/skills/audit-a-pull-request-diff-for-breaking-api-changes/SKILL.mdAct as a staff API platform engineer reviewing a pull request for backward compatibility. I will paste a git diff and any related schema or migration files right after this prompt. Audit the diff to separate wire-breaking changes from safe additive changes.
Rules:
1. Classify every API change as Wire-Breaking, Behavioral-Breaking, or Safe Additive, citing the exact file path and symbol name from the diff.
2. Check for renamed or removed fields, tightened validation, changed HTTP status codes, altered default values, and database migrations that drop or lock columns before old code stops reading them.
3. Never assume a change is safe because a test passed; flag missing contract tests or undocumented version bumps.
4. For every breaking item, provide a zero-downtime alternative using expand-and-contract or versioned routing.
Output format:
- **Verdict:** Ship, Ship with Deprecation, or Block, with a two-sentence rationale.
- **Consumer Impact Table:** Markdown table with columns: File and Symbol, Change Type, Severity, Affected Consumers, Required Fix.
- **Safe Additive Changes:** Bullet list of non-breaking additions verified in the diff.
- **Deprecation and Rollout Plan:** Numbered steps to deploy safely without breaking existing clients.
End with one short section listing assumptions made and any missing context (such as unknown external consumers or missing schema files) needed to finalize the review.Example output
Tips and common edits
Why this works
- Forces a strict three-tier classification so safe additive fields do not hide wire-breaking renames or status code shifts.
- Explicitly checks database migrations for column drops and locks that break rolling deployments.
- Requires concrete expand-and-contract steps instead of vague advice to version the API.
Use in GitHub Copilot Chat, Claude, or ChatGPT before approving an API pull request. Paste the full git diff along with any changed OpenAPI specs, proto files, or migration scripts.
Common edits
- Add your team's API deprecation policy (such as a 90-day sunset window) to Rule 4 for tailored rollout timelines.
- Include GraphQL or gRPC proto rules in Rule 2 if your service uses non-REST contracts.
Reuse it: Use in a workflowAdapt in the builder
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
More like this
Pull Request Review with Merge Recommendation
Reviews a diff against your standards and returns a merge, merge-with-changes, or do-not-merge recommendation. Findings are ranked by severity, with evidence, suggested fixes, and open questions.
Pre-PR Self-Review and Pull Request Description from a Git Diff
Has GitHub Copilot review your branch diff against the base branch, flag defects and missing tests, and draft a PR description with evidence. Use it to decide whether to open the PR or fix issues first.
Pre-Merge Self-Review of a Git Diff: Correctness, Security, and Test Gaps
Has Claude Code review a branch diff like a skeptical maintainer, producing severity-ranked findings with evidence and a clear merge, fix, or block recommendation. Use it before opening or approving a pull request.
Conventional Commit and PR Description from a Diff and Ticket
Produces a Conventional Commits message and a reviewer-ready PR description covering what changed, why, how to test it, and the risks, based on your diff and ticket.
Codex Pre-Merge Diff Review with Severity-Ranked Findings
Has Codex review a branch diff against a base ref in read-only mode. It checks correctness, tests, security, and maintainability, and returns evidence-backed findings with severity and a merge recommendation.
Audit a Pull Request Diff for Security Flaws and Auth Bypasses
Get a line-by-line PR security review mapping each flaw to an OWASP category, concrete abuse scenario, and minimal drop-in code patch.
- Audit a TypeScript API Route for Race Conditions, Auth, and N+1 Bugs
- Audit Cursor Rules Files for Conflicts and Context Bloat
- Audit AI Code Diffs for Performance Regressions
- Audit API Route Handlers for Auth and Permission Leaks
- Audit Git Diffs for Race Conditions and Shared Mutable State
- Audit PR Git Diffs for Scope Creep and Churn