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.
feat(heatmap): add heatmap as visual type #40 (#164)
Rupam Pal5611733f977d
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonindex 22d4d0f..c52ba92 100644--- a/.claude-plugin/marketplace.json+++ b/.claude-plugin/marketplace.json@@ -1,7 +1,7 @@{"name": "diagram-design","metadata": {- "description": "Create architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart, loop, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, waterfall, treemap, line, Gantt, scatter, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, database schema, lifecycle phase maps. HTML/SVG/PNG."+ "description": "Architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart, loop, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, waterfall, treemap, heatmap, line, Gantt, scatter, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, database schema, lifecycle phase map, HTML/SVG/PNG."},"owner": {"name": "Cathryn Lavery"diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonindex 492d2f5..7ebcacb 100644--- a/.claude-plugin/plugin.json+++ b/.claude-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "diagram-design",- "description": "Create architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart, loop, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, waterfall, treemap, line, Gantt, scatter, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, database schema, lifecycle phase maps. HTML/SVG/PNG.",+ "description": "Create architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart, loop, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, waterfall, treemap, heatmap, line, Gantt, scatter, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, database schema, lifecycle phase maps. SVG/PNG.","version": "2.6.32","author": {"name": "Cathryn Lavery",diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.jsonindex 21383e7..1ba9418 100644--- a/.codex-plugin/plugin.json+++ b/.codex-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "diagram-design",- "description": "Create architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart, loop, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, waterfall, treemap, line, Gantt, scatter, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, database schema, lifecycle phase maps. HTML/SVG/PNG.",+ "description": "Create architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart, loop, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, waterfall, treemap, heatmap, line, Gantt, scatter, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, database schema, lifecycle phase maps. SVG/PNG.","version": "2.6.32","author": {"name": "Cathryn Lavery",@@ -26,7 +26,7 @@"interface": {"displayName": "Diagram Design","shortDescription": "Create editorial technical and product diagrams as standalone HTML.",- "longDescription": "Create branded architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart (polar/radial lollipop), loop/flywheel, nested, tree, org chart, layer stack, Venn, pyramid/funnel, treemap, bar, waterfall, line, Gantt and scatter charts, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, or database schema diagrams as standalone HTML/SVG/PNG. Redraw .drawio/.drawio.png/.drawio.svg, Mermaid .mmd, or Excalidraw .excalidraw sources at a chosen size/detail; onboard brand tokens from a website; add lifecycle phase maps, semantic patterns, callouts, accessible motion, or sketchy/hand-drawn styling.",+ "longDescription": "Create branded architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart (polar/radial lollipop), loop/flywheel, nested, tree, org chart, layer stack, Venn, pyramid/funnel, treemap, heatmap, bar, waterfall, line, Gantt and scatter charts, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, or database schema diagrams as standalone HTML/SVG/PNG. Redraw .drawio/.drawio.png/.drawio.svg, Mermaid .mmd, or Excalidraw .excalidraw sources at a chosen size/detail; onboard brand tokens from a website; add lifecycle phase maps, semantic patterns, callouts, accessible motion, or sketchy/hand-drawn styling.","developerName": "Cathryn Lavery","category": "Productivity","capabilities": [diff --git a/.factory-plugin/plugin.json b/.factory-plugin/plugin.jsonindex 492d2f5..7ebcacb 100644--- a/.factory-plugin/plugin.json+++ b/.factory-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "diagram-design",- "description": "Create architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart, loop, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, waterfall, treemap, line, Gantt, scatter, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, database schema, lifecycle phase maps. HTML/SVG/PNG.",+ "description": "Create architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart, loop, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, waterfall, treemap, heatmap, line, Gantt, scatter, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, database schema, lifecycle phase maps. SVG/PNG.","version": "2.6.32","author": {"name": "Cathryn Lavery",diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex ee1910b..f6b2080 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -161,6 +161,14 @@ jobs:python scripts/test-verify-polar.pypython scripts/verify-polar.py+ - name: Verify heatmap monotone ramp and grid+ if: always()+ id: heatmap+ shell: bash+ run: |+ python scripts/test-verify-heatmap.py+ python scripts/verify-heatmap.py --all+- name: Verify sequence OAuth specsif: always()id: oauth@@ -440,6 +448,8 @@ jobs:echo "| Mojibake Repair Utility | ${{ steps.mojibake.outcome == 'success' && '✅ Passed' || (steps.mojibake.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARYecho "| Color Palette & Skin Linter | ${{ steps.skin.outcome == 'success' && '✅ Passed' || (steps.skin.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARYecho "| Quantitative Polar Chart | ${{ steps.polar.outcome == 'success' && '✅ Passed' || (steps.polar.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY+ echo "| Heatmap Monotone Ramp & Grid | ${{ steps.heatmap.outcome == 'success' && '✅ Passed' || (steps.heatmap.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY+ echo "| Heatmap Checker | ${{ steps.heatmap.outcome == 'success' && '✅ Passed' || (steps.heatmap.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARYecho "| Sequence Diagram Grammar | ${{ steps.oauth.outcome == 'success' && '✅ Passed' || (steps.oauth.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARYecho "| Semantic-Motion Verifier Tests | ${{ steps.semantic_motion_tests.outcome == 'success' && '✅ Passed' || (steps.semantic_motion_tests.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARYecho "| Sequence-OAuth Verifier Tests | ${{ steps.oauth_tests.outcome == 'success' && '✅ Passed' || (steps.oauth_tests.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARYdiff --git a/.maintainer-policy.json b/.maintainer-policy.jsonindex fee4685..acedbe8 100644--- a/.maintainer-policy.json+++ b/.maintainer-policy.json@@ -94,6 +94,8 @@"python3 scripts/test-verify-beeswarm.py","python3 scripts/verify-skin-polarity.py --all","python3 scripts/test-verify-skin-polarity.py",+ "python3 scripts/test-verify-heatmap.py",+ "python3 scripts/verify-heatmap.py --all","python3 scripts/build-icons.py && git diff --ignore-space-at-eol --exit-code -- skills/diagram-design/assets/icons.html skills/diagram-design/references/primitive-icons.md"],"required_check_names": [],diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 5d70432..5f2eb0d 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -8,7 +8,7 @@ Please read [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) first. All contributions ar## What this project is-Diagram Design is an agent skill (Claude Code, Codex, Factory Droid, Pi) that produces editorial-quality diagrams as self-contained HTML files. The repo is documentation-first: `skills/diagram-design/SKILL.md` is the index, each of the 40 visual types has its own reference file, and the extractor scripts in `skills/diagram-design/scripts/` turn draw.io, Mermaid, and Excalidraw sources into a structured IR.+Diagram Design is an agent skill (Claude Code, Codex, Factory Droid, Pi) that produces editorial-quality diagrams as self-contained HTML files. The repo is documentation-first: `skills/diagram-design/SKILL.md` is the index, each of the 41 visual types has its own reference file, and the extractor scripts in `skills/diagram-design/scripts/` turn draw.io, Mermaid, and Excalidraw sources into a structured IR.See [README.md](README.md) for the full picture, including the design system and the import/export flows.@@ -41,6 +41,7 @@ Every validation gate below must pass before a PR is ready. They also run automa| Skin conformance of every example and template (colors, fonts, a11y, assets, scripts) | `python3 scripts/lint-skin.py --all --baseline` || Rendered-layout checker and shipped examples/templates | `python3 scripts/lint-render.py --self-test && python3 scripts/lint-render.py --all` || Quantitative polar encoding and variant parity | `python3 scripts/test-verify-polar.py && python3 scripts/verify-polar.py` |+| Heatmap monotone opacity ramp, complete N×M grid, ≤1 focal cell | `python3 scripts/test-verify-heatmap.py && python3 scripts/verify-heatmap.py --all` || A single file, e.g. a new example | `python3 scripts/lint-skin.py skills/diagram-design/assets/example-my-type.html` || Sequence-doc consistency (ATL fragments, budgets) | `python3 scripts/verify-sequence-oauth.py` || Semantic-motion verifier behaves (pass + adversarial cases) | `python3 scripts/test-verify-semantic-motion.py` |@@ -110,6 +111,8 @@ python3 scripts/test-plugin-package.py \&& python3 scripts/lint-render.py --all \&& python3 scripts/test-verify-polar.py \&& python3 scripts/verify-polar.py \+ && python3 scripts/test-verify-heatmap.py \+ && python3 scripts/verify-heatmap.py --all \&& python3 scripts/verify-sequence-oauth.py \&& python3 scripts/test-verify-semantic-motion.py \&& python3 scripts/test-verify-sequence-oauth.py \diff --git a/docs/adr/0002-semantic-patterns-do-not-expand-the-taxonomy.md b/docs/adr/0002-semantic-patterns-do-not-expand-the-taxonomy.mdindex 8501f28..85811df 100644--- a/docs/adr/0002-semantic-patterns-do-not-expand-the-taxonomy.md+++ b/docs/adr/0002-semantic-patterns-do-not-expand-the-taxonomy.md@@ -24,6 +24,8 @@ Behavior is a separate axis. The semantic patterns in `references/semantic-patte**2026-08-20 — the count is 39.** Polar was admitted under the same escape clause: angle encodes ordered cyclic categories and linear radius encodes one quantitative series, a layout grammar no existing type provides. It shipped the full §10 set, and the counters named above moved 38 → 39 together with the prose.+**2026-08-31 — the count is 40.** Heatmap was admitted under the same escape clause: a rectangular grid of cells where fill opacity encodes a quantitative value across two categorical axes is a layout grammar no existing type provides (bar encodes with length along one axis, scatter with position on two quantitative axes, treemap with area). It shipped the full §10 set (three example variants, type reference, verifier, adversarial tests, gallery tab), and the two counters named above moved 39 → 40 together with the prose.+**2026-08-31 — the pattern count is eight.** Traceable block decomposition was added: hierarchical, ID-addressable block decomposition with per-block I/O, constraints, and an implementation-code link, for compliance, audit, or IP-style documentation. It routes to the existing Tree type — SysML-informed vocabulary (block, noun-phrase naming, flow port) applied to Tree's existing layout grammar, not a new grammar and not a claim of SysML or IDEF0 conformance. This is the first amendment to the *pattern* count specifically (every prior amendment above moved the *type* count); the mechanism is the same one-line-plus-routing-row cost this ADR's Decision describes, and `verify-semantic-motion.py`'s `PATTERN_NAMES` list is its enforcement, the same way the type counters enforce the type count. See [ADR 0010](0010-block-registry-metadata-contract.md).**2026-09-06 — the count is 40.** Waterfall was admitted under the same escape clause: a running total anchored by start/end bars and bridged by signed floating deltas is a layout grammar no existing type provides (bar compares independent categories, the dumbbell states two endpoints without the path, pyramid ranks one funnel, Sankey splits and merges). The per-grammar argument is in [ADR 0011](0011-waterfall-is-a-running-total-grammar.md); it ships the full §10 set, and the counters named above move 39 → 40 together with the prose.diff --git a/docs/screenshots/heatmap.png b/docs/screenshots/heatmap.pngnew file mode 100644index 0000000..e0d5d5aBinary files /dev/null and b/docs/screenshots/heatmap.png differdiff --git a/docs/screenshots/manifest.json b/docs/screenshots/manifest.jsonindex 1334370..260a1ae 100644--- a/docs/screenshots/manifest.json+++ b/docs/screenshots/manifest.json@@ -200,6 +200,15 @@"width": 2400,"height": 1202},+ {+ "slug": "heatmap",+ "source": "skills/diagram-design/assets/example-heatmap.html",+ "screenshot": "docs/screenshots/heatmap.png",+ "source_sha256": "1dd42f8cdfb73d1f0a139de52653c98da760ef4e1403990424f6a5da201cdb6b",+ "screenshot_sha256": "71dde28b4cab7788fd735a3c543a60c4fdc854749c627749eb768adc52fd9186",+ "width": 2400,+ "height": 1202+ },{"slug": "line","source": "skills/diagram-design/assets/example-line.html",diff --git a/scripts/render-canonical-screenshots.py b/scripts/render-canonical-screenshots.pyindex 0c7ec9e..d1f26e2 100644--- a/scripts/render-canonical-screenshots.py+++ b/scripts/render-canonical-screenshots.py@@ -1,5 +1,5 @@#!/usr/bin/env python3-"""Render the 40 canonical minimal-light examples and record their digests."""+"""Render the 41 canonical minimal-light examples and record their digests."""from __future__ import annotations@@ -21,8 +21,8 @@ from screenshot_catalog import (def main() -> int:slugs = canonical_slugs()- if len(slugs) != 40 or len(slugs) != len(set(slugs)):- raise SystemExit(f"expected 40 unique canonical types; found {len(slugs)}")+ if len(slugs) != 41 or len(slugs) != len(set(slugs)):+ raise SystemExit(f"expected 41 unique canonical types; found {len(slugs)}")SCREENSHOT_DIR.mkdir(parents=True, exist_ok=True)entries: list[dict[str, object]] = []@@ -56,7 +56,7 @@ def main() -> int:"height": height,})- print(f"[{index:02d}/40] {slug}: {width}x{height}")+ print(f"[{index:02d}/41] {slug}: {width}x{height}")browser.close()payload = {diff --git a/scripts/test-verify-heatmap.py b/scripts/test-verify-heatmap.pynew file mode 100644index 0000000..7feb140--- /dev/null+++ b/scripts/test-verify-heatmap.py@@ -0,0 +1,350 @@+#!/usr/bin/env python3+"""Adversarial tests for verify-heatmap.py — both polarities.++Per ADR 0005, a geometric contract is a checker plus fixtures proving it fires+when it should and stays quiet when it shouldn't. Each mutation below renders+visually identical to the good example (or plausibly so) and no other gate+would catch it.++Positive cases (must PASS):+ P1 — the shipped light example passes clean.+ P2 — the shipped dark example passes clean.+ P3 — the shipped full example passes clean.++Negative cases (must FAIL):+ N1 — two focal cells (data-focal on two different cells).+ N2 — missing cell (one (row,col) pair removed from the grid).+ N3 — duplicate cell (one (row,col) pair appears twice, different values).+ N4 — non-monotone fill (higher value gets lower opacity).+ N5 — inconsistent fill (same value, two different opacities in the same figure).+ N6 — no parseable cells (data-row attribute removed from all cells).+ N7 — non-focal cell with no rgba fill.+ N8 — CSS transform present in <style> block.+ N9 — missing axis declarations entirely.+ N10 — undeclared row/column values in the cells.+ N11 — focal value text fails AA contrast against the focal accent fill.+ N12 — duplicate axis declarations silently shrink the grid vocabulary.+ N13 — dark focal text is checked against the wrong underlay color.++Usage: python3 scripts/test-verify-heatmap.py+Exit: 0 all pass, 1 a case failed.+"""++from __future__ import annotations++import os+import re+import subprocess+import sys+import tempfile+from pathlib import Path++ROOT = Path(__file__).resolve().parent.parent+CHECKER = ROOT / "scripts/verify-heatmap.py"+GOOD = ROOT / "skills/diagram-design/assets/example-heatmap.html"+GOOD_DARK = ROOT / "skills/diagram-design/assets/example-heatmap-dark.html"+GOOD_FULL = ROOT / "skills/diagram-design/assets/example-heatmap-full.html"++CHILD_ENV = {**os.environ, "PYTHONIOENCODING": "utf-8"}++# Anchors — literal excerpts of the shipped light example.+FOCAL_CELL = (+ 'data-row="payments" data-col="S4" data-value="47" data-focal="true" '+ 'x="520" y="124" width="116" height="56" fill="rgba(235,108,54,0.85)"'+)+FIRST_NONFOCAL = (+ 'data-row="auth" data-col="S1" data-value="4" '+ 'x="160" y="64" width="116" height="56" fill="rgba(45,49,66,0.29)"'+)+HIGH_VALUE_CELL = (+ 'data-row="billing" data-col="S3" data-value="9" '+ 'x="400" y="244" width="116" height="56" fill="rgba(45,49,66,0.65)"'+)+LOW_VALUE_CELL = (+ 'data-row="notifications" data-col="S1" data-value="1" '+ 'x="160" y="304" width="116" height="56" fill="rgba(45,49,66,0.07)"'+)+# A non-focal cell used as the "missing" anchor in N2+MISSING_TARGET = (+ 'data-row="billing" data-col="S6" data-value="3" '+ 'x="760" y="244" width="116" height="56" fill="rgba(45,49,66,0.22)"'+)+# A cell with value=5 used as the inconsistent-opacity anchor in N5+FIVE_VALUE_CELL = (+ 'data-row="auth" data-col="S2" data-value="5" '+ 'x="280" y="64" width="116" height="56" fill="rgba(45,49,66,0.36)"'+)+++def invoke(argv: list[str]) -> tuple[int, str]:+ result = subprocess.run(+ argv,+ capture_output=True,+ text=True,+ encoding="utf-8",+ errors="replace",+ env=CHILD_ENV,+ )+ return result.returncode, (result.stdout or "") + (result.stderr or "")+++def run(*paths: Path) -> tuple[int, str]:+ return invoke([sys.executable, str(CHECKER), *(str(p) for p in paths)])+++def write(directory: Path, name: str, source: str) -> Path:+ path = directory / name+ path.write_text(source, encoding="utf-8")+ return path+++def case(+ failures: list[str],+ directory: Path,+ name: str,+ source: str,+ original: str,+ expect_pass: bool,+ describe: str,+) -> None:+ if source == original and not expect_pass:+ failures.append(+ f"could not build the {name!r} fixture (anchor not found in source)"+ )+ return+ path = write(directory, name, source)+ code, output = run(path)+ passed = code == 0+ if passed != expect_pass:+ direction = "pass" if expect_pass else "fail"+ actual = "passed" if passed else f"failed:\n {output.strip()}"+ failures.append(f"{name}: expected {direction} but {actual}")+++def main() -> int:+ original = GOOD.read_text(encoding="utf-8")+ failures: list[str] = []++ with tempfile.TemporaryDirectory() as tmp:+ d = Path(tmp)++ # ── Positive: shipped examples must pass ──────────────────────────────++ for label, path in [+ ("P1-light", GOOD),+ ("P2-dark", GOOD_DARK),+ ("P3-full", GOOD_FULL),+ ]:+ code, output = run(path)+ if code != 0:+ failures.append(f"{label}: shipped example failed:\n {output.strip()}")++ # ── Negative: mutations that must be rejected ─────────────────────────++ # N1: two focal cells+ second_focal = FIRST_NONFOCAL.replace(+ 'fill="rgba(45,49,66,0.29)"',+ 'data-focal="true" fill="rgba(235,108,54,0.85)"',+ )+ case(+ failures,+ d,+ "N1-two-focal.html",+ original.replace(FIRST_NONFOCAL, second_focal),+ original,+ False,+ "two data-focal cells",+ )++ # N2: missing cell (remove one complete <rect> pair — underlay + data)+ # We remove just the data rect for billing·S6; the grid becomes 29 cells.+ missing_rect = f"<rect {MISSING_TARGET}/>"+ case(+ failures,+ d,+ "N2-missing-cell.html",+ original.replace(missing_rect, ""),+ original,+ False,+ "missing (billing, S6) cell",+ )++ # N3: duplicate cell — replace the billing·S6 cell's col with S5+ # so we have two (billing, S5) cells.+ duplicate = MISSING_TARGET.replace('data-col="S6"', 'data-col="S5"')+ case(+ failures,+ d,+ "N3-duplicate-cell.html",+ original.replace(MISSING_TARGET, duplicate),+ original,+ False,+ "duplicate (billing, S5) cell",+ )++ # N4: non-monotone fill — swap opacities of high-value (9, 0.65) and+ # low-value (1, 0.07) cells so a lower value gets higher opacity.+ inverted = original.replace(+ HIGH_VALUE_CELL,+ HIGH_VALUE_CELL.replace("0.65", "0.07"),+ ).replace(+ LOW_VALUE_CELL,+ LOW_VALUE_CELL.replace("0.07", "0.65"),+ )+ case(+ failures,+ d,+ "N4-non-monotone.html",+ inverted,+ original,+ False,+ "non-monotone opacity (value=9 gets opacity=0.07, value=1 gets 0.65)",+ )++ # N5: inconsistent fill — give one of the value=5 cells a different opacity.+ inconsistent = original.replace(+ FIVE_VALUE_CELL,+ FIVE_VALUE_CELL.replace("0.36", "0.55"),+ )+ case(+ failures,+ d,+ "N5-inconsistent-opacity.html",+ inconsistent,+ original,+ False,+ "same value=5 with two different opacities (0.36 vs 0.55)",+ )++ # N6: no parseable cells — strip data-row from every rect.+ no_cells = re.sub(r'\s+data-row="[^"]*"', "", original)+ case(+ failures,+ d,+ "N6-no-cells.html",+ no_cells,+ original,+ False,+ "no parseable heatmap cells",+ )++ # N7: non-focal cell with no rgba fill — replace with a named color.+ no_rgba = original.replace(+ 'fill="rgba(45,49,66,0.07)"',+ 'fill="#f0eeec"',+ 1, # only the first occurrence+ )+ case(+ failures,+ d,+ "N7-no-rgba-fill.html",+ no_rgba,+ original,+ False,+ "non-focal cell with no rgba fill",+ )++ # N8: CSS transform in <style> block.+ css_transform = original.replace(+ "svg { display: block; width: 100%; height: auto; max-width: 100%; }",+ "svg { display: block; width: 100%; height: auto; max-width: 100%; transform: scale(1); }",+ )+ case(+ failures,+ d,+ "N8-css-transform.html",+ css_transform,+ original,+ False,+ "CSS transform property in <style>",+ )++ # N9: missing axis declarations.+ no_axis_labels = re.sub(r'\s+data-row-label="[^"]+"', "", original)+ no_axis_labels = re.sub(r'\s+data-col="[^"]+"', "", no_axis_labels)+ case(+ failures,+ d,+ "N9-missing-axis-labels.html",+ no_axis_labels,+ original,+ False,+ "missing axis declarations",+ )++ # N10: undeclared row/column value in a cell.+ undeclared_cell = original.replace(+ 'data-row="payments" data-col="S4" data-value="47" data-focal="true"',+ 'data-row="unknown" data-col="S4" data-value="47" data-focal="true"',+ 1,+ )+ case(+ failures,+ d,+ "N10-undeclared-row-col.html",+ undeclared_cell,+ original,+ False,+ "undeclared row/column values",+ )++ # N11: focal value text fails AA contrast against the focal accent fill.+ bad_focal_text = original.replace(+ 'fill="#111111" font-size="10" font-weight="600"',+ 'fill="#f5f5f5" font-size="10" font-weight="600"',+ 1,+ )+ case(+ failures,+ d,+ "N11-focal-text-contrast.html",+ bad_focal_text,+ original,+ False,+ "focal value text fails 4.5:1 contrast on accent fill",+ )++ # N12: duplicate axis declarations must not quietly shrink the declared grid.+ duplicate_axis = original.replace(+ 'data-row-label="auth" x="148" y="96" fill="#2d3142" font-size="9" font-family="\'Geist Mono\', monospace" text-anchor="end">auth</text>',+ 'data-row-label="auth" x="148" y="96" fill="#2d3142" font-size="9" font-family="\'Geist Mono\', monospace" text-anchor="end">auth</text>\n'+ ' <text data-row-label="auth" x="148" y="110" fill="#2d3142" font-size="9" font-family="\'Geist Mono\', monospace" text-anchor="end">auth</text>',+ 1,+ )+ case(+ failures,+ d,+ "N12-duplicate-axis-label.html",+ duplicate_axis,+ original,+ False,+ "duplicate axis label declaration silently shrinks the grid",+ )++ # N13: dark focal text must be evaluated against the dark background, not paper.+ dark_bad_focal_text = GOOD_DARK.read_text(encoding="utf-8").replace(+ 'fill="#111111" font-size="10" font-weight="600" font-family="\'Geist\', sans-serif" text-anchor="middle">47%</text>',+ 'fill="#f5f5f5" font-size="10" font-weight="600" font-family="\'Geist\', sans-serif" text-anchor="middle">47%</text>',+ 1,+ )+ case(+ failures,+ d,+ "N13-dark-focal-text-contrast.html",+ dark_bad_focal_text,+ GOOD_DARK.read_text(encoding="utf-8"),+ False,+ "dark focal value text fails 4.5:1 contrast against the actual dark underlay",+ )++ if failures:+ for f in failures:+ print("FAIL:", f, file=sys.stderr)+ return 1++ print(f"OK — {13 + 3} cases ({3} positive, {13} negative), all passed.")+ return 0+++if __name__ == "__main__":+ sys.exit(main())diff --git a/scripts/test-verify-motion.py b/scripts/test-verify-motion.pyindex a961106..c853dcf 100644--- a/scripts/test-verify-motion.py+++ b/scripts/test-verify-motion.py@@ -402,7 +402,7 @@ def main() -> int:missing_guide = directory / "missing-guide.md"missing_guide.write_text(original_skill.read_text(encoding="utf-8").replace(- "### Visual-type guide (40)", "### Visual guide"+ "### Visual-type guide (41)", "### Visual guide"),encoding="utf-8",)@@ -410,7 +410,7 @@ def main() -> int:markdown_errors = semantic_module.verify_markdown()finally:semantic_module.SKILL = original_skill- if not any("must contain the 40-row visual-type guide" in error for error in markdown_errors):+ if not any("must contain the 41-row visual-type guide" in error for error in markdown_errors):raise AssertionError(f"missing visual-guide anchor was accepted: {markdown_errors}")print("OK: missing visual-type guide anchor is rejected")diff --git a/scripts/verify-docs-sync.py b/scripts/verify-docs-sync.pyindex b2998df..9e1895f 100644--- a/scripts/verify-docs-sync.py+++ b/scripts/verify-docs-sync.py@@ -56,7 +56,7 @@ ONBOARDING_REFERENCE = ROOT / "skills/diagram-design/references/onboarding.md"LINE_DARK_EXAMPLE = ROOT / "skills/diagram-design/assets/example-line-dark.html"OUTPUT_SPEC_REFERENCE = ROOT / "skills/diagram-design/references/output-spec.md"VARIANTS = ("", "-dark", "-full")-VISUAL_TYPE_COUNT = 40+VISUAL_TYPE_COUNT = 41AGENT_SKILLS_DESCRIPTION_MAX = 1024PLUGIN_DESCRIPTION_MAX = 500# Types whose selection-table name differs from its description vocabulary.diff --git a/scripts/verify-heatmap.py b/scripts/verify-heatmap.pynew file mode 100644index 0000000..4ce6dc8--- /dev/null+++ b/scripts/verify-heatmap.py@@ -0,0 +1,531 @@+#!/usr/bin/env python3+"""Verify that a heatmap's drawn cells match the values they declare.++A heatmap makes one claim: **fill opacity is a monotone ramp on the declared+data value, and nothing else encodes quantity**. Row and column are categories;+their visual positions are only "which row" and "which column", not quantities+measured against a scale. Only the fill encodes "how much" — and the ramp must+be non-decreasing.++Four invariants:++1. COMPLETE GRID — every (row, col) pair in the declared row-and-column+ vocabulary is present. A missing cell is a gap in the reading that looks+ like "zero" but was never drawn.++2. MONOTONE FILL — non-focal cells whose data-value is higher must have a fill+ opacity that is >= the opacity of any cell with a lower data-value. The ramp+ must be non-decreasing: a lighter cell at a higher value inverts the visual+ scale and reverses every comparison. Cells with the same value must have the+ same opacity (tolerance ±0.03 to absorb floating-point representation).++3. ONE FOCAL MAX — at most one cell carries data-focal="true" or uses accent+ fill (R >= 200, G <= 150, B <= 100). The focal accent is an editorial marker+ for the single cell whose story the figure is about; using it on more than one+ inverts the ink-ramp contract the rest of the figure depends on.++4. FAIL CLOSED — zero parseable cells is a finding. A heatmap with no cells is+ not an empty-data edge case; it is an authoring error or a parse failure, and+ a checker that says OK because it found nothing to compare is the bug.++WHAT THIS DOES NOT CHECK, deliberately:++- **Cell geometry (x, y, width, height).** Both axes are categorical, so position+ encodes "which row/column", carried by axis labels — not a quantitative scale+ this checker can verify. A cell drawn at a wrong x,y is a layout error, not a+ data error; the label is what binds the mark to its identity.+- **The scale formula.** Monotone, not a specific slope or formula. Linear, sqrt,+ and log scales all pass as long as opacity is non-decreasing with value.+- **Text values inside cells.** Optional annotation; not part of the geometric+ contract.++Usage:+ python3 scripts/verify-heatmap.py --all+ python3 scripts/verify-heatmap.py skills/diagram-design/assets/example-heatmap.html++Exit: 0 clean, 1 findings, 2 usage.+"""++from __future__ import annotations++import argparse+import re+import sys+from pathlib import Path++ROOT = Path(__file__).resolve().parent.parent+ASSET_DIR = ROOT / "skills/diagram-design/assets"++RECT_RE = re.compile(r"<rect\b(?P<attrs>[^>]*?)/?>", re.IGNORECASE)+TEXT_RE = re.compile(r"<text\b(?P<attrs>[^>]*)>", re.IGNORECASE)+COMMENT_RE = re.compile(r"<!--.*?-->", re.DOTALL)+STYLE_RE = re.compile(r"<style\b[^>]*>(?P<body>.*?)</style>", re.IGNORECASE | re.DOTALL)+RGBA_RE = re.compile(r"rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)")+HEX_RE = re.compile(r"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$")++# CSS properties that can silently move a verified rect without changing its+# x/y/width/height attributes. Declaration-start anchoring avoids false matches+# on text-transform, custom-property values, etc.+# Mirrors verify-bump.py: checks transform/translate/rotate/scale and SVG+# presentation attributes that CSS can override (cx, cy, x, y, d, offset-*).+# Does NOT flag width/height since `svg { width: 100%; }` is standard responsive+# boilerplate and does not affect the verified rect attributes.+CSS_MOVES_MARK_RE = re.compile(+ r"(?:^|[{;}\n])\s*(?:-(?:webkit|moz|ms|o)-)?"+ r"(?P<prop>transform|translate|rotate|scale"+ r"|cx|cy|x|y|d"+ r"|offset(?:-(?:path|distance|position|anchor|rotate))?)"+ r"\s*:",+ re.IGNORECASE,+)+++def _attr(attrs_str: str, name: str) -> str | None:+ m = re.search(r"\b" + re.escape(name) + r'\s*=\s*"([^"]*)"', attrs_str)+ return m.group(1) if m else None+++def _is_accent(r: int, g: int, b: int) -> bool:+ """Detect accent fill — warm reddish-orange. Works for both light and dark skins."""+ return r >= 200 and g <= 150 and b <= 100+++def _parse_color(+ color: str, underlay: tuple[int, int, int] | None = None+) -> tuple[int, int, int] | None:+ """Parse a CSS hex or rgb/rgba color into the visible 8-bit RGB components.++ For rgba() values with alpha < 1, blend the color against the actual canvas+ underlay rather than assuming the light paper background. In dark heatmaps, the+ underlay is the dark paper color (#2d3142), not #f5f5f5.+ """+ value = color.strip()+ if not value:+ return None++ if underlay is None:+ underlay = (245, 245, 245)++ def blend(rgb: tuple[int, int, int], alpha: float) -> tuple[int, int, int]:+ if alpha >= 1.0:+ return rgb+ return tuple(+ round(c * alpha + underlay[idx] * (1.0 - alpha))+ for idx, c in enumerate(rgb)+ )++ if HEX_RE.match(value):+ hex_value = value[1:]+ if len(hex_value) == 3:+ hex_value = "".join(ch * 2 for ch in hex_value)+ try:+ rgb = (+ int(hex_value[0:2], 16),+ int(hex_value[2:4], 16),+ int(hex_value[4:6], 16),+ )+ return rgb+ except ValueError:+ return None++ rgba_match = RGBA_RE.match(value)+ if rgba_match:+ try:+ rgb = (+ int(rgba_match.group(1)),+ int(rgba_match.group(2)),+ int(rgba_match.group(3)),+ )+ alpha = float(rgba_match.group(4))+ return blend(rgb, alpha)+ except ValueError:+ return None++ rgb_match = re.match(+ r"rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)", value, re.IGNORECASE+ )+ if rgb_match:+ try:+ return (+ int(rgb_match.group(1)),+ int(rgb_match.group(2)),+ int(rgb_match.group(3)),+ )+ except ValueError:+ return None+ return None+++def _relative_luminance(rgb: tuple[int, int, int]) -> float:+ r, g, b = (channel / 255 for channel in rgb)++ def channel_to_linear(channel: float) -> float:+ if channel <= 0.03928:+ return channel / 12.92+ return ((channel + 0.055) / 1.055) ** 2.4++ r_lin = channel_to_linear(r)+ g_lin = channel_to_linear(g)+ b_lin = channel_to_linear(b)+ return 0.2126 * r_lin + 0.7152 * g_lin + 0.0722 * b_lin+++def _contrast_ratio(+ foreground: tuple[int, int, int], background: tuple[int, int, int]+) -> float:+ lum_fg = _relative_luminance(foreground)+ lum_bg = _relative_luminance(background)+ lighter, darker = max(lum_fg, lum_bg), min(lum_fg, lum_bg)+ return (lighter + 0.05) / (darker + 0.05)+++def parse_axis_labels(source: str) -> tuple[list[str], list[str], set[str], set[str]]:+ """Return (declared_rows, declared_cols, duplicate_rows, duplicate_cols).++ Rows are declared with data-row-label="name" on <text> elements (left gutter).+ Columns are declared with data-col="name" on <text> elements (top header row).+ Duplicate declarations are treated as a verifier failure because they silently+ shrink the grid vocabulary and make a malformed heatmap pass completeness.+ """+ source_clean = COMMENT_RE.sub("", source)+ declared_rows: list[str] = []+ declared_cols: list[str] = []+ duplicate_rows: set[str] = set()+ duplicate_cols: set[str] = set()+ seen_rows: set[str] = set()+ seen_cols: set[str] = set()++ for m in TEXT_RE.finditer(source_clean):+ attrs_str = m.group("attrs")+ row_label = _attr(attrs_str, "data-row-label")+ col_label = _attr(attrs_str, "data-col")+ if row_label:+ if row_label in seen_rows:+ duplicate_rows.add(row_label)+ else:+ declared_rows.append(row_label)+ seen_rows.add(row_label)+ if col_label:+ if col_label in seen_cols:+ duplicate_cols.add(col_label)+ else:+ declared_cols.append(col_label)+ seen_cols.add(col_label)++ return declared_rows, declared_cols, duplicate_rows, duplicate_cols+++def parse_cells(source: str) -> list[dict]:+ """Return list of cell dicts: row, col, value, opacity, focal."""+ source_clean = COMMENT_RE.sub("", source)+ cells: list[dict] = []++ for m in RECT_RE.finditer(source_clean):+ attrs_str = m.group("attrs")+ row = _attr(attrs_str, "data-row")+ col = _attr(attrs_str, "data-col")+ val_str = _attr(attrs_str, "data-value")+ if not (row and col and val_str is not None):+ continue+ try:+ value = float(val_str)+ except ValueError:+ continue+ if not (0.0 <= value < 1e9) or value != value: # reject nan/inf/negative+ continue++ fill = _attr(attrs_str, "fill") or ""+ focal = _attr(attrs_str, "data-focal") == "true"+ opacity: float | None = None+ x = _attr(attrs_str, "x")+ y = _attr(attrs_str, "y")+ width = _attr(attrs_str, "width")+ height = _attr(attrs_str, "height")++ rm = RGBA_RE.search(fill)+ if rm:+ try:+ r_ch = int(rm.group(1))+ g_ch = int(rm.group(2))+ b_ch = int(rm.group(3))+ opacity = float(rm.group(4))+ except ValueError:+ opacity = None+ else:+ if not (0.0 <= opacity <= 1.0):+ opacity = None+ elif _is_accent(r_ch, g_ch, b_ch):+ focal = True++ cells.append(+ {+ "row": row,+ "col": col,+ "value": value,+ "opacity": opacity,+ "focal": focal,+ "fill": fill,+ "x": float(x) if x is not None else None,+ "y": float(y) if y is not None else None,+ "width": float(width) if width is not None else None,+ "height": float(height) if height is not None else None,+ }+ )++ return cells+++def parse_text_labels(source: str) -> list[dict]:+ """Return SVG text labels with their fill, x, y, and rendered text."""+ source_clean = COMMENT_RE.sub("", source)+ texts: list[dict] = []+ for m in TEXT_RE.finditer(source_clean):+ attrs = m.group("attrs")+ fill = _attr(attrs, "fill")+ if not fill:+ continue+ x = _attr(attrs, "x")+ y = _attr(attrs, "y")+ text_content = re.search(r">(.*?)</text>", m.group(0), re.DOTALL)+ texts.append(+ {+ "fill": fill,+ "x": float(x) if x is not None else None,+ "y": float(y) if y is not None else None,+ "text": text_content.group(1).strip() if text_content else "",+ }+ )+ return texts+++def check_file(path: Path) -> list[str]:+ errors: list[str] = []+ try:+ source = path.read_text(encoding="utf-8")+ except OSError as exc:+ return [f"{path.name}: cannot read: {exc}"]++ # CSS-moves-geometry check.+ for style_body in STYLE_RE.findall(source):+ m = CSS_MOVES_MARK_RE.search(style_body)+ if m:+ errors.append(+ f"{path.name}: CSS property '{m.group('prop')}' can move verified "+ "cell geometry without changing the attributes this checker reads"+ )++ cells = parse_cells(source)++ if not cells:+ errors.append(+ f"{path.name}: no parseable heatmap cells found "+ "(need <rect data-row=... data-col=... data-value=...>)"+ )+ return errors++ focal_cells = [c for c in cells if c["focal"]]+ non_focal = [c for c in cells if not c["focal"]]++ # Invariant 3: at most one focal cell.+ if len(focal_cells) > 1:+ focal_ids = ", ".join(f"({c['row']},{c['col']})" for c in focal_cells)+ errors.append(+ f"{path.name}: found {len(focal_cells)} focal cells ({focal_ids}); "+ "at most 1 allowed — the focal accent marks one editorial cell, "+ "not a second data range"+ )++ # Invariant 1: require a declared axis vocabulary and reject any cell whose+ # row/column are outside that vocabulary. Cell-derived fallback is intentionally+ # not allowed here: a malformed heatmap can otherwise pass when a row or column+ # is missing from the label axis but the remaining cells still produce a count.+ declared_rows, declared_cols, duplicate_rows, duplicate_cols = parse_axis_labels(source)+ if not declared_rows or not declared_cols:+ errors.append(+ f"{path.name}: heatmap is missing declared row/column axis labels; "+ "every row and column must be named via data-row-label and data-col"+ )+ return errors+ if duplicate_rows or duplicate_cols:+ dup_msg = ", ".join(sorted(duplicate_rows | duplicate_cols))+ errors.append(+ f"{path.name}: duplicate axis declarations for {dup_msg}; "+ "repeated data-row-label/data-col entries silently shrink the grid and must be rejected"+ )+ return errors++ rows = declared_rows+ cols = declared_cols++ seen_rows: set[str] = set()+ seen_cols: set[str] = set()+ for c in cells:+ if c["row"] not in rows:+ errors.append(+ f"{path.name}: cell uses undeclared row '{c['row']}' — "+ "every cell must map to a declared row label"+ )+ if c["col"] not in cols:+ errors.append(+ f"{path.name}: cell uses undeclared column '{c['col']}' — "+ "every cell must map to a declared column label"+ )+ seen_rows.add(c["row"])+ seen_cols.add(c["col"])++ expected = len(rows) * len(cols)+ actual = len(cells)++ if actual != expected:+ errors.append(+ f"{path.name}: expected {expected} cells "+ f"({len(rows)} rows × {len(cols)} cols) but found {actual}; "+ "every (row, col) pair must be present"+ )+ else:+ seen: set[tuple[str, str]] = set()+ for c in cells:+ key = (c["row"], c["col"])+ if key in seen:+ errors.append(+ f"{path.name}: duplicate cell ({c['row']}, {c['col']}); "+ "each (row, col) pair must appear exactly once"+ )+ break+ seen.add(key)++ # Invariant 2: monotone fill ramp for non-focal cells.+ if non_focal:+ opaque_missing = [c for c in non_focal if c["opacity"] is None]+ if opaque_missing:+ for c in opaque_missing:+ errors.append(+ f"{path.name}: non-focal cell ({c['row']}, {c['col']}) "+ "has no parseable rgba fill — every non-focal cell must "+ "declare its opacity through rgba(R,G,B,opacity)"+ )++ by_value: dict[float, list[float]] = {}+ for c in non_focal:+ if c["opacity"] is not None:+ by_value.setdefault(c["value"], []).append(c["opacity"])++ # Within each value, all opacities must be identical (±TOLERANCE).+ TOLERANCE = 0.03+ for val, opacities in sorted(by_value.items()):+ spread = max(opacities) - min(opacities)+ if spread > TOLERANCE:+ errors.append(+ f"{path.name}: cells with data-value={val} have inconsistent "+ f"opacities (spread {spread:.3f} > {TOLERANCE}); "+ "every cell with the same value must use the same fill opacity"+ )++ # Across values, mean opacity must be non-decreasing.+ sorted_vals = sorted(by_value.keys())+ prev_opacity = -1.0+ prev_val = None+ for val in sorted_vals:+ mean_opacity = sum(by_value[val]) / len(by_value[val])+ if mean_opacity < prev_opacity - TOLERANCE:+ errors.append(+ f"{path.name}: value {val} has mean fill opacity "+ f"{mean_opacity:.3f}, which is less than value "+ f"{prev_val}'s opacity {prev_opacity:.3f}; "+ "the fill ramp must be non-decreasing — higher values "+ "must use >= opacity than lower values"+ )+ prev_opacity = mean_opacity+ prev_val = val++ # Require focal cell value text to maintain WCAG AA against the rendered focal fill.+ # The fill is composited against the heatmap canvas background, which is light paper in+ # light variants and dark paper in dark variants.+ canvas_underlay = None+ for rect_match in RECT_RE.finditer(source):+ attrs = rect_match.group("attrs")+ fill = _attr(attrs, "fill")+ width = _attr(attrs, "width")+ height = _attr(attrs, "height")+ if fill and width and height and (width in {"100%", "100"} or height in {"100%", "100"}):+ parsed = _parse_color(fill)+ if parsed is not None:+ canvas_underlay = parsed+ break+ if canvas_underlay is None:+ canvas_underlay = (245, 245, 245)++ text_labels = parse_text_labels(source)+ for focal in focal_cells:+ bg_rgb = _parse_color(focal["fill"], canvas_underlay)+ if bg_rgb is None:+ continue+ x0 = focal["x"] if focal["x"] is not None else 0.0+ y0 = focal["y"] if focal["y"] is not None else 0.0+ width = focal["width"] if focal["width"] is not None else 0.0+ height = focal["height"] if focal["height"] is not None else 0.0+ for text in text_labels:+ if text["x"] is None or text["y"] is None:+ continue+ if not (x0 <= text["x"] <= x0 + width and y0 <= text["y"] <= y0 + height):+ continue+ text_rgb = _parse_color(text["fill"])+ if text_rgb is None:+ continue+ ratio = _contrast_ratio(text_rgb, bg_rgb)+ if ratio < 4.5:+ errors.append(+ f"{path.name}: focal cell ({focal['row']}, {focal['col']}) has text "+ f"{text['text']!r} in {text['fill']} on fill {focal['fill']} "+ f"({ratio:.2f}:1 contrast, below WCAG AA 4.5:1)"+ )++ return errors+++def _heatmap_examples(asset_dir: Path) -> list[Path]:+ """Return all heatmap example HTML files from the asset directory."""+ return sorted(asset_dir.glob("example-heatmap*.html"))+++def main(argv: list[str] | None = None) -> int:+ parser = argparse.ArgumentParser(+ description="Verify heatmap chart files.",+ epilog="Exit 0 = clean, 1 = findings, 2 = usage error.",+ )+ parser.add_argument(+ "files",+ nargs="*",+ metavar="FILE",+ help="Heatmap HTML files to check. Default: all example-heatmap*.html.",+ )+ parser.add_argument(+ "--all",+ action="store_true",+ help="Check all example-heatmap*.html in the assets directory.",+ )+ args = parser.parse_args(argv)++ if args.all or not args.files:+ paths = _heatmap_examples(ASSET_DIR)+ if not paths:+ print("No heatmap examples found.", file=sys.stderr)+ return 1+ else:+ paths = [Path(f) for f in args.files]++ all_errors: list[str] = []+ for path in paths:+ all_errors.extend(check_file(path))++ if all_errors:+ for err in all_errors:+ print(err, file=sys.stderr)+ return 1++ print(f"OK — {len(paths)} file(s) checked, no findings.")+ return 0+++if __name__ == "__main__":+ sys.exit(main())diff --git a/scripts/verify-screenshot-freshness.py b/scripts/verify-screenshot-freshness.pyindex 9704cd0..e474953 100644--- a/scripts/verify-screenshot-freshness.py+++ b/scripts/verify-screenshot-freshness.py@@ -20,8 +20,8 @@ from screenshot_catalog import (def main() -> int:errors: list[str] = []slugs = canonical_slugs()- if len(slugs) != 40 or len(slugs) != len(set(slugs)):- errors.append(f"expected 40 unique canonical types; found {len(slugs)}")+ if len(slugs) != 41 or len(slugs) != len(set(slugs)):+ errors.append(f"expected 41 unique canonical types; found {len(slugs)}")if not MANIFEST.is_file():errors.append("docs/screenshots/manifest.json is missing")@@ -96,7 +96,7 @@ def main() -> int:for error in errors:print(f" - {error}")return 1- print("OK screenshot freshness: 40 canonical sources and PNG digests match")+ print("OK screenshot freshness: 41 canonical sources and PNG digests match")return 0diff --git a/scripts/verify-semantic-motion.py b/scripts/verify-semantic-motion.pyindex 7738add..b09e31c 100644--- a/scripts/verify-semantic-motion.py+++ b/scripts/verify-semantic-motion.py@@ -21,7 +21,7 @@ PATTERNS = ROOT / "skills/diagram-design/references/semantic-patterns.md"ANIMATION = ROOT / "skills/diagram-design/references/animation.md"EXAMPLE = ROOT / "skills/diagram-design/assets/example-policy-trace-animated.html"MAX_SKILL_BYTES = 40_000-VISUAL_TYPE_COUNT = 40+VISUAL_TYPE_COUNT = 41PATTERN_NAMES = ("Fan-in queue / bottleneck",diff --git a/skills/diagram-design/SKILL.md b/skills/diagram-design/SKILL.mdindex 6570381..2c9eb02 100644--- a/skills/diagram-design/SKILL.md+++ b/skills/diagram-design/SKILL.md@@ -1,6 +1,6 @@---name: diagram-design-description: Create branded architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart (polar/radial lollipop), loop/flywheel, nested, tree, org chart, layer stack, Venn, pyramid/funnel, treemap, bar, waterfall, line, Gantt and scatter charts, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, or database schema diagrams as standalone HTML/SVG/PNG. Redraw .drawio/.drawio.png/.drawio.svg, Mermaid .mmd, or Excalidraw .excalidraw sources at a chosen size/detail; onboard brand tokens from a website; add lifecycle phase maps, semantic patterns, callouts, accessible motion, or sketchy/hand-drawn styling.+description: Create branded architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart (polar/radial lollipop), loop/flywheel, nested, tree, org chart, layer stack, Venn, pyramid/funnel, treemap, heatmap, bar, waterfall, line, Gantt and scatter charts, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, or database schema diagrams as HTML/SVG/PNG, with .drawio and .excalidraw import support, plus lifecycle phase maps and onboarding guidance.license: MITmetadata:version: "2.6"@@ -8,9 +8,9 @@ metadata:# Diagram Design-Create visual diagrams as self-contained HTML files with inline SVG and CSS, following an opinionated editorial design system.+Create diagrams as self-contained HTML files with inline SVG and an editorial design system.-Forty visual types. Semantic patterns describe behavior independently; type references describe layout. Details load from `references/` only when selected.+Forty-one visual types. Semantic patterns describe behavior; type references describe layout.---@@ -18,13 +18,17 @@ Forty visual types. Semantic patterns describe behavior independently; type refe**Before generating your first diagram in a new project, verify the style guide has been customized.**-Don't silently ship default-skinned diagrams into a branded project.+Do not silently ship default-skinned diagrams into a branded project.First resolve any project `.diagram-design` marker per [`references/profiles.md`](references/profiles.md); a successfully resolved marker selects its profile and bypasses this gate. That reference owns failures, the protected default, and save behavior.-For a markerless project, open [`references/style-guide.md`](references/style-guide.md). If it still has the shipped paper, ink, and accent tokens, **pause and present the choices from [`references/onboarding.md`](references/onboarding.md)**, then follow the selected method; saved profiles route to `references/profiles.md`.+Open [`references/style-guide.md`](references/style-guide.md) and check the default tokens. If they are still the shipped defaults (paper `#f5f5f5`, ink `#2d3142`, accent `#eb6c36`), **pause and ask the user**:-After customization or an explicit default choice, skip this gate. Detect and save active/custom profiles exactly as `references/profiles.md` specifies.+> *"This is your first diagram in this project and the style guide is still default. Customize now? Options: (a) website URL, (b) installed skill, (c) local folder/design-system, (d) paste tokens, (e) keep default, (f) load saved profile."*++Then branch per the matching section of [`references/onboarding.md`](references/onboarding.md); for **(f)** follow [`references/profiles.md`](references/profiles.md).++**Once the style guide has been customized** (or the user explicitly chose default), skip this gate on later runs. A leading profile header names the copied-in active profile. Without a header, any semantic-role value or typography family differing from shipped defaults means **custom-unsaved**: skip the gate and offer to save it as a profile. All-default tokens with no marker/header trigger the gate. After onboarding, offer to save as a named client profile per `references/profiles.md`.---@@ -45,7 +49,7 @@ Applied to schematics:## 2. When to Use-Use for any of the 40 visual types (§3) when a reader will learn more from a visual than from prose, a table, or a bulleted list.+Use for any of the 41 visual types (§3) when a reader will learn more from a visual than from prose, a table, or a bulleted list.**Don't use for:**@@ -76,12 +80,12 @@ When behavior, state, enforcement, or risk carries the meaning, first load [`refThe pattern owns semantic primitives and its tighter budget; the type owns layout grammar. Use [`references/animation.md`](references/animation.md) only when motion is requested or materially clarifies ordered change; static remains the default.-### Visual-type guide (40)+### Visual-type guide (41)| If you're showing… | Use | Reference ||---|---|---|| Components + connections in a system | **Architecture** | [type-architecture.md](references/type-architecture.md) |-| Legacy IT landscape grouped by phase/department; documents the *before* state in modernization proposals | **IT current-state** | [type-it-state.md](references/type-it-state.md) |+| Legacy IT landscape by phase or department; shows the *before* state | **IT current-state** | [type-it-state.md](references/type-it-state.md) || Decision logic with branches | **Flowchart** | [type-flowchart.md](references/type-flowchart.md) || Time-ordered messages between actors | **Sequence** | [type-sequence.md](references/type-sequence.md) || States + transitions + guards | **State machine** | [type-state.md](references/type-state.md) |@@ -91,7 +95,7 @@ The pattern owns semantic primitives and its tighter budget; the type owns layou| Two-axis positioning / prioritization | **Quadrant** | [type-quadrant.md](references/type-quadrant.md) || Multiple entities scored across 3–5 quantitative criteria | **Radar / Spider** | [type-radar.md](references/type-radar.md) || One quantitative series across cyclic categories; angle=category, radius=magnitude | **Polar chart** | [type-polar.md](references/type-polar.md) |-| Reinforcing cycle / flywheel where the last step feeds the first and a shared hub accumulates state | **Loop** | [type-loop.md](references/type-loop.md) |+| Reinforcing cycle; the last step feeds the first and a hub accumulates state | **Loop** | [type-loop.md](references/type-loop.md) || Hierarchy through containment / scope | **Nested** | [type-nested.md](references/type-nested.md) || Parent → children relationships | **Tree** | [type-tree.md](references/type-tree.md) || Human/agent/team ownership, reporting, routing, escalation | **Org chart** | [type-org-chart.md](references/type-org-chart.md) |@@ -100,10 +104,11 @@ The pattern owns semantic primitives and its tighter budget; the type owns layou| Ranked hierarchy or conversion drop-off | **Pyramid / funnel** | [type-pyramid.md](references/type-pyramid.md) || Quantitative comparison across categories | **Bar chart** | [type-bar.md](references/type-bar.md) || A start total bridged to an end total by signed contributions (budget bridge, headcount deltas) | **Waterfall** | [type-waterfall.md](references/type-waterfall.md) |-| Part-of-whole where the relative sizes are the story, or a two-way split where column width and segment height are both shares (marimekko) | **Treemap** | [type-treemap.md](references/type-treemap.md) |-| Continuous trends over time, change between exactly two states (slopegraph), one distribution per series (ridgeline), rank movement across several snapshots (bump), or total composition across periods (streamgraph) | **Line chart** | [type-line.md](references/type-line.md) |+| Part-of-whole where the relative sizes are the story | **Treemap** | [type-treemap.md](references/type-treemap.md) |+| Cross-tabulated data; fill encodes value per cell | **Heatmap** | [type-heatmap.md](references/type-heatmap.md) |+| Continuous trends over time, change between exactly two states (slopegraph), one distribution per series (ridgeline), or rank movement across several snapshots (bump) | **Line chart** | [type-line.md](references/type-line.md) || Tasks and phases on a timeline | **Gantt** | [type-gantt.md](references/type-gantt.md) |-| Distribution and correlation between two variables, three with area-sized marks (bubble), or one variable with a dot per item (beeswarm) | **Scatter plot** | [type-scatter.md](references/type-scatter.md) |+| Correlation or distribution of two variables; bubble (three variables) and beeswarm (one variable, dot per item) variants | **Scatter plot** | [type-scatter.md](references/type-scatter.md) || End-to-end data stack on a container cluster | **High-Level** | [type-high-level.md](references/type-high-level.md) || Multi-actor sequential process with data handoffs | **Process** | [type-process.md](references/type-process.md) || Multi-tier data storage with quality levels and access policies | **Medallion** | [type-medallion.md](references/type-medallion.md) |diff --git a/skills/diagram-design/assets/example-heatmap-dark.html b/skills/diagram-design/assets/example-heatmap-dark.htmlnew file mode 100644index 0000000..5e35f90--- /dev/null+++ b/skills/diagram-design/assets/example-heatmap-dark.html@@ -0,0 +1,224 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>CI failure rate by service and sprint · Heatmap</title>+ <link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet">+ <style>+ *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }+ :root {+ --color-paper: #2d3142;+ --color-ink: #f5f5f5;+ --color-muted: #bfc0c0;+ --color-accent: #f08a59;+ --font-sans: 'Geist', system-ui, sans-serif;+ --font-serif: 'Instrument Serif', serif;+ --font-mono: 'Geist Mono', ui-monospace, monospace;+ }+ body { font-family: var(--font-sans); background: var(--color-paper); color: var(--color-ink); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 3rem 2rem; }+ .frame { max-width: 1200px; width: 100%; }+ .eyebrow { font-family: var(--font-mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--color-muted); margin-bottom: 0.5rem; }+ h1 { font-family: var(--font-serif); font-size: clamp(1.5rem, 2.4vw + 0.75rem, 2rem); font-weight: 400; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 1.5rem; }+ svg { display: block; width: 100%; height: auto; max-width: 100%; }+ </style>+</head>+<body>+ <div class="frame">+ <p class="eyebrow">Heatmap · Diagram Design</p>+ <h1>The week payments went dark</h1>++ <svg viewBox="0 0 1000 500" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="heatmap-dark-title heatmap-dark-desc">+ <title id="heatmap-dark-title">The week payments went dark</title>+ <desc id="heatmap-dark-desc">Heatmap of CI failure rate by service and sprint; payments service spiked to 47% in sprint 4 due to a deploy regression, recovered to 4% by sprint 6; billing carries the highest baseline failure rate at 9% in sprint 3.</desc>+ <defs>+ <pattern id="dots" width="22" height="22" patternUnits="userSpaceOnUse">+ <circle cx="1" cy="1" r="0.9" fill="rgba(245,245,245,0.10)"/>+ </pattern>+ </defs>++ <rect width="100%" height="100%" fill="#2d3142"/>+ <rect width="100%" height="100%" fill="url(#dots)" opacity="0.55"/>++ <!-- Cell grid: 6 columns (x=160,280,400,520,640,760), 5 rows (y=64,124,184,244,304).+ Cell size 116×56, gap 4px (col step=120, row step=60).+ Dark skin: paper underlay is #2d3142; ink ramp is rgba(245,245,245, opacity).+ Focal cell (payments·S4) uses the dark-skin accent and carries data-focal="true".+ scripts/verify-heatmap.py enforces monotone opacity against data-value for every+ non-focal cell, complete 5×6 coverage, and at most one data-focal cell. -->++ <!-- SERVICE axis label (rotated) -->+ <text transform="rotate(-90 24 212)" x="24" y="212" fill="#bfc0c0" font-size="7" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">SERVICE</text>++ <!-- SPRINT axis label -->+ <text x="518" y="36" fill="#bfc0c0" font-size="7" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">SPRINT</text>++ <!-- Column headers -->+ <text data-axis="0" data-col="S1" x="218" y="52" fill="#bfc0c0" font-size="9" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">S1</text>+ <text data-axis="1" data-col="S2" x="338" y="52" fill="#bfc0c0" font-size="9" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">S2</text>+ <text data-axis="2" data-col="S3" x="458" y="52" fill="#bfc0c0" font-size="9" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">S3</text>+ <text data-axis="3" data-col="S4" x="578" y="52" fill="#bfc0c0" font-size="9" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">S4</text>+ <text data-axis="4" data-col="S5" x="698" y="52" fill="#bfc0c0" font-size="9" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">S5</text>+ <text data-axis="5" data-col="S6" x="818" y="52" fill="#bfc0c0" font-size="9" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">S6</text>++ <!-- Row labels -->+ <text data-row-label="auth" x="148" y="96" fill="#f5f5f5" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">auth</text>+ <text data-row-label="payments" x="148" y="156" fill="#f5f5f5" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">payments</text>+ <text data-row-label="api-gateway" x="148" y="216" fill="#f5f5f5" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">api-gateway</text>+ <text data-row-label="billing" x="148" y="276" fill="#f5f5f5" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">billing</text>+ <text data-row-label="notifications" x="148" y="336" fill="#f5f5f5" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">notifications</text>++ <!-- Row: auth (y=64) — values 4,5,6,3,2,2 -->+ <rect x="160" y="64" width="116" height="56" fill="#2d3142"/>+ <rect data-row="auth" data-col="S1" data-value="4" x="160" y="64" width="116" height="56" fill="rgba(245,245,245,0.29)"/>+ <text x="218" y="96" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">4%</text>++ <rect x="280" y="64" width="116" height="56" fill="#2d3142"/>+ <rect data-row="auth" data-col="S2" data-value="5" x="280" y="64" width="116" height="56" fill="rgba(245,245,245,0.36)"/>+ <text x="338" y="96" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">5%</text>++ <rect x="400" y="64" width="116" height="56" fill="#2d3142"/>+ <rect data-row="auth" data-col="S3" data-value="6" x="400" y="64" width="116" height="56" fill="rgba(245,245,245,0.43)"/>+ <text x="458" y="96" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">6%</text>++ <rect x="520" y="64" width="116" height="56" fill="#2d3142"/>+ <rect data-row="auth" data-col="S4" data-value="3" x="520" y="64" width="116" height="56" fill="rgba(245,245,245,0.22)"/>+ <text x="578" y="96" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">3%</text>++ <rect x="640" y="64" width="116" height="56" fill="#2d3142"/>+ <rect data-row="auth" data-col="S5" data-value="2" x="640" y="64" width="116" height="56" fill="rgba(245,245,245,0.14)"/>+ <text x="698" y="96" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <rect x="760" y="64" width="116" height="56" fill="#2d3142"/>+ <rect data-row="auth" data-col="S6" data-value="2" x="760" y="64" width="116" height="56" fill="rgba(245,245,245,0.14)"/>+ <text x="818" y="96" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <!-- Row: payments (y=124) — values 3,4,5,47(focal),6,4 -->+ <rect x="160" y="124" width="116" height="56" fill="#2d3142"/>+ <rect data-row="payments" data-col="S1" data-value="3" x="160" y="124" width="116" height="56" fill="rgba(245,245,245,0.22)"/>+ <text x="218" y="156" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">3%</text>++ <rect x="280" y="124" width="116" height="56" fill="#2d3142"/>+ <rect data-row="payments" data-col="S2" data-value="4" x="280" y="124" width="116" height="56" fill="rgba(245,245,245,0.29)"/>+ <text x="338" y="156" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">4%</text>++ <rect x="400" y="124" width="116" height="56" fill="#2d3142"/>+ <rect data-row="payments" data-col="S3" data-value="5" x="400" y="124" width="116" height="56" fill="rgba(245,245,245,0.36)"/>+ <text x="458" y="156" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">5%</text>++ <!-- FOCAL CELL: payments·S4 = 47% deploy regression -->+ <rect x="520" y="124" width="116" height="56" fill="#2d3142"/>+ <rect data-row="payments" data-col="S4" data-value="47" data-focal="true" x="520" y="124" width="116" height="56" fill="rgba(240,138,89,0.85)" stroke="#f08a59" stroke-width="1.2"/>+ <text x="578" y="149" fill="#111111" font-size="10" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">47%</text>+ <text x="578" y="163" fill="#111111" font-size="7" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">REGRESSION</text>++ <rect x="640" y="124" width="116" height="56" fill="#2d3142"/>+ <rect data-row="payments" data-col="S5" data-value="6" x="640" y="124" width="116" height="56" fill="rgba(245,245,245,0.43)"/>+ <text x="698" y="156" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">6%</text>++ <rect x="760" y="124" width="116" height="56" fill="#2d3142"/>+ <rect data-row="payments" data-col="S6" data-value="4" x="760" y="124" width="116" height="56" fill="rgba(245,245,245,0.29)"/>+ <text x="818" y="156" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">4%</text>++ <!-- Row: api-gateway (y=184) — values 2,3,4,2,1,1 -->+ <rect x="160" y="184" width="116" height="56" fill="#2d3142"/>+ <rect data-row="api-gateway" data-col="S1" data-value="2" x="160" y="184" width="116" height="56" fill="rgba(245,245,245,0.14)"/>+ <text x="218" y="216" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <rect x="280" y="184" width="116" height="56" fill="#2d3142"/>+ <rect data-row="api-gateway" data-col="S2" data-value="3" x="280" y="184" width="116" height="56" fill="rgba(245,245,245,0.22)"/>+ <text x="338" y="216" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">3%</text>++ <rect x="400" y="184" width="116" height="56" fill="#2d3142"/>+ <rect data-row="api-gateway" data-col="S3" data-value="4" x="400" y="184" width="116" height="56" fill="rgba(245,245,245,0.29)"/>+ <text x="458" y="216" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">4%</text>++ <rect x="520" y="184" width="116" height="56" fill="#2d3142"/>+ <rect data-row="api-gateway" data-col="S4" data-value="2" x="520" y="184" width="116" height="56" fill="rgba(245,245,245,0.14)"/>+ <text x="578" y="216" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <rect x="640" y="184" width="116" height="56" fill="#2d3142"/>+ <rect data-row="api-gateway" data-col="S5" data-value="1" x="640" y="184" width="116" height="56" fill="rgba(245,245,245,0.07)"/>+ <text x="698" y="216" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">1%</text>++ <rect x="760" y="184" width="116" height="56" fill="#2d3142"/>+ <rect data-row="api-gateway" data-col="S6" data-value="1" x="760" y="184" width="116" height="56" fill="rgba(245,245,245,0.07)"/>+ <text x="818" y="216" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">1%</text>++ <!-- Row: billing (y=244) — values 5,7,9,6,4,3 -->+ <rect x="160" y="244" width="116" height="56" fill="#2d3142"/>+ <rect data-row="billing" data-col="S1" data-value="5" x="160" y="244" width="116" height="56" fill="rgba(245,245,245,0.36)"/>+ <text x="218" y="276" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">5%</text>++ <rect x="280" y="244" width="116" height="56" fill="#2d3142"/>+ <rect data-row="billing" data-col="S2" data-value="7" x="280" y="244" width="116" height="56" fill="rgba(245,245,245,0.51)"/>+ <text x="338" y="276" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">7%</text>++ <rect x="400" y="244" width="116" height="56" fill="#2d3142"/>+ <rect data-row="billing" data-col="S3" data-value="9" x="400" y="244" width="116" height="56" fill="rgba(245,245,245,0.65)"/>+ <text x="458" y="276" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">9%</text>++ <rect x="520" y="244" width="116" height="56" fill="#2d3142"/>+ <rect data-row="billing" data-col="S4" data-value="6" x="520" y="244" width="116" height="56" fill="rgba(245,245,245,0.43)"/>+ <text x="578" y="276" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">6%</text>++ <rect x="640" y="244" width="116" height="56" fill="#2d3142"/>+ <rect data-row="billing" data-col="S5" data-value="4" x="640" y="244" width="116" height="56" fill="rgba(245,245,245,0.29)"/>+ <text x="698" y="276" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">4%</text>++ <rect x="760" y="244" width="116" height="56" fill="#2d3142"/>+ <rect data-row="billing" data-col="S6" data-value="3" x="760" y="244" width="116" height="56" fill="rgba(245,245,245,0.22)"/>+ <text x="818" y="276" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">3%</text>++ <!-- Row: notifications (y=304) — values 1,2,2,2,1,1 -->+ <rect x="160" y="304" width="116" height="56" fill="#2d3142"/>+ <rect data-row="notifications" data-col="S1" data-value="1" x="160" y="304" width="116" height="56" fill="rgba(245,245,245,0.07)"/>+ <text x="218" y="336" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">1%</text>++ <rect x="280" y="304" width="116" height="56" fill="#2d3142"/>+ <rect data-row="notifications" data-col="S2" data-value="2" x="280" y="304" width="116" height="56" fill="rgba(245,245,245,0.14)"/>+ <text x="338" y="336" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <rect x="400" y="304" width="116" height="56" fill="#2d3142"/>+ <rect data-row="notifications" data-col="S3" data-value="2" x="400" y="304" width="116" height="56" fill="rgba(245,245,245,0.14)"/>+ <text x="458" y="336" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <rect x="520" y="304" width="116" height="56" fill="#2d3142"/>+ <rect data-row="notifications" data-col="S4" data-value="2" x="520" y="304" width="116" height="56" fill="rgba(245,245,245,0.14)"/>+ <text x="578" y="336" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <rect x="640" y="304" width="116" height="56" fill="#2d3142"/>+ <rect data-row="notifications" data-col="S5" data-value="1" x="640" y="304" width="116" height="56" fill="rgba(245,245,245,0.07)"/>+ <text x="698" y="336" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">1%</text>++ <rect x="760" y="304" width="116" height="56" fill="#2d3142"/>+ <rect data-row="notifications" data-col="S6" data-value="1" x="760" y="304" width="116" height="56" fill="rgba(245,245,245,0.07)"/>+ <text x="818" y="336" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">1%</text>++ <!-- Legend -->+ <line x1="40" y1="382" x2="960" y2="382" stroke="rgba(245,245,245,0.10)" stroke-width="0.8"/>+ <text x="40" y="398" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" letter-spacing="0.18em">LEGEND</text>+ <text x="960" y="398" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" letter-spacing="0.06em" text-anchor="end">ILLUSTRATIVE CI FAILURE RATES · NOT A MEASURED REGISTRY</text>++ <!-- Ink ramp strip: 8 steps low→high -->+ <rect x="120" y="386" width="20" height="12" fill="#2d3142"/><rect x="120" y="386" width="20" height="12" fill="rgba(245,245,245,0.07)"/>+ <rect x="142" y="386" width="20" height="12" fill="#2d3142"/><rect x="142" y="386" width="20" height="12" fill="rgba(245,245,245,0.14)"/>+ <rect x="164" y="386" width="20" height="12" fill="#2d3142"/><rect x="164" y="386" width="20" height="12" fill="rgba(245,245,245,0.22)"/>+ <rect x="186" y="386" width="20" height="12" fill="#2d3142"/><rect x="186" y="386" width="20" height="12" fill="rgba(245,245,245,0.29)"/>+ <rect x="208" y="386" width="20" height="12" fill="#2d3142"/><rect x="208" y="386" width="20" height="12" fill="rgba(245,245,245,0.36)"/>+ <rect x="230" y="386" width="20" height="12" fill="#2d3142"/><rect x="230" y="386" width="20" height="12" fill="rgba(245,245,245,0.43)"/>+ <rect x="252" y="386" width="20" height="12" fill="#2d3142"/><rect x="252" y="386" width="20" height="12" fill="rgba(245,245,245,0.51)"/>+ <rect x="274" y="386" width="20" height="12" fill="#2d3142"/><rect x="274" y="386" width="20" height="12" fill="rgba(245,245,245,0.65)"/>+ <text x="116" y="396" fill="#bfc0c0" font-size="7.5" font-family="'Geist Mono', monospace" text-anchor="end">LOW</text>+ <text x="298" y="396" fill="#bfc0c0" font-size="7.5" font-family="'Geist Mono', monospace">HIGH</text>++ <!-- Focal accent swatch -->+ <rect x="360" y="386" width="20" height="12" fill="#2d3142"/><rect x="360" y="386" width="20" height="12" fill="rgba(240,138,89,0.85)" stroke="#f08a59" stroke-width="1"/>+ <text x="388" y="396" fill="#bfc0c0" font-size="8.5" font-family="'Geist', sans-serif">payments · S4 · 47% — deploy regression (now fixed)</text>++ <!-- Scale note -->+ <text x="40" y="418" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" letter-spacing="0.06em">NON-FOCAL SCALE: 1–9% · SINGLE INK RAMP · ACCENT IS EDITORIAL, NOT A DATA RANGE</text>+ </svg>+ </div>+</body>+</html>diff --git a/skills/diagram-design/assets/example-heatmap-full.html b/skills/diagram-design/assets/example-heatmap-full.htmlnew file mode 100644index 0000000..3aa0d1a--- /dev/null+++ b/skills/diagram-design/assets/example-heatmap-full.html@@ -0,0 +1,270 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>CI failure rate by service and sprint · Heatmap</title>+ <link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet">+ <style>+ *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }+ :root { --color-paper:#f5f5f5; --color-paper-2:#ececec; --color-ink:#2d3142; --color-muted:#4f5d75; --color-soft:#7a8399; --color-rule:rgba(45,49,66,0.12); --color-accent:#eb6c36; --font-sans:'Geist',system-ui,sans-serif; --font-serif:'Instrument Serif',serif; --font-mono:'Geist Mono',ui-monospace,monospace; }+ body { font-family: var(--font-sans); background: var(--color-paper); min-height: 100vh; padding: 3rem 2rem; color: var(--color-ink); }+ .container { max-width: 1200px; margin: 0 auto; }+ .header { margin-bottom: 2.5rem; }+ .header-eyebrow { font-family: var(--font-mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--color-muted); margin-bottom: 0.75rem; }+ h1 { font-family: var(--font-serif); font-size: clamp(1.75rem, 3vw + 1rem, 2.5rem); font-weight: 400; letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 0.5rem; }+ .subtitle { font-size: 1rem; line-height: 1.55; color: var(--color-muted); max-width: 62ch; }+ .diagram-container { background: var(--color-paper-2); border-radius: 8px; border: 1px solid var(--color-rule); padding: 1.5rem; overflow-x: auto; }+ svg { width: 100%; min-width: 760px; display: block; }+ .cards { display: grid; grid-template-columns: 1.1fr 1fr 0.9fr; gap: 1rem; margin-top: 1.5rem; }+ @media (max-width: 720px) { .cards { grid-template-columns: 1fr; } }+ .card { background: #fff; border-radius: 6px; border: 1px solid var(--color-rule); padding: 1.25rem; }+ .card .eyebrow { font-family: var(--font-mono); font-size: 0.5rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--color-muted); margin-bottom: 0.5rem; }+ .card-header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.875rem; padding-bottom: 0.875rem; border-bottom: 1px solid rgba(45,49,66,0.08); }+ .card-swatch { width: 14px; height: 14px; border-radius: 2px; }+ .card-swatch.focal { background: rgba(235,108,54,0.85); border: 1px solid #eb6c36; }+ .card-swatch.high { background: rgba(45,49,66,0.65); }+ .card-swatch.low { background: rgba(45,49,66,0.07); border: 1px solid rgba(45,49,66,0.20); }+ .card h3 { font-size: 0.875rem; font-weight: 600; }+ .card p { color: var(--color-muted); font-size: 0.8125rem; line-height: 1.55; }+ .footer { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(45,49,66,0.10); font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--color-muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }+ </style>+</head>+<body>+ <div class="container">+ <div class="header">+ <p class="header-eyebrow">Heatmap · Diagram Design</p>+ <h1>The week payments went dark</h1>+ <p class="subtitle">CI failure rate (%) by service and sprint, six sprints. payments spiked to 47% in S4 — a deploy regression that slipped through the gate — and had recovered to 4% by S6. billing carries the highest structural rate; notifications is the quietest service throughout.</p>+ </div>++ <div class="diagram-container">+ <svg viewBox="0 0 1000 500" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="heatmap-full-title heatmap-full-desc">+ <title id="heatmap-full-title">The week payments went dark</title>+ <desc id="heatmap-full-desc">Heatmap of CI failure rate by service and sprint; payments service spiked to 47% in sprint 4 due to a deploy regression, recovered to 4% by sprint 6; billing carries the highest baseline failure rate at 9% in sprint 3.</desc>+ <defs>+ <pattern id="dots" width="22" height="22" patternUnits="userSpaceOnUse">+ <circle cx="1" cy="1" r="0.9" fill="rgba(45,49,66,0.10)"/>+ </pattern>+ </defs>++ <rect width="100%" height="100%" fill="#f5f5f5"/>+ <rect width="100%" height="100%" fill="url(#dots)" opacity="0.55"/>++ <!-- Cell grid: 6 columns (x=160,280,400,520,640,760), 5 rows (y=64,124,184,244,304).+ Cell size 116×56, gap 4px (col step=120, row step=60).+ scripts/verify-heatmap.py enforces monotone opacity, complete grid, ≤1 focal. -->++ <!-- SERVICE axis label (rotated) -->+ <text transform="rotate(-90 24 212)" x="24" y="212" fill="#4f5d75" font-size="7" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">SERVICE</text>++ <!-- SPRINT axis label -->+ <text x="518" y="36" fill="#4f5d75" font-size="7" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">SPRINT</text>++ <!-- Column headers -->+ <text data-axis="0" data-col="S1" x="218" y="52" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">S1</text>+ <text data-axis="1" data-col="S2" x="338" y="52" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">S2</text>+ <text data-axis="2" data-col="S3" x="458" y="52" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">S3</text>+ <text data-axis="3" data-col="S4" x="578" y="52" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">S4</text>+ <text data-axis="4" data-col="S5" x="698" y="52" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">S5</text>+ <text data-axis="5" data-col="S6" x="818" y="52" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">S6</text>++ <!-- Row labels -->+ <text data-row-label="auth" x="148" y="96" fill="#2d3142" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">auth</text>+ <text data-row-label="payments" x="148" y="156" fill="#2d3142" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">payments</text>+ <text data-row-label="api-gateway" x="148" y="216" fill="#2d3142" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">api-gateway</text>+ <text data-row-label="billing" x="148" y="276" fill="#2d3142" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">billing</text>+ <text data-row-label="notifications" x="148" y="336" fill="#2d3142" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">notifications</text>++ <!-- Row: auth (y=64) -->+ <rect x="160" y="64" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="auth" data-col="S1" data-value="4" x="160" y="64" width="116" height="56" fill="rgba(45,49,66,0.29)"/>+ <text x="218" y="96" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">4%</text>++ <rect x="280" y="64" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="auth" data-col="S2" data-value="5" x="280" y="64" width="116" height="56" fill="rgba(45,49,66,0.36)"/>+ <text x="338" y="96" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">5%</text>++ <rect x="400" y="64" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="auth" data-col="S3" data-value="6" x="400" y="64" width="116" height="56" fill="rgba(45,49,66,0.43)"/>+ <text x="458" y="96" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">6%</text>++ <rect x="520" y="64" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="auth" data-col="S4" data-value="3" x="520" y="64" width="116" height="56" fill="rgba(45,49,66,0.22)"/>+ <text x="578" y="96" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">3%</text>++ <rect x="640" y="64" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="auth" data-col="S5" data-value="2" x="640" y="64" width="116" height="56" fill="rgba(45,49,66,0.14)"/>+ <text x="698" y="96" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <rect x="760" y="64" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="auth" data-col="S6" data-value="2" x="760" y="64" width="116" height="56" fill="rgba(45,49,66,0.14)"/>+ <text x="818" y="96" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <!-- Row: payments (y=124) -->+ <rect x="160" y="124" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="payments" data-col="S1" data-value="3" x="160" y="124" width="116" height="56" fill="rgba(45,49,66,0.22)"/>+ <text x="218" y="156" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">3%</text>++ <rect x="280" y="124" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="payments" data-col="S2" data-value="4" x="280" y="124" width="116" height="56" fill="rgba(45,49,66,0.29)"/>+ <text x="338" y="156" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">4%</text>++ <rect x="400" y="124" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="payments" data-col="S3" data-value="5" x="400" y="124" width="116" height="56" fill="rgba(45,49,66,0.36)"/>+ <text x="458" y="156" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">5%</text>++ <!-- FOCAL CELL: payments·S4 = 47% deploy regression -->+ <rect x="520" y="124" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="payments" data-col="S4" data-value="47" data-focal="true" x="520" y="124" width="116" height="56" fill="rgba(235,108,54,0.85)" stroke="#eb6c36" stroke-width="1.2"/>+ <text x="578" y="149" fill="#111111" font-size="10" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">47%</text>+ <text x="578" y="163" fill="#111111" font-size="7" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">REGRESSION</text>++ <rect x="640" y="124" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="payments" data-col="S5" data-value="6" x="640" y="124" width="116" height="56" fill="rgba(45,49,66,0.43)"/>+ <text x="698" y="156" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">6%</text>++ <rect x="760" y="124" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="payments" data-col="S6" data-value="4" x="760" y="124" width="116" height="56" fill="rgba(45,49,66,0.29)"/>+ <text x="818" y="156" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">4%</text>++ <!-- Row: api-gateway (y=184) -->+ <rect x="160" y="184" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="api-gateway" data-col="S1" data-value="2" x="160" y="184" width="116" height="56" fill="rgba(45,49,66,0.14)"/>+ <text x="218" y="216" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <rect x="280" y="184" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="api-gateway" data-col="S2" data-value="3" x="280" y="184" width="116" height="56" fill="rgba(45,49,66,0.22)"/>+ <text x="338" y="216" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">3%</text>++ <rect x="400" y="184" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="api-gateway" data-col="S3" data-value="4" x="400" y="184" width="116" height="56" fill="rgba(45,49,66,0.29)"/>+ <text x="458" y="216" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">4%</text>++ <rect x="520" y="184" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="api-gateway" data-col="S4" data-value="2" x="520" y="184" width="116" height="56" fill="rgba(45,49,66,0.14)"/>+ <text x="578" y="216" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <rect x="640" y="184" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="api-gateway" data-col="S5" data-value="1" x="640" y="184" width="116" height="56" fill="rgba(45,49,66,0.07)"/>+ <text x="698" y="216" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">1%</text>++ <rect x="760" y="184" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="api-gateway" data-col="S6" data-value="1" x="760" y="184" width="116" height="56" fill="rgba(45,49,66,0.07)"/>+ <text x="818" y="216" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">1%</text>++ <!-- Row: billing (y=244) -->+ <rect x="160" y="244" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="billing" data-col="S1" data-value="5" x="160" y="244" width="116" height="56" fill="rgba(45,49,66,0.36)"/>+ <text x="218" y="276" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">5%</text>++ <rect x="280" y="244" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="billing" data-col="S2" data-value="7" x="280" y="244" width="116" height="56" fill="rgba(45,49,66,0.51)"/>+ <text x="338" y="276" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">7%</text>++ <rect x="400" y="244" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="billing" data-col="S3" data-value="9" x="400" y="244" width="116" height="56" fill="rgba(45,49,66,0.65)"/>+ <text x="458" y="276" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">9%</text>++ <rect x="520" y="244" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="billing" data-col="S4" data-value="6" x="520" y="244" width="116" height="56" fill="rgba(45,49,66,0.43)"/>+ <text x="578" y="276" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">6%</text>++ <rect x="640" y="244" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="billing" data-col="S5" data-value="4" x="640" y="244" width="116" height="56" fill="rgba(45,49,66,0.29)"/>+ <text x="698" y="276" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">4%</text>++ <rect x="760" y="244" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="billing" data-col="S6" data-value="3" x="760" y="244" width="116" height="56" fill="rgba(45,49,66,0.22)"/>+ <text x="818" y="276" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">3%</text>++ <!-- Row: notifications (y=304) -->+ <rect x="160" y="304" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="notifications" data-col="S1" data-value="1" x="160" y="304" width="116" height="56" fill="rgba(45,49,66,0.07)"/>+ <text x="218" y="336" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">1%</text>++ <rect x="280" y="304" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="notifications" data-col="S2" data-value="2" x="280" y="304" width="116" height="56" fill="rgba(45,49,66,0.14)"/>+ <text x="338" y="336" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <rect x="400" y="304" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="notifications" data-col="S3" data-value="2" x="400" y="304" width="116" height="56" fill="rgba(45,49,66,0.14)"/>+ <text x="458" y="336" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <rect x="520" y="304" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="notifications" data-col="S4" data-value="2" x="520" y="304" width="116" height="56" fill="rgba(45,49,66,0.14)"/>+ <text x="578" y="336" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <rect x="640" y="304" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="notifications" data-col="S5" data-value="1" x="640" y="304" width="116" height="56" fill="rgba(45,49,66,0.07)"/>+ <text x="698" y="336" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">1%</text>++ <rect x="760" y="304" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="notifications" data-col="S6" data-value="1" x="760" y="304" width="116" height="56" fill="rgba(45,49,66,0.07)"/>+ <text x="818" y="336" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">1%</text>++ <!-- Annotation: callout for focal column -->+ <line x1="520" y1="60" x2="636" y2="60" stroke="#eb6c36" stroke-width="1" stroke-dasharray="3,2"/>+ <text x="578" y="58" fill="#eb6c36" font-size="7" font-family="'Geist Mono', monospace" letter-spacing="0.06em" text-anchor="middle">DEPLOY REGRESSION</text>++ <!-- Annotation: callout for billing row high baseline -->+ <line x1="880" y1="244" x2="880" y2="300" stroke="rgba(45,49,66,0.30)" stroke-width="1" stroke-dasharray="3,2"/>+ <text x="884" y="272" fill="#4f5d75" font-size="7" font-family="'Geist Mono', monospace" letter-spacing="0.04em">HIGH BASELINE</text>++ <!-- Legend -->+ <line x1="40" y1="382" x2="960" y2="382" stroke="rgba(45,49,66,0.10)" stroke-width="0.8"/>+ <text x="40" y="398" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" letter-spacing="0.18em">LEGEND</text>+ <text x="960" y="398" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" letter-spacing="0.06em" text-anchor="end">ILLUSTRATIVE CI FAILURE RATES · NOT A MEASURED REGISTRY</text>++ <rect x="120" y="386" width="20" height="12" fill="#f5f5f5"/><rect x="120" y="386" width="20" height="12" fill="rgba(45,49,66,0.07)"/>+ <rect x="142" y="386" width="20" height="12" fill="#f5f5f5"/><rect x="142" y="386" width="20" height="12" fill="rgba(45,49,66,0.14)"/>+ <rect x="164" y="386" width="20" height="12" fill="#f5f5f5"/><rect x="164" y="386" width="20" height="12" fill="rgba(45,49,66,0.22)"/>+ <rect x="186" y="386" width="20" height="12" fill="#f5f5f5"/><rect x="186" y="386" width="20" height="12" fill="rgba(45,49,66,0.29)"/>+ <rect x="208" y="386" width="20" height="12" fill="#f5f5f5"/><rect x="208" y="386" width="20" height="12" fill="rgba(45,49,66,0.36)"/>+ <rect x="230" y="386" width="20" height="12" fill="#f5f5f5"/><rect x="230" y="386" width="20" height="12" fill="rgba(45,49,66,0.43)"/>+ <rect x="252" y="386" width="20" height="12" fill="#f5f5f5"/><rect x="252" y="386" width="20" height="12" fill="rgba(45,49,66,0.51)"/>+ <rect x="274" y="386" width="20" height="12" fill="#f5f5f5"/><rect x="274" y="386" width="20" height="12" fill="rgba(45,49,66,0.65)"/>+ <text x="116" y="396" fill="#4f5d75" font-size="7.5" font-family="'Geist Mono', monospace" text-anchor="end">LOW</text>+ <text x="298" y="396" fill="#4f5d75" font-size="7.5" font-family="'Geist Mono', monospace">HIGH</text>++ <rect x="360" y="386" width="20" height="12" fill="#f5f5f5"/><rect x="360" y="386" width="20" height="12" fill="rgba(235,108,54,0.85)" stroke="#eb6c36" stroke-width="1"/>+ <text x="388" y="396" fill="#4f5d75" font-size="8.5" font-family="'Geist', sans-serif">payments · S4 · 47% — deploy regression (now fixed)</text>++ <text x="40" y="418" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" letter-spacing="0.06em">NON-FOCAL SCALE: 1–9% · SINGLE INK RAMP · ACCENT IS EDITORIAL, NOT A DATA RANGE</text>+ </svg>+ </div>++ <div class="cards">+ <div class="card">+ <p class="eyebrow">Focal · payments · S4</p>+ <div class="card-header">+ <div class="card-swatch focal"></div>+ <h3>Deploy regression — 47%</h3>+ </div>+ <p>A CI gate misconfiguration during the payments S4 deploy let a breaking change through. The spike resolved by S6 after the rollback and a gate fix, returning to a 4% baseline.</p>+ </div>+ <div class="card">+ <p class="eyebrow">Structural issue · billing</p>+ <div class="card-header">+ <div class="card-swatch high"></div>+ <h3>Highest baseline — peaks 9%</h3>+ </div>+ <p>billing shows the highest non-focal failure rates across all six sprints, peaking at 9% in S3. This is a persistent structural issue unrelated to the payments regression.</p>+ </div>+ <div class="card">+ <p class="eyebrow">Quietest service · notifications</p>+ <div class="card-header">+ <div class="card-swatch low"></div>+ <h3>Most stable — never above 2%</h3>+ </div>+ <p>notifications stayed at or below 2% every sprint. This is the contrast the heatmap makes visible: same period, same team, dramatically different structural rates.</p>+ </div>+ </div>++ <div class="footer">+ <span>Heatmap · Diagram Design</span>+ <span>Illustrative CI failure rates · not a measured registry</span>+ </div>+ </div>+</body>+</html>diff --git a/skills/diagram-design/assets/example-heatmap.html b/skills/diagram-design/assets/example-heatmap.htmlnew file mode 100644index 0000000..643516b--- /dev/null+++ b/skills/diagram-design/assets/example-heatmap.html@@ -0,0 +1,224 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>CI failure rate by service and sprint · Heatmap</title>+ <link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet">+ <style>+ *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }+ :root {+ --color-paper: #f5f5f5;+ --color-ink: #2d3142;+ --color-muted: #4f5d75;+ --color-accent: #eb6c36;+ --font-sans: 'Geist', system-ui, sans-serif;+ --font-serif: 'Instrument Serif', serif;+ --font-mono: 'Geist Mono', ui-monospace, monospace;+ }+ body { font-family: var(--font-sans); background: var(--color-paper); color: var(--color-ink); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 3rem 2rem; }+ .frame { max-width: 1200px; width: 100%; }+ .eyebrow { font-family: var(--font-mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--color-muted); margin-bottom: 0.5rem; }+ h1 { font-family: var(--font-serif); font-size: clamp(1.5rem, 2.4vw + 0.75rem, 2rem); font-weight: 400; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 1.5rem; }+ svg { display: block; width: 100%; height: auto; max-width: 100%; }+ </style>+</head>+<body>+ <div class="frame">+ <p class="eyebrow">Heatmap · Diagram Design</p>+ <h1>The week payments went dark</h1>++ <svg viewBox="0 0 1000 500" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="heatmap-title heatmap-desc">+ <title id="heatmap-title">The week payments went dark</title>+ <desc id="heatmap-desc">Heatmap of CI failure rate by service and sprint; payments service spiked to 47% in sprint 4 due to a deploy regression, recovered to 4% by sprint 6; billing carries the highest baseline failure rate at 9% in sprint 3.</desc>+ <defs>+ <pattern id="dots" width="22" height="22" patternUnits="userSpaceOnUse">+ <circle cx="1" cy="1" r="0.9" fill="rgba(45,49,66,0.10)"/>+ </pattern>+ </defs>++ <rect width="100%" height="100%" fill="#f5f5f5"/>+ <rect width="100%" height="100%" fill="url(#dots)" opacity="0.55"/>++ <!-- Cell grid: 6 columns (x=160,280,400,520,640,760), 5 rows (y=64,124,184,244,304).+ Cell size 116×56, gap 4px (col step=120, row step=60).+ Fill: single ink ramp for non-focal cells — opacity = max(0.07, value/9·0.65).+ Focal cell (payments·S4) uses the accent fill and carries data-focal="true".+ scripts/verify-heatmap.py enforces monotone opacity against data-value for every+ non-focal cell, complete 5×6 coverage, and at most one data-focal cell. -->++ <!-- SERVICE axis label (rotated) -->+ <text transform="rotate(-90 24 212)" x="24" y="212" fill="#4f5d75" font-size="7" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">SERVICE</text>++ <!-- SPRINT axis label -->+ <text x="518" y="36" fill="#4f5d75" font-size="7" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">SPRINT</text>++ <!-- Column headers -->+ <text data-axis="0" data-col="S1" x="218" y="52" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">S1</text>+ <text data-axis="1" data-col="S2" x="338" y="52" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">S2</text>+ <text data-axis="2" data-col="S3" x="458" y="52" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">S3</text>+ <text data-axis="3" data-col="S4" x="578" y="52" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">S4</text>+ <text data-axis="4" data-col="S5" x="698" y="52" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">S5</text>+ <text data-axis="5" data-col="S6" x="818" y="52" fill="#4f5d75" font-size="9" font-family="'Geist Mono', monospace" letter-spacing="0.14em" text-anchor="middle">S6</text>++ <!-- Row labels -->+ <text data-row-label="auth" x="148" y="96" fill="#2d3142" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">auth</text>+ <text data-row-label="payments" x="148" y="156" fill="#2d3142" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">payments</text>+ <text data-row-label="api-gateway" x="148" y="216" fill="#2d3142" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">api-gateway</text>+ <text data-row-label="billing" x="148" y="276" fill="#2d3142" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">billing</text>+ <text data-row-label="notifications" x="148" y="336" fill="#2d3142" font-size="9" font-family="'Geist Mono', monospace" text-anchor="end">notifications</text>++ <!-- Row: auth (y=64) — values 4,5,6,3,2,2 -->+ <rect x="160" y="64" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="auth" data-col="S1" data-value="4" x="160" y="64" width="116" height="56" fill="rgba(45,49,66,0.29)"/>+ <text x="218" y="96" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">4%</text>++ <rect x="280" y="64" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="auth" data-col="S2" data-value="5" x="280" y="64" width="116" height="56" fill="rgba(45,49,66,0.36)"/>+ <text x="338" y="96" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">5%</text>++ <rect x="400" y="64" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="auth" data-col="S3" data-value="6" x="400" y="64" width="116" height="56" fill="rgba(45,49,66,0.43)"/>+ <text x="458" y="96" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">6%</text>++ <rect x="520" y="64" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="auth" data-col="S4" data-value="3" x="520" y="64" width="116" height="56" fill="rgba(45,49,66,0.22)"/>+ <text x="578" y="96" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">3%</text>++ <rect x="640" y="64" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="auth" data-col="S5" data-value="2" x="640" y="64" width="116" height="56" fill="rgba(45,49,66,0.14)"/>+ <text x="698" y="96" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <rect x="760" y="64" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="auth" data-col="S6" data-value="2" x="760" y="64" width="116" height="56" fill="rgba(45,49,66,0.14)"/>+ <text x="818" y="96" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <!-- Row: payments (y=124) — values 3,4,5,47(focal),6,4 -->+ <rect x="160" y="124" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="payments" data-col="S1" data-value="3" x="160" y="124" width="116" height="56" fill="rgba(45,49,66,0.22)"/>+ <text x="218" y="156" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">3%</text>++ <rect x="280" y="124" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="payments" data-col="S2" data-value="4" x="280" y="124" width="116" height="56" fill="rgba(45,49,66,0.29)"/>+ <text x="338" y="156" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">4%</text>++ <rect x="400" y="124" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="payments" data-col="S3" data-value="5" x="400" y="124" width="116" height="56" fill="rgba(45,49,66,0.36)"/>+ <text x="458" y="156" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">5%</text>++ <!-- FOCAL CELL: payments·S4 = 47% deploy regression -->+ <rect x="520" y="124" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="payments" data-col="S4" data-value="47" data-focal="true" x="520" y="124" width="116" height="56" fill="rgba(235,108,54,0.85)" stroke="#eb6c36" stroke-width="1.2"/>+ <text x="578" y="149" fill="#111111" font-size="10" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">47%</text>+ <text x="578" y="163" fill="#111111" font-size="7" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.06em">REGRESSION</text>++ <rect x="640" y="124" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="payments" data-col="S5" data-value="6" x="640" y="124" width="116" height="56" fill="rgba(45,49,66,0.43)"/>+ <text x="698" y="156" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">6%</text>++ <rect x="760" y="124" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="payments" data-col="S6" data-value="4" x="760" y="124" width="116" height="56" fill="rgba(45,49,66,0.29)"/>+ <text x="818" y="156" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">4%</text>++ <!-- Row: api-gateway (y=184) — values 2,3,4,2,1,1 -->+ <rect x="160" y="184" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="api-gateway" data-col="S1" data-value="2" x="160" y="184" width="116" height="56" fill="rgba(45,49,66,0.14)"/>+ <text x="218" y="216" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <rect x="280" y="184" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="api-gateway" data-col="S2" data-value="3" x="280" y="184" width="116" height="56" fill="rgba(45,49,66,0.22)"/>+ <text x="338" y="216" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">3%</text>++ <rect x="400" y="184" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="api-gateway" data-col="S3" data-value="4" x="400" y="184" width="116" height="56" fill="rgba(45,49,66,0.29)"/>+ <text x="458" y="216" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">4%</text>++ <rect x="520" y="184" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="api-gateway" data-col="S4" data-value="2" x="520" y="184" width="116" height="56" fill="rgba(45,49,66,0.14)"/>+ <text x="578" y="216" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <rect x="640" y="184" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="api-gateway" data-col="S5" data-value="1" x="640" y="184" width="116" height="56" fill="rgba(45,49,66,0.07)"/>+ <text x="698" y="216" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">1%</text>++ <rect x="760" y="184" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="api-gateway" data-col="S6" data-value="1" x="760" y="184" width="116" height="56" fill="rgba(45,49,66,0.07)"/>+ <text x="818" y="216" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">1%</text>++ <!-- Row: billing (y=244) — values 5,7,9,6,4,3 -->+ <rect x="160" y="244" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="billing" data-col="S1" data-value="5" x="160" y="244" width="116" height="56" fill="rgba(45,49,66,0.36)"/>+ <text x="218" y="276" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">5%</text>++ <rect x="280" y="244" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="billing" data-col="S2" data-value="7" x="280" y="244" width="116" height="56" fill="rgba(45,49,66,0.51)"/>+ <text x="338" y="276" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">7%</text>++ <rect x="400" y="244" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="billing" data-col="S3" data-value="9" x="400" y="244" width="116" height="56" fill="rgba(45,49,66,0.65)"/>+ <text x="458" y="276" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">9%</text>++ <rect x="520" y="244" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="billing" data-col="S4" data-value="6" x="520" y="244" width="116" height="56" fill="rgba(45,49,66,0.43)"/>+ <text x="578" y="276" fill="#f5f5f5" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">6%</text>++ <rect x="640" y="244" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="billing" data-col="S5" data-value="4" x="640" y="244" width="116" height="56" fill="rgba(45,49,66,0.29)"/>+ <text x="698" y="276" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">4%</text>++ <rect x="760" y="244" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="billing" data-col="S6" data-value="3" x="760" y="244" width="116" height="56" fill="rgba(45,49,66,0.22)"/>+ <text x="818" y="276" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">3%</text>++ <!-- Row: notifications (y=304) — values 1,2,2,2,1,1 -->+ <rect x="160" y="304" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="notifications" data-col="S1" data-value="1" x="160" y="304" width="116" height="56" fill="rgba(45,49,66,0.07)"/>+ <text x="218" y="336" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">1%</text>++ <rect x="280" y="304" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="notifications" data-col="S2" data-value="2" x="280" y="304" width="116" height="56" fill="rgba(45,49,66,0.14)"/>+ <text x="338" y="336" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <rect x="400" y="304" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="notifications" data-col="S3" data-value="2" x="400" y="304" width="116" height="56" fill="rgba(45,49,66,0.14)"/>+ <text x="458" y="336" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <rect x="520" y="304" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="notifications" data-col="S4" data-value="2" x="520" y="304" width="116" height="56" fill="rgba(45,49,66,0.14)"/>+ <text x="578" y="336" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">2%</text>++ <rect x="640" y="304" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="notifications" data-col="S5" data-value="1" x="640" y="304" width="116" height="56" fill="rgba(45,49,66,0.07)"/>+ <text x="698" y="336" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">1%</text>++ <rect x="760" y="304" width="116" height="56" fill="#f5f5f5"/>+ <rect data-row="notifications" data-col="S6" data-value="1" x="760" y="304" width="116" height="56" fill="rgba(45,49,66,0.07)"/>+ <text x="818" y="336" fill="#2d3142" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">1%</text>++ <!-- Legend -->+ <line x1="40" y1="382" x2="960" y2="382" stroke="rgba(45,49,66,0.10)" stroke-width="0.8"/>+ <text x="40" y="398" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" letter-spacing="0.18em">LEGEND</text>+ <text x="960" y="398" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" letter-spacing="0.06em" text-anchor="end">ILLUSTRATIVE CI FAILURE RATES · NOT A MEASURED REGISTRY</text>++ <!-- Ink ramp strip: 8 steps low→high -->+ <rect x="120" y="386" width="20" height="12" fill="#f5f5f5"/><rect x="120" y="386" width="20" height="12" fill="rgba(45,49,66,0.07)"/>+ <rect x="142" y="386" width="20" height="12" fill="#f5f5f5"/><rect x="142" y="386" width="20" height="12" fill="rgba(45,49,66,0.14)"/>+ <rect x="164" y="386" width="20" height="12" fill="#f5f5f5"/><rect x="164" y="386" width="20" height="12" fill="rgba(45,49,66,0.22)"/>+ <rect x="186" y="386" width="20" height="12" fill="#f5f5f5"/><rect x="186" y="386" width="20" height="12" fill="rgba(45,49,66,0.29)"/>+ <rect x="208" y="386" width="20" height="12" fill="#f5f5f5"/><rect x="208" y="386" width="20" height="12" fill="rgba(45,49,66,0.36)"/>+ <rect x="230" y="386" width="20" height="12" fill="#f5f5f5"/><rect x="230" y="386" width="20" height="12" fill="rgba(45,49,66,0.43)"/>+ <rect x="252" y="386" width="20" height="12" fill="#f5f5f5"/><rect x="252" y="386" width="20" height="12" fill="rgba(45,49,66,0.51)"/>+ <rect x="274" y="386" width="20" height="12" fill="#f5f5f5"/><rect x="274" y="386" width="20" height="12" fill="rgba(45,49,66,0.65)"/>+ <text x="116" y="396" fill="#4f5d75" font-size="7.5" font-family="'Geist Mono', monospace" text-anchor="end">LOW</text>+ <text x="298" y="396" fill="#4f5d75" font-size="7.5" font-family="'Geist Mono', monospace">HIGH</text>++ <!-- Focal accent swatch -->+ <rect x="360" y="386" width="20" height="12" fill="#f5f5f5"/><rect x="360" y="386" width="20" height="12" fill="rgba(235,108,54,0.85)" stroke="#eb6c36" stroke-width="1"/>+ <text x="388" y="396" fill="#4f5d75" font-size="8.5" font-family="'Geist', sans-serif">payments · S4 · 47% — deploy regression (now fixed)</text>++ <!-- Scale note -->+ <text x="40" y="418" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" letter-spacing="0.06em">NON-FOCAL SCALE: 1–9% · SINGLE INK RAMP · ACCENT IS EDITORIAL, NOT A DATA RANGE</text>+ </svg>+ </div>+</body>+</html>diff --git a/skills/diagram-design/assets/index.html b/skills/diagram-design/assets/index.htmlindex b670b85..a21496f 100644--- a/skills/diagram-design/assets/index.html+++ b/skills/diagram-design/assets/index.html@@ -307,8 +307,11 @@<button class="tab new" data-type="treemap"><span class="eyebrow">30</span>Treemap</button>- <button class="tab new" data-type="marimekko" data-parent-type="treemap">- <span class="eyebrow">30</span>Treemap · marimekko+ <button class="tab new" data-type="heatmap">+ <span class="eyebrow">31</span>Heatmap+ </button>+ <button class="tab new" data-type="marimekko">+ <span class="eyebrow">32</span>Marimekko</button><button class="tab new" data-type="slopegraph" data-parent-type="line"><span class="eyebrow">21</span>Line · slopegraph@@ -323,70 +326,70 @@<span class="eyebrow">21</span>Line · bump</button><button class="tab new" data-type="dp-security-matrix">- <span class="eyebrow">31</span>DP security matrix+ <span class="eyebrow">33</span>DP security matrix</button><button class="tab new" data-type="it-state">- <span class="eyebrow">32</span>IT current-state+ <span class="eyebrow">34</span>IT current-state</button><button class="tab new" data-type="sankey">- <span class="eyebrow">33</span>Sankey+ <span class="eyebrow">35</span>Sankey</button><button class="tab new" data-type="fishbone">- <span class="eyebrow">34</span>Fishbone+ <span class="eyebrow">36</span>Fishbone</button><button class="tab new" data-type="wardley">- <span class="eyebrow">35</span>Wardley map+ <span class="eyebrow">37</span>Wardley map</button><button class="tab new" data-type="kanban">- <span class="eyebrow">36</span>Kanban+ <span class="eyebrow">38</span>Kanban</button><button class="tab new" data-type="journey">- <span class="eyebrow">37</span>User journey+ <span class="eyebrow">39</span>User journey</button><button class="tab new" data-type="deployment">- <span class="eyebrow">38</span>Deployment+ <span class="eyebrow">40</span>Deployment</button><button class="tab new" data-type="dependency">- <span class="eyebrow">39</span>Dependency graph+ <span class="eyebrow">41</span>Dependency graph</button><button class="tab new" data-type="uml-class">- <span class="eyebrow">40</span>UML class+ <span class="eyebrow">42</span>UML class</button><button class="tab new" data-type="story-map">- <span class="eyebrow">41</span>Story map+ <span class="eyebrow">43</span>Story map</button><button class="tab new" data-type="db-schema">- <span class="eyebrow">42</span>Database schema+ <span class="eyebrow">44</span>Database schema</button><button class="tab new" data-type="sequence-oauth">- <span class="eyebrow">43</span>Sequence · OAuth+ <span class="eyebrow">45</span>Sequence · OAuth</button><button class="tab new" data-type="import-drawio" data-single>- <span class="eyebrow">44</span>Import · draw.io+ <span class="eyebrow">46</span>Import · draw.io</button><button class="tab new" data-type="import-mermaid" data-single>- <span class="eyebrow">45</span>Import · Mermaid+ <span class="eyebrow">47</span>Import · Mermaid</button><button class="tab new" data-type="quadrant-consultant" data-single>- <span class="eyebrow">46</span>Quadrant · consultant+ <span class="eyebrow">48</span>Quadrant · consultant</button><button class="tab new" data-type="loop-terminal" data-single>- <span class="eyebrow">47</span>Loop · terminal+ <span class="eyebrow">49</span>Loop · terminal</button><button class="tab new" data-type="policy-trace-animated" data-single>- <span class="eyebrow">48</span>Policy trace · animated+ <span class="eyebrow">50</span>Policy trace · animated</button><button class="tab new" data-type="queue-animated" data-single>- <span class="eyebrow">49</span>Fan-in queue · animated+ <span class="eyebrow">51</span>Fan-in queue · animated</button><button class="tab new" data-type="paved-road-animated" data-single>- <span class="eyebrow">50</span>Secure paved road · animated+ <span class="eyebrow">52</span>Secure paved road · animated</button><button class="tab new" data-type="tree-block-decomposition">- <span class="eyebrow">51</span>Tree · block decomposition+ <span class="eyebrow">53</span>Tree · block decomposition</button><button class="tab new" data-type="import-excalidraw" data-single>- <span class="eyebrow">52</span>Import · Excalidraw+ <span class="eyebrow">54</span>Import · Excalidraw</button></div>diff --git a/skills/diagram-design/references/style-guide.md b/skills/diagram-design/references/style-guide.mdindex 730e78f..b60f499 100644--- a/skills/diagram-design/references/style-guide.md+++ b/skills/diagram-design/references/style-guide.md@@ -19,6 +19,7 @@ Every token is referred to by **semantic role**, not by its hex value. Type refe| `paper` | Page background, default node fill | `#f5f5f5` (white-smoke) | `#2d3142` (jet-black) || `paper-2` | Diagram container bg, secondary fill | `#ececec` | `#393e53` || `ink` | Primary text, primary stroke | `#2d3142` (jet-black) | `#f5f5f5` (white-smoke) |+| `ink-strong` | High-contrast text on warm accent fills | `#111111` | `#111111` || `muted` | Secondary text, default arrow stroke | `#4f5d75` (blue-slate) | `#bfc0c0` (silver) || `soft` | Sublabels, boundary labels | `#7a8399` | `#8e98ac` || `rule` | Hairline borders | `rgba(45,49,66,0.12)` | `rgba(245,245,245,0.12)` |diff --git a/skills/diagram-design/references/type-heatmap.md b/skills/diagram-design/references/type-heatmap.mdnew file mode 100644index 0000000..c345791--- /dev/null+++ b/skills/diagram-design/references/type-heatmap.md@@ -0,0 +1,72 @@+# Heatmap++**Best for:** cross-tabulated data where *which row × column combination stands out* is the story. Use when the reader needs to scan a full matrix at once — not compare individual bars or trace a trend line — and one cell (or a cluster of cells) is editorially distinct from the field. Common uses: CI failure rate by service and sprint, support ticket volume by team and week, confusion matrix for a classifier, correlation coefficients across many variables.++## Layout conventions++- **Plot area:** left 160px (row labels), top 64px (column labels), right 40px, bottom 120px (legend area); inside `0 0 1000 500` viewBox.+- **Cell size:** 116px wide × 56px tall, gap 4px. Maximum grid: 6 columns × 5 rows within the viewBox; smaller grids scale the cells up to fill the space.+- **Row count:** 3–7. Fewer → a table says it with less ink; more → the cells shrink below readability at the minimum viewBox width.+- **Column count:** 3–8. Same constraint: 8 × 116 = 928px exceeds the available 800px at this viewBox, so either reduce columns or reduce cell width proportionally (minimum cell width 80px).+- **Axes:** row labels right-aligned in the left gutter (Geist Mono 9px, `text-anchor="end"`, x=148); column labels centered above each column (Geist Mono 9px, `text-anchor="middle"`); axis titles in Geist Mono 7px small-caps rotated/positioned in the margins.+- **Value text (optional):** Geist Mono 8px centered inside each cell. Flip text color to paper when fill opacity ≥ 0.40 (the ink ramp becomes dark enough to carry white); keep ink text below that threshold.++### Cell pattern++Every cell is two overlapping `<rect>` elements: a paper-fill underlay (no data attributes, paints the background), then the data rect with all three data bindings.++```svg+<!-- Paper underlay — no data attributes, scenery only -->+<rect x="160" y="64" width="116" height="56" fill="#f5f5f5"/>++<!-- Data cell — all three bindings required -->+<rect data-row="auth" data-col="S1" data-value="4"+ x="160" y="64" width="116" height="56"+ fill="rgba(45,49,66,0.29)"/>++<!-- Focal cell — data-focal="true" required, uses accent fill -->+<rect x="520" y="124" width="116" height="56" fill="#f5f5f5"/>+<rect data-row="payments" data-col="S4" data-value="47" data-focal="true"+ x="520" y="124" width="116" height="56"+ fill="rgba(235,108,54,0.85)" stroke="#eb6c36" stroke-width="1.2"/>+```++## The fill ramp++**One ink ramp, one accent.** Non-focal cells use a single tonal ramp: `rgba(INK, opacity)` where opacity is a non-decreasing function of the data value. The shipped example uses `opacity = max(0.07, value / max_non_focal × 0.65)`. Any monotone formula (linear, sqrt, log) passes the verifier as long as opacity never decreases with value.++**One focal cell only.** The accent marks the editorially focal cell — the one whose combination of row and column is the figure's argument. It is not the automatically highest value; choose the cell whose story the title is about. `data-focal="true"` is required; `scripts/verify-heatmap.py` counts all accent-fill and `data-focal` cells and fails if more than one is found.++**Ramp bounds:** the lowest-value non-focal cell should land at ≥ 0.05 opacity (the cell must be visually distinct from the paper background) and the highest-value non-focal cell at ≤ 0.70 (the ramp must not bleed into the focal accent's territory).++## Anti-patterns++- A hue per row or per column — hue is not a continuous variable; it maps "which series" (slopegraph contract), not "how much". The ramp carries quantity; the label carries category identity.+- A multi-hue diverging ramp (e.g. blue–white–red) — these read as two variables (negative and positive deviation from center) and are only honest when the data is signed and the center is meaningful. For unsigned rates or counts, the single ink ramp is the honest encoding.+- Focal accent on more than one cell — if two cells are both focal the figure needs a different title; hue-coding two things is a palette decision masquerading as an editorial one.+- A value axis (color bar with a continuous legend) instead of a discrete ramp strip — the ink ramp is not a gradient legend; it encodes comparative reading ("S4 is much darker than S3"), not precise magnitude retrieval. If readers need the exact value, the number printed inside the cell carries it.+- Rows or columns dropped because they made the pattern less clean — omitted rows and columns are invisible to the reader and look like "the services that didn't have this problem". Name everything included and say in the footnote if anything is excluded.+- A transform on a cell, its underlay, or an ancestor `<g>`. The verifier reads raw `x`/`y`/`width`/`height` attributes; a transform silently moves the rendered mark off the verified position.++## Honest-data rule++**Row × column labels are complete and stated.** A heatmap that quietly drops a service with a high rate is a filtered view the reader cannot see. State every included row and column; note any exclusions in the footnote or source line.++**The ramp scale is declared.** The legend strip shows the range the ramp covers for non-focal cells, stated as "LOW" to "HIGH" rather than a continuous scale — because the ramp's job is comparative, not absolute. If the footnote states bounds, those bounds must match the actual minimum and maximum non-focal values in the figure.++**The focal cell is excluded from the ramp's scale.** Its value (often an outlier) would collapse every other cell into near-identical opacity if included. The footnote must state the focal cell's value explicitly. `scripts/verify-heatmap.py` checks that the focal cell carries `data-focal="true"` and that no non-focal cell uses accent fill.++## Declaring the values++**Every drawn cell is bound to its row, column, and value.** The paper underlay carries nothing. The data rect carries all three.++| Binding | Without it |+|---|---|+| `data-row` on the data rect | A row cannot be identified during verification; a swapped row passes silently. |+| `data-col` on the data rect | A column cannot be identified; a shuffled column is invisible to the verifier. |+| `data-value` on the data rect | The fill cannot be verified as monotone; any opacity passes. |+| `data-focal="true"` on the focal rect | The focal cell is counted as a non-focal cell with an unexplained accent fill. |++`scripts/verify-heatmap.py` enforces the complete `rows × cols` grid, the monotone fill ramp on non-focal cells, and at most one focal cell. It does **not** verify cell geometry (position, width, height) because both axes are categorical — position encodes "which row/column", and that is carried by the label, not by a scale the checker can measure against.++**No `transform` on any verified element.** Bake any coordinate offsets directly into `x`/`y` attributes.