Skip to content

Editorial diagram design for Claude Code, Codex, GitHub Copilot, Cursor, Factory Droid, Qoder, and Pi. 45 diagram types. Self-contained HTML + SVG. No shadows. No Mermaid slop.

fix(verify-geometry): compare curved runs when checking for stacked connectors

Cathryn Lavery50b7f490ce43
diff --git a/.github/pr-visual-proof/279/db-schema.png b/.github/pr-visual-proof/279/db-schema.png
new file mode 100644
index 0000000..71b9306
Binary files /dev/null and b/.github/pr-visual-proof/279/db-schema.png differ
diff --git a/docs/screenshots/db-schema.png b/docs/screenshots/db-schema.png
index 505d376..9a9c1bc 100644
Binary files a/docs/screenshots/db-schema.png and b/docs/screenshots/db-schema.png differ
diff --git a/docs/screenshots/manifest.json b/docs/screenshots/manifest.json
index aa55429..f96708c 100644
--- a/docs/screenshots/manifest.json
+++ b/docs/screenshots/manifest.json
@@ -402,8 +402,8 @@
"slug": "db-schema",
"source": "skills/diagram-design/assets/example-db-schema.html",
"screenshot": "docs/screenshots/db-schema.png",
- "source_sha256": "58d473906c57670fecee29bc55377df5b433549445962204412ebd2c081b76db",
- "screenshot_sha256": "939061c701f7bb70aa1b5f7ee1fe2da3a68b3b8edc4822cd9dcb7586acd7a2d6",
+ "source_sha256": "6031e6df48ba3511906f30ceb0b3fe5741091dd6bb30ca67ac6ab178492de57b",
+ "screenshot_sha256": "d5a82a34734c7d1dcd82770a6482cbb238ba1b79dda6cc36e4716a58f0bba24f",
"width": 2480,
"height": 1288
}
diff --git a/docs/screenshots/thumbs/db-schema.webp b/docs/screenshots/thumbs/db-schema.webp
index d8cfb3c..bffa863 100644
Binary files a/docs/screenshots/thumbs/db-schema.webp and b/docs/screenshots/thumbs/db-schema.webp differ
diff --git a/docs/screenshots/thumbs/manifest.json b/docs/screenshots/thumbs/manifest.json
index ff8c42f..4552943 100644
--- a/docs/screenshots/thumbs/manifest.json
+++ b/docs/screenshots/thumbs/manifest.json
@@ -54,11 +54,11 @@
{
"thumb": "db-schema.webp",
"source": "docs/screenshots/db-schema.png",
- "source_sha256": "939061c701f7bb70aa1b5f7ee1fe2da3a68b3b8edc4822cd9dcb7586acd7a2d6",
+ "source_sha256": "d5a82a34734c7d1dcd82770a6482cbb238ba1b79dda6cc36e4716a58f0bba24f",
"width": 600,
"height": 312,
"quality": 82,
- "thumb_sha256": "77ad43cc5cb8509fd76b1fdfee62827cb876c3893df6e46c2b1a278c50748e41"
+ "thumb_sha256": "e9a1353e9c55c8953f6118707d8200a82a71b45da24fb3a563f6e4cb725ffa2a"
},
{
"thumb": "dependency.webp",
diff --git a/scripts/test-verify-geometry.py b/scripts/test-verify-geometry.py
index 3461263..13d4d2c 100644
--- a/scripts/test-verify-geometry.py
+++ b/scripts/test-verify-geometry.py
@@ -17,6 +17,8 @@ ZONED = ASSET_DIR / "example-dp-integration.html"
SEQUENCE_OAUTH = ASSET_DIR / "example-sequence-oauth.html"
HIGH_LEVEL = ASSET_DIR / "example-high-level.html"
QUEUE_ANIMATED = ASSET_DIR / "example-queue-animated.html"
+MEDALLION = ASSET_DIR / "example-medallion.html"
+DB_SCHEMA = ASSET_DIR / "example-db-schema.html"
def load_verifier():
@@ -241,6 +243,21 @@ def main() -> int:
),
1,
)
+ # Shared curved run with separate straight runs: only curve sampling sees it.
+ check_message(
+ "two connectors sharing a curved run",
+ document(
+ f'<path d="M 10,100 Q 50,100 50,60 H 90" {arrow}/>'
+ f'<path d="M 10,110 V 100 Q 50,100 50,60 V 20" {arrow}/>'
+ ),
+ "runs on top of",
+ )
+ # Two connectors that only cross at a right angle are not stacked.
+ check(
+ "perpendicular crossing is not a stacked run",
+ document(f'<path d="M 10,50 H 90" {arrow}/><path d="M 50,10 V 90" {arrow}/>'),
+ 0,
+ )
# Coordinates under a rotate are not canvas space; skip rather than misjudge.
check(
"connector under a non-translate transform is skipped",
@@ -252,6 +269,9 @@ def main() -> int:
check_file("shipped swimlane example", SWIMLANE, 0)
check_file("shipped high-level example", HIGH_LEVEL, 0)
check_file("shipped queue animation", QUEUE_ANIMATED, 0)
+ # Medallion's promotion arcs meet head to tail at each tier; that joint stays legal.
+ check_file("shipped medallion chain joints", MEDALLION, 0)
+ check_file("shipped db-schema example", DB_SCHEMA, 0)
check_file("shipped zoned example", ZONED, 0)
check_file("shipped sequence-oauth example", SEQUENCE_OAUTH, 0)
diff --git a/scripts/verify-geometry.py b/scripts/verify-geometry.py
index 90718d5..0f43b2b 100644
--- a/scripts/verify-geometry.py
+++ b/scripts/verify-geometry.py
@@ -39,8 +39,9 @@ and chart bars stay out of it. Five shapes are reported:
* Two connectors leaving (or two arriving at) the same edge of a node closer
than primitives-core.md rule 4 allows: 12px, or 8px on an edge shorter than
48px. A head-to-tail chain joint is allowed.
-* Two connectors whose straight segments lie on the same line for more than
- 4px, the stacked trunk primitives-core.md rule 3 forbids.
+* Two connectors drawn within 1px of each other for more than 4px, straight
+ or curved: the stacked trunk primitives-core.md rule 3 forbids. Curves and
+ arcs are flattened into short chords so their shape is compared too.
An arrowed path whose data the checker cannot parse is reported too, so a
connector never passes because nothing read it.
@@ -53,6 +54,7 @@ Usage:
from __future__ import annotations
import argparse
+import math
import re
import sys
from pathlib import Path
@@ -170,11 +172,86 @@ def number(attrs: str, name: str) -> float | None:
Segment = tuple[str, float, float, float, float] # (kind, x1, y1, x2, y2)
+CHORD_LENGTH = 2.0 # curves are flattened into chords about this long
+
+
+def chord_count(points: list[tuple[float, float]]) -> int:
+ """Chords to split a curve into, from the length of its control polygon."""
+
+ length = sum(math.dist(a, b) for a, b in zip(points, points[1:]))
+ return max(4, min(256, math.ceil(length / CHORD_LENGTH)))
+
+
+def bezier(points: list[tuple[float, float]]) -> list[tuple[float, float]]:
+ """Points along a quadratic or cubic Bezier, excluding its start."""
+
+ steps = chord_count(points)
+ out = []
+ for i in range(1, steps + 1):
+ t = i / steps
+ level = points
+ while len(level) > 1: # de Casteljau
+ level = [
+ (a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t)
+ for a, b in zip(level, level[1:])
+ ]
+ out.append(level[0])
+ return out
+
+
+def arc(
+ start: tuple[float, float], rx: float, ry: float, rotation: float,
+ large: float, sweep: float, end: tuple[float, float],
+) -> list[tuple[float, float]]:
+ """Points along an SVG elliptical arc (SVG 2 appendix B.2.4), excluding its start."""
+
+ (x1, y1), (x2, y2) = start, end
+ rx, ry = abs(rx), abs(ry)
+ if rx == 0 or ry == 0 or start == end:
+ return [end]
+ phi = math.radians(rotation)
+ cos_p, sin_p = math.cos(phi), math.sin(phi)
+ hx, hy = (x1 - x2) / 2, (y1 - y2) / 2
+ x1p, y1p = cos_p * hx + sin_p * hy, -sin_p * hx + cos_p * hy
+ scale = (x1p / rx) ** 2 + (y1p / ry) ** 2
+ if scale > 1:
+ rx, ry = rx * math.sqrt(scale), ry * math.sqrt(scale)
+ denominator = (rx * y1p) ** 2 + (ry * x1p) ** 2
+ numerator = (rx * ry) ** 2 - denominator
+ root = math.sqrt(max(0.0, numerator / denominator)) if denominator else 0.0
+ if large == sweep:
+ root = -root
+ cxp, cyp = root * rx * y1p / ry, -root * ry * x1p / rx
+ cx = cos_p * cxp - sin_p * cyp + (x1 + x2) / 2
+ cy = sin_p * cxp + cos_p * cyp + (y1 + y2) / 2
+ ux, uy = (x1p - cxp) / rx, (y1p - cyp) / ry
+ vx, vy = (-x1p - cxp) / rx, (-y1p - cyp) / ry
+ theta = math.atan2(uy, ux)
+ delta = math.atan2(ux * vy - uy * vx, ux * vx + uy * vy)
+ if not sweep and delta > 0:
+ delta -= 2 * math.pi
+ elif sweep and delta < 0:
+ delta += 2 * math.pi
+ steps = max(4, min(256, math.ceil(abs(delta) * max(rx, ry) / CHORD_LENGTH)))
+ out = []
+ for i in range(1, steps + 1):
+ angle = theta + delta * i / steps
+ ex, ey = rx * math.cos(angle), ry * math.sin(angle)
+ out.append((cos_p * ex - sin_p * ey + cx, sin_p * ex + cos_p * ey + cy))
+ out[-1] = end
+ return out
+
+
def path_segments(d: str) -> list[Segment] | None:
- """Flatten a path into straight and curved segments, or None if unparseable."""
+ """Flatten a path into straight segments and curve chords, or None if unparseable.
+
+ Straight commands become one `line` segment each. Curves and arcs become a
+ run of short `curve` chords, so overlap checks can follow their shape.
+ """
segments: list[Segment] = []
x = y = start_x = start_y = 0.0
+ previous_control: tuple[str, float, float] | None = None # for S and T reflection
command = ""
pos = 0
while not PATH_END_RE.match(d, pos):
@@ -198,20 +275,41 @@ def path_segments(d: str) -> list[Segment] | None:
args.append(float(match.group(1)))
pos = match.end()
relative = command.islower()
+ ox, oy = (x, y) if relative else (0.0, 0.0)
if upper == "H":
- nx, ny = (x + args[0] if relative else args[0]), y
+ nx, ny = args[0] + ox, y
elif upper == "V":
- nx, ny = x, (y + args[0] if relative else args[0])
+ nx, ny = x, args[0] + oy
else:
- nx, ny = args[-2], args[-1]
- if relative:
- nx, ny = x + nx, y + ny
+ nx, ny = args[-2] + ox, args[-1] + oy
if upper == "M":
x, y = start_x, start_y = nx, ny
command = "l" if relative else "L" # implicit lineto after moveto
+ previous_control = None
continue
- kind = "line" if upper in "LHV" else "curve"
- segments.append((kind, x, y, nx, ny))
+ if upper in "LHV":
+ segments.append(("line", x, y, nx, ny))
+ previous_control = None
+ else:
+ pairs = [(args[i] + ox, args[i + 1] + oy) for i in range(0, len(args) - 1, 2)]
+ if upper in "ST":
+ family = "C" if upper == "S" else "Q"
+ if previous_control and previous_control[0] == family:
+ reflected = (2 * x - previous_control[1], 2 * y - previous_control[2])
+ else:
+ reflected = (x, y)
+ pairs = [reflected] + pairs
+ if upper == "A":
+ points = arc((x, y), args[0], args[1], args[2], args[3], args[4], (nx, ny))
+ previous_control = None
+ else:
+ points = bezier([(x, y)] + pairs)
+ family = "C" if upper in "CS" else "Q"
+ previous_control = (family, pairs[-2][0], pairs[-2][1])
+ px, py = x, y
+ for qx, qy in points:
+ segments.append(("curve", px, py, qx, qy))
+ px, py = qx, qy
x, y = nx, ny
return segments
@@ -418,20 +516,57 @@ def check_connectors(path: Path, source: str) -> list[str]:
return findings
-def collinear_overlap(a: Segment, b: Segment) -> float:
- """Length two axis-aligned straight segments share on one line, else 0."""
+STACK_TOLERANCE = 1.0 # strokes this close are drawn on top of each other
+SAMPLE_STEP = 1.0 # distance between samples when measuring a shared run
- if a[0] != "line" or b[0] != "line":
+
+def bounds(segments: list[Segment], pad: float) -> tuple[float, float, float, float]:
+ xs = [v for _, x1, _, x2, _ in segments for v in (x1, x2)]
+ ys = [v for _, _, y1, _, y2 in segments for v in (y1, y2)]
+ return min(xs) - pad, min(ys) - pad, max(xs) + pad, max(ys) + pad
+
+
+def distance_to_segment(px: float, py: float, segment: Segment) -> float:
+ _, x1, y1, x2, y2 = segment
+ dx, dy = x2 - x1, y2 - y1
+ length_sq = dx * dx + dy * dy
+ t = 0.0 if not length_sq else max(0.0, min(1.0, ((px - x1) * dx + (py - y1) * dy) / length_sq))
+ return math.hypot(px - (x1 + t * dx), py - (y1 + t * dy))
+
+
+def shared_run(a: list[Segment], b: list[Segment]) -> float:
+ """Length of connector `a` drawn within 1px of connector `b`.
+
+ Straight runs and curve chords count alike, so a shared curved trunk is
+ caught as well as a straight one. Samples near an endpoint the two share
+ are skipped: a head-to-tail joint or a common port is judged by the port
+ checks, not counted as a stacked run.
+ """
+
+ left, top, right, bottom = bounds(b, STACK_TOLERANCE)
+ a_left, a_top, a_right, a_bottom = bounds(a, 0.0)
+ if a_right < left or a_left > right or a_bottom < top or a_top > bottom:
return 0.0
- _, ax1, ay1, ax2, ay2 = a
- _, bx1, by1, bx2, by2 = b
- a_flat, b_flat = abs(ay1 - ay2) <= AXIS_TOLERANCE, abs(by1 - by2) <= AXIS_TOLERANCE
- a_tall, b_tall = abs(ax1 - ax2) <= AXIS_TOLERANCE, abs(bx1 - bx2) <= AXIS_TOLERANCE
- if a_flat and b_flat and abs(ay1 - by1) <= BORDER_TOLERANCE:
- return min(max(ax1, ax2), max(bx1, bx2)) - max(min(ax1, ax2), min(bx1, bx2))
- if a_tall and b_tall and abs(ax1 - bx1) <= BORDER_TOLERANCE:
- return min(max(ay1, ay2), max(by1, by2)) - max(min(ay1, ay2), min(by1, by2))
- return 0.0
+ ends_a = ((a[0][1], a[0][2]), (a[-1][3], a[-1][4]))
+ ends_b = ((b[0][1], b[0][2]), (b[-1][3], b[-1][4]))
+ joints = [p for p in ends_a if any(math.dist(p, q) <= STACK_TOLERANCE for q in ends_b)]
+ boxes = [bounds([segment], STACK_TOLERANCE) for segment in b]
+ shared = 0
+ for _, x1, y1, x2, y2 in a:
+ steps = max(1, math.ceil(math.hypot(x2 - x1, y2 - y1) / SAMPLE_STEP))
+ for i in range(steps):
+ px, py = x1 + (x2 - x1) * i / steps, y1 + (y2 - y1) * i / steps
+ if not (left <= px <= right and top <= py <= bottom):
+ continue
+ if any(math.dist((px, py), joint) < CORNER_CLEARANCE for joint in joints):
+ continue
+ if any(
+ bx0 <= px <= bx1 and by0 <= py <= by1
+ and distance_to_segment(px, py, segment) <= STACK_TOLERANCE
+ for segment, (bx0, by0, bx1, by1) in zip(b, boxes)
+ ):
+ shared += 1
+ return shared * SAMPLE_STEP
def stacked_connectors(
@@ -442,13 +577,11 @@ def stacked_connectors(
findings: list[str] = []
for i, (line_a, label_a, segments_a) in enumerate(parsed):
for line_b, label_b, segments_b in parsed[i + 1 :]:
- shared = max(
- (collinear_overlap(a, b) for a in segments_a for b in segments_b), default=0.0
- )
+ shared = max(shared_run(segments_a, segments_b), shared_run(segments_b, segments_a))
if shared > BORDER_MIN_RUN:
findings.append(
f"{path.name}:{line_b}: connector {label_b} runs on top of {label_a}"
- f" (line {line_a}) for {shared:g}px - offset one route by at least"
+ f" (line {line_a}) for about {shared:g}px - offset one route by at least"
f" {SHARED_PORT_MIN:g}px so each arrow stays traceable"
)
return findings
diff --git a/skills/diagram-design/assets/example-db-schema-dark.html b/skills/diagram-design/assets/example-db-schema-dark.html
index b3d5a12..18d7c01 100644
--- a/skills/diagram-design/assets/example-db-schema-dark.html
+++ b/skills/diagram-design/assets/example-db-schema-dark.html
@@ -70,31 +70,31 @@
<rect width="100%" height="100%" fill="#2d3142"/>
<!-- BILLING schema group (drawn first so tables paint over it) -->
- <rect x="744" y="284" width="272" height="152" rx="8" fill="rgba(245,245,245,0.02)" stroke="rgba(245,245,245,0.20)" stroke-width="0.8" stroke-dasharray="4,4"/>
- <text x="756" y="300" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" letter-spacing="0.14em">BILLING</text>
+ <rect x="744" y="332" width="272" height="152" rx="8" fill="rgba(245,245,245,0.02)" stroke="rgba(245,245,245,0.20)" stroke-width="0.8" stroke-dasharray="4,4"/>
+ <text x="756" y="348" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" letter-spacing="0.14em">BILLING</text>
<!-- FK connectors (drawn before boxes) -->
<!-- FK1: orders.customer_id -> customers.id · ON DELETE RESTRICT -->
<path d="M 400,104 H 348 Q 340,104 340,112 Q 340,120 332,120 H 280" fill="none" stroke="#bfc0c0" stroke-width="1" marker-end="url(#arrow)"/>
<!-- FK2: order_items.order_id -> orders.id · ON DELETE CASCADE (focal) -->
- <path d="M 640,384 H 692 Q 700,384 700,376 V 80 Q 700,72 692,72 H 640" fill="none" stroke="#f08a59" stroke-width="1.2" marker-end="url(#arrow-accent)"/>
+ <path d="M 640,384 H 660 Q 668,384 668,376 V 96 Q 668,88 660,88 H 640" fill="none" stroke="#f08a59" stroke-width="1.2" marker-end="url(#arrow-accent)"/>
<!-- FK3: order_items.product_id -> products.id · ON DELETE RESTRICT -->
<path d="M 640,408 H 708 Q 716,408 716,400 V 88 Q 716,80 724,80 H 760" fill="none" stroke="#bfc0c0" stroke-width="1" marker-end="url(#arrow)"/>
<!-- FK4: invoices.order_id -> orders.id · ON DELETE RESTRICT -->
- <path d="M 760,384 H 692 Q 684,384 684,376 V 96 Q 684,88 676,88 H 640" fill="none" stroke="#bfc0c0" stroke-width="1" marker-end="url(#arrow)"/>
+ <path d="M 760,432 H 700 Q 692,432 692,424 V 416 a 8,8 0 0,0 0,-16 V 80 Q 692,72 684,72 H 640" fill="none" stroke="#bfc0c0" stroke-width="1" marker-end="url(#arrow)"/>
<!-- FK labels (masked, 6-10px gap above/beside their connector) -->
<rect x="284" y="82" width="112" height="12" rx="2" fill="#2d3142"/>
<text x="340" y="91" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">ON DELETE RESTRICT</text>
- <rect x="648" y="392" width="88" height="12" rx="2" fill="#2d3142"/>
- <text x="692" y="401" fill="#f08a59" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">ON DELETE CASCADE</text>
+ <rect x="572" y="274" width="88" height="12" rx="2" fill="#2d3142"/>
+ <text x="616" y="283" fill="#f08a59" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">ON DELETE CASCADE</text>
<rect x="724" y="252" width="112" height="12" rx="2" fill="#2d3142"/>
<text x="780" y="261" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">ON DELETE RESTRICT</text>
- <rect x="564" y="270" width="112" height="12" rx="2" fill="#2d3142"/>
- <text x="620" y="279" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">ON DELETE RESTRICT</text>
+ <rect x="644" y="440" width="112" height="12" rx="2" fill="#2d3142"/>
+ <text x="700" y="449" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">ON DELETE RESTRICT</text>
<!-- Table: public.customers -->
<rect x="40" y="80" width="240" height="100" rx="6" fill="#393e53" stroke="#f5f5f5" stroke-width="1"/>
@@ -250,32 +250,32 @@
<text x="772" y="220" fill="#bfc0c0" font-size="9" font-family="'Geist Mono', monospace">uq_products_sku</text>
<!-- Table: billing.invoices (inside BILLING group) -->
- <rect x="760" y="320" width="240" height="100" rx="6" fill="#393e53" stroke="#f5f5f5" stroke-width="1"/>
- <rect x="760" y="320" width="240" height="28" rx="6" fill="rgba(245,245,245,0.04)" stroke="none"/>
- <rect x="760" y="340" width="240" height="8" fill="rgba(245,245,245,0.04)"/>
- <line x1="760" y1="348" x2="1000" y2="348" stroke="rgba(245,245,245,0.22)" stroke-width="1"/>
- <text x="772" y="338" fill="#f5f5f5" font-size="12" font-weight="600" font-family="'Geist', sans-serif">billing.invoices</text>
- <rect x="948" y="328" width="40" height="12" rx="2" fill="none" stroke="rgba(245,245,245,0.40)" stroke-width="0.8"/>
- <text x="968" y="337" fill="#f5f5f5" opacity="0.8" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.08em">TABLE</text>
-
- <rect x="760" y="348" width="240" height="24" fill="rgba(245,245,245,0.02)"/>
- <text x="772" y="364" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif">id</text>
- <rect x="880" y="356" width="20" height="12" rx="2" fill="none" stroke="rgba(245,245,245,0.35)" stroke-width="0.8"/>
- <text x="890" y="365" fill="#f5f5f5" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">PK</text>
- <text x="988" y="364" fill="#bfc0c0" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">uuid</text>
-
- <text x="772" y="388" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif">order_id</text>
- <rect x="880" y="380" width="20" height="12" rx="2" fill="none" stroke="rgba(245,245,245,0.35)" stroke-width="0.8"/>
- <text x="890" y="389" fill="#f5f5f5" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">FK</text>
- <rect x="904" y="380" width="20" height="12" rx="2" fill="none" stroke="rgba(245,245,245,0.35)" stroke-width="0.8"/>
- <text x="914" y="389" fill="#f5f5f5" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">NN</text>
- <text x="988" y="388" fill="#bfc0c0" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">uuid</text>
+ <rect x="760" y="368" width="240" height="100" rx="6" fill="#393e53" stroke="#f5f5f5" stroke-width="1"/>
+ <rect x="760" y="368" width="240" height="28" rx="6" fill="rgba(245,245,245,0.04)" stroke="none"/>
+ <rect x="760" y="388" width="240" height="8" fill="rgba(245,245,245,0.04)"/>
+ <line x1="760" y1="396" x2="1000" y2="396" stroke="rgba(245,245,245,0.22)" stroke-width="1"/>
+ <text x="772" y="386" fill="#f5f5f5" font-size="12" font-weight="600" font-family="'Geist', sans-serif">billing.invoices</text>
+ <rect x="948" y="376" width="40" height="12" rx="2" fill="none" stroke="rgba(245,245,245,0.40)" stroke-width="0.8"/>
+ <text x="968" y="385" fill="#f5f5f5" opacity="0.8" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.08em">TABLE</text>
<rect x="760" y="396" width="240" height="24" fill="rgba(245,245,245,0.02)"/>
- <text x="772" y="412" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif">issued_at</text>
+ <text x="772" y="412" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif">id</text>
<rect x="880" y="404" width="20" height="12" rx="2" fill="none" stroke="rgba(245,245,245,0.35)" stroke-width="0.8"/>
- <text x="890" y="413" fill="#f5f5f5" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">NN</text>
- <text x="988" y="412" fill="#bfc0c0" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">timestamptz</text>
+ <text x="890" y="413" fill="#f5f5f5" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">PK</text>
+ <text x="988" y="412" fill="#bfc0c0" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">uuid</text>
+
+ <text x="772" y="436" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif">order_id</text>
+ <rect x="880" y="428" width="20" height="12" rx="2" fill="none" stroke="rgba(245,245,245,0.35)" stroke-width="0.8"/>
+ <text x="890" y="437" fill="#f5f5f5" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">FK</text>
+ <rect x="904" y="428" width="20" height="12" rx="2" fill="none" stroke="rgba(245,245,245,0.35)" stroke-width="0.8"/>
+ <text x="914" y="437" fill="#f5f5f5" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">NN</text>
+ <text x="988" y="436" fill="#bfc0c0" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">uuid</text>
+
+ <rect x="760" y="444" width="240" height="24" fill="rgba(245,245,245,0.02)"/>
+ <text x="772" y="460" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif">issued_at</text>
+ <rect x="880" y="452" width="20" height="12" rx="2" fill="none" stroke="rgba(245,245,245,0.35)" stroke-width="0.8"/>
+ <text x="890" y="461" fill="#f5f5f5" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">NN</text>
+ <text x="988" y="460" fill="#bfc0c0" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">timestamptz</text>
<!-- Legend -->
<line x1="40" y1="500" x2="1040" y2="500" stroke="rgba(245,245,245,0.10)" stroke-width="0.8"/>
diff --git a/skills/diagram-design/assets/example-db-schema-full.html b/skills/diagram-design/assets/example-db-schema-full.html
index 3bb51b0..5389f92 100644
--- a/skills/diagram-design/assets/example-db-schema-full.html
+++ b/skills/diagram-design/assets/example-db-schema-full.html
@@ -51,31 +51,31 @@
<rect width="100%" height="100%" fill="#f5f5f5"/>
<!-- BILLING schema group (drawn first so tables paint over it) -->
- <rect x="744" y="284" width="272" height="152" rx="8" fill="rgba(45,49,66,0.02)" stroke="rgba(45,49,66,0.20)" stroke-width="0.8" stroke-dasharray="4,4"/>
- <text x="756" y="300" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" letter-spacing="0.14em">BILLING</text>
+ <rect x="744" y="332" width="272" height="152" rx="8" fill="rgba(45,49,66,0.02)" stroke="rgba(45,49,66,0.20)" stroke-width="0.8" stroke-dasharray="4,4"/>
+ <text x="756" y="348" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" letter-spacing="0.14em">BILLING</text>
<!-- FK connectors (drawn before boxes) -->
<!-- FK1: orders.customer_id -> customers.id · ON DELETE RESTRICT -->
<path d="M 400,104 H 348 Q 340,104 340,112 Q 340,120 332,120 H 280" fill="none" stroke="#4f5d75" stroke-width="1" marker-end="url(#arrow)"/>
<!-- FK2: order_items.order_id -> orders.id · ON DELETE CASCADE (focal) -->
- <path d="M 640,384 H 692 Q 700,384 700,376 V 80 Q 700,72 692,72 H 640" fill="none" stroke="#eb6c36" stroke-width="1.2" marker-end="url(#arrow-accent)"/>
+ <path d="M 640,384 H 660 Q 668,384 668,376 V 96 Q 668,88 660,88 H 640" fill="none" stroke="#eb6c36" stroke-width="1.2" marker-end="url(#arrow-accent)"/>
<!-- FK3: order_items.product_id -> products.id · ON DELETE RESTRICT -->
<path d="M 640,408 H 708 Q 716,408 716,400 V 88 Q 716,80 724,80 H 760" fill="none" stroke="#4f5d75" stroke-width="1" marker-end="url(#arrow)"/>
<!-- FK4: invoices.order_id -> orders.id · ON DELETE RESTRICT -->
- <path d="M 760,384 H 692 Q 684,384 684,376 V 96 Q 684,88 676,88 H 640" fill="none" stroke="#4f5d75" stroke-width="1" marker-end="url(#arrow)"/>
+ <path d="M 760,432 H 700 Q 692,432 692,424 V 416 a 8,8 0 0,0 0,-16 V 80 Q 692,72 684,72 H 640" fill="none" stroke="#4f5d75" stroke-width="1" marker-end="url(#arrow)"/>
<!-- FK labels (masked, 6-10px gap above/beside their connector) -->
<rect x="284" y="82" width="112" height="12" rx="2" fill="#f5f5f5"/>
<text x="340" y="91" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">ON DELETE RESTRICT</text>
- <rect x="648" y="392" width="88" height="12" rx="2" fill="#f5f5f5"/>
- <text x="692" y="401" fill="#eb6c36" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">ON DELETE CASCADE</text>
+ <rect x="572" y="274" width="88" height="12" rx="2" fill="#f5f5f5"/>
+ <text x="616" y="283" fill="#eb6c36" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">ON DELETE CASCADE</text>
<rect x="724" y="252" width="112" height="12" rx="2" fill="#f5f5f5"/>
<text x="780" y="261" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">ON DELETE RESTRICT</text>
- <rect x="564" y="270" width="112" height="12" rx="2" fill="#f5f5f5"/>
- <text x="620" y="279" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">ON DELETE RESTRICT</text>
+ <rect x="644" y="440" width="112" height="12" rx="2" fill="#f5f5f5"/>
+ <text x="700" y="449" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">ON DELETE RESTRICT</text>
<!-- Table: public.customers -->
<rect x="40" y="80" width="240" height="100" rx="6" fill="#ffffff" stroke="#2d3142" stroke-width="1"/>
@@ -231,32 +231,32 @@
<text x="772" y="220" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace">uq_products_sku</text>
<!-- Table: billing.invoices (inside BILLING group) -->
- <rect x="760" y="320" width="240" height="100" rx="6" fill="#ffffff" stroke="#2d3142" stroke-width="1"/>
- <rect x="760" y="320" width="240" height="28" rx="6" fill="rgba(45,49,66,0.04)" stroke="none"/>
- <rect x="760" y="340" width="240" height="8" fill="rgba(45,49,66,0.04)"/>
- <line x1="760" y1="348" x2="1000" y2="348" stroke="rgba(45,49,66,0.22)" stroke-width="1"/>
- <text x="772" y="338" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist', sans-serif">billing.invoices</text>
- <rect x="948" y="328" width="40" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.40)" stroke-width="0.8"/>
- <text x="968" y="337" fill="#2d3142" opacity="0.8" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.08em">TABLE</text>
-
- <rect x="760" y="348" width="240" height="24" fill="rgba(45,49,66,0.02)"/>
- <text x="772" y="364" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif">id</text>
- <rect x="880" y="356" width="20" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.35)" stroke-width="0.8"/>
- <text x="890" y="365" fill="#2d3142" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">PK</text>
- <text x="988" y="364" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">uuid</text>
-
- <text x="772" y="388" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif">order_id</text>
- <rect x="880" y="380" width="20" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.35)" stroke-width="0.8"/>
- <text x="890" y="389" fill="#2d3142" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">FK</text>
- <rect x="904" y="380" width="20" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.35)" stroke-width="0.8"/>
- <text x="914" y="389" fill="#2d3142" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">NN</text>
- <text x="988" y="388" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">uuid</text>
+ <rect x="760" y="368" width="240" height="100" rx="6" fill="#ffffff" stroke="#2d3142" stroke-width="1"/>
+ <rect x="760" y="368" width="240" height="28" rx="6" fill="rgba(45,49,66,0.04)" stroke="none"/>
+ <rect x="760" y="388" width="240" height="8" fill="rgba(45,49,66,0.04)"/>
+ <line x1="760" y1="396" x2="1000" y2="396" stroke="rgba(45,49,66,0.22)" stroke-width="1"/>
+ <text x="772" y="386" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist', sans-serif">billing.invoices</text>
+ <rect x="948" y="376" width="40" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.40)" stroke-width="0.8"/>
+ <text x="968" y="385" fill="#2d3142" opacity="0.8" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.08em">TABLE</text>
<rect x="760" y="396" width="240" height="24" fill="rgba(45,49,66,0.02)"/>
- <text x="772" y="412" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif">issued_at</text>
+ <text x="772" y="412" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif">id</text>
<rect x="880" y="404" width="20" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.35)" stroke-width="0.8"/>
- <text x="890" y="413" fill="#2d3142" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">NN</text>
- <text x="988" y="412" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">timestamptz</text>
+ <text x="890" y="413" fill="#2d3142" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">PK</text>
+ <text x="988" y="412" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">uuid</text>
+
+ <text x="772" y="436" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif">order_id</text>
+ <rect x="880" y="428" width="20" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.35)" stroke-width="0.8"/>
+ <text x="890" y="437" fill="#2d3142" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">FK</text>
+ <rect x="904" y="428" width="20" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.35)" stroke-width="0.8"/>
+ <text x="914" y="437" fill="#2d3142" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">NN</text>
+ <text x="988" y="436" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">uuid</text>
+
+ <rect x="760" y="444" width="240" height="24" fill="rgba(45,49,66,0.02)"/>
+ <text x="772" y="460" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif">issued_at</text>
+ <rect x="880" y="452" width="20" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.35)" stroke-width="0.8"/>
+ <text x="890" y="461" fill="#2d3142" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">NN</text>
+ <text x="988" y="460" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">timestamptz</text>
<!-- Legend -->
<line x1="40" y1="500" x2="1040" y2="500" stroke="rgba(45,49,66,0.10)" stroke-width="0.8"/>
diff --git a/skills/diagram-design/assets/example-db-schema.html b/skills/diagram-design/assets/example-db-schema.html
index 0b6e20b..363e7f7 100644
--- a/skills/diagram-design/assets/example-db-schema.html
+++ b/skills/diagram-design/assets/example-db-schema.html
@@ -70,31 +70,31 @@
<rect width="100%" height="100%" fill="#f5f5f5"/>
<!-- BILLING schema group (drawn first so tables paint over it) -->
- <rect x="744" y="284" width="272" height="152" rx="8" fill="rgba(45,49,66,0.02)" stroke="rgba(45,49,66,0.20)" stroke-width="0.8" stroke-dasharray="4,4"/>
- <text x="756" y="300" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" letter-spacing="0.14em">BILLING</text>
+ <rect x="744" y="332" width="272" height="152" rx="8" fill="rgba(45,49,66,0.02)" stroke="rgba(45,49,66,0.20)" stroke-width="0.8" stroke-dasharray="4,4"/>
+ <text x="756" y="348" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" letter-spacing="0.14em">BILLING</text>
<!-- FK connectors (drawn before boxes) -->
<!-- FK1: orders.customer_id -> customers.id · ON DELETE RESTRICT -->
<path d="M 400,104 H 348 Q 340,104 340,112 Q 340,120 332,120 H 280" fill="none" stroke="#4f5d75" stroke-width="1" marker-end="url(#arrow)"/>
<!-- FK2: order_items.order_id -> orders.id · ON DELETE CASCADE (focal) -->
- <path d="M 640,384 H 692 Q 700,384 700,376 V 80 Q 700,72 692,72 H 640" fill="none" stroke="#eb6c36" stroke-width="1.2" marker-end="url(#arrow-accent)"/>
+ <path d="M 640,384 H 660 Q 668,384 668,376 V 96 Q 668,88 660,88 H 640" fill="none" stroke="#eb6c36" stroke-width="1.2" marker-end="url(#arrow-accent)"/>
<!-- FK3: order_items.product_id -> products.id · ON DELETE RESTRICT -->
<path d="M 640,408 H 708 Q 716,408 716,400 V 88 Q 716,80 724,80 H 760" fill="none" stroke="#4f5d75" stroke-width="1" marker-end="url(#arrow)"/>
<!-- FK4: invoices.order_id -> orders.id · ON DELETE RESTRICT -->
- <path d="M 760,384 H 692 Q 684,384 684,376 V 96 Q 684,88 676,88 H 640" fill="none" stroke="#4f5d75" stroke-width="1" marker-end="url(#arrow)"/>
+ <path d="M 760,432 H 700 Q 692,432 692,424 V 416 a 8,8 0 0,0 0,-16 V 80 Q 692,72 684,72 H 640" fill="none" stroke="#4f5d75" stroke-width="1" marker-end="url(#arrow)"/>
<!-- FK labels (masked, 6-10px gap above/beside their connector) -->
<rect x="284" y="82" width="112" height="12" rx="2" fill="#f5f5f5"/>
<text x="340" y="91" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">ON DELETE RESTRICT</text>
- <rect x="648" y="392" width="88" height="12" rx="2" fill="#f5f5f5"/>
- <text x="692" y="401" fill="#eb6c36" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">ON DELETE CASCADE</text>
+ <rect x="572" y="274" width="88" height="12" rx="2" fill="#f5f5f5"/>
+ <text x="616" y="283" fill="#eb6c36" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">ON DELETE CASCADE</text>
<rect x="724" y="252" width="112" height="12" rx="2" fill="#f5f5f5"/>
<text x="780" y="261" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">ON DELETE RESTRICT</text>
- <rect x="564" y="270" width="112" height="12" rx="2" fill="#f5f5f5"/>
- <text x="620" y="279" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">ON DELETE RESTRICT</text>
+ <rect x="644" y="440" width="112" height="12" rx="2" fill="#f5f5f5"/>
+ <text x="700" y="449" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">ON DELETE RESTRICT</text>
<!-- Table: public.customers -->
<rect x="40" y="80" width="240" height="100" rx="6" fill="#ffffff" stroke="#2d3142" stroke-width="1"/>
@@ -250,32 +250,32 @@
<text x="772" y="220" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace">uq_products_sku</text>
<!-- Table: billing.invoices (inside BILLING group) -->
- <rect x="760" y="320" width="240" height="100" rx="6" fill="#ffffff" stroke="#2d3142" stroke-width="1"/>
- <rect x="760" y="320" width="240" height="28" rx="6" fill="rgba(45,49,66,0.04)" stroke="none"/>
- <rect x="760" y="340" width="240" height="8" fill="rgba(45,49,66,0.04)"/>
- <line x1="760" y1="348" x2="1000" y2="348" stroke="rgba(45,49,66,0.22)" stroke-width="1"/>
- <text x="772" y="338" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist', sans-serif">billing.invoices</text>
- <rect x="948" y="328" width="40" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.40)" stroke-width="0.8"/>
- <text x="968" y="337" fill="#2d3142" opacity="0.8" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.08em">TABLE</text>
-
- <rect x="760" y="348" width="240" height="24" fill="rgba(45,49,66,0.02)"/>
- <text x="772" y="364" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif">id</text>
- <rect x="880" y="356" width="20" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.35)" stroke-width="0.8"/>
- <text x="890" y="365" fill="#2d3142" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">PK</text>
- <text x="988" y="364" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">uuid</text>
-
- <text x="772" y="388" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif">order_id</text>
- <rect x="880" y="380" width="20" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.35)" stroke-width="0.8"/>
- <text x="890" y="389" fill="#2d3142" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">FK</text>
- <rect x="904" y="380" width="20" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.35)" stroke-width="0.8"/>
- <text x="914" y="389" fill="#2d3142" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">NN</text>
- <text x="988" y="388" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">uuid</text>
+ <rect x="760" y="368" width="240" height="100" rx="6" fill="#ffffff" stroke="#2d3142" stroke-width="1"/>
+ <rect x="760" y="368" width="240" height="28" rx="6" fill="rgba(45,49,66,0.04)" stroke="none"/>
+ <rect x="760" y="388" width="240" height="8" fill="rgba(45,49,66,0.04)"/>
+ <line x1="760" y1="396" x2="1000" y2="396" stroke="rgba(45,49,66,0.22)" stroke-width="1"/>
+ <text x="772" y="386" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist', sans-serif">billing.invoices</text>
+ <rect x="948" y="376" width="40" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.40)" stroke-width="0.8"/>
+ <text x="968" y="385" fill="#2d3142" opacity="0.8" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.08em">TABLE</text>
<rect x="760" y="396" width="240" height="24" fill="rgba(45,49,66,0.02)"/>
- <text x="772" y="412" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif">issued_at</text>
+ <text x="772" y="412" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif">id</text>
<rect x="880" y="404" width="20" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.35)" stroke-width="0.8"/>
- <text x="890" y="413" fill="#2d3142" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">NN</text>
- <text x="988" y="412" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">timestamptz</text>
+ <text x="890" y="413" fill="#2d3142" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">PK</text>
+ <text x="988" y="412" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">uuid</text>
+
+ <text x="772" y="436" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif">order_id</text>
+ <rect x="880" y="428" width="20" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.35)" stroke-width="0.8"/>
+ <text x="890" y="437" fill="#2d3142" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">FK</text>
+ <rect x="904" y="428" width="20" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.35)" stroke-width="0.8"/>
+ <text x="914" y="437" fill="#2d3142" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">NN</text>
+ <text x="988" y="436" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">uuid</text>
+
+ <rect x="760" y="444" width="240" height="24" fill="rgba(45,49,66,0.02)"/>
+ <text x="772" y="460" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif">issued_at</text>
+ <rect x="880" y="452" width="20" height="12" rx="2" fill="none" stroke="rgba(45,49,66,0.35)" stroke-width="0.8"/>
+ <text x="890" y="461" fill="#2d3142" opacity="0.75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">NN</text>
+ <text x="988" y="460" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">timestamptz</text>
<!-- Legend -->
<line x1="40" y1="500" x2="1040" y2="500" stroke="rgba(45,49,66,0.10)" stroke-width="0.8"/>