All challengesCHALLENGE 11 OF 25

Protect Repository Boundaries

Keep changes within the intended repository boundaries.

Intermediate

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.

YOUR AGENTS.mdEdit the Current AGENTS.md shown in the challenge
AGENTS.mdMarkdown
Loading editor…

Sign in to save progress across devices.

Your answer is checked locally against the challenge rules. No AI is used for evaluation.