Restore layer boundaries in an agent-built service

Judgment callHard25 minAnthropic and OpenAI style

Your task

Over a quarter, agents built most of your team's TypeScript service, one feature at a time. Each feature works, but the layers have blurred.

Business rules sit in HTTP controllers. Controllers, jobs and helpers all query the database directly, and no module owns the domain logic. The service ships fine today. You are the staff engineer.

What do you do about it? Decide how you restore the boundaries and what you change about how the team hands work to agents.

It covers

  • Machine written
  • Abstraction boundaries
  • Review