Enforce strict three-layer architecture: thin HTTP routes, pure service logic with domain errors, isolated data access with dependency injection.
94
93%
Does it follow best practices?
Impact
97%
1.08xAverage score across 5 eval scenarios
Passed
No known issues
A public library is modernizing its catalog system. They need a backend API to manage books — allowing staff to look up books by ISBN, add new titles, and mark books as checked out or returned. The current codebase is a single Express.js file with everything mixed together, making it impossible to add unit tests before an upcoming refactor.
A senior engineer has been asked to restructure the catalog management feature as a properly layered system, so that the business logic can be tested independently and the data access can be swapped out (e.g., moving from SQLite to PostgreSQL later) without touching the business rules.
Implement the catalog management feature with at minimum:
Produce TypeScript source files implementing the catalog feature:
src/routes/catalog.ts — HTTP route handlerssrc/services/catalogService.ts — Business logicsrc/repositories/bookRepo.ts — Data access (use an in-memory store to simulate a database)src/types/book.ts — Type/interface definitions for the Book domain objectThe in-memory store should be initialized with at least 3 sample books so the implementation can be reasoned about. The implementation does not need to run; focus on structure and correct layering.
Also produce architecture-notes.md describing how the three layers interact and how data flows through them.
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
skills
separation-of-concerns
verifiers