chompyy 0.1.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/README.md +82 -8
  2. package/THIRD_PARTY_NOTICES.md +29 -1
  3. package/dist/appstate.js +121 -4
  4. package/dist/away.js +191 -25
  5. package/dist/blueprint.js +102 -7
  6. package/dist/board.js +143 -15
  7. package/dist/catalog.js +81 -0
  8. package/dist/claudesettings.js +23 -0
  9. package/dist/cli.js +804 -55
  10. package/dist/coldstart.js +208 -0
  11. package/dist/config.js +43 -8
  12. package/dist/costs.js +162 -0
  13. package/dist/deps.js +124 -0
  14. package/dist/dream.js +422 -0
  15. package/dist/duration.js +3 -3
  16. package/dist/gate.js +40 -5
  17. package/dist/history.js +308 -0
  18. package/dist/live.js +255 -0
  19. package/dist/livequota.js +42 -5
  20. package/dist/macapp.js +25 -2
  21. package/dist/pacing.js +189 -0
  22. package/dist/permissions.js +106 -0
  23. package/dist/picture.js +124 -0
  24. package/dist/picturetype.js +208 -0
  25. package/dist/preflight.js +168 -0
  26. package/dist/projects.js +5 -4
  27. package/dist/quota.js +31 -5
  28. package/dist/refresh.js +290 -0
  29. package/dist/report.js +41 -21
  30. package/dist/review.js +111 -11
  31. package/dist/runner.js +318 -10
  32. package/dist/taste.js +528 -0
  33. package/dist/tokens.js +75 -0
  34. package/dist/tokenstore.js +61 -0
  35. package/dist/trace.js +284 -0
  36. package/dist/triggers.js +193 -0
  37. package/dist/usage.js +467 -0
  38. package/dist/vendor/codeburn/prices.js +45 -0
  39. package/dist/verify.js +150 -0
  40. package/dist/verifycard.js +146 -0
  41. package/dist/workspace.js +132 -18
  42. package/package.json +4 -2
  43. package/skills/taste/SKILL.md +4 -1
  44. package/vendor/diagram-design/LICENSE +21 -0
  45. package/vendor/diagram-design/SKILL.md +399 -0
  46. package/vendor/diagram-design/UPSTREAM.md +18 -0
  47. package/vendor/diagram-design/assets/example-arc-diagram.html +111 -0
  48. package/vendor/diagram-design/assets/example-architecture-containment.html +205 -0
  49. package/vendor/diagram-design/assets/example-architecture-delta.html +193 -0
  50. package/vendor/diagram-design/assets/example-architecture.html +183 -0
  51. package/vendor/diagram-design/assets/example-axonometric-plan-campus.html +108 -0
  52. package/vendor/diagram-design/assets/example-axonometric-plan-coffee-shop.html +121 -0
  53. package/vendor/diagram-design/assets/example-axonometric-plan-warehouse.html +127 -0
  54. package/vendor/diagram-design/assets/example-axonometric-plan.html +114 -0
  55. package/vendor/diagram-design/assets/example-bar.html +129 -0
  56. package/vendor/diagram-design/assets/example-beeswarm.html +384 -0
  57. package/vendor/diagram-design/assets/example-box-plot.html +127 -0
  58. package/vendor/diagram-design/assets/example-bubble.html +147 -0
  59. package/vendor/diagram-design/assets/example-bump.html +142 -0
  60. package/vendor/diagram-design/assets/example-data-flow.html +143 -0
  61. package/vendor/diagram-design/assets/example-datalake.html +269 -0
  62. package/vendor/diagram-design/assets/example-db-schema.html +302 -0
  63. package/vendor/diagram-design/assets/example-dependency.html +224 -0
  64. package/vendor/diagram-design/assets/example-deployment.html +190 -0
  65. package/vendor/diagram-design/assets/example-dp-integration.html +81 -0
  66. package/vendor/diagram-design/assets/example-dp-security-matrix.html +88 -0
  67. package/vendor/diagram-design/assets/example-er.html +202 -0
  68. package/vendor/diagram-design/assets/example-event-modeling.html +64 -0
  69. package/vendor/diagram-design/assets/example-exploded-ai-stack.html +85 -0
  70. package/vendor/diagram-design/assets/example-exploded-keyboard.html +84 -0
  71. package/vendor/diagram-design/assets/example-exploded-phone.html +83 -0
  72. package/vendor/diagram-design/assets/example-exploded-unboxing.html +84 -0
  73. package/vendor/diagram-design/assets/example-exploded.html +83 -0
  74. package/vendor/diagram-design/assets/example-fishbone.html +152 -0
  75. package/vendor/diagram-design/assets/example-flowchart.html +163 -0
  76. package/vendor/diagram-design/assets/example-gantt.html +137 -0
  77. package/vendor/diagram-design/assets/example-heatmap.html +224 -0
  78. package/vendor/diagram-design/assets/example-high-level-vertical.html +325 -0
  79. package/vendor/diagram-design/assets/example-high-level.html +301 -0
  80. package/vendor/diagram-design/assets/example-import-drawio.html +185 -0
  81. package/vendor/diagram-design/assets/example-import-excalidraw.html +70 -0
  82. package/vendor/diagram-design/assets/example-import-mermaid.html +70 -0
  83. package/vendor/diagram-design/assets/example-import-plantuml.html +107 -0
  84. package/vendor/diagram-design/assets/example-it-state.html +128 -0
  85. package/vendor/diagram-design/assets/example-journey.html +148 -0
  86. package/vendor/diagram-design/assets/example-kanban.html +174 -0
  87. package/vendor/diagram-design/assets/example-layers.html +123 -0
  88. package/vendor/diagram-design/assets/example-line.html +111 -0
  89. package/vendor/diagram-design/assets/example-loop.html +100 -0
  90. package/vendor/diagram-design/assets/example-marimekko.html +148 -0
  91. package/vendor/diagram-design/assets/example-medallion.html +159 -0
  92. package/vendor/diagram-design/assets/example-nested.html +136 -0
  93. package/vendor/diagram-design/assets/example-org-chart.html +45 -0
  94. package/vendor/diagram-design/assets/example-polar.html +116 -0
  95. package/vendor/diagram-design/assets/example-process.html +64 -0
  96. package/vendor/diagram-design/assets/example-pyramid.html +119 -0
  97. package/vendor/diagram-design/assets/example-quadrant-consultant.html +166 -0
  98. package/vendor/diagram-design/assets/example-quadrant.html +135 -0
  99. package/vendor/diagram-design/assets/example-radar.html +139 -0
  100. package/vendor/diagram-design/assets/example-requirement-traceability.html +122 -0
  101. package/vendor/diagram-design/assets/example-ridgeline.html +104 -0
  102. package/vendor/diagram-design/assets/example-sankey.html +150 -0
  103. package/vendor/diagram-design/assets/example-sbgn.html +213 -0
  104. package/vendor/diagram-design/assets/example-scatter.html +141 -0
  105. package/vendor/diagram-design/assets/example-sequence-oauth.html +227 -0
  106. package/vendor/diagram-design/assets/example-sequence.html +222 -0
  107. package/vendor/diagram-design/assets/example-service-blueprint.html +185 -0
  108. package/vendor/diagram-design/assets/example-slopegraph.html +119 -0
  109. package/vendor/diagram-design/assets/example-state-lifecycle.html +92 -0
  110. package/vendor/diagram-design/assets/example-state.html +147 -0
  111. package/vendor/diagram-design/assets/example-steps.html +78 -0
  112. package/vendor/diagram-design/assets/example-story-map.html +184 -0
  113. package/vendor/diagram-design/assets/example-streamgraph.html +99 -0
  114. package/vendor/diagram-design/assets/example-swimlane.html +172 -0
  115. package/vendor/diagram-design/assets/example-timeline.html +135 -0
  116. package/vendor/diagram-design/assets/example-tree-block-decomposition.html +151 -0
  117. package/vendor/diagram-design/assets/example-tree.html +173 -0
  118. package/vendor/diagram-design/assets/example-treemap.html +107 -0
  119. package/vendor/diagram-design/assets/example-uml-class.html +188 -0
  120. package/vendor/diagram-design/assets/example-unit-grid.html +141 -0
  121. package/vendor/diagram-design/assets/example-venn.html +110 -0
  122. package/vendor/diagram-design/assets/example-wardley.html +153 -0
  123. package/vendor/diagram-design/assets/example-waterfall.html +129 -0
  124. package/vendor/diagram-design/assets/template-dark.html +99 -0
  125. package/vendor/diagram-design/assets/template.html +100 -0
  126. package/vendor/diagram-design/references/layout-budget.md +103 -0
  127. package/vendor/diagram-design/references/output-spec.md +277 -0
  128. package/vendor/diagram-design/references/primitive-annotation.md +36 -0
  129. package/vendor/diagram-design/references/primitive-sketchy.md +43 -0
  130. package/vendor/diagram-design/references/primitives-core.md +146 -0
  131. package/vendor/diagram-design/references/semantic-patterns.md +154 -0
  132. package/vendor/diagram-design/references/style-guide.md +234 -0
  133. package/vendor/diagram-design/references/type-architecture-delta.md +143 -0
  134. package/vendor/diagram-design/references/type-architecture.md +117 -0
  135. package/vendor/diagram-design/references/type-axonometric-plan.md +83 -0
  136. package/vendor/diagram-design/references/type-bar.md +108 -0
  137. package/vendor/diagram-design/references/type-data-flow.md +371 -0
  138. package/vendor/diagram-design/references/type-db-schema.md +48 -0
  139. package/vendor/diagram-design/references/type-dependency.md +113 -0
  140. package/vendor/diagram-design/references/type-deployment.md +45 -0
  141. package/vendor/diagram-design/references/type-dp-integration.md +407 -0
  142. package/vendor/diagram-design/references/type-dp-security-matrix.md +379 -0
  143. package/vendor/diagram-design/references/type-er.md +25 -0
  144. package/vendor/diagram-design/references/type-event-modeling.md +36 -0
  145. package/vendor/diagram-design/references/type-exploded.md +115 -0
  146. package/vendor/diagram-design/references/type-fishbone.md +75 -0
  147. package/vendor/diagram-design/references/type-flowchart.md +23 -0
  148. package/vendor/diagram-design/references/type-gantt.md +45 -0
  149. package/vendor/diagram-design/references/type-heatmap.md +80 -0
  150. package/vendor/diagram-design/references/type-high-level.md +470 -0
  151. package/vendor/diagram-design/references/type-it-state.md +468 -0
  152. package/vendor/diagram-design/references/type-journey.md +55 -0
  153. package/vendor/diagram-design/references/type-kanban.md +49 -0
  154. package/vendor/diagram-design/references/type-layers.md +26 -0
  155. package/vendor/diagram-design/references/type-line.md +337 -0
  156. package/vendor/diagram-design/references/type-loop.md +223 -0
  157. package/vendor/diagram-design/references/type-medallion.md +356 -0
  158. package/vendor/diagram-design/references/type-nested.md +22 -0
  159. package/vendor/diagram-design/references/type-org-chart.md +44 -0
  160. package/vendor/diagram-design/references/type-polar.md +136 -0
  161. package/vendor/diagram-design/references/type-process.md +490 -0
  162. package/vendor/diagram-design/references/type-pyramid.md +33 -0
  163. package/vendor/diagram-design/references/type-quadrant.md +81 -0
  164. package/vendor/diagram-design/references/type-radar.md +82 -0
  165. package/vendor/diagram-design/references/type-requirement-traceability.md +45 -0
  166. package/vendor/diagram-design/references/type-sankey.md +75 -0
  167. package/vendor/diagram-design/references/type-sbgn.md +80 -0
  168. package/vendor/diagram-design/references/type-scatter.md +276 -0
  169. package/vendor/diagram-design/references/type-sequence.md +130 -0
  170. package/vendor/diagram-design/references/type-service-blueprint.md +103 -0
  171. package/vendor/diagram-design/references/type-state.md +30 -0
  172. package/vendor/diagram-design/references/type-steps.md +180 -0
  173. package/vendor/diagram-design/references/type-story-map.md +46 -0
  174. package/vendor/diagram-design/references/type-swimlane.md +22 -0
  175. package/vendor/diagram-design/references/type-timeline.md +20 -0
  176. package/vendor/diagram-design/references/type-tree.md +24 -0
  177. package/vendor/diagram-design/references/type-treemap.md +137 -0
  178. package/vendor/diagram-design/references/type-uml-class.md +65 -0
  179. package/vendor/diagram-design/references/type-unit-grid.md +63 -0
  180. package/vendor/diagram-design/references/type-venn.md +26 -0
  181. package/vendor/diagram-design/references/type-wardley.md +39 -0
  182. package/vendor/diagram-design/references/type-waterfall.md +75 -0
  183. package/vendor/diagram-design/scripts/self_check.py +1177 -0
  184. package/vendor/diagram-design/scripts/verify_geometry.py +696 -0
@@ -0,0 +1,277 @@
1
+ # Draw.io import output spec — format × size × detail × audience
2
+
3
+ Four dials decide what an imported diagram becomes. Set them **before** redrawing — they change the deliverable, layout, type ramp, node count, and wording, so retrofitting them afterwards means redrawing.
4
+
5
+ | Dial | Question it answers | Default |
6
+ |---|---|---|
7
+ | **Format** | Where does this file land? | `html` |
8
+ | **Size** | How big is the canvas, and how far away is the reader? | `doc-inline` |
9
+ | **Detail level** | Reproduce every element, or compress it? | `balanced` |
10
+ | **Audience** | How technical should the wording be? | `mixed` |
11
+
12
+ Infer choices that are clear from the request (for example, "for my deck" implies a slide preset). Ask one concise question for anything material that remains ambiguous. If the user does not care, use the defaults above and say which ones you used.
13
+
14
+ ---
15
+
16
+ ## 1. Format
17
+
18
+ | Format | Deliverable | Keeps | Drops |
19
+ |---|---|---|---|
20
+ | `html` | self-contained `.html` (default) | header, diagram, summary cards, footer, live fonts | nothing |
21
+ | `svg` | `.svg` next to the source | the `<svg>` node, vector text | editorial wrapper; fonts substitute in offline tools |
22
+ | `png` | `.png` at `device_scale_factor` | pixels exactly as the browser renders them | vector editability |
23
+ | `html+png` | both | — | — |
24
+
25
+ Always generate the HTML first — `svg` and `png` are produced *from* it via [`export.md`](export.md). Never hand-author an SVG file directly; the HTML is the source of truth and the only artifact the taste gate (SKILL.md §9) is written against.
26
+
27
+ Pick by destination:
28
+
29
+ | Destination | Format | Size preset |
30
+ |---|---|---|
31
+ | Blog post, README, docs site | `html` (embed) or `png` | `doc-inline` |
32
+ | Keynote / PowerPoint / Google Slides | `png` @2 | `slide-16x9` |
33
+ | Figma / Illustrator / further editing | `svg` | `fit` |
34
+ | X / LinkedIn / OG link card | `png` @2 | `social-og` |
35
+ | Printed handout, PDF deck | `png` @3 | `print-a4-landscape` |
36
+ | Confluence / Notion / internal wiki | `png` @2 | `doc-wide` |
37
+
38
+ ---
39
+
40
+ ## 2. Size
41
+
42
+ The preset sets the SVG `viewBox`. Every value below is divisible by 4, so the grid rule in SKILL.md §7 still holds.
43
+
44
+ | Preset | viewBox | Aspect | PNG @2 | Type ramp | Use |
45
+ |---|---|---|---|---|---|
46
+ | `doc-inline` (default) | `0 0 960 600` | 8:5 | 1920×1200 | standard | Body-width diagram in a post or README |
47
+ | `doc-wide` | `0 0 1280 720` | 16:9 | 2560×1440 | standard | Full-width docs, wiki pages |
48
+ | `slide-16x9` | `0 0 1280 720` | 16:9 | 2560×1440 | presentation | Deck slide, projected |
49
+ | `slide-4x3` | `0 0 1024 768` | 4:3 | 2048×1536 | presentation | Legacy deck templates |
50
+ | `social-og` | `0 0 1200 632` | ~1.9:1 | 2400×1264 | presentation | Link preview card |
51
+ | `social-square` | `0 0 1080 1080` | 1:1 | 2160×2160 | presentation | Feed post, carousel |
52
+ | `print-a4-landscape` | `0 0 1120 792` | ~1.41:1 | @3 → 3360×2376 | print | A4 landscape, ~10mm margins at 96dpi |
53
+ | `print-a3-landscape` | `0 0 1584 1120` | ~1.41:1 | @3 → 4752×3360 | print | A3 landscape, ~10mm margins at 96dpi |
54
+ | `print-letter-landscape` | `0 0 1056 816` | ~1.29:1 | @3 → 3168×2448 | print | US Letter landscape |
55
+ | `fit` | derived from content | any | @2 | standard | Vector hand-off; no fixed frame |
56
+
57
+ ### Holding the canvas on a narrow screen
58
+
59
+ The SVG keeps its readable width on a phone instead of shrinking into it, so
60
+ `min-width` is **the viewBox width of the preset in use** — not a fixed number.
61
+ Pin it lower and the whole drawing scales down and takes the type ramp with it:
62
+ a 12px node name on a `doc-wide` 1280 viewBox pinned at 900 draws at 8.4px,
63
+ under every floor this spec sets, and nothing on screen says so.
64
+
65
+ A canvas that wide has to scroll somewhere. Put it in a wrapper that scrolls on
66
+ its own, or the document scrolls sideways and the right-hand nodes are gone
67
+ unless the reader thinks to look for them:
68
+
69
+ ```html
70
+ <div class="diagram-container">
71
+ <svg viewBox="0 0 960 600" …> … </svg>
72
+ </div>
73
+ ```
74
+
75
+ ```css
76
+ .diagram-container { width: 100%; overflow-x: auto; }
77
+ svg { width: 100%; min-width: 960px; display: block; }
78
+ ```
79
+
80
+ Two shapes need extra care. A centred grid or flex item sizes itself to the
81
+ SVG's max-content width, so the wrapper's `width: 100%` resolves against the
82
+ wide item and never scrolls — give that item `max-width: 100%; min-width: 0`.
83
+ And when an ancestor is `overflow: hidden` (window chrome, a clipped card), the
84
+ SVG is cut off instead of scrolled: no scrollbar, no page overflow, and a
85
+ page-overflow check reports the file clean because the content was destroyed
86
+ rather than spilled. The wrapper has to sit **inside** that ancestor.
87
+
88
+ Paper has no scrollbar, so on a sheet the same wrapper clips instead of
89
+ scrolls. Release both in print and let the drawing scale to fit — smaller but
90
+ whole beats sharp but cut off. The rule has to come **after** the `svg` rule,
91
+ because a media query adds no specificity and a later plain rule would win:
92
+
93
+ ```css
94
+ @media print {
95
+ .diagram-container { overflow-x: visible; }
96
+ svg { min-width: 0; }
97
+ }
98
+ ```
99
+
100
+ `scripts/lint-render.py --all` renders every template at 390px and fails on
101
+ page overflow, an unreachable clipped SVG, a missing local scroller, or a
102
+ `min-width` that disagrees with the viewBox — including an absent one, which
103
+ lets the SVG shrink into the phone and takes the type ramp with it.
104
+
105
+ ### Deriving `fit`
106
+
107
+ Round the content bounding box **up** to the next multiple of 4, then add the fixed chrome: 40px outer margin on every side, plus 60px at the bottom for the legend strip. Never let the content touch the viewBox edge.
108
+
109
+ ### Type ramp per size class
110
+
111
+ Node names shrink relative to the canvas as it grows — resist that. Scale the ramp with the preset so a projected slide stays readable from the back row.
112
+
113
+ | Role | standard | presentation | print |
114
+ |---|---|---|---|
115
+ | Title (Instrument Serif) | 28 | 40 | 32 |
116
+ | Node name (Geist 600) | 12 | 16 | 12 |
117
+ | Sublabel (Geist Mono) | 9 | 12 | 9 |
118
+ | Arrow label (Geist Mono) | 8 | 12 | 8 |
119
+ | Eyebrow / tag (Geist Mono) | 8 | 8 | 8 |
120
+ | Node box min height | 48 | 64 | 48 |
121
+ | Min gap between nodes | 24 | 40 | 24 |
122
+
123
+ The families named in these tables are the default skin's, and they are what `scripts/verify-docs-sync.py` binds each size to. Under a custom skin, read them as the `title`, `node-name`, `sublabel`, `arrow-label`, and `eyebrow` roles from [`style-guide.md`](style-guide.md); type references write those roles as `{node-name}` and so on.
124
+
125
+ Every `font-size` is one of the role values above for the preset in use, or one of these named exceptions:
126
+
127
+ | Exception | Font | Sizes |
128
+ |---|---|---|
129
+ | Dense annotation: legend keys, axis ticks, chart data labels, source lines, in-box tags | Geist Mono or Geist regular | 7 to 11, half steps allowed |
130
+ | Chart series or row name: bar category, line or bump series, gantt row, matrix header | Geist 600 | 10 to 11 |
131
+ | Group or entity heading | Geist 600 | 14 |
132
+ | Decorative watermark numerals at or under 0.08 opacity | any | any |
133
+
134
+ An exception is bound to the font beside it, weight included: Geist at 600 or heavier is the node-name voice, lighter Geist is annotation. So a Geist 600 node name cannot borrow the dense-annotation range down to 7, and a Geist Mono tick cannot borrow the 14 reserved for headings. A chart row carries a name in the same Geist 600 voice at a rank the ramp has no row for, which is why it has an exception of its own rather than a licence to shrink: `type-bar.md`, `type-gantt.md` and `type-line.md` all set that name at 10 or 11.
135
+
136
+ Anything else is a bug in the diagram, not a new size. The one standing carve-out is the closed inventory below.
137
+
138
+ ### Registered legacy sizes
139
+
140
+ Thirty-three declared sizes across sixteen files predate this contract. They are recorded here so the rule above is exact rather than aspirational, and frozen so the list cannot quietly grow. `scripts/verify-docs-sync.py` reads these rows against the files and fails if one gains an off-ramp size, loses one, or drops off disk.
141
+
142
+ Each is registered against the font carrying it, because that is what the sweep checks. It classifies every element first, resolving `class` attributes through the stylesheet, `var(--font-mono)` back to the family it names, and a `{node-name}` token to the ramp row that owns it, then applies only the exceptions open to that font. The canonical role sizes stay one union, so a size on the ramp for any role is on contract wherever it appears. An element whose font it cannot read gets no exception at all. It reads the `<svg>` and any CSS rule worn by an element inside it, so the prose around a diagram does not count as diagram type.
143
+
144
+ | File | Sizes | What they are |
145
+ |---|---|---|
146
+ | `assets/example-data-flow.html` | Geist Mono 5, Geist Mono 6 | chip text and role label, both set in CSS |
147
+ | `assets/example-data-flow-dark.html` | Geist Mono 5, Geist Mono 6 | chip text and role label, both set in CSS |
148
+ | `assets/example-data-flow-full.html` | Geist Mono 5, Geist Mono 6 | chip text and role label, both set in CSS |
149
+ | `assets/example-nested.html` | Instrument Serif 14, Instrument Serif 14 | two italic serif asides |
150
+ | `assets/example-nested-dark.html` | Instrument Serif 14, Instrument Serif 14 | two italic serif asides |
151
+ | `assets/example-nested-full.html` | Instrument Serif 14, Instrument Serif 14 | two italic serif asides |
152
+ | `assets/example-paved-road-animated.html` | Geist 600 13 | boundary node name |
153
+ | `assets/example-process.html` | Geist Mono 6 | role chip |
154
+ | `assets/example-process-dark.html` | Geist Mono 6 | role chip |
155
+ | `assets/example-process-full.html` | Geist Mono 6 | role chip |
156
+ | `assets/example-quadrant-consultant.html` | Geist 600 13 | inline dot glyph in a `tspan` |
157
+ | `assets/example-queue-animated.html` | Geist 600 13, Geist 600 22, Geist 600 24 | state caption and two fill counters |
158
+ | `assets/example-treemap.html` | Geist 600 7, Geist 600 7, Geist 600 13, Geist 600 13 | two cell index glyphs and two cell names |
159
+ | `assets/example-treemap-dark.html` | Geist 600 7, Geist 600 7, Geist 600 13, Geist 600 13 | two cell index glyphs and two cell names |
160
+ | `assets/example-treemap-full.html` | Geist 600 7, Geist 600 7, Geist 600 13, Geist 600 13 | two cell index glyphs and two cell names |
161
+ | `references/type-treemap.md` | Geist 600 13 | the cell-name line of the documented pattern |
162
+
163
+ New diagrams get no rows here. Bringing one of these onto the ramp is a visual change to a shipped example and belongs in its own PR.
164
+
165
+ Presentation ramp implies fewer nodes — 16px names in 64px boxes eat the canvas. If a `slide-16x9` layout won't fit, that's the size dial telling you the detail dial is set too high; drop a level rather than shrinking the type.
166
+
167
+ ### Safe areas
168
+
169
+ - **All presets:** 40px outer margin; legend strip is the bottom 60px and nothing else lives there.
170
+ - **`social-og`:** keep the outer 64px clear on every side — link-card crops are unpredictable across platforms.
171
+ - **`slide-*`:** keep the bottom 80px clear if the deck template has a footer bar; ask if unsure.
172
+
173
+ ---
174
+
175
+ ## 3. Detail level
176
+
177
+ How much of the source survives. This is a *count* dial — it governs how many elements make it through, not how they're worded (that's §4).
178
+
179
+ | Level | Nodes | Edges | Sublabels | What survives |
180
+ |---|---|---|---|---|
181
+ | `faithful` (詳細) | ≤24, zoned | ≤32 | every port, protocol, version | Every distinct component in the source. Only exact duplicates merge. |
182
+ | `balanced` (default) | ≤12 | ≤16 | technical sublabel on ≤4 nodes | Components that carry the story; leaf clusters collapse to one node each. |
183
+ | `simplified` (簡略) | ≤7 | ≤9 | none | Capabilities and their sequence. Infrastructure disappears. |
184
+
185
+ `balanced` and `simplified` sit inside the standard complexity budget (SKILL.md §7). **`faithful` deliberately exceeds it** — that's the trade, and it comes with conditions:
186
+
187
+ 1. **Zoning is mandatory.** Above 9 nodes, every node belongs to a labeled zone (2–4 zones, hairline-bordered, `paper-2` fill, mono uppercase zone label at top-left). An unzoned 20-node diagram is a wiring diagram, not a schematic.
188
+ 2. **Connector rules don't relax.** SKILL.md §6 rules 1–5 still apply at 24 nodes. If you can't route it without overlaps, you're over the real ceiling — split.
189
+ 3. **Above 24 nodes, split.** Produce an overview (zones as nodes, `balanced` grammar) plus one detail diagram per zone. Name them `<base>-overview.html`, `<base>-<zone>.html`. Never ship a 40-node single canvas.
190
+ 4. **Accent stays at 2.** More nodes never buys more focal elements.
191
+
192
+ ### Degrade ladder
193
+
194
+ When the source has more than the level allows, cut in this order and stop as soon as you're under budget. Never cut ad hoc.
195
+
196
+ 1. **Decorative cells** — sticky notes, free-floating text, title blocks, watermarks, the source's own legend. (Notes worth keeping become annotation callouts — max 2, see [primitive-annotation.md](primitive-annotation.md).)
197
+ 2. **Exact duplicates** — N identical workers/replicas/shards become one node labeled `Worker ×N`.
198
+ 3. **Leaf clusters** — a container whose children are all leaves collapses to the container: `Core Services` replaces its three boxes. The extractor lists these under *collapsible groups*.
199
+ 4. **Degree-1 sinks that don't change the story** — a monitoring hook, a log bucket, an archive tier.
200
+ 5. **Cross-cutting infrastructure** — logging, metrics, secrets, CI. At `simplified` these go without asking; at `balanced` keep at most one, and only if the diagram is about it.
201
+ 6. **Still over?** Split into overview + detail. Splitting beats shrinking.
202
+
203
+ Anything cut in steps 2–6 goes in the fidelity ledger (§5). Step 1 doesn't need reporting.
204
+
205
+ ---
206
+
207
+ ## 4. Audience level
208
+
209
+ Independent of the detail dial: the same 12 nodes get named differently for a platform team than for a steering committee. Detail sets *how many*; audience sets *what they're called*.
210
+
211
+ | Audience | Node names | Sublabels | Edge labels | Never |
212
+ |---|---|---|---|---|
213
+ | `engineer` | exact service / component names | protocol, port, version, image tag | `POST /v2/orders`, `SQL`, `gRPC` | Vague verbs like "connects to" |
214
+ | `mixed` (default) | component names, expanded acronyms | technology only where it changes a decision | plain verbs — `verifies`, `writes`, `notifies` | Ports, versions, internal codenames |
215
+ | `executive` | capabilities and outcomes | none | business verbs — `approves`, `pays out` | Vendor names, infrastructure, protocols |
216
+
217
+ Worked example — the same node through all three:
218
+
219
+ | Audience | Node name | Sublabel |
220
+ |---|---|---|
221
+ | `engineer` | `Auth Service` | `JWT · RS256 · :8443` |
222
+ | `mixed` | `Auth Service` | `token check` |
223
+ | `executive` | `Sign-in` | — |
224
+
225
+ Two rules that hold at every audience level:
226
+
227
+ - **Never invent detail to fill a slot.** If an input names `svc-04` but provides no explanation, keep the identifier and ask rather than guessing a business name.
228
+ - **Keep the source's vocabulary for proper nouns.** Renaming `Kafka` to `Message Bus` is fine at `executive`; renaming it to `Event Grid` (a different product) is a factual error.
229
+
230
+ ### Non-Latin labels
231
+
232
+ Geist has no CJK coverage. When labels contain Japanese, Chinese, or Korean text, extend the family on those `<text>` elements — don't swap the whole skin:
233
+
234
+ ```svg
235
+ <text font-family="'Geist', 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic', sans-serif">認証サービス</text>
236
+ <text font-family="'Geist', 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif">인증 서비스</text>
237
+ <text font-family="'Geist', 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif">认证服务</text>
238
+ <text font-family="'Geist', 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif">認證服務</text>
239
+ ```
240
+
241
+ These stacks lead with the default skin's sans. Under a custom skin, lead with the `node-name` family instead and keep the CJK fallbacks after it. The Hiragino/Yu Gothic stack carries no Hangul glyphs, so Korean labels need the Korean stack — don't reuse the Japanese one. Noto Sans KR ships in the skin's font link, so it leads that stack and the local families follow it; the register, floor, and title rules Korean needs beyond the font live in [`style-guide.md`](style-guide.md#korean-labels). Japanese fonts also cover only a subset of the Chinese character set and render Simplified forms with Japanese glyph variants, so Chinese labels need a Chinese stack; Simplified and Traditional are separate stacks for the same reason. Noto Sans TC now ships in the link too, so it leads the Traditional stack and the local families follow; the register, floor, and title rules Traditional Chinese needs beyond the font live in [`style-guide.md`](style-guide.md#traditional-chinese-labels). For mono sublabels use `'Geist Mono', 'Noto Sans Mono CJK JP', monospace` (Japanese), `'Geist Mono', 'Noto Sans Mono CJK KR', monospace` (Korean), or `'Geist Mono', 'Noto Sans Mono CJK SC', monospace` / `'Geist Mono', 'Noto Sans Mono CJK TC', monospace` (Chinese). Budget **1em per full-width CJK glyph**, not a small percentage over the average Latin glyph; `verify-treemap.py` uses that conservative contract for Unicode wide/full-width characters and treats combining marks as non-advancing. Prefer 12px names over 8px sublabels for CJK; Hangul and Han go muddy below 12px, so treat 12px as the floor rather than 10px. Actual width still varies by fallback font, so run the relevant geometry verifier after translating labels.
242
+
243
+ ---
244
+
245
+ ## 5. Fidelity ledger
246
+
247
+ Any time output is smaller than input — every `balanced` and `simplified` run, and most `faithful` ones — report what you cut, in chat, after the file path. Short and specific:
248
+
249
+ ```
250
+ Detail: balanced · 18 source nodes → 9 drawn
251
+ Merged: worker-01..06 → "Ingest Worker ×6"
252
+ Collapsed: "Observability" group (Grafana, Loki, Tempo) → one node
253
+ Dropped: 2 sticky notes, CI pipeline (cross-cutting)
254
+ Kept in full: the request path (Client → Gateway → Orders → Postgres)
255
+ ```
256
+
257
+ The reader of the diagram can't see what's missing. The person who asked for it needs to.
258
+
259
+ ---
260
+
261
+ ## 6. Checklist
262
+
263
+ Run alongside the SKILL.md §9 taste gate.
264
+
265
+ - [ ] All four dials set — explicitly requested, inferred from the destination, or defaulted and stated?
266
+ - [ ] `viewBox` matches the size preset exactly, values divisible by 4?
267
+ - [ ] `min-width` equals the preset's viewBox width, and the SVG sits in a local `overflow-x: auto` wrapper (inside any `overflow: hidden` ancestor)?
268
+ - [ ] `@media print` releases `min-width` and `overflow-x`, placed after the `svg` rule?
269
+ - [ ] Type ramp matches the size class — not the standard ramp on a slide?
270
+ - [ ] 40px outer margin honoured (64px for `social-og`)?
271
+ - [ ] Node count inside the detail level's ceiling?
272
+ - [ ] `faithful` above 9 nodes → zoned, and split above 24?
273
+ - [ ] Node names, sublabels, and edge labels all at the same audience level?
274
+ - [ ] CJK labels given a font fallback?
275
+ - [ ] Fidelity ledger reported for anything cut?
276
+ - [ ] Diagram `<svg>` has `role="img"`, resolving `aria-labelledby`, a non-empty first-child `<title>`, a non-empty `<desc>`, and per-diagram/variant prefixed IDs?
277
+ - [ ] Requested non-HTML formats produced via [`export.md`](export.md), not hand-authored?
@@ -0,0 +1,36 @@
1
+ # Annotation Callout (italic-serif aside)
2
+
3
+ Use for editorial asides — the "italic pointer" that marks a detail without competing with the primary diagram grammar. Think marginalia: *"structure IS the index"*, *"no imports, no configuration"*.
4
+
5
+ ## Grammar
6
+
7
+ ```svg
8
+ <!-- 1. Italic serif text: the `callout` role from style-guide.md -->
9
+ <text x="904" y="36" fill="{ink}" font-size="14" font-style="italic"
10
+ font-family="{callout}" text-anchor="end">no imports, no configuration</text>
11
+ <!-- 2. Dashed Bézier leader -->
12
+ <path d="M 820 44 Q 700 84 520 216" fill="none"
13
+ stroke="{ink @ 0.40}" stroke-width="1" stroke-dasharray="4,3"/>
14
+ <!-- 3. Landing dot -->
15
+ <circle cx="520" cy="216" r="2" fill="{ink}"/>
16
+ ```
17
+
18
+ ## Rules
19
+ - Italic + serif together signal "editorial voice" against the diagram's sans/mono body. Don't substitute italic sans or italic mono — the combination is load-bearing.
20
+ - Dashed path (`stroke-dasharray="4,3"`) distinguishes the callout leader from primary arrows (which are solid).
21
+ - Place callouts in margins (top-right, bottom-left). Never inside the active diagram area.
22
+ - Max 2 callouts per diagram. More becomes commentary, not signal.
23
+
24
+ ## Colors
25
+
26
+ | Intent | Text | Leader |
27
+ |---|---|---|
28
+ | Neutral aside | `ink` | `ink @ 0.40` |
29
+ | Focal / accent | `accent` | `accent @ 0.50` |
30
+ | Tertiary (muted) | `muted` | `ink @ 0.30` |
31
+
32
+ ## Anti-patterns
33
+ - Solid arrow leader (reads as a flow arrow).
34
+ - Italic sans or italic mono — the serif is load-bearing.
35
+ - Callouts crossing primary arrows / lifelines — offset to a clear margin.
36
+ - Using a callout to label something the diagram should label directly — put the label on the element.
@@ -0,0 +1,43 @@
1
+ # Sketchy Filter (hand-drawn variant)
2
+
3
+ Optional displacement filter that wobbles every stroke and edge slightly — turns any minimal variant into a hand-drawn "editorial" register without changing layout. Use when the diagram accompanies an essay rather than technical docs.
4
+
5
+ ## Grammar
6
+
7
+ ```svg
8
+ <defs>
9
+ <filter id="sketchy" x="-2%" y="-2%" width="104%" height="104%">
10
+ <feTurbulence type="fractalNoise" baseFrequency="0.02" numOctaves="2" seed="4"/>
11
+ <feDisplacementMap in="SourceGraphic" scale="1.5"/>
12
+ </filter>
13
+ </defs>
14
+
15
+ <!-- Apply to a group wrapping shapes — NOT text -->
16
+ <g filter="url(#sketchy)">
17
+ <!-- rects, paths, circles, lines go here -->
18
+ </g>
19
+
20
+ <!-- Text sits OUTSIDE the filtered group — legibility stays crisp -->
21
+ <text ...>Labels go here</text>
22
+ ```
23
+
24
+ ## Tuning
25
+
26
+ | Parameter | Range | Effect |
27
+ |---|---|---|
28
+ | `baseFrequency` | 0.01–0.04 | Lower = lazy wavy lines; higher = jittery. 0.02 default. |
29
+ | `numOctaves` | 1–3 | More = more noise detail. 2 is plenty. |
30
+ | `scale` | 1–6 | 1 barely-there, 1.5 default, 2 visible, 4+ cartoon. |
31
+ | `seed` | integer | Swap for a different random pattern. |
32
+
33
+ ## Critical rule
34
+ Filter shapes, NOT text. Displacement-mapped text becomes illegible. Structure your SVG so text is in a sibling group outside the filtered group.
35
+
36
+ ## When to use
37
+ - Essay / blog post / newsletter where the diagram is the hero of a narrative page.
38
+ - "Working sketch" register — showing something is mid-thought, not final architecture.
39
+
40
+ ## When not to use
41
+ - Technical documentation (precision matters).
42
+ - Diagrams with dense labels or tight alignments (filter reads as noise).
43
+ - Dark variants — wobble reads as artifact on dark backgrounds. Test first.
@@ -0,0 +1,146 @@
1
+ # Core SVG primitives
2
+
3
+ Routed from SKILL.md §6. SKILL.md keeps the six connector rules as one line each, the arrow roles, and a one-line node box summary. This file holds the markup and the long form of every rule. The copied template already carries the background rect, the commented dotted-paper pattern, and all three arrow markers, so load this file when you need exact markup or a rule's edge cases.
4
+
5
+ Type-specialized primitives (lifeline, activation bar, region) live in the relevant type reference linked in SKILL.md §3.
6
+
7
+ Snippets here and in every type reference name colors and fonts by role, never by value: `{ink}`, `{muted}`, `{paper}`, `{accent}`, `{link}`, `{soft}` for colors, `{ink @ 0.10}` for a role at an opacity, and `{title}`, `{node-name}`, `{sublabel}`, `{eyebrow}`, `{arrow-label}`, `{callout}` for font families. Resolve each against the active skin in [`style-guide.md`](style-guide.md) before emitting: `{ink @ 0.10}` becomes the `ink` color as `rgba(r,g,b,0.10)`, and `{sublabel}` becomes that role's full family stack. Uppercase names (`X`, `FILL`, `STROKE`) are geometry and per-node values you compute.
8
+
9
+ ## Background
10
+
11
+ **Default: clean paper, no dot pattern.** Single `<rect>` filled with `paper`. Don't wrap the diagram in a secondary container background — the diagram sits directly on the page.
12
+
13
+ ```svg
14
+ <rect width="100%" height="100%" fill="{paper}"/>
15
+ ```
16
+
17
+ **Optional: dotted paper variant.** When a long-form editorial diagram benefits from textured ground (essays, hero diagrams on a dedicated page), opt in by adding the `dots` pattern and a second rect:
18
+
19
+ ```svg
20
+ <defs>
21
+ <pattern id="dots" width="22" height="22" patternUnits="userSpaceOnUse">
22
+ <circle cx="1" cy="1" r="0.9" fill="{ink @ 0.10}"/>
23
+ </pattern>
24
+ </defs>
25
+ <rect width="100%" height="100%" fill="{paper}"/>
26
+ <rect width="100%" height="100%" fill="url(#dots)" opacity="0.6"/>
27
+ ```
28
+
29
+ Don't use the dot pattern when the diagram sits inside a product page, slide, or card — the texture compounds with surrounding chrome and reads as noise.
30
+
31
+ ## Arrow markers (define all three, always)
32
+
33
+ ```svg
34
+ <marker id="arrow" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
35
+ <polygon points="0 0, 8 3, 0 6" fill="{muted}"/>
36
+ </marker>
37
+ <marker id="arrow-accent" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
38
+ <polygon points="0 0, 8 3, 0 6" fill="{accent}"/>
39
+ </marker>
40
+ <marker id="arrow-link" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
41
+ <polygon points="0 0, 8 3, 0 6" fill="{link}"/>
42
+ </marker>
43
+ ```
44
+
45
+ | Arrow | Stroke | When |
46
+ |---|---|---|
47
+ | Default | `muted` | Internal, generic |
48
+ | Accent | `accent` | Primary / highlighted / headline |
49
+ | Link-blue | `link` | HTTP/API calls, external systems |
50
+ | Dashed | `stroke-dasharray="5,4"` + any color | Optional, passive, return, async |
51
+
52
+ **Draw arrows before boxes** so z-order puts lines behind nodes.
53
+
54
+ The geometry source gate excludes shapes inside definition-only containers (`defs`, `symbol`, `marker`, `pattern`, `clipPath`, `mask`) because those shapes do not paint at their local coordinates. It does not resolve `<use>` instances; check referenced drawings with rendered lint and visual review. Inert HTML comments and `>` inside quoted tag attributes do not alter definition custody. The gate reads single- and double-quoted SVG attributes.
55
+
56
+ ## Mandatory connector rules
57
+
58
+ These six rules are **non-negotiable**. Run the pre-output checklist (SKILL.md §9) to verify before producing any diagram.
59
+
60
+ 1. **Rounded right-angle (orthogonal) connectors are mandatory.** Never use diagonal `<line>` or straight slanted paths between nodes that don't share an x or y axis. Every bend must be a quarter-arc with `r=8` (or `r=6` minimum for tight layouts). See `references/type-architecture.md` for the elbow-path formula. Reserve plain straight `<line>` only for connections whose endpoints share the same x or y coordinate. Diagonal connectors are an automatic fail. A connector also leaves and enters each box perpendicular to the edge it touches, at a port on the straight part of that edge at least 8px from a corner. A horizontal segment that starts on a top or bottom edge, or a vertical one that starts on a side edge, runs along the border behind the node fill and reads as an arrow coming out of the corner. From the installed skill directory, `python3 scripts/verify_geometry.py <file>` reports diagonal connectors, border-riding segments, and corner ports.
61
+
62
+ 2. **Label-to-connector margin: 6–10px gap, always.** A label must never sit *on* its arrow — the connector must remain visible. Place the label centered above (or beside, for vertical segments) the line with a **minimum 6px gap** between the bottom of the label's mask rect and the connector stroke. The opaque mask rect prevents the arrow from bleeding through, but the *visible* gap between mask edge and line preserves the reader's ability to trace the connection. If the label is large enough that 6px feels cramped, push it to 8–10px. Never let the mask rect touch or overlap the stroke.
63
+
64
+ 3. **No overlapping connectors.** Two connectors must never share the same stroke path, run parallel on top of each other, or be drawn on top of each other for any segment. When two orthogonal arrows must cross at a single point, apply the **bridge / hop** primitive (see `references/type-architecture.md` § Crossing arrows). When two arrows naturally want to overlap, offset their routing by ≥12px so each line is independently traceable. If you find yourself stacking connectors, redesign the layout — it means two nodes are too close, or the diagram is over budget (split into overview + detail).
65
+
66
+ 4. **Shared edge → fan the attach points.** When two or more connectors enter or exit the *same edge* of a box, each must have its own distinct attach point along that edge — **no two connectors may share a single point on a box**. Spread the attach points evenly along the edge with **≥12px** between adjacent points (8px minimum for very small boxes). Routing rules:
67
+ - For N connectors on an edge of length L, attach point `k` (1..N) sits at offset `L * k / (N + 1)` from the edge's leading corner.
68
+ - When the connectors fan out to destinations on different sides, route each one orthogonally from its own attach point — no merging strokes near the box.
69
+ - When two parallel connectors run in the same direction, keep them ≥12px apart along their entire length, not just at the attach point. Each arrow must remain independently traceable end-to-end.
70
+
71
+ No connector may hide another. If you can't tell two arrows apart at a glance, the layout has failed.
72
+
73
+ 5. **A connector must not pass behind a box that isn't its source or destination — except when the box is geometrically unavoidable on a direct orthogonal path.** Reroute around intervening boxes by default. The only legitimate exception is when a cross-cutting node (e.g., a footer service, a horizontal layer bar) physically sits between the connector's source and destination on the only straight path between them. In that exception:
74
+ - The stroke must be **dashed** (e.g., `stroke-dasharray="4,3"`) to signal "transit, not interaction" — it tells the reader the intervening box is not an endpoint.
75
+ - The label sits at the **visible end** of the connector (typically near the source) so it doesn't fall behind the intervening box.
76
+ - No marker (arrowhead) may land on the intervening box's edge — the marker resolves at the true destination only.
77
+
78
+ When in doubt, reroute. The exception exists for the narrow case where rerouting is geometrically impossible, not as a shortcut to avoid layout work.
79
+
80
+ 6. **A label mask must not overlap a node drawn after it.** Compare their bounds after supported group and element `translate()` offsets, in the shared canvas rather than separate panel-local coordinates. Rule 2 keeps the label off its own connector; this one keeps it off the boxes. Because nodes are painted after labels, a mask that lands partly inside a node is covered by the node fill and the text renders as a fragment sitting on the node border. Place the label on a segment of the connector that runs through open canvas — for a connector leaving a node's right edge, that means clearing the node's `x + width` before the mask starts. A mask fully *inside* a node is a badge chip and is fine; a mask overlapping a zone container is fine too, since zones are painted first. From the installed skill directory, verify with `python3 scripts/verify_geometry.py <file>`.
81
+
82
+ ## Node box — full pattern
83
+
84
+ ```svg
85
+ <!-- 1. Opaque paper mask — prevents arrows bleeding through transparent fills -->
86
+ <rect x="X" y="Y" width="W" height="H" rx="6" fill="{paper}"/>
87
+ <!-- 2. Styled box -->
88
+ <rect x="X" y="Y" width="W" height="H" rx="6" fill="FILL" stroke="STROKE" stroke-width="1"/>
89
+ <!-- 3. Rectangular type tag (rx=2, NOT a pill) -->
90
+ <rect x="X+8" y="Y+6" width="28" height="12" rx="2" fill="transparent" stroke="STROKE@0.40" stroke-width="0.8"/>
91
+ <text x="X+22" y="Y+15" fill="STROKE@0.8" font-size="7" font-family="{eyebrow}"
92
+ text-anchor="middle" letter-spacing="0.08em">API</text>
93
+ <!-- 4. Node name (node-name role, sans: human-readable) -->
94
+ <text x="CX" y="CY+2" fill="{ink}" font-size="12" font-weight="600"
95
+ font-family="{node-name}" text-anchor="middle">Node Name</text>
96
+ <!-- 5. Technical sublabel (sublabel role, mono) -->
97
+ <text x="CX" y="CY+18" fill="{muted}" font-size="9"
98
+ font-family="{sublabel}" text-anchor="middle">tech:port</text>
99
+ ```
100
+
101
+ ## Arrow labels — always mask, always with margin
102
+
103
+ Every arrow label needs an opaque rect behind it. Without one it bleeds through the line. **And the label must sit with a visible gap above the connector — never on top of it.**
104
+
105
+ ```svg
106
+ <!-- Mask sits 14px above the arrow (8px text height + 6px gap). Stroke is at ARROW_Y. -->
107
+ <rect x="MID_X-18" y="ARROW_Y-20" width="36" height="12" rx="2" fill="{paper}"/>
108
+ <text x="MID_X" y="ARROW_Y-11" fill="{soft}" font-size="8"
109
+ font-family="{arrow-label}" text-anchor="middle" letter-spacing="0.06em">WRITE</text>
110
+ ```
111
+
112
+ Rules:
113
+
114
+ - ≤14 characters, all-caps, centered on segment midpoint.
115
+ - **Mandatory 6–10px gap** between the bottom of the mask rect and the arrow stroke. The connector must remain visible — a label that hides its own arrow is a hard fail.
116
+ - Never `writing-mode` vertical.
117
+ - For vertical segments, place the label to the side (not on the line) with the same 6–10px horizontal gap.
118
+
119
+ **Font substitution.** Don't estimate per-character widths — use the `style-guide.md` budget (0.60em sans / 0.62em mono per char). A production run sized mono labels at ~0.47em/char and clipped twice; the calibrated budget fits both the default skin's mono face (Geist Mono) and the common substituted mono faces (Menlo, Courier New, Monaco, all ≈0.60em). Previews via `rsvg`/`inkscape` can't fetch the injected Google Fonts, so verify with `python3 scripts/verify_geometry.py <file>` from the skill directory — it checks masks against later-painted nodes, not text fit. `scripts/self_check.py` checks text against the visible box it sits in, but not against an arrow-label mask, so on masks holding the budget is yours.
120
+
121
+ ## Legend — horizontal strip at the bottom
122
+
123
+ **Never put the legend inside the diagram area.** Place as a horizontal strip after all nodes, with a hairline separator:
124
+
125
+ ```svg
126
+ <line x1="30" y1="LEGEND_Y-8" x2="VIEWBOX_W-30" y2="LEGEND_Y-8"
127
+ stroke="{ink @ 0.10}" stroke-width="0.8"/>
128
+ <text x="30" y="LEGEND_Y+8" fill="{muted}" font-size="8" font-family="{eyebrow}"
129
+ letter-spacing="0.14em">LEGEND</text>
130
+ <!-- Items — horizontal row, ~160px apart -->
131
+ ```
132
+
133
+ Expand SVG `viewBox` height by ~60px.
134
+
135
+ ## Accessible SVG contract
136
+
137
+ SKILL.md §12 lists these six points one line each; this is the long form.
138
+
139
+ Every diagram is an accessible figure by default:
140
+
141
+ 1. Its `<svg>` carries `role="img"` and `aria-labelledby` naming the diagram's `<title>` and `<desc>`.
142
+ 2. `<title>` is the first child of `<svg>`, before `<defs>`. Assistive technology may ignore a title placed later.
143
+ 3. The IDs are prefixed per diagram and variant: `<slug>-title` / `<slug>-desc`, where the slug matches the file (`loop`, `loop-dark`, `loop-full`). Bare `title` / `desc` IDs are banned — two inline diagrams would otherwise share one ID, and the second could be announced with the first's name. Each naming ID must also be unique across the whole document, including non-SVG elements; the packaged `scripts/self_check.py` rejects these collisions.
144
+ 4. `<title>` is the short name of the subject — roughly the page `<h1>`, and about 60 characters or fewer.
145
+ 5. `<desc>` is one sentence stating what the diagram shows in terms a reader needs without the image. Describe the content, not the geometry: “Org chart showing a command center routing work to specialist agents and escalation owners,” not “A box at the top with five boxes below it.” A shape-by-shape narration is worse than no useful description.
146
+ 6. Decorative-only SVG, such as the specimen glyphs in `assets/icons.html`, carries `aria-hidden="true"` instead.