Goal
Prevent agents from manually editing generated source files.
Repository Context
This application generates TypeScript API client code from an OpenAPI specification.
Code exampleMarkdown
storefront/
├── src/
│ ├── api/
│ │ └── generated/
│ └── features/
├── openapi/
│ └── api.yaml
├── package.json
└── AGENTS.md
The source of truth is:
Code exampleMarkdown
openapi/api.yaml
Generated client files are written to:
Code exampleMarkdown
src/api/generated/
The client is regenerated with:
Code exampleMarkdown
pnpm generate:api
Manual changes inside src/api/generated/ will be overwritten the next time generation runs.
Current AGENTS.md
Code exampleMarkdown
# Project Instructions
## Development
- Use `pnpm`.
- Keep feature code inside `src/features`.
- API client files are located in `src/api/generated`.
## Validation
Before completing substantial changes, run:
- `pnpm lint`
- `pnpm typecheck`
- `pnpm test`
Your Task
Add instructions that protect the generated API client.
The agent should understand that generated files must not be manually edited and that API-client changes should be made through the source specification and generation workflow.