Architecture-Diagram Conventions¶
Kind: how-to
Read this page before you draw or change a Taskbase architecture diagram, whether you are an agent working through the MCP tools or a person on the canvas. Draw one level of detail per diagram, make every group a software system, and give each connection a short label that says why it exists. The rest of this page spells out what that means.
The conventions are based on the C4 model. They were adopted in
Taskbase decision #1046 (phase 1), from the survey
docs/diagram-frameworks-survey.md
in Skatzi/taskbase (section R1), which explains why. How the diagram tools, ops and canvas
work is described in Architecture Diagrams. None of these
conventions changes the model, the ops or the layout rules: they only shape what you put in.
1. Pick one level and say it in the description¶
Every diagram shows exactly one of these levels:
| Level | Shows | Groups stand for | Leave out |
|---|---|---|---|
| Landscape | People and software systems, one box per system | Software systems, if you group at all | Containers, in-process parts, infrastructure |
| Container | One software system's deployable parts (APIs, UIs, workers) and its datastores and queues; the people and other systems it talks to, as single boxes outside it | The software system in scope | In-process parts, infrastructure |
| Component | The in-process parts of one container: modules, adapters, handlers | The container in scope | Other containers' insides, infrastructure |
| Deployment | Clusters, namespaces, machines, and what runs on them | Clusters, namespaces, machines | In-process parts |
When you create the diagram, its description names the level and the scope:
- "Landscape of Skatzi"
- "Containers of Taskbase"
- "Deployment of hetzner-mgmt (prod)"
If the box you want to add belongs to another level, it goes in another diagram, not this one.
Check list_diagrams for one that already covers that level and scope before creating a new
one.
2. Follow the rules¶
Structure
- One level per diagram. Do not mix people, applications, in-process parts and clusters in one drawing.
- In landscape and container diagrams a group is a software system. It is never a cluster, a namespace, a machine or a network.
- Clusters, namespaces, gateways, GitOps (Flux) and secret operators (External Secrets) appear only in deployment diagrams.
- In-process parts appear only in component diagrams. An adapter or a proxy that runs inside another program is not a box in a container diagram.
- One box per piece of software. Never add a second copy of the same software because it also runs somewhere else; where it runs is a deployment diagram's business.
- No connections to groups. Connect the box inside the group that actually sends or receives.
- About 15 boxes per diagram and 8 per group. These limits are a guideline, not a rule:
check_diagramwarns past them but never refuses a save. Past them, split a landscape, container or component diagram by level or scope. - A deployment diagram shows the whole cluster, even past 15 boxes. Draw every namespace of
the cluster in one diagram, each software once; never split a cluster into numbered parts
that draw the gateway or Flux again. Keep groups readable by nesting the namespaces in a few
area groups (for example core, platform services, hosted workloads, cluster add-ons), and
leave the
too_many_boxeswarning in place. "Deployment of hetzner-mgmt (prod)" (diagram #7 in organization 2) is drawn this way, decided by the owner on 2026-10-18 (Taskbase task #1156).
Component types. Use the types as Component types
describes them. In a landscape diagram a system of your own organization is a service box and a
third party's or another organization's system is an external box. A person is a role or
user group that acts, not a configuration file: agent personas are not people, the runners that
use them are the actors.
Connection labels
- Say the intent as a verb phrase of at most about 40 characters: "claims tasks", "signs in users", "pushes images".
- Put the protocol in
protocol(HTTPS,OIDC,SQL,gRPC), not in the label. - Never use hostnames or URLs as labels. "gitea.prod.skatzi.com" is routing configuration, not intent.
- When the intent changes, rewrite the label with
update_connectionso it states the current intent. Do not append what changed: the history already records it.
Keys and names
- No environment or cluster prefixes in keys and names:
gateway, notmgmt-gateway; "Taskbase", not "Taskbase (tasks-prod)". The diagram's description carries the environment when it matters, as in "Deployment of hetzner-mgmt (prod)". - Keys stay readable slugs, as the tool text requires (
taskbase-api, nevernode1).
3. Build in this order¶
list_diagrams, thencreate_diagramwith the level and scope in its description, orget_diagramon the existing one.- One
apply_diagram_opsbatch per system: the system's group, its boxes and the connections inside it, together. - Then one batch with the connections between systems.
- Every summary names the task and the system, e.g.
#1086: add Taskbase containers.
Building system by system keeps the history readable one system at a time, and gives the layout rules, which place a new box next to the box it shares the most connections with, the connections they need. A first draft that adds every box first and every connection afterwards loses both.
4. Check the draft¶
After your last apply_diagram_ops batch, call check_diagram with the diagram's id. It
reads the current model and lists warnings; it never changes the diagram, and no batch is ever
refused because of a warning. Fix what it points out in one more batch where your task allows,
and say in your final comment which warnings you left on purpose. People can call the REST route
behind it, GET /api/diagrams/{id}/check; the tool and the route are described in
Architecture Diagrams.
Each warning has a code, the keys of the components or connections involved, and a message
that says what to change. The codes, the rule each one stands for, and when it fires (read from
api/internal/diagram/check.go in Skatzi/taskbase, merged in PR #439, on 2026-10-18):
| Code | Rule | Fires when |
|---|---|---|
too_many_boxes |
About 15 boxes per diagram | More than 15 boxes. A box is any component except groups and notes. keys is empty |
group_too_large |
About 8 boxes per group | A group has more than 8 direct children, of any type, nested groups and notes included |
mixed_levels |
One level per diagram | The diagram has all three of: a person or external system; a service, data store or queue; and deployment infrastructure (see below), and its description does not start with "Deployment of" (any case; leading spaces and the Markdown marks *, _ and # are skipped): a deployment diagram draws all three. keys lists the infrastructure |
connection_on_group |
No connections to groups | A connection starts or ends on a group |
duplicate_name |
One box per piece of software | Two or more boxes have the same name once case, punctuation and the words pod(s), instance(s), replica(s), deployment, container(s), copy, prod, production, dev, staging and test are left out |
twin_components |
One box per piece of software; in-process parts only in component diagrams | Two or more boxes with at least one connection have exactly the same connections: same direction, other end and label |
label_hostname |
Never hostnames or URLs as labels | The label holds scheme:// or a dotted name ending in a common domain such as .com, .dk, .local or .svc |
label_empty |
Say the intent | The label is empty |
label_too_long |
At most about 40 characters | The label is longer than 40 characters |
label_one_word |
Say the intent as a verb phrase | The label is a single word, such as "writes" or "HTTPS" |
missing_tech |
None on this page: tech says what a box is built with | A box other than a person has no tech. Reported once, with all such keys |
missing_description |
None on this page: a description says what a component does | A component other than a note, groups included, has no description. Reported once, with all such keys |
fan_out_hub |
Gateways only in deployment diagrams | A box has more than 8 connections and at least 80 % of them go out, like a gateway drawn with one line per route |
A connection gets at most one label warning, checked in the order of the table: a hostname label is not also reported as too long.
Deployment infrastructure, for mixed_levels, is a service, data store or queue whose key or
name holds one of these words, or a group whose key, name or tech holds one: cluster, clusters,
namespace, namespaces, kubernetes, k8s, node, nodes, machine, machines, vm, vms, pod, pods, gateway,
ingress, flux, argocd, gitops, operator, helm, secret, secrets, eso. Only these whole words count, in any case, so "Gateways" and
"Operators" are not infrastructure, while "External Secrets" and "ESO" are. A box's tech is not read, so "Gitea" with tech "Helm" is not
infrastructure.
Limits. The check looks for words and counts, not meaning:
- It knows a diagram's level only from the start of its description, and only the deployment
level: "Deployment of …" turns
mixed_levelsoff. A container diagram that holds clusters but no person or external system gets nomixed_levels, nor does one whose description wrongly starts with "Deployment of", and in-process parts are only caught when they are twins. - It does not check that the description states the level and scope.
- It does not look for environment prefixes in keys (
mgmt-gateway), only drops environment words when comparing names. - Any box whose name or key holds "secret", "secrets" or "eso" counts as a secret operator, so a data store named "Secrets store" is reported as infrastructure too.
fan_out_hubis not the canvas's hub: the canvas draws chips for components connected to many others, whatever the direction; the warning is about outgoing fan-out only.- The thresholds (15, 8, 40, more than 8 connections at 80 %) are fixed in the code and are the same starting values as the size limits above (see Open questions).
5. Link each system to the diagram that details it¶
On a landscape diagram, link every system that has a container diagram to that diagram. A reader then opens "Containers of Taskbase" from the Taskbase box in "Landscape of Skatzi" instead of looking for it on the Architecture tab. Link the same way from any box to the diagram one level down that details it, such as a container to its component diagram. Do not write the link into the box's description.
A link goes to another diagram of the same organization, never to the diagram the box is in.
As an agent, set linked_diagram_id to the id of the detailing diagram, which you find with
list_diagrams:
linked_diagram_id works in add_component too, and null in update_component removes the
link. The batch is refused if the id is not a diagram of this organization, or is the diagram
itself. Create the container diagram first, then link to it from the landscape in its own batch,
with a summary such as #1093: link Taskbase to its container diagram. The id 12 above is an
illustration; this op was not applied to a diagram.
As a person, select the box, choose the diagram under Opens diagram in its panel, and click Save.
A linked box gets a round Open diagram button on its top right corner; the opened diagram's top bar leads back. What the canvas does is described in Linked diagrams.
Example: diagram #1, before and after¶
Diagram #1, "Skatzi platform" (organization 2), was the first diagram an agent drew (task #706). The survey found these problems in its revision 13:
| # | What happened | Rule it breaks |
|---|---|---|
| P1 | 37 components spanning four levels in one diagram: people, applications, in-process adapters and cluster infrastructure | One level per diagram |
| P2 | The top-level groups are clusters (hetzner-mgmt) and machines ("Agent runners"); agent-runner is drawn twice; 4 connections end on a group |
A group is a software system; one box per piece of software; no connections to groups |
| P3 | claude-code-adapter and codex-adapter each have the same 3 outgoing connections, so 6 lines say what 3 would |
In-process parts only in component diagrams |
| P4 | 10 of 63 labels are hostnames; one label grew from 47 to 92 characters as edits were appended | Labels state intent, ≤ ~40 characters; rewrite, don't append |
| P5 | The gateway has 12 connections, 10 of them "this hostname routes here"; Flux and External Secrets add 9 lines of wiring | Gateways, GitOps and secret operators only in deployment diagrams |
| P6 | Revisions 1–4 added all 41 components and no connections; revisions 5–6 added all 60 connections | One batch per system, then the connections between systems |
| P7 | Some keys carry a mgmt- prefix and some do not; names such as "Taskbase (tasks-prod)" |
No environment prefixes |
Bad — the gateway and Gitea inside a cluster group, joined by a hostname (shape of diagram
1's mgmt-gateway → gitea):¶
[
{"op": "add_component", "key": "hetzner-mgmt", "type": "group", "name": "hetzner-mgmt cluster"},
{"op": "add_component", "key": "mgmt-gateway", "type": "service", "name": "Gateway", "parent": "hetzner-mgmt", "tech": "Cilium Gateway API"},
{"op": "add_component", "key": "gitea", "type": "service", "name": "Gitea", "parent": "hetzner-mgmt"},
{"op": "add_connection", "from": "mgmt-gateway", "to": "gitea", "label": "gitea.prod.skatzi.com"}
]
Good — in "Landscape of Skatzi", Gitea is one system box, and the line says what the developer does with it. The gateway is left for "Deployment of hetzner-mgmt (prod)":
[
{"op": "add_component", "key": "developer", "type": "person", "name": "Developer"},
{"op": "add_component", "key": "gitea", "type": "service", "name": "Gitea", "tech": "Gitea with Actions"},
{"op": "add_connection", "from": "developer", "to": "gitea", "label": "pushes code and reviews PRs", "protocol": "HTTPS"}
]
Both are the ops array of an apply_diagram_ops call, written with the op fields listed in
Architecture Diagrams. They are
illustrations and were not applied to a diagram.
Brief template for "map the architecture of X" tasks¶
The project manager uses this when planning a task that draws an organization's or a system's architecture. Copy it into the task description and fill in the brackets:
## Goal
Draw the architecture of [X] in organization [id], following
docs/content/contribution/guides/architecture-diagram-conventions.md.
## Diagrams
1. A landscape diagram first, described as "Landscape of [X]": people and software
systems only, one box per system.
2. Then one container diagram per system that needs one, described as
"Containers of [system]": [list the systems].
Do not add deployment infrastructure (clusters, gateways, Flux, External Secrets)
unless the task asks for a deployment diagram.
## Sources
[Repositories and docs to read. Don't guess.]
## Build
One apply_diagram_ops batch per system, then the connections between systems;
each summary names the task and the system. Set project_id on boxes that have a
Taskbase project: [project ids]. Once a container diagram exists, set
linked_diagram_id on its system's box in the landscape.
## Done when
The diagrams exist, each within about 15 boxes, and the final comment lists
anything you were not sure about.
Do not ask for one diagram of everything, a component count such as "25–50 components", or groups per cluster: diagram #1's brief (task #706) asked for all three, and the survey traces part of P1 and P2 to it.
Open questions¶
- Size limits. About 15 boxes per diagram and 8 per group are the survey's starting values, not taken from any source, and stay a guideline. Deployment diagrams are exempt from the box limit (task #1156); the readability decision (task #1087) settles the rest.
- What these conventions cannot express, such as a system that is also a cluster or a gateway on a line, is collected by the redraw and decided in phase 2. Drill-down between diagrams is now expressed by linking a box (Taskbase task #1092). The redraw's findings are in Phase 1 Redraw of the Skatzi Platform.