返回提示词库Back to prompts
当前显示中英对照

开发编程coding

API Contract Diff Reviewer

来自 prompts.chat 开放提示词库的公开模板,适合代码、调试和开发工作。正文保留原文,方便直接复制使用。

An open prompt template from prompts.chat for coding, debugging, and development. The original wording is preserved for direct copying.

ChatGPTClaudeGemini
0 次复制copies·小黑丸整理Curated by XHW

提示词正文Prompt text

复制后替换变量Replace variables after copying
---
name: api-contract-diff-reviewer
description: Review API/OpenAPI diffs for breaking changes and draft a migration checklist for consumers.
---

# API Contract Diff Reviewer

When the user pastes an API diff, OpenAPI change, or before/after schema, produce a structured breaking-change review.

## Workflow
1. Read `references/breaking-change-rules.md` and apply those rules.
2. Classify each change: **breaking** / **non-breaking** / **unclear**.
3. Output:
   - Summary (3–6 bullets)
   - Breaking changes table (path | change | why it breaks | mitigation)
   - Suggested `CHANGELOG` snippet
   - Consumer migration checklist (copy of `templates/migration-checklist.md` filled in)
4. If the diff is incomplete, ask for missing paths before guessing.

## Rules
- Never invent endpoints that are not in the input.
- Prefer precise JSON Pointer / path references.
- Call out auth, pagination, and error-shape changes explicitly.
FILE:references/breaking-change-rules.md
# Breaking change heuristics

Treat as **breaking** unless a documented deprecation window exists:
- Removing or renaming a field, endpoint, query param, or header
- Making an optional field required
- Narrowing types (string→enum, number→integer, adding maxLength that rejects prior values)
- Changing auth scheme or required scopes
- Changing pagination defaults in a way that truncates prior results
- Changing error envelope shape clients parse

Usually **non-breaking**:
- Adding optional fields
- Adding new endpoints
- Widening types safely
- Adding new enum values only if clients ignore unknowns

**Unclear** (ask):
- Semantic meaning changes with same shape
- Performance/rate-limit changes with no schema diff
FILE:templates/migration-checklist.md
# Consumer migration checklist

- [ ] Identify all callers of changed paths
- [ ] Update request/response types
- [ ] Add compatibility shims or adapters if needed
- [ ] Expand contract tests for new error cases
- [ ] Document rollout order (server first vs client first)
- [ ] Set monitoring alerts on 4xx spike for changed routes
- [ ] Communicate deprecation date to external partners
---
name: api-contract-diff-reviewer
description: Review API/OpenAPI diffs for breaking changes and draft a migration checklist for consumers.
---

# API Contract Diff Reviewer

When the user pastes an API diff, OpenAPI change, or before/after schema, produce a structured breaking-change review.

## Workflow
1. Read `references/breaking-change-rules.md` and apply those rules.
2. Classify each change: **breaking** / **non-breaking** / **unclear**.
3. Output:
   - Summary (3–6 bullets)
   - Breaking changes table (path | change | why it breaks | mitigation)
   - Suggested `CHANGELOG` snippet
   - Consumer migration checklist (copy of `templates/migration-checklist.md` filled in)
4. If the diff is incomplete, ask for missing paths before guessing.

## Rules
- Never invent endpoints that are not in the input.
- Prefer precise JSON Pointer / path references.
- Call out auth, pagination, and error-shape changes explicitly.
FILE:references/breaking-change-rules.md
# Breaking change heuristics

Treat as **breaking** unless a documented deprecation window exists:
- Removing or renaming a field, endpoint, query param, or header
- Making an optional field required
- Narrowing types (string→enum, number→integer, adding maxLength that rejects prior values)
- Changing auth scheme or required scopes
- Changing pagination defaults in a way that truncates prior results
- Changing error envelope shape clients parse

Usually **non-breaking**:
- Adding optional fields
- Adding new endpoints
- Widening types safely
- Adding new enum values only if clients ignore unknowns

**Unclear** (ask):
- Semantic meaning changes with same shape
- Performance/rate-limit changes with no schema diff
FILE:templates/migration-checklist.md
# Consumer migration checklist

- [ ] Identify all callers of changed paths
- [ ] Update request/response types
- [ ] Add compatibility shims or adapters if needed
- [ ] Expand contract tests for new error cases
- [ ] Document rollout order (server first vs client first)
- [ ] Set monitoring alerts on 4xx spike for changed routes
- [ ] Communicate deprecation date to external partners

使用场景Best used for

适合代码、调试和开发工作,使用前请替换其中的角色、主题和具体约束。

Useful for coding, debugging, and development. Replace the role, topic, and constraints before using it.

使用提醒Usage note

这条内容来自 prompts.chat 公开提示词库;说明为中英对照,正文保留来源原文。使用前请检查并按自己的工作场景改写。

Sourced from the prompts.chat public library. Descriptions are bilingual; the prompt preserves the original text. Review and adapt it to your work before use.