APImanual
OpenAPI Sync Until Valid
Keep openapi.yaml valid and in sync with route handlers — lint the spec and fix drift each pass.
Kickoff prompt
Start the "OpenAPI Sync Until Valid" loop.
Goal: openapi.yaml lints clean and matches implemented routes
Max iterations: 8
Between iterations run: npx @redocly/cli lint openapi.yaml
Exit when: OpenAPI lint exits 0
Step 1: Lint openapi.yaml. Fix spec errors and handler drift until lint passes.
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
openapi.yaml lints clean and matches implemented routes
Max iterations
8
Check command
npx @redocly/cli lint openapi.yaml
Exit when
OpenAPI lint exits 0
Supported agents
Cursor
Steps
- 1
Lint OpenAPI
Validate openapi.yaml with spectral or swagger-cli. List every error with line numbers.
npx @redocly/cli lint openapi.yaml - 2
Sync handlers
Update route handlers or the spec so documented paths, schemas, and status codes match reality.