Docs & Code Guide

How often should architecture diagrams be updated: on merge for generated views, quarterly for the rest

Update an architecture diagram whenever the change it depicts reaches the main branch. If the diagram is generated, that can literally mean every merge. If it is hand-maintained, tie updates to a short list of event triggers and add a quarterly review floor so silent drift gets caught. The right frequency is not a number on a calendar; it is a function of how fast that level of the architecture changes and how much one update costs.

7 min readFor engineers deciding how stale is too stale

See it as a diagram

Everything below, as a diagram you can edit. Describe yours and see it in seconds.

152/20003 credits left
Try:

No account needed · Editable canvas, not a picture

The short answer

On merge for anything you can regenerate, and a quarterly verification floor for everything else. The reasoning: a diagram is wrong from the moment the system diverges from it, so the ideal update moment is the merge that causes the divergence. What stops teams from updating at that moment is cost, not ignorance. When an update costs 45 minutes of box dragging, people batch updates and the diagram spends most of its life wrong. When an update costs one command, updating on merge stops being aspirational.

A useful test: if a new engineer used this diagram to debug production today, what on it would send them in the wrong direction? If the answer is anything load-bearing, the diagram missed its update window, and no cadence policy matters until that is fixed.

Cadence by diagram level

Different zoom levels change at different speeds, so one cadence for all diagrams is wrong twice. A context-level view, the system plus its external dependencies, changes a few times a year: new vendor, new upstream consumer, a system retired. A quarterly verification pass genuinely covers it.

A container or service-level view changes monthly on most teams: a service split, a new queue, a datastore migration. This level needs event-triggered updates, with the quarterly pass as a backstop for the events nobody flagged.

Component-level and pipeline-level views can change weekly. Hand-maintaining diagrams at this level is a losing trade on most teams, and the honest choice is either to generate them from the source or not to keep them at all. A wrong detailed diagram costs more than no diagram, because detail signals authority.

Event triggers do the real work

Calendar reviews catch drift late; events catch it at the source. The trigger list worth wiring into your workflow is short: a service added or removed, a dependency between services added or removed, a datastore or queue swapped, an external integration changed, and any incident where the diagram sent a responder the wrong way. That last one is a free audit: the postmortem already proved the diagram lied.

The calendar still matters as a floor, because triggers get skipped during crunch. Quarterly is the widest floor that still catches drift within the same planning cycle that caused it. The mechanics of a verification pass, minutes per doc rather than hours, are covered in documentation review cadence.

Update cost sets the honest cadence

The variable teams control is cost per update. Datadef ships an MCP server, registry name io.datadef/mcp, so an agent like Claude Code or Cursor connected to it can read the repository and update the diagram to match: after a merge, in a scheduled job, or on request during code review. To be precise about what that is not: Datadef does not watch your repository and nothing detects code changes on its own. The update is one agent call or one CI command away, which is what makes an on-merge cadence realistic. Connecting an agent needs an API key, available on paid plans.

When regeneration is cheap, the cadence question inverts: instead of asking how often you can afford to update, you ask which merges are worth a redraw, which is the subject of when to regenerate an architecture diagram.

# Regenerate the diagram when architecture-shaped paths change on main.
# The agent reads the repo and updates the diagram through the Datadef
# MCP server (configured in the repo's .mcp.json).
name: redraw-architecture-diagram
on:
  push:
    branches: [main]
    paths: ['services/**', 'infra/**', 'docker-compose*.yml']
jobs:
  redraw:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Reconcile diagram with the repo
        run: |
          claude -p "Compare our platform diagram to the services and infra
          in this repo, and update the diagram via Datadef where they diverge."
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

A policy you can copy

Context diagrams: verify quarterly, update on vendor and boundary changes. Container diagrams: update on the trigger list, verify quarterly, generate if the team ships weekly. Component diagrams: generate or delete. Write the policy next to the diagrams it governs, name an owner per diagram, and treat an incident-revealed lie as a sev-2 against the doc.

If diagrams have drifted so far that nobody trusts them, cadence is the wrong first move; recovery is, and that is covered in documentation drift.

One-line answer for your team wiki

Generated diagrams update on merge. Hand-maintained diagrams update on architecture-changing events, with a quarterly verification floor. Detailed diagrams that cannot be generated get deleted, not maintained.

FAQ

How often should architecture diagrams be updated?

Update a diagram when the change it depicts merges. Generated diagrams can follow every merge; hand-maintained diagrams should update on a short list of event triggers (service added or removed, dependency changed, datastore swapped) with a quarterly verification floor. Context-level diagrams change slowly and survive on the quarterly floor alone; component-level diagrams change weekly and are only worth keeping if generated.

Should architecture diagrams be updated on every commit?

No. Commit-level churn is noise at diagram altitude; most commits change nothing a diagram shows. Merge-level is the right granularity, and only for merges that touch architecture-shaped paths: services, infrastructure definitions, queues, datastores. A CI path filter expresses that cheaply.

Is a quarterly review enough for architecture diagrams?

For context-level diagrams, usually yes: system boundaries change a few times a year. For service-level diagrams, quarterly alone means the diagram is wrong for most of the quarter on an active team. Use event triggers for those, and keep the quarterly pass as the backstop for missed events.

Who should update the architecture diagram?

The team that owns the system, with the engineer who made the architecture change responsible for the diagram change in the same unit of work. If the diagram is generated, responsibility shrinks to reviewing the regenerated version rather than redrawing it.

Can a diagram update itself when code changes?

Not by itself. Datadef does not watch repositories, and no tool honestly detects architectural intent from a diff alone. What works today: an AI agent connected to the Datadef MCP server reads the repository and updates the diagram when invoked, after a merge, in a scheduled CI job, or on request. The update is one command away rather than automatic, which in practice keeps a wiki current.