Open specification · v0.2 draft · MIT

Make your repository self‑describing.

Architecture Markup (AMARK) is a lightweight, tool‑independent metadata layer for Git repositories. Add three small keys to the files you already have — and humans, CI, and AI agents can all read your architecture, relationships, and ownership without guessing.

No server. No model file. No lock‑in. Just metadata, next to the code, checked in CI.

README.md
---
amark-id: SYS-COMMERCE
amark-kind: system
amark-text: Commerce platform.
amark-owner: team-commerce
amark-links:
  - contains:BE-ORDERS
  - contains:BE-PAYMENTS
  - integrates_with:EXT-STRIPE
---

# Commerce Platform
architecture.md — Mermaid C4, rendered on GitHub
C4Context
  System(SYS-COMMERCE, "Commerce platform.")
  System_Ext(EXT-STRIPE, "Stripe")
  Rel(SYS-COMMERCE, EXT-STRIPE, "integrates with")

Three keys. That’s the whole idea.

Every important artifact declares what it is and how it connects. Everything a machine can infer — imports, packages, build dependencies — stays out; you only write down what humans know and machines cannot discover.

id

A stable, unique identifier with a kind prefix: SYS-COMMERCE, BE-ORDERS, DB-USERS, EXT-STRIPE. Case-insensitive, unique across your whole estate.

kind

What the artifact is: system, backend, api, database, decision, requirement… An open, extensible registry — add your own under an x- namespace.

links

Typed relationships, written relation:TARGET — contains, exposes, persists_to, integrates_with, implements, documents…

It lives on the files you already have

All keys use the amark- prefix, so they never collide with a host file’s own keys — a Kubernetes kind, a blog’s id. There is no separate model file to maintain and no parallel artifact to drift.

---
title: Authentication Service   # the document's own key — ignored by AM
amark-id: CMP-AUTH
amark-kind: component
amark-links:
  - depends_on:DB-USERS
  - exposes:API-AUTH
---

# Authentication Service

Documentation records what a machine cannot infer: architecture, rationale, decisions, ownership.

# amark:id=CMP-AUTH
def authenticate(user, credentials):
    ...

Source code declares only its identity — one comment marker. Technical dependencies are discovered automatically, never hand-written.

kind: Deployment            # Kubernetes' key, not AM's
amark-id: DEP-BUILD
amark-kind: pipeline

Infrastructure files carry amark- keys alongside their own. Bicep and templated YAML use the comment marker.

{
  "amark-id": "STACK-ORDERS",
  "amark-kind": "pipeline",
  "Resources": { ... }
}

A JSON binding covers comment-less formats like CloudFormation and ARM templates.

One CLI to enforce and project it

amark is the reference implementation: a single, dependency-light CLI that runs offline, in milliseconds, in CI — no server, no LLM, no license. Deterministic output means regenerated diagrams only change in git when the architecture actually changes.

amark scan

Build the metadata index — every artifact, every link, as plain JSON.

amark validate --strict

A blocking CI gate: id grammar, collisions, dangling links, unregistered names. Exhaustive and exact.

amark c4

Generate a Mermaid C4 document — System Context plus one Container diagram per system, viewable on GitHub/GitLab.

amark impact BE-ORDERS

What breaks if this changes? Direct dependencies plus transitive dependents.

amark graph

The full relationship graph, ready for any downstream tool.

amark tech

A technology inventory across artifacts — end-of-life questions, answered from metadata.

amark merge

Combine per-repo indexes into one global graph, with exact cross-repo id-collision detection.

amark export / import

Export ArchiMate or Backstage; import an existing Backstage catalog. Adopt without replacing anything.

Built for the age of coding agents

AI agents are the cheapest producers of architecture metadata — they read code, infer structure, and write the markup. The tool is what an agent cannot be: deterministic, exhaustive, and free to run on every commit.

  • Agents write it. Point any coding agent at the agent instructions — a stable, public URL — and it marks up the repo for you.
  • CI enforces it. amark validate --strict is offline and exact, so the agent-visible model can never silently rot the way prose conventions do.
  • Agents consume it. amark scan --json and amark impact give an agent ground truth instead of re-deriving your architecture every session.
your agent’s prompt
# Onboard any repo in one prompt:
Read and follow
https://raw.githubusercontent.com/architecture-markup/
amark/main/docs/architecture-markup-agent-instructions.md

# Then let CI keep it honest:
$ amark validate --strict .
OK: 42 artifacts, 0 errors, 0 warnings

A format, not a product

AMARK does not ask anything else to change. It is designed to feed the tools you already run — adopting it replaces nothing.

Backstage

Owner and lifecycle fields are Backstage-compatible by design. Import an existing catalog, or generate catalog-info.yaml from AMARK in CI.

amark export --format backstage

EA tools

Export an ArchiMate Model Exchange File that imports into Archi and most EA suites — a code-anchored current-state feed that never drifts from the repos.

amark export -o model.archimate

C4 diagrams

C4 is a projection, not a hand-maintained model: Mermaid diagrams render directly on GitHub and GitLab, regenerated on every commit.

amark c4 -o docs/architecture.md

Cloud & multi-repo

Cloud inventories see deployed instances in one cloud; AMARK records intent across clouds, on-prem, SaaS, and the secret-shaped edges no scanner can see.

amark merge repo-a.json repo-b.json

Domain profiles map AMARK onto TOGAF, ArchiMate, C4, Azure, AWS, GCP, and Backstage.

“Don’t we already have this?”

It is the first question every architect asks, and it deserves an answer before the install instructions. The difference is not front matter — catalogs use that too. It is where the model lives.

Architecture Markup Backstage catalog EA tools Structurizr / C4 DSL
Where the model lives On the files you already have, in every repo A dedicated catalog-info.yaml per repo A central database, away from the code A separate model file in a DSL
Runtime needed None — a CLI in CI A Backstage instance, database and plugins A server or SaaS licence The Structurizr service or CLI
Who maintains it The team, next to the code, gated in CI The team, in one portal-specific file Architects, separately from delivery Whoever owns the model file
Primary consumer Any tool — JSON, graph, C4, ArchiMate, Backstage The portal and its plugins EA analysis and governance Diagram rendering
Status Open specification, MIT De-facto format tied to a product Vendor metamodels Vendor DSL

A survey of CALM, Backstage, Cortex, OpsLevel, Score, OAM, arc42, Structurizr and LikeC4 found every one of them keeps its model in a separate descriptor file. AMARK does not ask any of them to change — it feeds them. Read the full comparison.

Install

Python 3.9+ and a single dependency — or run it in Docker and install nothing at all. Every dependency is pinned to an exact version behind a seven-day supply-chain cooldown, and the base image is pinned by digest.

From source
pip install git+https://github.com/architecture-markup/amark.git
amark scan .
Docker
git clone https://github.com/architecture-markup/amark.git
cd amark && make build && make scan

Packaged releases — PyPI, a container image on GHCR, and standalone binaries with SHA-256 checksums and a CycloneDX SBOM — follow the first tagged release. The release pipeline that produces them is already in the repository.