APImanual
API Contract Until Match
Loop until API responses match the OpenAPI or JSON Schema contract — catch drift between docs and implementation.
Kickoff prompt
Start the "API Contract Until Match" loop.
Goal: API implementation matches the published contract
Max iterations: 10
Between iterations run: npm run test:contract
Exit when: contract test suite exits 0
Step 1: Run contract tests. Fix each schema/response mismatch with minimal diffs, then re-run.
Self-pace this loop. After each iteration, run the check command, read the output, and only continue if the exit condition is not met. Stop when the exit condition passes or max iterations is reached. Give a short status update each pass.Basic information
Category
API
Goal
API implementation matches the published contract
Max iterations
10
Check command
npm run test:contract
Exit when
contract test suite exits 0
Supported agents
Cursor
Steps
- 1
Run contract tests
Run contract tests against openapi.yaml or schema fixtures. List every mismatch with endpoint and field.
npm run test:contract - 2
Fix implementation or spec
Fix the smallest change: update handler types/validation or correct the spec if the code is canonical.