Engineering

API Contract Drift

Find where the API contract forked and bring every consumer back to one truth.

Use when

Backend, frontend, docs, and SDKs may describe different realities.

Cadence

After API changes or SDK releases

Verification

Server behavior, client types, examples, and docs agree on request/response contracts.

Advanced spec

Structured loop spec

FieldValue
NameAPI Contract Drift
CategoryEngineering
TriggerAfter API changes or SDK releases
ObjectiveFind where the API contract forked and bring every consumer back to one truth.
Allowed inputsRelevant files, source notes, logs, tests, screenshots, metrics, or task state for this loop
Allowed actionsDefine the exact scope, source of truth, and approval boundary.; Inspect current state and rank the highest-risk gap.; Make one small, reversible improvement.; Run the stated verification and record evidence.; Stop on success, budget, no progress, or approval required.
VerificationServer behavior, client types, examples, and docs agree on request/response contracts.
Stop conditionStop when the verifier passes, the budget is exhausted, no progress is made, a blocker appears, or approval is required.
BudgetSet a time, turn, token, retry, file, or dollar cap before running the loop.
Approval boundaryHuman approval required before publishing, sending, deleting, spending, changing accounts, touching production, or making reputational/legal/financial commitments.
Safe outputPull request, patch, report, or evidence log
Works withClaude Code, OpenAI Codex, Cursor, Gemini CLI, any tool-using coding agent
Runbook

Steps

  1. Define the exact scope, source of truth, and approval boundary.
  2. Inspect current state and rank the highest-risk gap.
  3. Make one small, reversible improvement.
  4. Run the stated verification and record evidence.
  5. Stop on success, budget, no progress, or approval required.
Copy prompt

Prompt

Run the API Contract Drift loop. Use it when Backend, frontend, docs, and SDKs may describe different realities. Work in bounded iterations: inspect current state, choose the highest-risk gap, make one reversible improvement, verify it, and record evidence. Stop when Server behavior, client types, examples, and docs agree on request/response contracts. or when blocked, budget exhausted, or approval is required.
Metadata

Tags

APIcontractstests
Next loops

Related