The five hard rules and the naming that follows
The layer map compresses into five rules the CLAUDE.md labels “never violate.” Read them once as a set; they’ll become instinct fast because breaking one always feels wrong once you’ve internalised the direction.
Naming keeps the layers from colliding. Use cases in application/ are verb-first: SaveFlightNote, GetFlights, RevertDisruptionDecision. Workers and coordinators in domain/ are noun-first: DisruptionCostCalculator, RateLookup. Splitting the naming by layer means an application concept and a domain concept about the same thing don’t clash.
Files are grouped by domain concept, not technical role: application/flight-notes/ holds the use case, its request, and its response together, rather than an application/handlers/ bucket. Co-locating by feature is the same instinct that colocates a React component with its test.
Try it yourself
Kill a banned name
Do the rename that most changes how the code reads.
- Take a class you'd instinctively call
FlightCostServicefrom Nest muscle memory - Ask what it actually DOES: it calculates disruption cost
- Rename it
DisruptionCostCalculator(noun-first, it's a domain worker) or, if it's an application use case,CalculateDisruptionCost(verb-first) - Confirm the name now says the behaviour, and no
Service/Manager/Providerremains
Verb-first or noun-first
Know which layer names which way.
Application use cases and domain workers are named differently. Which is verb-first, which is noun-first, and why split them?
Reveal answer
Application use cases are verb-first (SaveFlightNote, GetFlights). Domain workers/coordinators are noun-first (DisruptionCostCalculator, RateLookup). Splitting by layer prevents name collisions when both layers have a concept about the same thing.