<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vincent Composieux</title>
    <description>The latest articles on DEV Community by Vincent Composieux (@eko).</description>
    <link>https://dev.to/eko</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F527164%2F500c630f-3afd-4cf6-8203-f2840849b124.jpg</url>
      <title>DEV Community: Vincent Composieux</title>
      <link>https://dev.to/eko</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eko"/>
    <language>en</language>
    <item>
      <title>Architecture Drift Detection: Keep Your Code Aligned with Design</title>
      <dc:creator>Vincent Composieux</dc:creator>
      <pubDate>Mon, 08 Jun 2026 20:35:33 +0000</pubDate>
      <link>https://dev.to/eko/architecture-drift-detection-keep-your-code-aligned-with-design-kae</link>
      <guid>https://dev.to/eko/architecture-drift-detection-keep-your-code-aligned-with-design-kae</guid>
      <description>&lt;p&gt;Somewhere in your organization, there's an architecture diagram that's wrong. Maybe it shows a microservice that was merged into another six months ago. Maybe it lists Redis as the caching layer when the team switched to Memcached during a production incident. Maybe it describes a clean hexagonal architecture in a service that's accumulated enough shortcuts and workarounds to look like spaghetti.&lt;/p&gt;

&lt;p&gt;This is architecture drift: the gradual, silent divergence between how your system is documented and how it actually works. Unlike bugs, drift doesn't trigger alerts. Unlike performance regressions, it doesn't show up in monitoring. It sits quietly until someone makes a decision based on outdated documentation -- and that decision turns out to be wrong.&lt;/p&gt;

&lt;p&gt;Architecture drift is universal. Every team experiences it. The question isn't whether your documentation will drift, but how quickly you'll detect it and what you'll do about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Architecture Drift?
&lt;/h2&gt;

&lt;p&gt;Architecture drift occurs when the actual implementation of a software system diverges from its documented or intended architecture. The term was coined in the academic software engineering community, but the concept is painfully familiar to any practicing engineer.&lt;/p&gt;

&lt;p&gt;Drift manifests at every level of architectural documentation:&lt;/p&gt;

&lt;h3&gt;
  
  
  Structural Drift
&lt;/h3&gt;

&lt;p&gt;The documented structure no longer matches the codebase:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A service documented as a standalone container was absorbed into a monolith&lt;/li&gt;
&lt;li&gt;A component was renamed but the diagram still shows the old name&lt;/li&gt;
&lt;li&gt;A new service was created but never added to the architecture model&lt;/li&gt;
&lt;li&gt;A database was migrated from MySQL to PostgreSQL but the container diagram still says MySQL&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Behavioral Drift
&lt;/h3&gt;

&lt;p&gt;The documented behavior no longer matches reality:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A synchronous API call was replaced with an async message, but the relationship still says "REST/HTTP"&lt;/li&gt;
&lt;li&gt;A data flow was changed to go through an API gateway, but the diagram shows direct service-to-service communication&lt;/li&gt;
&lt;li&gt;An authentication step was added that isn't reflected in the system context diagram&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Dependency Drift
&lt;/h3&gt;

&lt;p&gt;The documented dependencies no longer match actual integrations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A third-party API was replaced with an in-house solution&lt;/li&gt;
&lt;li&gt;A new external dependency was added (payment provider, monitoring service) but not documented&lt;/li&gt;
&lt;li&gt;An integration was decommissioned but still appears in the system context diagram&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Decision Drift
&lt;/h3&gt;

&lt;p&gt;The documented architectural decisions are no longer being followed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An ADR says "use PostgreSQL for all persistent storage" but a team started using MongoDB&lt;/li&gt;
&lt;li&gt;The conformance rules say "no direct database access from the frontend" but someone added a client-side Supabase integration&lt;/li&gt;
&lt;li&gt;The deployment architecture says "single region" but services were deployed to multiple regions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Architecture Drift Happens
&lt;/h2&gt;

&lt;p&gt;Understanding the causes of drift is essential to preventing it. Drift isn't usually malicious or even negligent -- it's a natural consequence of how software is developed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Speed Over Documentation
&lt;/h3&gt;

&lt;p&gt;When shipping a feature by Friday, updating the architecture diagram is the first thing that gets dropped. The code change is the deliverable. The documentation update is overhead. This is rational behavior in the short term and devastating in the long term.&lt;/p&gt;

&lt;h3&gt;
  
  
  Many Small Changes
&lt;/h3&gt;

&lt;p&gt;Drift rarely happens in one dramatic moment. It accumulates through hundreds of small changes, each too minor to warrant a documentation update:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Renaming a file&lt;/li&gt;
&lt;li&gt;Adding a utility package&lt;/li&gt;
&lt;li&gt;Switching a library dependency&lt;/li&gt;
&lt;li&gt;Extracting a function into a separate module&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No single change is significant enough to trigger a documentation update. Together, they transform the architecture.&lt;/p&gt;

&lt;h3&gt;
  
  
  Team Turnover
&lt;/h3&gt;

&lt;p&gt;When engineers leave, they take implicit knowledge with them. The new team inherits the codebase but not the understanding of why it's structured the way it is. They make changes based on what they see in the code, not what the documentation says, widening the drift.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lack of Feedback Loops
&lt;/h3&gt;

&lt;p&gt;If nobody checks whether documentation matches reality, drift is invisible. Without a detection mechanism, the only way to discover drift is during an incident, an audit, or when a new engineer points out that the diagram doesn't match the code. By then, the drift may be extensive.&lt;/p&gt;

&lt;h3&gt;
  
  
  Emergency Changes
&lt;/h3&gt;

&lt;p&gt;Production incidents often require architectural shortcuts: a direct database connection instead of going through the API layer, a hardcoded configuration instead of using the config service, a temporary cache that becomes permanent. These changes bypass normal review processes and are rarely documented.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Cost of Architecture Drift
&lt;/h2&gt;

&lt;p&gt;Drift isn't just an aesthetic problem. It has concrete, measurable costs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bad Decisions
&lt;/h3&gt;

&lt;p&gt;When architects make decisions based on outdated documentation, those decisions can be wrong. "This service has low traffic, so we can afford a synchronous dependency" -- except the documentation is stale and the service actually handles 10x the documented load.&lt;/p&gt;

&lt;h3&gt;
  
  
  Slow Onboarding
&lt;/h3&gt;

&lt;p&gt;New engineers rely on architecture documentation to build their mental model. If the documentation is wrong, they build wrong mental models. They write code that doesn't fit the actual architecture. They ask questions that reveal their confusion, consuming senior engineers' time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Incident Response
&lt;/h3&gt;

&lt;p&gt;During a production incident, architecture diagrams should help teams understand blast radius and dependencies. If those diagrams are wrong, teams waste precious minutes tracing the wrong dependency chains or missing critical upstream systems.&lt;/p&gt;

&lt;h3&gt;
  
  
  Compliance and Audit Failures
&lt;/h3&gt;

&lt;p&gt;In regulated industries, architecture documentation is often required for compliance (SOC 2, ISO 27001, HIPAA). If auditors find that documentation doesn't match reality, it's a finding -- potentially a serious one.&lt;/p&gt;

&lt;h3&gt;
  
  
  AI Agent Confusion
&lt;/h3&gt;

&lt;p&gt;As AI coding agents become more prevalent, they increasingly rely on architecture documentation for context. An agent that reads a stale C4 model will generate code that fits the documented architecture, not the actual one. This amplifies drift rather than fixing it.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Detect Architecture Drift
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Manual Review (Traditional Approach)
&lt;/h3&gt;

&lt;p&gt;The simplest approach is periodic manual review: gather the team, walk through the architecture diagrams, and check whether they still match reality.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When this works&lt;/strong&gt;: Small teams, simple architectures, quarterly cadence.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When this fails&lt;/strong&gt;: Large systems, fast-moving teams, or when the people who know the code best don't have time for review meetings. Manual review also suffers from confirmation bias -- people tend to see what they expect to see.&lt;/p&gt;

&lt;h3&gt;
  
  
  Architecture Fitness Functions
&lt;/h3&gt;

&lt;p&gt;Fitness functions, popularized by Neal Ford and the "Building Evolutionary Architectures" book, are automated tests that validate architectural properties:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// Example: Ensure no direct database imports in handler packages&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;TestNoDatabaseImportsInHandlers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;testing&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;packages&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;analyzeImports&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"./internal/handler/..."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pkg&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;packages&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;imp&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;pkg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Imports&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;assert&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;NotContains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;imp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"database/sql"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s"&gt;"Handler %s imports database/sql directly"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pkg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;assert&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;NotContains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;imp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"gorm.io"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s"&gt;"Handler %s imports GORM directly"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pkg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fitness functions are powerful for enforcing specific rules, but they require upfront effort to write and maintain. They check constraints, not the full model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Static Analysis Tools
&lt;/h3&gt;

&lt;p&gt;Tools like ArchUnit (Java), Deptrac (PHP), and go-arch-lint (Go) analyze code structure and enforce dependency rules:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// go-arch-lint configuration&lt;/span&gt;
&lt;span class="n"&gt;components&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
  &lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;in&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="o"&gt;./&lt;/span&gt;&lt;span class="n"&gt;internal&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
  &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;in&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="o"&gt;./&lt;/span&gt;&lt;span class="n"&gt;internal&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
  &lt;span class="n"&gt;repository&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;in&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="o"&gt;./&lt;/span&gt;&lt;span class="n"&gt;internal&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;repository&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;

&lt;span class="n"&gt;rules&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
  &lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;can_depend_on&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;can_depend_on&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;repository&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="n"&gt;repository&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;can_depend_on&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These tools are excellent for enforcing layered architecture within a single codebase. They don't address cross-service drift or validate that the architecture model matches the code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automated Drift Scoring
&lt;/h3&gt;

&lt;p&gt;This is the approach Archyl takes. Instead of checking specific rules, it validates the entire architecture model against the codebase:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does each documented system match a repository?&lt;/li&gt;
&lt;li&gt;Does each documented container match a directory in the codebase?&lt;/li&gt;
&lt;li&gt;Does each documented code element reference a file that still exists?&lt;/li&gt;
&lt;li&gt;Are both endpoints of each documented relationship still valid?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The result is a drift score (0-100) and a detailed breakdown showing exactly what drifted. This is the most comprehensive approach because it validates the full model, not just specific constraints.&lt;/p&gt;

&lt;p&gt;The key design decisions in Archyl's drift detection:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lightweight.&lt;/strong&gt; No AI tokens consumed, no file content read. Just file path existence checks against the Git provider API. This means drift scoring takes seconds, not minutes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deterministic.&lt;/strong&gt; Same codebase, same model, same score. No variability from LLM temperature or prompt engineering.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cheap.&lt;/strong&gt; Run it on every push without cost concerns. A hundred computations a day is fine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Actionable.&lt;/strong&gt; The breakdown shows exactly which elements drifted, so you know what to fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Prevent Architecture Drift
&lt;/h2&gt;

&lt;p&gt;Detection is necessary but not sufficient. The goal is to prevent drift from accumulating in the first place.&lt;/p&gt;

&lt;h3&gt;
  
  
  Make Documentation Updates Part of the Definition of Done
&lt;/h3&gt;

&lt;p&gt;If a code change modifies the architecture, the PR should include a documentation update. Add a checkbox to your PR template:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Checklist&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; [ ] Tests pass
&lt;span class="p"&gt;-&lt;/span&gt; [ ] Code reviewed
&lt;span class="p"&gt;-&lt;/span&gt; [ ] Architecture documentation updated (if applicable)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This doesn't catch everything, but it establishes the expectation that documentation is a first-class deliverable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automate Drift Detection in CI
&lt;/h3&gt;

&lt;p&gt;The single most effective prevention mechanism is a CI gate that fails when drift exceeds a threshold:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;main&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;drift&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;archyl-com/actions/drift-score@v1&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;api-key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.ARCHYL_API_KEY }}&lt;/span&gt;
          &lt;span class="na"&gt;organization-id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.ARCHYL_ORG_ID }}&lt;/span&gt;
          &lt;span class="na"&gt;project-id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;your-project-uuid'&lt;/span&gt;
          &lt;span class="na"&gt;threshold&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;70'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the build fails because the drift score dropped, someone has to fix it before merging. Documentation accuracy becomes as non-negotiable as passing tests.&lt;/p&gt;

&lt;p&gt;Start with a low threshold (50-60%) and increase it gradually as the team builds the habit.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Architecture-as-Code
&lt;/h3&gt;

&lt;p&gt;When your architecture model is defined in a text-based format (Structurizr DSL, Archyl YAML), it can be version-controlled alongside your code. This means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Architecture changes appear in pull requests&lt;/li&gt;
&lt;li&gt;Changes are reviewed by the team&lt;/li&gt;
&lt;li&gt;The history of architectural evolution is captured in Git&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is significantly better than architecture defined in a GUI tool where changes are invisible and un-reviewable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Set Up Drift Alerts
&lt;/h3&gt;

&lt;p&gt;Archyl supports webhook alerts for drift events:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;drift.score_computed&lt;/code&gt;&lt;/strong&gt;: Fires on every drift computation. Post to a Slack channel for visibility.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;drift.score_degraded&lt;/code&gt;&lt;/strong&gt;: Fires when the score drops by 10+ points. This is your early warning system.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Configure these alerts to a channel your team monitors. Awareness is the first step toward action.&lt;/p&gt;

&lt;h3&gt;
  
  
  Run Architecture Reviews
&lt;/h3&gt;

&lt;p&gt;Monthly or quarterly architecture reviews serve multiple purposes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Validate that the documented architecture still matches reality&lt;/li&gt;
&lt;li&gt;Identify drift that automated tools missed (behavioral drift, for example)&lt;/li&gt;
&lt;li&gt;Discuss whether drifted components should be updated in code or in documentation&lt;/li&gt;
&lt;li&gt;Review and update ADRs for decisions that may need revisiting&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Adopt Conformance Rules
&lt;/h3&gt;

&lt;p&gt;Conformance rules define architectural constraints that should always be true:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"The frontend container must not depend on the database container"&lt;/li&gt;
&lt;li&gt;"All public APIs must go through the API gateway"&lt;/li&gt;
&lt;li&gt;"Each service must own its own database (no shared databases)"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In Archyl, conformance rules are defined in the platform and enforced via the conformance check feature. AI agents can read these rules via MCP and respect them when generating code.&lt;/p&gt;

&lt;p&gt;Conformance rules are complementary to drift detection. Drift detection checks whether your model matches reality. Conformance checks whether reality follows your rules.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture Drift vs. Architecture Erosion
&lt;/h2&gt;

&lt;p&gt;These terms are related but distinct:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Architecture drift&lt;/strong&gt; is divergence between documentation and implementation. The code might be perfectly fine -- the documentation is just wrong.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Architecture erosion&lt;/strong&gt; is degradation of the architecture itself. The code violates architectural principles, accumulates tech debt, and becomes harder to maintain. Erosion is a code quality problem. Drift is a documentation accuracy problem.&lt;/p&gt;

&lt;p&gt;They often co-occur. When documentation drifts, teams lose awareness of the intended architecture. Without that awareness, they make changes that erode the architecture. Drift enables erosion.&lt;/p&gt;

&lt;p&gt;This is why drift detection matters beyond just documentation accuracy. Accurate documentation serves as a reference that prevents erosion. When everyone can see the intended architecture, they're more likely to maintain it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measuring and Tracking Drift Over Time
&lt;/h2&gt;

&lt;p&gt;A single drift score is useful. A trend is powerful.&lt;/p&gt;

&lt;h3&gt;
  
  
  Establish a Baseline
&lt;/h3&gt;

&lt;p&gt;Run your first drift computation to establish where you stand. Don't panic if the score is low -- most teams that haven't been actively maintaining architecture documentation will see scores between 40-70%.&lt;/p&gt;

&lt;h3&gt;
  
  
  Set Targets
&lt;/h3&gt;

&lt;p&gt;Establish realistic targets for improvement:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Month 1&lt;/strong&gt;: Improve from baseline to 60% by fixing the most obvious drift&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Month 3&lt;/strong&gt;: Reach 75% by incorporating documentation updates into the workflow&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Month 6&lt;/strong&gt;: Maintain 80%+ through CI gates and regular reviews&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Track the Trend
&lt;/h3&gt;

&lt;p&gt;Archyl stores every drift computation with its full breakdown. The drift history view shows a timeline of scores, so you can see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is drift getting better or worse over time?&lt;/li&gt;
&lt;li&gt;Did a specific sprint or release cause a significant drop?&lt;/li&gt;
&lt;li&gt;Is the CI threshold preventing degradation?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Celebrate Improvements
&lt;/h3&gt;

&lt;p&gt;When the team improves the drift score, acknowledge it. Architecture documentation is thankless work. Making progress visible and recognized reinforces the behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Role of Drift Detection in AI-Assisted Development
&lt;/h2&gt;

&lt;p&gt;The rise of AI coding agents makes drift detection more important than ever.&lt;/p&gt;

&lt;p&gt;AI agents increasingly rely on architecture documentation for context. Through protocols like MCP, agents can read your C4 model, ADRs, and conformance rules before generating code. This makes them more effective -- they generate code that fits your architecture instead of guessing.&lt;/p&gt;

&lt;p&gt;But this only works if the documentation is accurate. An agent that reads a stale C4 model and generates code based on it will produce code that fits the wrong architecture. The agent amplifies drift instead of preventing it.&lt;/p&gt;

&lt;p&gt;Drift detection creates the feedback loop that keeps AI agents honest:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Agent reads architecture&lt;/strong&gt; via MCP&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent generates code&lt;/strong&gt; that fits the documented architecture&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code is merged&lt;/strong&gt;, potentially changing the actual architecture&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Drift detection runs&lt;/strong&gt; and catches any divergence&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CI gate fails&lt;/strong&gt; if drift exceeds threshold&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Team updates documentation&lt;/strong&gt; to reflect reality&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent reads updated architecture&lt;/strong&gt; -- loop closes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Without step 4, the loop is open. Documentation becomes increasingly fictional. Agents increasingly generate code that fits a fantasy architecture. The gap widens with every commit.&lt;/p&gt;

&lt;p&gt;Drift detection is the mechanism that closes this loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started With Drift Detection
&lt;/h2&gt;

&lt;h3&gt;
  
  
  If You Have No Architecture Documentation
&lt;/h3&gt;

&lt;p&gt;Start with AI discovery. Connect your repository to Archyl, run discovery, and review the generated C4 model. This gives you a baseline model that's roughly 70-80% accurate. Then set up drift detection to maintain that accuracy.&lt;/p&gt;

&lt;h3&gt;
  
  
  If You Have Existing Documentation
&lt;/h3&gt;

&lt;p&gt;Import or recreate your architecture model in a tool that supports drift detection. Run the first drift computation. The score will tell you exactly how accurate your current documentation is -- and the breakdown will show you what to fix first.&lt;/p&gt;

&lt;h3&gt;
  
  
  If You're Already Tracking Drift
&lt;/h3&gt;

&lt;p&gt;Integrate drift detection into CI. Set a threshold. Configure alerts. Start tracking trends. Make drift a team metric, not a one-time audit.&lt;/p&gt;

&lt;h3&gt;
  
  
  Regardless of Where You Start
&lt;/h3&gt;

&lt;p&gt;The most important thing is to start. Architecture drift is like tech debt -- it compounds over time. The longer you wait to address it, the more work it takes to catch up. But unlike tech debt, drift detection can be set up in minutes and provides immediate value.&lt;/p&gt;

&lt;p&gt;Your architecture documentation is either reflecting reality or it isn't. Now you can measure which one it is.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Learn more about maintaining architecture documentation: &lt;a href="https://www.archyl.com/blog/architecture-drift-score-measure-documentation-accuracy" rel="noopener noreferrer"&gt;Architecture Drift Score: How It Works&lt;/a&gt; | &lt;a href="https://www.archyl.com/blog/what-is-the-c4-model-complete-guide" rel="noopener noreferrer"&gt;What is the C4 Model?&lt;/a&gt; | &lt;a href="https://www.archyl.com/blog/ai-powered-architecture-documentation" rel="noopener noreferrer"&gt;AI-Powered Architecture Documentation&lt;/a&gt;. Or &lt;a href="https://www.archyl.com" rel="noopener noreferrer"&gt;try Archyl free&lt;/a&gt; and compute your first drift score in minutes.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://www.archyl.com/blog/architecture-drift-detection-guide" rel="noopener noreferrer"&gt;Archyl blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>devops</category>
      <category>programming</category>
      <category>documentation</category>
    </item>
    <item>
      <title>MCP Server: Talk to Your Architecture from Your Favorite AI Tools</title>
      <dc:creator>Vincent Composieux</dc:creator>
      <pubDate>Tue, 27 Jan 2026 15:09:41 +0000</pubDate>
      <link>https://dev.to/eko/mcp-server-talk-to-your-architecture-from-your-favorite-ai-tools-4o86</link>
      <guid>https://dev.to/eko/mcp-server-talk-to-your-architecture-from-your-favorite-ai-tools-4o86</guid>
      <description>&lt;p&gt;I've been using AI coding assistants daily for over a year now. &lt;/p&gt;

&lt;p&gt;Claude Code for complex refactoring, Cursor for quick edits, GitHub Copilot for autocomplete. But there was always a frustrating gap: these tools couldn't see my architecture documentation.&lt;/p&gt;

&lt;p&gt;Every time I asked Claude to "add a new endpoint to the payment service," it would guess. It didn't know that our payment service talks to Stripe, uses Redis for caching, and has specific security requirements documented in our ADRs. I'd spend more time correcting the AI than writing code myself.&lt;/p&gt;

&lt;p&gt;Today, we're closing that gap. &lt;a href="https://www.archyl.com" rel="noopener noreferrer"&gt;Archyl&lt;/a&gt; now exposes a full MCP (Model Context Protocol) server with 56 tools that give AI assistants complete visibility into your architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is MCP?
&lt;/h2&gt;

&lt;p&gt;Model Context Protocol is Anthropic's open standard for connecting AI assistants to external tools and data sources. Think of it as a universal adapter between LLMs and the systems they need to interact with.&lt;/p&gt;

&lt;p&gt;Instead of copy-pasting context into prompts, MCP lets AI assistants directly query your tools. They can read data, take actions, and stay synchronized with your actual systems.&lt;/p&gt;

&lt;p&gt;And &lt;a href="https://www.archyl.com" rel="noopener noreferrer"&gt;Archyl&lt;/a&gt;'s MCP server means your architecture documentation becomes a first-class data source for any AI assistant.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Can You Do With It?
&lt;/h2&gt;

&lt;p&gt;Here's where it gets exciting. With the &lt;a href="https://www.archyl.com" rel="noopener noreferrer"&gt;Archyl&lt;/a&gt; MCP server, your AI assistant can:&lt;/p&gt;

&lt;h2&gt;
  
  
  Query Your Architecture
&lt;/h2&gt;

&lt;p&gt;Ask natural questions and get real answers:&lt;/p&gt;

&lt;p&gt;"Which elements are linked to the Payment Processor system?"&lt;br&gt;
"What containers does the User Service depend on?"&lt;br&gt;
"Show me all systems that interact with our PostgreSQL database"&lt;br&gt;
"What ADRs affect the authentication flow?"&lt;br&gt;
The AI doesn't guess. It queries your actual documented architecture and returns precise, structured information.&lt;/p&gt;

&lt;p&gt;Claude Code querying architecture via MCP&lt;/p&gt;

&lt;h2&gt;
  
  
  Navigate the C4 Model
&lt;/h2&gt;

&lt;p&gt;Your AI understands the full hierarchy:&lt;/p&gt;

&lt;h2&gt;
  
  
  List all projects in your organization
&lt;/h2&gt;

&lt;p&gt;Drill down from systems to containers to components&lt;br&gt;
Explore relationships and dependencies&lt;br&gt;
Understand the technology stack at each level&lt;br&gt;
When you ask "what technologies does the Order Service use?", the AI returns the actual documented stack, not a hallucinated guess.&lt;/p&gt;

&lt;h2&gt;
  
  
  Modify Documentation
&lt;/h2&gt;

&lt;p&gt;This is the killer feature. The MCP server supports write operations:&lt;/p&gt;

&lt;h2&gt;
  
  
  Create new systems, containers, and components
&lt;/h2&gt;

&lt;p&gt;Add relationships between elements&lt;br&gt;
Create and update ADRs&lt;br&gt;
Write project documentation&lt;br&gt;
Define user flows&lt;br&gt;
Ask Claude to "document the new notification service we just built" and it can create the C4 elements, link them to existing systems, and even draft an ADR explaining the design decision.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stay in Sync
&lt;/h2&gt;

&lt;p&gt;The AI always sees the latest state. No stale context, no outdated documentation. When your teammate updates the architecture, your AI assistant sees it immediately.&lt;/p&gt;

&lt;p&gt;56 Tools, One Integration&lt;br&gt;
We didn't build a minimal proof-of-concept. The MCP server exposes comprehensive functionality:&lt;/p&gt;

&lt;p&gt;Projects &amp;amp; Settings: List, get, and manage projects. Configure AI providers and discovery settings.&lt;/p&gt;

&lt;p&gt;C4 Model (All 4 Levels): Full CRUD for systems, containers, components, and code elements. Create relationships, manage overlays, handle the complete model hierarchy.&lt;/p&gt;

&lt;p&gt;Documentation: Create and update architecture documentation. Link docs to specific C4 elements.&lt;/p&gt;

&lt;p&gt;ADRs: Full Architecture Decision Record management. Create, update, list, and link ADRs to the elements they affect.&lt;/p&gt;

&lt;p&gt;User Flows: Define and visualize user journeys through your system.&lt;/p&gt;

&lt;p&gt;Discovery: Trigger AI-powered architecture discovery on your connected repositories.&lt;/p&gt;

&lt;p&gt;Teams: Query team structure and project access.&lt;/p&gt;

&lt;p&gt;Every tool returns structured data that AI assistants can reason about. No parsing HTML, no scraping UIs, no brittle integrations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started in 2 Minutes
&lt;/h2&gt;

&lt;p&gt;Here's how to connect Claude Code (or any MCP-compatible tool):&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Create an API Key
&lt;/h3&gt;

&lt;p&gt;Go to your &lt;a href="https://www.archyl.com" rel="noopener noreferrer"&gt;Archyl&lt;/a&gt; profile, click on "API Keys", and create a new key. Give it a descriptive name like "Claude Code" and select the scopes you need (read-only or full access).&lt;/p&gt;

&lt;p&gt;Copy the key immediately — you won't see it again.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Configure Your MCP Client
&lt;/h3&gt;

&lt;p&gt;Add Archyl to your MCP configuration. For Claude Code, add this to your settings:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{&lt;br&gt;
  "mcpServers": {&lt;br&gt;
    "archyl": {&lt;br&gt;
      "url": "https://api.archyl.com/mcp",&lt;br&gt;
      "transport": "http",&lt;br&gt;
      "headers": {&lt;br&gt;
        "X-API-Key": "your_api_key_here"&lt;br&gt;
      }&lt;br&gt;
    }&lt;br&gt;
  }&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Start Talking to Your Architecture
&lt;/h3&gt;

&lt;p&gt;That's it. Ask your AI assistant about your architecture and watch it fetch real data from Archyl.&lt;/p&gt;

&lt;p&gt;Try these prompts:&lt;/p&gt;

&lt;p&gt;"List all my Archyl projects"&lt;br&gt;
"What systems exist in the E-commerce Platform project?"&lt;br&gt;
"Show me the relationships for the Payment Gateway"&lt;br&gt;
"Create a new ADR explaining why we chose PostgreSQL"&lt;br&gt;
Why This Matters&lt;br&gt;
Architecture documentation has always had a discoverability problem. You write it, it lives in a wiki or a diagram somewhere, and then nobody reads it. Engineers ask questions in Slack instead of checking the docs.&lt;/p&gt;

&lt;p&gt;MCP changes the interaction model. Documentation isn't something you go read — it's something your AI assistant knows. When you ask "how does payment processing work?", the answer comes from your actual architecture, not the AI's training data.&lt;/p&gt;

&lt;p&gt;This has profound implications:&lt;/p&gt;

&lt;p&gt;Onboarding becomes instant. New engineers ask their AI about system architecture and get accurate answers from day one.&lt;/p&gt;

&lt;p&gt;Context is always available. When writing code, the AI knows exactly what services exist, how they connect, and what decisions shaped them.&lt;/p&gt;

&lt;p&gt;Documentation stays current. Because it's actively used, inaccuracies get noticed and fixed. Dead documentation is documentation nobody reads.&lt;/p&gt;

&lt;p&gt;AI suggestions are grounded. When Claude suggests a design, it's informed by your actual architecture, not generic patterns.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Bigger Picture
&lt;/h2&gt;

&lt;p&gt;We're entering an era where AI assistants are genuine collaborators in software development. But they're only as good as the context they have access to.&lt;/p&gt;

&lt;p&gt;Most AI interactions today are context-poor. You paste some code, add a brief description, and hope the AI figures out the rest. The results are mediocre because the AI is working blind.&lt;/p&gt;

&lt;p&gt;MCP-powered integrations flip this model. Your AI has persistent, queryable access to everything it needs: your code (via repository integration), your architecture (via &lt;a href="https://www.archyl.com" rel="noopener noreferrer"&gt;Archyl&lt;/a&gt;), your issues (via Jira/Linear integrations), your documentation (via Notion/Confluence integrations).&lt;/p&gt;

&lt;p&gt;The AI becomes a true team member with access to team knowledge.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.archyl.com" rel="noopener noreferrer"&gt;Archyl&lt;/a&gt;'s MCP server is our contribution to this vision. Your architecture shouldn't be locked in a diagram tool. It should be accessible to every tool your team uses, including your AI assistants.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;This is version 1. Here's what we're building next:&lt;/p&gt;

&lt;p&gt;Proactive suggestions: The MCP server could watch for architecture changes and suggest documentation updates.&lt;/p&gt;

&lt;p&gt;Cross-reference linking: Connect ADRs to specific commits, link documentation to CI/CD events, create a web of interconnected knowledge.&lt;/p&gt;

&lt;p&gt;Custom queries: Define organization-specific queries like "show me all services owned by the payments team."&lt;/p&gt;

&lt;p&gt;Audit logging: Track every MCP interaction for compliance and debugging.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It Now
&lt;/h2&gt;

&lt;p&gt;The MCP server is available today on all &lt;a href="https://www.archyl.com" rel="noopener noreferrer"&gt;Archyl&lt;/a&gt; plans. If you're already using Claude Code, Cursor, or another MCP-compatible tool, you can connect in minutes.&lt;/p&gt;

&lt;p&gt;Create an API key, add the configuration, and start talking to your architecture.&lt;/p&gt;

&lt;p&gt;And if you're not using Archyl yet, sign up for free and see how AI-powered architecture documentation works. Connect a repository, run discovery, and then connect your favorite AI assistant.&lt;/p&gt;

&lt;p&gt;Your architecture is too important to be locked in static diagrams. Let your AI assistants explore it.&lt;/p&gt;

&lt;p&gt;Want to learn more about Archyl's AI capabilities? Check out our post on AI-Powered Architecture Discovery, or start with the basics in our Introduction to the C4 Model.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>architecture</category>
      <category>documentation</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
