Before the First Line of Code:
Forces 01–02

Chapter 9 of 18 Practitioner · 9 min

The most expensive mistakes in software are not made during development. They are made before development starts – in how requirements are written, and in how the domain is modelled. In 2026, two structural forces are reshaping both of these phases. Neither is optional when AI agents are in the build chain.

// the crux

The most expensive mistakes are made before the first line of code. AI gives a requirement three readers – the user, the agent, and the reviewer – and turns the domain model into the language of delegation. Domain-Driven Design stops being optional.

// in one breath
  • Why a single requirement now has to land for three different readers at once – the user, the agent, the reviewer – and what breaks when it lands for only one.
  • How Domain-Driven Design quietly became an AI skill: the bounded context is where you fence in an agent.
  • A pre-sprint checklist and a five-step EventStorming shortcut for making a domain agent-ready.

This article covers Forces 01 and 02 from the eight structural forces reshaping software development. These are the forces that operate upstream of everything: they determine the quality ceiling for everything AI builds downstream. Get them right, and AI amplifies precision. Get them wrong, and AI amplifies the wrong thing faster.

// Companion overview
All 8 Forces Reshaping How Software Gets Built – reference card for the full landscape. Chapters 9–12 go deep on each force pair.
force 01
Force 01 / 08 Requirements & Discovery

Three-Stakeholder Analysis: Users, Agents & Reviewers

Every requirement now serves three distinct audiences – the humans who will use the feature, the AI agents who will build it, and the reviewers who will validate quality and compliance. Writing for one is no longer enough.

Requirement errors are the costly ones. A misunderstanding gets written into the spec, survives the entire development cycle, and reaches production – all because the specification was written for one reader and interpreted by another. This problem existed long before AI. AI just makes it far more expensive.

When a human developer misreads a spec, they usually notice. They ask a clarifying question, they run it by a colleague, they realise during implementation that something is off. When an AI agent misreads a spec, it implements the misreading with complete confidence, generates tests that validate the misreading, and produces clean code that does the wrong thing coherently. The error is harder to detect because it looks right.

// The upstream quality law
The upstream quality of your analysis is the ceiling of your AI-generated implementation quality. You cannot write a vague spec, hand it to an agent, and review your way to a precise outcome. The precision must exist at the input.

Writing for Three Readers

A requirement that serves three audiences is not three times the work. It is one discovery conversation that produces three artifacts. The discipline is in knowing what each reader actually needs:

Reader 01 · End User
The User Story
Needs: clarity of outcome
What the user wants to accomplish, why it matters, and what "done" looks like from their perspective. Written in plain language. Focused on the outcome, not the implementation.
Format: As a [user], I want [action] so that [outcome] · Acceptance: [criteria in user language]
Reader 02 · AI Agent
The Agent Spec
Needs: unambiguous precision
Explicit inputs and outputs. Bounded context with clear scope. Edge cases enumerated. Acceptance criteria machine-parseable. No assumptions. No implicit context that only a human would infer.
Format: Input schema · Output contract · Edge cases · Failure modes · Bounded context ID
Reader 03 · Human Reviewer
The Review Checklist
Needs: traceability
Compliance checkpoints. Security considerations. Performance expectations. Audit trail from requirement to implementation to test. What a reviewer needs to approve this feature with confidence.
Format: Compliance items · Security checklist · Performance SLA · Reviewable evidence per gate

The three-audience approach surfaces something valuable beyond the artifacts themselves: it exposes conflicting assumptions before design starts. When you try to write the agent spec, you discover that the user story was ambiguous. When you write the reviewer checklist, you discover that a compliance requirement contradicts the user story. These conflicts exist regardless – the three-audience process just finds them in a planning session rather than in a post-production incident.

↳ industry alignment · AWS AI-DLC – its Inception phase produces the same artifacts through a team ritual it calls Mob Elaboration: AI drafts the stories, the whole team validates.

What AI Can Do at This Phase – and What It Cannot

In 2026, AI can generate all three artifacts from a single discovery session. Given a recording or transcript of a stakeholder meeting, a well-prompted model (Claude Sonnet, Gemini 2.5) will produce a draft user story, a structured agent spec, and a reviewer checklist in minutes. It will also surface gaps – places where the discovery conversation did not produce enough information for a complete spec.

What AI cannot do is attend the meeting. It cannot ask the follow-up question when a stakeholder's answer is contradicted by their body language. It cannot notice that the product owner and the engineer have a different mental model of the same feature. The discovery conversation itself is the part that requires human judgment – and it is the part that determines the quality of everything that follows.

force 02
Force 02 / 08 Architecture & Domain Design

DDD as the Language of AI Delegation

Domain-Driven Design has quietly become the most critical AI engineering skill – not philosophically, but practically. Bounded contexts are the natural unit of AI agent assignment, and ambiguous domains produce ambiguous AI output at architectural speed.

In Chapter 5, we established that an agent's bounded context is its scope boundary – the definition of what it is allowed to touch, what it must not touch, and what constitutes success within that scope. The question that article did not fully answer is: how do you define those bounded contexts for a real production system?

The answer is Domain-Driven Design. Not as a philosophy – as a practical method for producing the input that makes agent-based development reliable.

// What I have seen in teams using agents in production
In the teams I have worked with, clear DDD models cut AI code review by half or more – sometimes closer to two-thirds. Teams without domain models find AI accelerates the creation of a Big Ball of Mud. DDD precision is prompt engineering at the architectural level.

The DDD Concepts That Now Do Double Duty

Each core DDD concept maps directly to an agent requirement. This is not a metaphor – these are the exact properties an agent needs to operate reliably within a production system:

DDD concept What it gives the agent
Bounded Context
The agent's scope boundary – exactly what it can and cannot touch. The most important input. Without this, the agent will drift across domain boundaries and produce coherent-looking code that violates architectural constraints.
Ubiquitous Language
The vocabulary for your prompts. When you use the domain's exact terms consistently – Order, Shipment, Fulfilment – the agent maps to the correct concepts. When you use casual synonyms, the agent guesses, and it sometimes guesses wrong across the same session.
Aggregate
The unit an agent can operate on without touching adjacent aggregates. An agent told to "update the Order aggregate" knows its boundary. An agent told to "update the order and make sure shipping is notified" is crossing context boundaries and making coordination decisions it should not make.
Domain Events
The contracts between agent-generated services. When a bounded context emits an event (OrderPlaced, ShipmentDispatched), other agents subscribing to that event have a stable contract. Without domain events, inter-service coordination becomes implicit coupling – the worst kind.
Context Map
The document that prevents agents from reinventing integration logic. When an agent needs to interact with an upstream context, the context map tells it how: upstream/downstream relationship, anti-corruption layer if needed, shared kernel or separate ways. Without this, agents guess at integration patterns.
↳ industry alignment · AWS AI-DLC – embeds DDD into its Construction phase by design: domain models are AI-proposed and human-validated, not an afterthought.

EventStorming: The Fastest Path to Agent-Ready Contexts

You do not need a perfect DDD model to get started. You need enough structure to give agents unambiguous scope. EventStorming is the fastest method for a team that has not done DDD before – and for teams that have, it is a useful reset when AI is being introduced to an existing codebase.

// EventStorming in 5 steps – enough for agent-ready contexts
01
Map domain events on a timeline (orange stickies). What happens in this system? OrderPlaced, PaymentReceived, ShipmentDispatched. Write events, not functions.
02
Identify commands – what triggers each event? Commands come from users, systems, or time. This reveals where user intent enters the system.
03
Cluster events around aggregates. Which events belong together? The cluster boundary is your bounded context candidate.
04
Name each context using domain language – not technical names. "Order Management" not "OrderService". The name becomes the ubiquitous language anchor.
05
Draw the context map – which contexts communicate, how, and in which direction? This is your agent coordination blueprint.

A two-hour EventStorming session with the right people – domain experts, not just engineers – will produce enough structure for an agent to operate reliably within one context. That is all you need to start. You do not need the full map before you begin. You need the map for the context you are working in next sprint.

Writing the Design Down: The Standards an Agent Can Read

EventStorming gives you the model. The next question is where the model lives. A design that exists in stickies and heads scopes nobody, human or machine, and this is where the classic documentation standards earn a second career. A documented standard does for the design phase what the user story template does for analysis: it defines the deliverable, in a form the model has already read many thousands of times in training.

Design standard What it gives the agent
arc42
The document template: twelve sections from constraints and context to decisions and risks, each with a defined purpose. An agent can draft a section and a reviewer can grade a section, because the template says what belongs in it. The closest thing architecture documentation has to an acceptance criteria format, and a de facto standard across the German-speaking industry.
C4 model
Structure at four zoom levels: system context, containers, components, code. It solves the altitude problem in design conversations with an agent. Name the level a change request lives at, and the agent knows how much of the system is in scope.
UML
Precision where prose is too loose. Sequence diagrams pin down interaction order; state machines pin down lifecycle rules. Both are structured enough for an agent to generate from code or generate code from, and both surface the edge cases a prose description hides.
OOAD
The discipline underneath all of the above: identify the objects, their responsibilities, and their collaborations. Half a century of object-oriented analysis and design literature sits in every model's training corpus. A team that speaks it precisely gets more precise output for free.

None of these standards solves the design problem for you. They define what a finished design looks like, which is the one thing an agent cannot infer from intent alone. That is the pattern Chapter 6 closes on: scoped, not constrained. The bounded context tells the agent where it may work; arc42, C4, and UML tell it what the work is supposed to leave behind.

Red Flags: When a Domain Is Not Ready for Agents

// Domain not agent-ready if any of these are true
  • The team uses different names for the same concept across different files or conversations – the ubiquitous language does not exist.
  • Changing one service requires changes in three other services as a matter of routine – bounded contexts are not bounded.
  • Nobody can draw the context map in 10 minutes – the domain model exists only in individual engineers' heads.
  • The word "everything" appears in feature descriptions – "update everything for the new pricing rule" is not an agent-ready task.
  • There are no domain events – services communicate via direct database reads or synchronous REST calls with no published contracts.

None of these red flags are unfixable. They are signals that the DDD work needs to happen before agent deployment – not alongside it. Agents introduced into an ambiguous domain do not clarify it. They encode the ambiguity into generated code that is harder to refactor than hand-written code, because it is more consistent-looking and more of it exists.

the connection

Why These Two Forces Are Inseparable

Forces 01 and 02 look like separate concerns – one is about writing requirements, the other is about modelling the domain. In practice, they are the same conversation at different levels of zoom.

A good domain model is the context that makes requirements precise. When you know the bounded context, the ubiquitous language, and the aggregates, you can write the agent spec unambiguously – because you know exactly which aggregate you are operating on, which events you are emitting, and which boundaries you must not cross.

And the reverse is equally true: writing requirements for three audiences reveals domain model gaps. When you try to write the agent spec and discover you cannot define the bounded context clearly, that is the domain model telling you something. The requirement work and the domain design are a feedback loop, not a waterfall.

// Pre-sprint checklist
Before any sprint involving AI agents
User story written Force 01
Outcome-focused, in user language, with acceptance criteria the user would recognise.
Agent spec written Force 01
Explicit input schema, output contract, edge cases, failure modes. No implicit assumptions. Machine-parseable acceptance criteria.
Reviewer checklist written Force 01
Compliance, security, and performance checkpoints. Reviewable evidence per gate.
Bounded context identified Force 02
Named using domain language. Clear in and out of scope. Cross-context interaction documented.
Ubiquitous language confirmed Force 02
The terms in the spec match the terms in the codebase and the terms the domain expert uses. No synonyms, no approximations.
Domain events and aggregate scope defined Force 02
What aggregate does this task operate on? What domain events does it emit? What events must it not trigger inadvertently?
// try it – a 20-minute lab
Write One Requirement for Three Readers
  1. Pick one real feature request from your current backlog.
  2. Write the user story: the outcome, in plain language, three sentences maximum.
  3. Write the agent spec: explicit inputs, outputs, two edge cases, and the bounded context the agent must not leave.
  4. Write the reviewer checklist: three checks – one compliance, one security, one performance.
  5. Hand the agent spec to Claude or Copilot, then score the output against your own checklist.
// what you'll learn: where your requirement was ambiguous – the agent will show you within minutes, for free, before a sprint pays for it.
Two forces, one principle: the quality of what you build is determined by the clarity of the structure you build within. A requirement that lands for three readers, and a domain modelled tightly enough that an agent cannot wander outside it.
// carry forward

The next two forces move from how software is planned to how it is built and where its data lives. Forces 03 and 04: AI-augmented development across the full stack, and what changes when both the developer and the database have an AI layer. That is Chapter 10.

// tool references last reviewed · 2026