Goal
Make sure agents update generated API clients through their authoritative schema and generation workflow rather than patching generated output.
Repository Context
This application consumes an external Payments API.
Code exampleMarkdown
checkout-app/
├── src/
│ ├── payments/
│ └── generated/
│ └── payments-client/
├── schemas/
│ └── payments-openapi.yaml
├── package.json
└── AGENTS.md
The authoritative API contract is:
Code exampleMarkdown
schemas/payments-openapi.yaml
The generated client is written to:
Code exampleMarkdown
src/generated/payments-client/
Generate the client with:
Code exampleMarkdown
pnpm generate:payments-client
Generated output may be replaced whenever generation runs.
Current AGENTS.md
Code exampleMarkdown
# Project Instructions
## Payments
- The Payments API client is stored in `src/generated/payments-client/`.
- Small fixes may be made directly in generated client files if regenerating the client takes longer.
- If the generated client does not match the API, keep the manual fix and update the schema later.
## Validation
- Run `pnpm test` after changing payment behavior.
Your Task
Repair the generated-client workflow.
Make the API schema the source of truth, prevent manual fixes to generated output, and require regeneration through the repository's generation command.