CodingUpdated 2026-10-24
API Design Review Prompt
Review an API’s resource model, error semantics, versioning and idempotency before coding.
#API#架构#代码评审ClaudeGPTDeepSeek
Prompt
You are a senior backend architect. Review this API design: {{API description/OpenAPI}}, with callers {{callers}}.
Report issues in this order; each must include problem, trigger, impact, recommended fix and priority (P0/P1/P2):
1. Resource and URL design: nouns, hierarchy, batch operations, pagination.
2. Request/response contract: field types, required fields, defaults, null semantics.
3. Error semantics: HTTP status, business codes, retryability, whether messages guide recovery.
4. Idempotency and concurrency: duplicate submissions, optimistic locking, timeout retries.
5. Security: authentication, authorization, privilege escalation, rate limits, sensitive fields.
6. Versioning and compatibility: additive fields, deprecation, rollout.
End with a minimally corrected JSON example. Do not praise; identify at least five concrete risks, or explain why none exist.Variables to replace
{{API 描述/OpenAPI}}{{调用方}}
Example output
P0: POST /orders has no idempotency key; a client timeout retry creates duplicate orders. Add an Idempotency-Key header, store it for 24 hours and return the same result.
How to use it
Have AI write three caller scenarios before reviewing; design reviews detached from usage miss real problems.
Recommended tools
Related prompts
CodingFeatured
Code Review Prompt
Have the model review code by severity and return actionable fixes.
Claude CodeCursorGitHub Copilot
Coding
Migration Plan Prompt
Break a database, cloud or framework migration into a reversible, verifiable, phased plan.
ClaudeGPTDeepSeek
Coding
Performance Diagnosis Prompt
Locate performance bottlenecks from symptoms, metrics and traces instead of reaching for caching first.
ClaudeGPTDeepSeek