DDD as Code + Spec-Driven Development
When Code Is Cheap: Software Engineering in 2027
Agentic builder · Java Tech Lead · AsyncAPI TSC member · Spring I/O speaker
Building ZenWave SDK and ZenWave Platform
Design and verification are the new bottlenecks,
and
Markdown is making things worse.
Spec-Driven Development is the way, but in order to leverage long-running autonomous agentic coding loops we need specs that are detailed enough to leave nothing to guess. That leaves two options:
My proposal in a nutshell is DDD as Code:
- compact domain models you and your agents can read,
- instead of piles of Markdown specs.
Two DSLs for capturing EventStorming as code:
- ZFL Process level: the business flows across services.
- ZDL Software design level: the design of each service or module.
How do I know it works? Arcadia Editions
An entire e-commerce system, Arcadia Editions, fits in 7 files (1 ZFL + 6 ZDL), ~14k tokens: a fraction of the smart zone of your agent's context window.
I built Arcadia Editions using only the models as specs for the agents
| file | LOC | NCLOC | tokens (est.) |
|---|---|---|---|
| place-order-flow.zfl | 346 | 178 | ~3.5k |
| orders-checkout.zdl | 184 | 149 | ~1.5k |
| catalog-inventory.zdl | 263 | 193 | ~1.9k |
| catalog-products.zdl | 107 | 90 | ~0.7k |
| payments-processing.zdl | 252 | 174 | ~2.2k |
| fulfillment-shipping.zdl | 157 | 117 | ~1.2k |
| notifications-consumer.zdl | 145 | 116 | ~1.1k |
| total | 1,454 | 1,017 | ~14k |
- Modular monolith Spring Boot · JavaSpring Boot · KotlinQuarkus
- Microservices orders-checkoutcatalog-inventorypayments-processingfulfillment-shippingnotifications-consumer
Looking to join a team as architect and builder. Building business software with agents, and helping other teams adopt DDD as Code.
Contact meYou can use the rest of this page to dive deeper into different aspects.
Generating code becomes cheap. Design and verification are a bottleneck. Code quality is a problem.
When generating code becomes cheap, what remains are the three pillars of software engineering:
- Understanding the domain DDD as Code
- Proving the design is correct Formal Verification
- Validating the result Verification Contract
All three happen before the spec goes to the agent.
Spec-driven development in two loops
- Human in the Loop (HITL). Discover the business with Domain-Driven Design and capture the findings in models a human can read and approve.
- Away From Keyboard (AFK). Agents split those models into a backlog of tasks. Once I approve that backlog, an orchestrator agent runs the loop on its own.
My focus is the human loop. The agentic loop is a technical challenge, and it will keep changing as the tools evolve. The lasting work is getting models a human can read and approve, and that stay in the team's heads.
Read more
The problem: Markdown is the bottleneck
To let the agentic loop run on its own you need a spec that is sharp and concrete, detailed down to the level where the agent doesn't need to ask. Two options:
- You write it by hand, and you may end up writing more text than the code itself.
- An LLM writes it, and you cannot possibly read and validate it at the speed of an agent. Decisions slip in unread, and the agent takes them as gospel.
The proposal: Domain-Driven Design as Code
My answer is not new. It is model-driven development: instead of describing the system in prose, you describe it with a model. I take the EventStorming sessions to code, at two zoom levels, with one DSL each:
- Process level: the business flows across services. ZFL.
- Design level: the software design of each service or module. ZDL.
I've been doing this in production for 4 years, writing domain models by hand and generating all the boring parts. Now agents can help with that too.
Arcadia Editions: see it for yourself
Arcadia Editions is an open source fictional e-commerce that works as my laboratory, first for API governance and now for spec-driven development. I implemented it (5 microservices or 1 monolith) using agentic loops, without resorting to Markdown specs.
👷 Try it with your agent. Different scripts check out the repos you need, each with a prompt to analyze a different aspect: analyze with agents. Use them as they are, change them, or write your own.
Business flows: ZFL, process level
ZFL captures process-level EventStorming. Its main building block is the
policy, the business rule that connects a domain event (a business fact)
with the next command: when X do Y.






Service design: ZDL, design level
Zoom in from the business flow to the design of each microservice or module.
Built to last
Code is now very easy to change. Some things are not:
- Data
- APIs
- Events
That is what we model here.



ZDL is structured and parseable, so a lot of code can be generated from it with deterministic templates instead of agents. More in Extra Ball.
A connected graph
ZFL and the ZDLs form one connected graph, deterministically parseable. That opens the door to formal verification.
Pillar 2: Formal Verification
Each service can behave correctly in isolation while the system as a whole behaves incorrectly. From ZFL I derive a state machine per bounded context and model-check every path. On the Place Order flow of Arcadia Editions: 220 states, 3 incorrect final states. The repaired design: 312 states, none incorrect. ZFL is not 100% of TLA+, but humans can read it.
Pillar 3: Verification Contract
The definition of correctness has to be in place before the agentic loop starts. A Verification Contract lists falsifiable guarantees per requirement, in natural language, approved by a human. The Executable Verification Contract turns it into examples, acceptance tests and properties, frozen before the implementation and run against the code.
Extra Ball
Deterministic generation: keeping code quality from decaying
Instead of generating 100% of the code with agents, generate the structure with deterministic templates. Agents copy the patterns they find in the repo; if those patterns came from your best templates, quality stays consistent. Highly configurable if you want a different architecture. It started with Spring Boot Java, then Kotlin, and now there is an experimental Quarkus implementation.
Architecture manifest: an architectural world model
One YAML links every domain model and API in your organization. A Kotlin Multiplatform library parses it, ZenWave Platform for VS Code visualizes it, and an EventCatalog can be generated from it. A whole e-commerce fits in ~14k tokens, about 14% of a conservative smart zone. These aren't verbose Markdown specs you have to search with RAG or grep: you could talk to your whole architecture.



The book
When Code Is Cheap: A field guide to agentic engineering, from domain models to verified behaviour. Everything on this page, the long version. Coming soon. The articles behind it are free today.