Goal
Prevent agents from bypassing the repository's established architecture when implementing new functionality.
Repository Context
This Express application separates HTTP handling, business logic, and database access.
Code exampleMarkdown
commerce-api/
├── src/
│ ├── routes/
│ ├── services/
│ └── repositories/
├── tests/
├── package.json
└── AGENTS.md
The architecture follows these boundaries:
Code exampleMarkdown
routes → HTTP request/response handling
services → business logic
repositories → database access
Routes may call services.
Services may call repositories.
Routes should not access the database directly.
Current AGENTS.md
Code exampleMarkdown
# Project Instructions
## Development
- Use `pnpm`.
- Keep route handlers in `src/routes`.
- New features may access the database directly from routes when that is simpler.
## Validation
Before completing substantial changes, run:
- `pnpm lint`
- `pnpm typecheck`
- `pnpm test`
Your Task
Fix the development instructions so agents preserve the repository's existing architecture.
Make the responsibilities of routes, services, and repositories clear, and prevent route handlers from accessing the database directly.