AAWEA.ORG
AAWEA.ORG
AAWEA.ORG
API Manual trigger πŸ‘‘ Official πŸ›‘ Hardened

OpenAPI Sync Until Valid

Keep openapi.yaml valid and in sync with route handlers β€” lint the spec and fix drift each pass.

πŸ‘ 1,660 views πŸ“₯ 1,916 installs πŸ‘€ by loops!
Download loop
Share Now
Manual start
↓
  1. 1
    Lint OpenAPI

    Validate openapi.yaml with spectral or swagger-cli. List every error with line numbers.

    > npx @redocly/cli lint openapi.yaml
  2. 2
    Sync handlers

    Update route handlers or the spec so documented paths, schemas, and status codes match reality.

↓
βœ“
Exit condition: lint_clean

OpenAPI spec lints with zero errors

> npx @redocly/cli lint openapi.yaml
πŸ“Š Flow Diagram
flowchart TD Start(["Manual start"]) Start --> S0 S0("Lint OpenAPI") S1("Sync handlers") S0 --> S1 Exit{"OpenAPI spec lints with zero errors"} S1 --> Exit Exit -- "No" --> S0 Exit -- "Yes" --> Done(["Success"]) style Exit fill:#fffbeb,stroke:#f59e0b,stroke-width:2px,color:#92400e style Done fill:#ecfdf5,stroke:#10b981,stroke-width:2px,color:#065f46
Run "OpenAPI Sync Until Valid" in your agent
Prompt only
Deeplinks and "Open in Cursor" only paste the kickoff prompt. They do not install hook files β€” your agent cannot tell whether files are on disk until you add them yourself.
Two separate pieces
  • Kickoff prompt β€” tells the agent the goal, check command, exit condition, and how to self-pace.
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.
Anti-gaming rules
Rules the agent must follow so it cannot cheat the exit condition.
  • Do not modify the check command or exit criteria to force success
  • Do not skip, disable, or bypass checks to pass the exit condition
  • If stuck after several iterations, stop and report blockers instead of gaming metrics