Software Design in the Age of AI¶
Chapter Info
Calculating...
!!We are living through a unique historical period with no equivalent in the history of humanity. Historically, changes have been gradual, with one generation resembling the next. However, we are now in a time of disruption, where changes are sudden and profound.!! This era is both daunting and exciting, as it challenges us to adapt and innovate in ways we have never experienced before.
!!The LLM revolution is reshaping software at every layer of its existence.!! Applications, the user interface, the developer's role, the structure of the engineering organization, and the underlying business model are all being redefined at once. !!Unlike previous shifts—such as the move from low-level to high-level languages or from on-premise to cloud—this change does not only improve how we build software; it changes what software is, who builds it, and how companies are organized around it.!!
The LLM Revolution: A New Era¶
Something Just Broke¶
!!For forty years, software was the only contract between humans and machines: humans had to fit the software — its forms, menus, commands, APIs — and the machine executed exactly what it was told.!! Every interaction was pre-programmed. Every behavior was deterministic. The application was rigid; the human adapted. !!That contract is being torn up. Machines have learned ours. They now read intent in natural language, reason about goals, and compose actions across services without anyone writing the path in advance.!!
The Shift Is Already Underway¶
AI started as a simple assistant: developers could ask questions, get explanations, and request small pieces of code. Then it became a coding partner, helping write and modify entire applications. Today, developers increasingly direct autonomous agents that produce code for them. But where does this evolution end? Will developers become orchestrators of AI agents, or will those agents eventually replace them?
2022: The Moment AI Became Accessible to Everyone¶
!!In 2022, ChatGPT made general-purpose AI accessible to the general public.!! For the first time, millions of people could use a powerful, non-specialized AI system directly through a simple language interface: the prompt. No code, no setup, just a conversation. ChatGPT did not create the AI revolution from nothing. !!It transformed years of technical progress into something people could use directly.!!
The Acceleration Has Just Begun¶
AI capabilities are advancing at an extraordinary pace. Each new generation of models can tackle problems that seemed out of reach only months earlier. What began with answering questions has evolved into reasoning, coding, using tools, and executing complex tasks autonomously. The boundaries of what AI can accomplish keep moving, and the time between major breakthroughs keeps shrinking.
From One Model, Knowledge for All¶
!!For decades, AI was specialized and locked behind expertise — one model for images, another for translation, another for fraud, each trained for one task and accessible only to a few teams. ChatGPT collapsed all of that into a single conversational interface.!! One model, asked in natural language, can write code, explain medicine, draft contracts, analyze data, or reason across domains. Specialization gave way to general-purpose intelligence — and the gate that kept knowledge behind training, credentials, or technical skill simply opened.
Predicting the Next Token¶
!!An LLM — a Large Language Model, also called a foundation model — is a mathematical function with billions of parameters. Given input text, it predicts the most likely next token: a word, a fragment, or a punctuation mark.!! The input is not only the last sentence, but the full context window: the conversation, attached documents, instructions, and examples. The model adds one token, then runs again. Token by token, the answer grows. !!Every behavior we will see next — understanding, reasoning, tool selection, and code generation — is built on this simple primitive.!!
From Prediction to Understanding, Reasoning, and Tool Selection¶
!!Prediction becomes useful because the model compresses patterns across billions of examples. It does not understand like a human, but it can predict what an understanding answer should look like.!! The same mechanism makes reasoning possible. !!Once it can understand intent and decompose a task, it can also select tools: search, APIs, databases, code execution, or workflows. That is the foundation of agents — a model that can reason and choose what action should happen next.!!
How Prediction Becomes an AI Coding Agent¶
!!The foundation model is also trained on code — large amounts of existing programs, documentation, APIs, error messages, configuration files, and development patterns. Next-token prediction therefore learns not only how people write sentences, but also how developers write programs.!! It has seen enough examples of functions, classes, tests, infrastructure definitions, and common software structures to predict what a useful implementation should look like. !!Wrapped into an AI coding agent — Claude Code, Cursor, GitHub Copilot — with the right tools, context, and harness, the same general-purpose model becomes a source of implementation.!!
AI Does Not Change the Engineering Foundations¶
The Surface Changes, The Foundations Remain¶
This chapter explores how deeply the AI revolution is reshaping software development. !!The visible shape of software is changing fast, but the engineering foundations underneath remain the same.!! How we architect distributed systems, model data, decouple components, secure them, observe them, test them, and operate them — none of this is a legacy concern. !!These are the invariants of good software, and they hold whether a human or an agent writes the code.!!
Fix What Is Broken Before Adding AI¶
!!AI compresses time and multiplies output. When the foundations are solid, it creates leverage, shortens cycles, and turns disciplined engineering into a competitive edge. When they are broken, it spreads the breakage at the same speed — faster incidents, wider blast radius, more damage per hour.!! A company cannot build a serious AI strategy on top of broken engineering systems.
Use AI to Repair the Foundations¶
!!The good news is that AI can help fix the foundations faster.!! It can generate missing tests, turn manual runbooks into scripts, convert console operations into code, document hidden workflows, expose internal tools as APIs, and refactor duplicated logic behind cleaner abstractions. AI does not remove the need for engineering discipline. It makes that discipline cheaper to apply.
The End of Applications¶
For forty years, the application was the only contract between humans and machines — a static product, with fixed screens, fixed workflows, and a fixed path the user had to follow. The LLM revolution breaks that. !!Once a model can understand intent, reason, call tools, and write code, the machine no longer needs a rigid surface to be reached through. It can build, on the fly, a dynamic system — an agent — that translates each user's intention into action.!!
The Application as a Static Container¶
!!An application is a static container: a fixed name, a fixed brand, fixed screens, fixed workflows — all wrapped around a set of capabilities defined, developed, and deployed together as one artifact.!! Booking a trip means searching, reserving, paying, notifying — many capabilities frozen into a single surface, and switching between apps is the user's job. !!That container exists for two reasons: users need a stable surface to learn and trust, and machines cannot understand what people want. Both reasons are disappearing.!!
Most Applications Will Disappear¶
If the user is the new center, the screen is no longer the meeting point. !!Most applications — the billions of screens, forms, menus, and navigation flows designed over decades — were workarounds for a single limitation: machines could not read intent. That limitation is gone. The prompt, written or spoken, becomes the primary interface.!!
The UI Becomes an Agent Capability¶
The UI does not disappear; it becomes a capability the agent can invoke when needed. The agent decides how best to communicate with the user: sometimes a simple text response is enough; other times, a table, chart, or interactive visualization makes complex information easier to understand. Instead of forcing users through fixed screens, the agent generates the right interface for the moment. The UI becomes a means of communication, not the destination.
Customer-Centric by Design¶
For decades, companies designed user journeys around their own business interests. Airlines, for example, guide customers through upgrades, insurance offers, and additional services before completing a booking. AI agents reverse this relationship. Acting on behalf of the customer, they can compare providers, bypass unnecessary steps, and select what best matches the user’s needs. Brands and trust will still matter, but the experience is no longer controlled by the seller. For the first time, customer-centric becomes more than a marketing promise.
The Death of the Brand Surface¶
When users no longer open applications, they no longer experience the carefully designed interfaces, navigation flows, and visual identities that companies have invested billions in creating. The entire brand experience — from how products are presented to how customers interact with them — becomes invisible. The agent becomes the primary interface, replacing the experience designed by the provider with one built around the user’s needs.
The End of Proprietary Software?¶
For decades, proprietary software companies had a major advantage: the resources to employ hundreds of engineers and spend years building complex applications. AI is eroding that advantage. Open-source communities can now develop, improve, and maintain sophisticated software at a fraction of the traditional cost. From 3D modeling to graphic design and engineering tools, free alternatives may increasingly rival expensive commercial products. Proprietary companies will benefit from AI too, but their ability to finance large development teams may no longer be the competitive advantage it once was.
From Applications to Agent-Orchestrated Capabilities¶
!!The end of applications does not mean the end of their functionality. What disappears is the application as the primary user interface.!! The underlying systems continue to provide business capabilities — search, payment, booking, identity, messaging, and data access — exposed through APIs and protocols such as MCP. Instead of navigating multiple applications, users express their intent to an agent, which invokes and combines these capabilities to accomplish their goals.
Anatomy of an Agent¶
!!The agent is the new runtime of software.!! This section opens it up: what makes it work, how it turns intent into action, and what makes one reliable enough to run in production.
The Limitation of a Raw LLM¶
!!A raw LLM is a language and reasoning engine. It can understand natural language, infer human intent, analyze a situation, and decide what should happen next — but without an orchestration layer around it, it remains limited to advice. It can tell the user, "you should use this SQL query," without running the query itself.!! It can say, "you should send a notification," without sending one. !!It is also stateless by default: at every interaction, the user has to remind it of the important context already shared before.!!
What Is an Agent¶
An agent receives the user's intent and passes it to an LLM. The LLM interprets that intent and decomposes the problem into steps. The agent then becomes the orchestrator: for each step, it calls the LLM again and asks how that step should be achieved. The LLM explains the next action in natural language — retrieve this data, call this API, run this query, send this message. The agent takes that instruction, maps it to an executable tool or capability, runs it, and returns the result to the LLM as new context.
Two Patterns: Loops and Workflows¶
!!Agents usually take one of two shapes. Loop-based agents are fully autonomous: they observe, reason, act, evaluate, and replan continuously.!! They can change strategy mid-task, retry failures, and adapt when the environment shifts. !!Maximum flexibility — minimum predictability. Workflow-based agents are the opposite: their path is defined in advance by engineers.!! They are more predictable, but individual steps can still use an LLM to perform specific tasks, such as translation, summarization, classification, or information extraction.
The Demo-to-Production Gap¶
!!Creating an agent is easy today: a prompt, a few tools, and a convincing demo appears quickly. The hard part begins when the demo has to become a system people depend on.!! In a demo, the path is narrow, the context is controlled, and mistakes are tolerated. In production, the agent meets messy inputs, partial data, slow tools, permission boundaries, and users who expect repeatable results.
Reliability Comes From Orchestration, Not the Model¶
!!Reliability is not built inside the model — it is built around it.!! Predictability comes from what surrounds the LLM: business context, tool contracts, permissions, validation gates, scoped memory, governance, observability, and clear accountability. The model stays creative; the system around it stays controllable.
From Agent to Expert¶
Reliability is only the first threshold. !!A reliable agent can run without breaking the workflow. An expert agent is different: it can be trusted with judgment inside a specific domain.!! It has seen enough real cases, handled enough edge cases, and built enough evidence over time that the organization treats it less like a tool and more like a specialist. !!That promotion — from runnable agent to trusted domain expert — is the real shift this section is about.!!
What Is an Expert?¶
An expert is not an agent with a larger model or more training data. !!It is an agent that has proven competence in a specific domain.!! Expertise means consistent judgment, strong domain understanding, and a measurable record of handling real scenarios with less supervision.
Earning Expert Status¶
Not every agent becomes an expert. !!Expert status must be earned through evidence: accuracy above a defined threshold, reliable handling of edge cases, low production error rates, and positive human review.!! A few successful runs are not enough — promotion requires volume, consistency, and statistical confidence across real tasks.
Every Expert Has an Owner¶
An expert does not operate in isolation. !!Every expert has a human owner — someone accountable for its learning trajectory, quality standards, and domain accuracy.!! The owner coaches the expert over time, refines its judgment, corrects its errors, and approves new capabilities before they go live.
Experts Learn from Feedback¶
Beyond human coaching, an expert improves through feedback — not by retraining its model, but by updating what surrounds it: memory, rules, prompts, examples, evals, routing. It observes the outcomes of its own decisions, detects when its predictions diverge from reality, and adjusts based on production telemetry, corrections, and patterns across thousands of similar tasks.
The End of Developers¶
!!If applications die and agents take their place, the next obvious question is: who builds them, and who builds the capabilities they call? For forty years the answer was developers — humans typing code line by line.!! That answer is changing fast. !!The role is not disappearing, but the work that defined it is.!!
The Developer Is Dead¶
In most companies, this is already a reality. !!Developers no longer write code — they use AI to generate code based on their specifications.!! Tools like Cursor and Claude Code don't just autocomplete; they reason over project context, propose multi-file changes, and produce substantial implementation from intent.
Long Live Engineers¶
!!The developer is dead, but the engineer is more essential than ever. Writing code was never the hard part — understanding the problem was.!! Engineers supervise, make high-level decisions, define constraints, and validate that generated output aligns with business reality.
The New Rhythm of Engineering¶
The day-to-day rhythm of the job has flipped. !!The old loop was think, type, compile, debug — most hours spent typing. The new loop is intent, prompt, review, refine — most hours spent reading what was generated and deciding whether to accept, reject, or steer. Sessions are shorter, iteration is faster, and the bottleneck moves from how fast you can write to how fast you can judge.!!
Context Switching: The New Engineering Skill¶
!!As AI makes engineers more productive, management expectations rise accordingly. Engineers are expected to deliver more features, handle more projects, and move faster than ever.!! They now orchestrate multiple agents working in parallel, constantly switching contexts to review results, resolve blockers, and redirect work. Managing this parallel activity becomes a new engineering skill. !!But the old problem remains: under pressure to deliver, engineers make compromises, rush reviews, and accept generated code they have not fully understood. AI accelerates development, but it does not eliminate the trade-off between speed and quality.!!
Engineers Build Capabilities, Not Screens¶
As traditional UIs fade into the background, what engineers build changes too. !!The focus shifts from designing screens and user flows to creating APIs, MCP extensions, services, and capabilities that agents and other systems can consume.!! Engineers — with the help of AI — continue to build the functional backbone: business logic, data pipelines, integrations, security controls, and infrastructure.
The AI-Native Software Development Lifecycle¶
AI does not remove the software development lifecycle. It changes how every stage is performed. Requirements become more explicit, design becomes more exploratory, implementation becomes generated, testing becomes continuous, review becomes more important, and operations feed directly back into development. !!The lifecycle remains — but the balance of work inside it shifts.!!
Requirements Become the Starting Point¶
!!When implementation becomes cheap, unclear requirements become expensive.!! The quality of the result increasingly depends on how clearly the problem, constraints, expected behavior, and acceptance criteria are expressed. !!Engineers spend less time translating requirements into code and more time making sure the requirements themselves are precise enough for an agent to act on.!!
Let the Agent Clarify What I Want and Need¶
Most of us do not fully know what we want until someone asks. !!Let the agent clarify what you want and what you need: tell it that its job right now is not to build the thing, but to help you get clear.!! This inverts the control structure — the agent asks, the human answers, and generation starts only once the intent is sharp.
From Intuition to Rational Design¶
Before AI, exploring architectural alternatives required significant expertise, experience, time, and a structured methodology. As a result, engineers often relied on familiar solutions and intuition rather than systematically comparing multiple approaches. AI makes it easier to examine multiple solutions, compare their trade-offs, challenge assumptions, and eliminate weaker options. !!Design becomes a more rational decision process, where choices are based on systematic comparison rather than intuition alone.!! Human judgment remains essential to make the final decision.
Implementation Becomes Generation¶
Implementation is no longer the developer’s primary responsibility. !!Coding agents now generate the code, turning requirements and architectural decisions into working software.!! Engineers no longer need to write the implementation themselves. Their responsibility shifts to providing context, defining constraints, guiding the agent, and validating that the generated code meets the intended design.
Keep Tests Aligned with Requirements¶
AI can generate both implementation and tests, but both may reflect the same misunderstanding of the requirements. !!Requirements must therefore be explicit, reviewed, and used as the source of truth for both code generation and test validation.!! Tests should verify the expected behavior defined in those requirements, not simply confirm what the generated code does. This prevents a shared misunderstanding from producing software that passes every test but still fails to meet its intended purpose.
AI-Driven Deployment Decisions¶
AI agents can take over deployment decisions that previously required human judgment. They can analyze infrastructure changes, review Terraform plans, assess potential risks, and determine whether a deployment can safely proceed. !!Routine decisions can be handled automatically, while high-risk changes are escalated for human approval.!! AI extends deployment automation beyond execution to decision-making, reducing manual intervention while maintaining control.
The Lifecycle Becomes a Continuous Loop¶
The software development lifecycle no longer ends with deployment. Production logs, traces, incidents, user behavior, and performance provide continuous feedback that AI agents can analyze and turn into improvements. A failure can trigger an investigation, a proposed fix, new tests, and another deployment. The lifecycle becomes a continuous loop: intent → design → generate → validate → deploy → observe → improve. AI dramatically shortens the time between these stages, while humans remain responsible for defining what to build and deciding what is acceptable.
Keeping the Code Under Control¶
AI-generated code is growing at an unprecedented rate, creating a new risk for software organizations: a tsunami of technical debt. Millions of lines of code can be produced in hours, introducing unnecessary complexity, duplicated functionality, inconsistent architectures, and dependencies that become increasingly difficult to understand and maintain. Without effective control, organizations risk losing control of their own software. How can we prevent AI-generated code from turning enterprise software into unmanageable chaos?
Humans Cannot Review Everything AI Generates¶
We must face a fundamental reality: AI can generate code far faster than humans can read, understand, and review it. As AI coding agents become more capable and operate in parallel, this gap will only widen. Expecting engineers to manually review every line of generated code is neither realistic nor sustainable. Human code review alone can no longer be the foundation of software quality and control. Organizations must rethink how they maintain control over the software they produce.
Build a Strong Internal Developer Platform¶
A strong internal developer platform is the first line of defense against the uncontrolled growth of AI-generated code. It provides standardized, reusable capabilities for infrastructure, deployment, security, observability, communication, and data access. Instead of each team or AI agent building its own solutions, the platform provides a common foundation for the entire organization. The more responsibilities the platform absorbs, the less code needs to be generated, reviewed, and maintained.
Prevent Developers from Writing Anything but Business Logic¶
A platform is effective only when its use is enforced. Developers and AI agents must write business logic, not recreate shared technical capabilities inside individual services. If a capability is missing, they must contribute it to the platform for everyone to reuse. Specialized AI review agents can detect duplicated functionality or code placed at the wrong architectural level and block merges until it is moved to the platform. The question is no longer just whether the code is correct, but whether it belongs there.
Specifications Are the Source of Truth, Code Is Disposable¶
In AI-driven development, specifications must become the source of truth, while generated code becomes a disposable artifact. Functional requirements, API contracts, data schemas, architectural constraints, and acceptance criteria define what the software must do and how it must behave. Code is simply one possible implementation of these specifications. When an implementation becomes too complex, inconsistent, or difficult to maintain, the solution is not necessarily to patch it endlessly, but to refine the specifications and regenerate it. We preserve the intent, not the implementation.
Separate What from How, and Make the What the Source of Truth¶
Separating what software must do from how it is implemented should become a fundamental principle across the entire software development lifecycle. Higher-level abstractions, such as domain-specific languages (DSLs), declarative models, contracts, and policies, should capture intent across business logic, testing, infrastructure, and configuration. These abstractions become the source of truth, allowing implementations to be regenerated, refactored, or replaced without losing the original intent.
Measure Code Waste and Complexity¶
Code coverage measures how much code is exercised by tests, but not whether that code is necessary or unnecessarily complex. CI should go further, using specialized AI agents to continuously identify dead code, unused functionality, redundant dependencies, duplicated logic, and opportunities for simplification. Production usage data can help distinguish code that is genuinely unused from code that is rarely executed but still essential. The goal is not only to validate new code, but to continuously reduce unnecessary code and complexity before they accumulate into technical debt.














































