System Diagramming (Archify Style)
Priority: P1 (HIGH)
Author a typed JSON spec, then render. Never hand-place pixels in prose, and never ship Mermaid as the deliverable.
Pick One Type
| Type | Use for |
|---|---|
architecture |
Components, services, cloud and trust boundaries |
workflow |
Processes, approval gates, runbooks, CI/CD |
sequence |
Call chains, request lifecycles, async traces |
dataflow |
Pipelines, ETL, lineage, consumers |
lifecycle |
State transitions, retries, terminal states |
One type per diagram. A design doc usually needs architecture plus one of sequence or dataflow.
Render Path
- Check whether the Archify skill is installed (
archify/SKILL.mdunder any agent skills directory). - Installed: author the JSON against its
schemas/<type>.schema.json, then runarchify validate <type> <file>.jsonafter every edit andarchify deliveronce at the end. A non-zero exit is never a success. - Not installed: emit inline SVG directly, following the style contract. Same tokens, same geometry, same legend rules.
- Either way the spec is the source of truth: nodes carry
id,type,label, optionalsublabelandtag; edges carryfrom,to,label,variant; groups list the ids theywrap.
Semantics Are Colors
- Node
typeis meaning, not decoration:frontend,backend,database,cloud,security,messagebus,external. - Edge
variantis meaning:defaultplain call,emphasismain request path,securityauth or policy hop,dashedasync or event. - Never introduce a color outside that map, and never inline a literal hex that breaks dark/light parity.
- Group frames come in two kinds only:
regionfor deployment or ownership,security-groupfor a trust boundary.
Composition Rules
- One left-to-right main path; side branches leave the nearest main-path node.
- At most 12 primary nodes. Split the view before crowding it.
- Number every lane or stage as
01 / Label, in order. - Every edge carries a label unless both endpoints already imply the protocol, direction, and sync behavior.
- Spacing means clear gap, not center distance: leave more than the label mask width plus 8px.
- Legend is mandatory and lists only the kinds actually present.
Repair Order
Fix in this sequence, one diagnosed control at a time: schema errors, then node overlap or out-of-range placement, then edges crossing an opaque node, then ambiguous corridors and crossings, then label clearance.
Anti-Patterns
- No Mermaid deliverable: read Mermaid for topology if given, then author fresh in this format.
- No edge through an unrelated node: always a hard failure, never an acceptable trade.
- No label deleted to fix geometry: labels are data; reroute instead.
- No decorative accent: every saturated color maps to a node or relationship meaning.
- No coordinates planned in prose: write the spec, render, then read the diagnostics.
References
- Archify Style Contract - tokens, geometry, SVG scaffold, per-type layout bands