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.
---
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
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 scanBuild the metadata index — every artifact, every link, as plain JSON.
amark validate --strictA blocking CI gate: id grammar, collisions, dangling links, unregistered names. Exhaustive and exact.
amark c4Generate a Mermaid C4 document — System Context plus one Container diagram per system, viewable on GitHub/GitLab.
amark impact BE-ORDERSWhat breaks if this changes? Direct dependencies plus transitive dependents.
amark graphThe full relationship graph, ready for any downstream tool.
amark techA technology inventory across artifacts — end-of-life questions, answered from metadata.
amark mergeCombine per-repo indexes into one global graph, with exact cross-repo id-collision detection.
amark export / importExport 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 --strictis offline and exact, so the agent-visible model can never silently rot the way prose conventions do. - Agents consume it.
amark scan --jsonandamark impactgive an agent ground truth instead of re-deriving your architecture every session.
# 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.
pip install git+https://github.com/architecture-markup/amark.git
amark scan .git clone https://github.com/architecture-markup/amark.git
cd amark && make build && make scanPackaged 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.
Documentation
Primer
A friendly introduction to the idea and the common patterns. Start here.
Specification v0.2
The normative rules: metadata model, id grammar, kind and relationship registries, processing model.
Positioning
How AMARK relates to Backstage, EA tools, and C4 tooling — read this if your reaction is “don’t we already have this?”
Cheat sheet
Every key, prefix, and relationship on one page.
Agent instructions
A stable URL you point any AI coding agent at to mark up a repository.
Multi-repo adoption guide
A practical rollout across many repositories, with a central catalog template.