Skip to main content

AI-Assisted Architecture

AI-assisted architecture is the practice of designing and governing architecture with AI capabilities, and of adapting the architect's role to AI-native ways of working, where most, if not all, code, tests and documentation is produced by AI agents, with engineers directing and reviewing their work.

It has two sides:

  • AI as a tool for architects: analyzing existing systems, drafting designs and decision records, generating diagrams from code, reviewing proposals against standards, and answering questions about the landscape.
  • Architecture as input for AI: making sure that the AI agents that write code know about the organization's systems, standards and building blocks, and use them.

The second side changes the architect's role the most.

Documentation was rarely read​

Before AI, architectural artifacts such as diagrams, documents and written standards had a well-known problem: they were rarely read or referenced. A team starting a new service did not usually read the integration guidelines or the logging standard first. They copied an existing project, followed what their colleagues did, and asked an architect when something was unclear.

Standards became effective mainly when they were embedded and enforced, not when they were written:

  • implemented as platform capabilities, so that following the standard was the easiest path (see platform mindset)
  • enforced by guardrails, such as cloud policies, admission controllers or pipeline checks
  • checked by code standards and tests, such as linters, architecture tests and fitness functions

Documentation still had value for onboarding and for explaining why. But the gap between what was written and what was built was closed by platforms and automation, not by reading.

Documentation becomes the specification​

With large language models (LLMs), this changes. AI coding agents read documentation directly, every time they work on a task. Written context, such as project instructions, specifications, decision records, API definitions and standards, becomes direct input to the code the AI creates. It is part of the specification.

This has several consequences for architects:

  • Documentation has a new, very diligent reader. An agent reads the relevant guidelines every time. A clear, current standard is followed far more consistently than before. An outdated or vague one is followed just as consistently, and spreads its mistakes at the speed of AI.
  • Precision matters more than prose. Agents work best with documentation that is specific, structured and unambiguous: explicit rules, examples, identifiers, links to the right building blocks. A page that says "use the standard logging approach" helps nobody. A page that names the library, the format and the required fields does.
  • Machine-readable formats gain value. Catalog entries, OpenAPI and AsyncAPI definitions, decision records with a clear status, and metamodels with stable IDs can be queried by agents, not just read.
  • Enforcement still matters. LLMs can misunderstand context, skip it or invent details. Guardrails, tests and policy checks remain the safety net. They also become the feedback loop for agents: a failing test or a rejected policy tells the agent what to fix, in seconds.
  • The architect writes for two audiences. Humans need the reasoning and the trade-offs. Agents need the rules, the structure and the pointers to building blocks. Good documentation serves both.

AI in architecture governance​

AI also changes how architecture is governed:

  • Design reviews: an agent checks a proposed design or pull request against standards, decision records and the target architecture before a human review, so human reviewers can focus on trade-offs.
  • Drift detection: agents compare what is documented (catalog, diagrams, decisions) with what is in the code and the cloud, and propose corrections to either.
  • Living diagrams: diagrams generated from code and the catalog instead of drawn by hand, so they stay current.
  • Answering questions: "Which system is the source of truth for customer addresses?" can be answered by an assistant with access to the architecture repository, without waiting for an architect.

On this page​

AI-assisted development works best when it does not start from an empty page, and when it follows a shared way of working:

  1. AI PDLC: the Software Factory: a defined process for building, changing and decommissioning software, with standard artifacts, specialized agents and contextual policies, all drawn from architectural materials.
  2. The architecture repository as context: the architecture repository becomes the crucial context for an AI-assisted product development lifecycle (PDLC). It tells agents what exists, who owns it, which standards apply and which decisions were made.
  3. Platform capabilities as building blocks: platform capabilities provide well-structured foundations, so that AI-assisted development builds on reliable, tested and well-supported building blocks instead of generating everything from scratch.

AI PDLC: The Software Factory​

Giving every engineer an AI coding assistant does not, on its own, change how an organization builds software. Each person uses it differently, with different prompts and different context, and the results are as inconsistent as before, only faster.

The real step change comes when architectural materials (the processes, artifacts, standards, decisions and building blocks) are built into the way software is produced. The AI-assisted product development lifecycle (AI PDLC) is often described as a Software Factory:

  • a defined process, with clear steps for each kind of work
  • standard artifacts that each step produces and consumes
  • specialized agents that do well-defined tasks within that process
  • policies and building blocks that apply to each task, taken from the architecture repository
  • quality gates where humans review, decide and approve

The factory metaphor is not about removing people. It is about making the path from idea to production repeatable and predictable, so that people spend their time on decisions and judgment, and agents do the well-defined work in between.

note

A Software Factory is as much about ways of working as about tools. The engineering organization must agree on the process and the artifacts, and actually use them. Agents can only follow a process that exists and is written down.

Foundation 1: Define the process​

The first foundation is to define, step by step, what happens when the organization changes its software. There are three basic types of work, and each needs its own flow.

Type of workTypical triggerKey questions
Build something newNew product, new capability, new building blockDo we really need something new, or can we reuse what exists? Where does it fit in the landscape?
Modify something existingNew feature, change in requirements, technical improvementWhich systems are affected? Which contracts change? Who are the consumers?
Decommission old softwareReplacement, consolidation, end of lifeWho still depends on it? What happens to its data? What must be removed?

Building something new​

  1. Problem definition: what problem is solved, for whom, and how success is measured.
  2. Landscape analysis: which existing systems, data and capabilities are relevant. Is there something to reuse or extend instead? (This step alone prevents much duplication.)
  3. Solution design: components, integrations, data, non-functional requirements and the applicable standards.
  4. Decisions and contracts: record significant decisions as ADRs; define API and event contracts before implementation.
  5. Provisioning: create the repository and infrastructure from a golden path.
  6. Implementation and testing: code, tests and infrastructure built on platform building blocks.
  7. Release and registration: deploy, and make sure the catalog, documentation and runbooks are complete.

Modifying something existing​

Most work is modification. The flow is shorter, but the analysis focuses on impact:

  1. Understand the change and the affected systems, using the systems inventory and dependency data.
  2. Check existing decisions and contracts. Does the change conflict with an ADR? Does it break an API or event used by others?
  3. For significant changes, update the solution design and record new decisions.
  4. Implement, test, review and release. Update the catalog and documentation in the same change.

Decommissioning old software​

Decommissioning is the most neglected flow, and the one where a structured process helps most. Old systems are rarely switched off because nobody is sure what still depends on them.

  1. Identify dependencies: consumers of APIs and events, data flows, scheduled jobs, users. Combine catalog data with observed traffic from observability.
  2. Plan the migration: where each consumer moves, and in which order.
  3. Decide on data: migrate, archive or delete, according to retention and legal requirements.
  4. Mark as deprecated in the catalog, so no new consumers start using it.
  5. Remove traffic, code, infrastructure, credentials and access rights.
  6. Update the repository: lifecycle status Retired, decision record for the decommissioning, updated diagrams.

Foundation 2: Know the artifacts​

The second foundation is a clear set of artifacts: what each step produces, who or what consumes it, and where it lives. Artifacts are the interfaces between steps. They are what humans review, and what agents read as input for the next step.

ArtifactPurposeProduced in stepUsed by
Problem statement / product requirementsWhat and whyProblem definitionDesign, testing, review
Solution designHow: components, integrations, data, NFRs, applicable standardsSolution designDecisions, implementation, review
Architecture Decision Record (ADR)A significant decision, its context, the options considered, and the consequencesDecisionsFuture designs, reviews, agents
API and event contractsOpenAPI / AsyncAPI definitions agreed before implementationDecisions and contractsImplementation, consumers, tests
Threat modelSecurity risks and mitigations for the designSolution designSecurity review, implementation
Implementation planThe work broken into reviewable tasksBefore implementationCoding agents, developers
Code, tests, infrastructure codeThe implementationImplementationReview, pipeline
Catalog entryOwnership, system, lifecycle, dependenciesProvisioning, releaseEveryone, all agents
RunbookHow to operate and troubleshootReleaseOn-call engineers, operations agents
Decommissioning planDependencies, migration, data handling, removal stepsDecommissioningAffected teams, review

Each artifact type should have a template in the architecture repository: a fixed structure that people and agents fill in. A template makes artifacts comparable, easier to review, and easier for agents to read and produce.

templates/solution-design.md
# Solution Design: <title>

## Context
- Problem statement: <link>
- Affected systems: <system IDs from the catalog>
- Type of work: new | modification | decommissioning
- Component types: backend service | UI | mobile | infrastructure building block | data pipeline

## Proposed solution
<components, responsibilities, diagram>

## Integrations
<APIs and events used or changed, with links to contracts>

## Data
<data entities, source of truth, classification, retention>

## Non-functional requirements
<availability tier, performance, scalability, security>

## Applicable standards and policies
<list from the policy packs for the component types above>

## Decisions
<links to ADRs, new or existing>

## Open questions and risks

Foundation 3: Specialized agents​

With a defined process and artifact templates in place, agents can be specialized. Instead of one general assistant that does everything, the factory has agents with a narrow task, specific instructions, the right tools and the relevant policies, much like specialists on a team.

AgentTaskMain inputsOutput
Landscape analystFind affected systems, owners, dependencies and reuse candidatesProblem statement, catalogLandscape analysis
Solution designerDraft a solution design that follows standards and reuses existing capabilitiesProblem statement, analysis, standards, tech radarSolution design draft
Decision recorderDraft ADRs for significant decisions, check consistency with earlier ADRsSolution design, existing ADRsADR drafts
Security analystProduce a threat model and check the design against security policiesSolution design, security standardsThreat model, findings
ImplementerWrite code and tests using golden paths and building blocksDesign, contracts, implementation planCode, tests, infrastructure code
ReviewerCheck changes against the design, standards and ADRs before human reviewPull request, design, policiesReview comments
Decommissioning analystFind all dependencies and draft the removal planCatalog, observability dataDecommissioning plan

Each agent is defined once, in version control, and shared by all teams. Many tools support this directly, for example subagents and skills in Claude Code. An agent definition is a short instruction file:

.claude/agents/solution-designer.md
---
name: solution-designer
description: Drafts solution designs for new or changed functionality. Use after the problem statement and landscape analysis are ready.
tools: Read, Grep, Glob, mcp__architecture__find_system, mcp__architecture__search_apis, mcp__architecture__get_decisions, mcp__architecture__check_technology
---

You are a solution designer in our software factory.

1. Read the problem statement and the landscape analysis.
2. Determine the component types involved (backend service, UI, mobile app,
infrastructure building block, data pipeline) and load the matching policy
packs from `architecture/policies/`.
3. Prefer reusing and extending existing systems, APIs and events over
creating new ones. Justify every new component.
4. Use only technologies in the Adopt or Trial ring of the technology radar.
5. Fill in `templates/solution-design.md` completely. Link every system by its
catalog ID and every decision by its ADR number.
6. List open questions instead of guessing. The design is reviewed by an architect.

The agents are only as good as what they can draw on. The instructions stay short because the knowledge lives in the architecture repository: the catalog, the policies, the templates and the decisions.

Foundation 4: Contextual policies​

Which rules apply depends on what is being built. A UI component and an infrastructure building block share some rules (security basics, ownership, documentation), but most of their policies are different.

Component typeExamples of applicable policies
Infrastructure building blockTerraform module structure and versioning, secure defaults (encryption, private networking), tagging, cost limits, compatibility guarantees for consumers, upgrade documentation
Backend serviceAPI design guidelines, authentication and authorization, observability (golden signals, tracing), resilience (timeouts, retries), data ownership, event schemas
UI componentDesign system usage, accessibility (WCAG), browser support, performance budgets (Core Web Vitals), internationalization, real user monitoring
Mobile appPlatform guidelines (iOS, Android), offline behavior, secure storage, app store and release process, crash reporting, privacy and consent
Data pipelineData contracts, data quality checks, classification and lineage, retention, cost of storage and processing

The architecture repository organizes these rules as policy packs: one set of standards, guidelines and checks per component type, plus a common baseline for everything. The component type is already part of the catalog metamodel (for example spec.type: service, website or library), so selecting the right pack can be automatic.

Where possible, a policy exists in two forms: as guidance that agents and people read (with reasons and examples), and as an automated check that fails the build when the rule is broken. The guidance makes the first attempt better. The check makes sure nothing slips through.

Humans in the factory​

Agents produce drafts. People own decisions. Each process defines quality gates where a human reviews and approves, and the level of autonomy can follow the risk of the work:

RiskExampleHuman involvement
LowDependency update, small fix in one serviceAutomated checks; review of the pull request
MediumNew feature in an existing systemReview of the design summary and the code
HighNew system, new external integration, change to personal data handling, decommissioningArchitect review of the solution design and ADRs; security review; code review

Review effort moves "up the stack": instead of reading every generated line, people review designs, decisions and contracts, where their judgment has the most impact, and rely on guardrails for the details.

The architecture repository answers it all​

None of these foundations require a separate system. A well-structured architecture repository provides the answers and guidelines for every use case:

Factory needsArchitecture repository provides
What are the steps?Process definitions for new, modify and decommission
What do we produce?Artifact templates: solution design, ADR, threat model, decommissioning plan
What exists already?Systems, data, API and event inventories
What rules apply?Baseline policies and policy packs per component type
What do we build on?Golden paths and platform building blocks
Why is it this way?Decision records

Getting started​

  1. Write down the current process for new, modify and decommission, even if it is informal today. Agree on it with the engineering teams.
  2. Define templates for the key artifacts: solution design and ADR first.
  3. Group existing standards into policy packs by component type, and add a baseline for everything.
  4. Start with one or two specialized agents, for example the landscape analyst and the reviewer, where the benefit is fast and the risk is low.
  5. Expose the repository to agents through instruction files and tools (see architecture repository as context).
  6. Measure and improve: lead time from idea to production, rework after review, share of changes with complete artifacts, and policy findings per change. Every recurring finding is an opportunity to improve a template, a policy or a building block.

Architecture Repository as Context​

An AI coding agent is only as good as the context it works with. Given a task like "notify customers when their order ships", an agent without context will produce plausible code: a new email client, a new database table for addresses, maybe a new queue. It compiles and passes its own tests, and it duplicates three things the organization already has.

With the right context, the same agent finds that the CRM is the source of truth for customer contact data, that an OrderShipped event already exists, that the organization has a notification service, and that a decision record forbids sending email directly from product services. The result is a small change that fits the landscape.

That context is exactly what the architecture repository contains. In an AI-assisted product development lifecycle (PDLC), the architecture repository becomes crucial context: the shared map that humans and agents use to understand what exists and how to build on it.

tip

This is what is often called context engineering: deliberately choosing and structuring the information an AI model sees, so that it can do the task well. See Anthropic's article on effective context engineering for AI agents.

What the repository provides​

Repository elementWhat it gives the agentExample question it answers
MetamodelThe vocabulary and relationships of the landscape"What is the difference between a system and a component here?"
Systems inventoryWhat exists, who owns it, lifecycle status"Is there already a system for notifications? Is it deprecated?"
Data inventoryData entities and their sources of truth"Which system masters customer addresses?"
Integrations inventory, API and event definitions (OpenAPI, AsyncAPI)Contracts to reuse instead of inventing new ones"Is there an event when an order ships, and what does it contain?"
Technology radarAllowed and discouraged technologies"Which database should a new service use?"
Decision records (ADRs)Why things are the way they are, and what was rejected"Can services send email directly?"
Standards and reference architecturesRules and patterns to follow"How should this service log, authenticate and expose metrics?"
Golden paths and templatesThe supported way to build this kind of thing"How do I create a new event consumer?"

Context across the PDLC​

The repository is useful at every stage of the lifecycle, not only while writing code.

StageHow AI uses the repository
Discover and planFind affected systems, owners and dependencies for a new requirement; estimate impact
DesignDraft a design that reuses existing systems, APIs and events; check it against the target architecture and decision records; propose a new ADR where needed
Build and testGenerate code that uses approved technologies, existing contracts and platform building blocks; follow coding and security standards
ReviewCheck the change against standards and decisions before a human review; flag new dependencies or deviations
Deploy and operateUse ownership and dependency data for impact analysis during incidents; route findings to the right team

The flow also goes back: when an agent creates a new component, API or decision, the repository is updated as part of the same change, for example through the catalog-info.yaml created by a template.

How to deliver context to agents​

1. Instructions in the repository​

Coding agents read instruction files from the repository they work in, for example AGENTS.md (a convention supported by many tools) or CLAUDE.md for Claude Code. These files are the entry point: short, specific rules, and pointers to where the rest of the context lives.

AGENTS.md
# Order Service

Part of system `sys-order-mgmt`, owned by `team-checkout`.

## Architecture rules
- Customer contact data is mastered by the CRM (`sys-crm`). Never store
email addresses or phone numbers in this service; fetch them via `customer-api`.
- Send notifications only through the notification platform
(`notification-api`), never directly via SMTP. See ADR-042.
- New infrastructure must use the platform Terraform modules in `infra/`.
Do not create raw AWS resources.
- Publish domain events to Kafka using the schemas in `events/`.
Check the event catalog before creating a new event type.

## Where to find more
- System catalog and APIs: use the `architecture` MCP tools
- Decisions: docs/adr/
- Standards: https://architecture.example.com/standards

2. Tools that query the repository​

Instruction files cannot contain the whole landscape. For the rest, agents should be able to query the repository, for example through a server based on the Model Context Protocol (MCP), which exposes tools that agents can call:

ToolReturns
find_system(capability or keyword)Matching systems with owner, lifecycle and description
get_data_owner(entity)The system that masters a data entity
search_apis(keyword)APIs and events with links to their OpenAPI / AsyncAPI definitions
get_decisions(topic)Relevant ADRs with their status
check_technology(name)Technology radar ring and guidance
list_templates()Available golden paths and what they create

Behind such a server sits the same data that humans see: the Software Catalog, API definitions and decision records. There is one source of truth, with two interfaces.

3. Specifications as the contract​

In spec-driven development, a feature starts with a written specification that humans and agents refine together before code is generated, supported by tools such as GitHub's Spec Kit. The architecture repository supplies the constraints of that specification: which systems are involved, which contracts apply, which standards must be met. The specification then becomes the reviewed input for the code.

Making the repository AI-ready​

Agents raise the bar for the quality of the architecture repository:

  • Current over complete. Stale context is worse than no context, because agents follow it confidently. Prefer a smaller repository that is kept accurate, and mark deprecated items clearly.
  • Structured and identifiable. Stable IDs, consistent element types, explicit relationships and statuses (see the metamodel). Agents can follow sys-crm reliably; they cannot follow "the old customer system".
  • Explicit rules with reasons. "Do X, not Y, because Z" with a link to the decision. The reason helps both humans and agents handle cases the rule did not foresee.
  • Examples. A short code example of the right way is worth more than a page of description, for humans and for models.
  • Close to the code. Catalog entries, API definitions and decision records stored in the repositories they describe, updated in the same pull requests.
  • Access-controlled. Context is data. Agents should get only what the user running them is allowed to see, and sensitive information (security findings, personal data) should not be exposed to tools that do not need it.

The architect's new role​

In an AI-native organization, a large part of the architect's impact comes from curating context: keeping the repository accurate, writing decisions and standards that agents can apply, and exposing them through instruction files and tools. Every improvement to that context improves every change made by every agent that uses it.

The next section, platform capabilities as building blocks, describes what the agents should build on once they know the landscape.

Platform Capabilities as Building Blocks​

AI makes generating code cheap. That is both its promise and its main risk for architecture.

An agent asked to build a new service can generate authentication, logging, retry logic, infrastructure code, a deployment pipeline and a database schema in minutes. Each piece may look reasonable on its own. But every generated piece is new code that someone must review, secure, operate and maintain. Repeated across hundreds of services, the result is a landscape of AI-generated snowflakes: many slightly different implementations of the same concerns, each with its own bugs.

The answer is the same principle as in the platform mindset, now even more important: AI-assisted development should not start from scratch. It should build on well-structured foundations, the reliable, tested and well-supported building blocks provided as platform capabilities.

tip

Generate less, compose more. The best code an agent can write for authentication, observability or infrastructure is a few lines that use the platform's building block, not a new implementation.

Without and with building blocks​

Agent generates everythingAgent composes building blocks
Code to reviewThousands of lines, including security-critical codeBusiness logic plus a small amount of integration code
ConsistencyEvery service solves cross-cutting concerns differentlyCross-cutting concerns are solved once, the same way everywhere
QualityDepends on the model, the prompt and the reviewer that dayTested, hardened and proven in production
SecurityNew code paths for authentication, secrets, network accessSecure defaults from the platform; fewer places to get it wrong
OperationsUnknown behavior, custom dashboards, custom runbooksStandard metrics, logs, alerts and runbooks
Change over timeA fix must be found and applied in every generated copyA fix in the building block reaches every service with a version bump

The layered model​

Building blocks work at several levels. The agent works at the top and relies on the layers below.

  • Golden paths and templates give the agent a correct starting point. Instead of designing a new service structure, it creates the service from a template, and the result already has a repository, pipeline, infrastructure, catalog entry, and observability.
  • Building blocks cover the cross-cutting concerns. The agent calls them instead of re-implementing them:
ConcernBuilding blockPlatform capability
Compute, storage, networkingVersioned Terraform modulesInfrastructure, provisioning
TelemetryOpenTelemetry setup, logging library, standard dashboards and alertsObservability
Authentication and authorizationOIDC client configuration, token validation middleware, policy engineIdentity and access management
Supply chain and runtime protectionHardened base images, shared pipeline with scanning and signingSecurity
IntegrationExisting APIs and events from the catalog, client SDKsArchitecture repository
  • Guardrails check whatever the agent produces: unit and architecture tests, policy checks on infrastructure, admission control in the cluster, and cloud policies. They catch what the agent got wrong, regardless of how the code was written.

Guardrails as the agent's feedback loop​

For human developers, guardrails were mainly a safety net. For AI agents, they are also the fastest way to learn. An agent can run tests, linters and policy checks, read the failures, and correct its own work in a loop, before a human ever looks at the change.

This makes the quality of guardrails directly visible in the quality of AI-generated code:

  • Fast and local. Checks that run in seconds on the developer's machine or in the agent's sandbox are used in every iteration. Checks that only run in a nightly pipeline are not.
  • Clear error messages. "Images must come from the company registry, see ADR-017" tells the agent (and the human) exactly what to change. A failure with no explanation leads to guessing.
  • Architecture as tests. Rules such as "services in the order domain must not access the CRM database directly" or "only the notification platform may send email" can be written as automated tests or policy checks, often called fitness functions. Rules that exist only as text can be ignored; rules that fail a build cannot.

Designing building blocks for AI​

Building blocks have always needed good documentation. With AI agents as users, a few qualities become more important:

  • Discoverable. Registered in the catalog with a clear description, and exposed through the same tools agents use to query the architecture repository. A building block that the agent cannot find will be re-implemented.
  • Small, stable interfaces. A module with three required inputs and good defaults is used correctly. A module with forty options invites creative misuse.
  • Examples first. Every building block comes with a minimal, copyable usage example. Models learn from examples more reliably than from reference documentation.
  • Deterministic tools for actions. For actions such as "create a service", "request a database" or "add a team to an AWS account", give agents tools that call the platform (templates, APIs, MCP tools) instead of asking them to generate the steps. Deterministic tools produce the same result every time.
  • Versioned and supported. Clear versioning, a changelog, and a team that owns the building block. Agents should be told which version to use, and automated upgrades should keep services current.

Measuring the foundations​

A few indicators show whether AI-assisted development builds on the platform or around it:

  • Golden path adoption: share of new services created from templates.
  • Building block usage: share of services using the current versions of platform modules and libraries.
  • Custom implementations of cross-cutting concerns: for example, services with their own authentication or logging setup. These are candidates either for migration or for a missing building block.
  • Guardrail findings per change: how often agents' changes fail policy checks, and for which rules. Recurring failures point to unclear documentation or a missing building block.

Summary​

AI does not remove the need for architecture and platforms. It amplifies whatever foundations exist:

  • A clear, current architecture repository tells agents what exists and which rules apply.
  • Well-designed platform capabilities give agents reliable building blocks to compose, instead of code to invent.
  • Fast, clear guardrails give agents feedback to correct themselves, and give the organization confidence in what is produced.

With these foundations, AI-assisted development is fast and consistent with the organization's architecture. Without them, it is only fast.