Editorial diagram design for Claude Code, Codex, GitHub Copilot, Cursor, Factory Droid, Qoder, and Pi. 45 diagram types. Self-contained HTML + SVG. No shadows. No Mermaid slop.
fix(docs): drop non-existent extended asset citations and enforce asset link integrity (#185) (#193)
Oscar Madera93244020569e
diff --git a/scripts/test-verify-docs-sync.py b/scripts/test-verify-docs-sync.pyindex 35d94b1..082f14b 100644--- a/scripts/test-verify-docs-sync.py+++ b/scripts/test-verify-docs-sync.py@@ -596,9 +596,35 @@ diagram-design/raise AssertionError(f"variant with missing parent not caught: {errs}")print("OK gallery: variant with missing parent caught")+ with tempfile.TemporaryDirectory(prefix="verify-docs-sync-assets-") as asset_tmp:+ tmp_skill_dir = Path(asset_tmp)+ tmp_asset_dir = tmp_skill_dir / "assets"+ tmp_ref_dir = tmp_skill_dir / "references"+ tmp_asset_dir.mkdir(parents=True)+ tmp_ref_dir.mkdir(parents=True)++ (tmp_asset_dir / "example-valid.html").write_text("", encoding="utf-8")+ (tmp_ref_dir / "type-sample.md").write_text(+ "- `assets/example-valid.html`\n- `assets/example-missing.html`\n",+ encoding="utf-8",+ )++ errs: list[str] = []+ verify.check_reference_asset_links(errs, tmp_skill_dir)+ if not any("type-sample.md" in e and "example-missing.html" in e for e in errs):+ raise AssertionError(f"missing asset citation was not caught: {errs}")+ print("OK reference assets: missing asset citation caught")++ (tmp_asset_dir / "example-missing.html").write_text("", encoding="utf-8")+ errs = []+ verify.check_reference_asset_links(errs, tmp_skill_dir)+ if errs:+ raise AssertionError(f"valid asset citations produced unexpected error: {errs}")+ print("OK reference assets: valid asset citations produce no error")+print(- "PASS: docs sync checks references, strict-bundler packaging, routing surfaces, "- "Factory install contract, type-count routing, High-Level invariants, "+ "PASS: docs sync checks references, asset citations, strict-bundler packaging, "+ "routing surfaces, Factory install contract, type-count routing, High-Level invariants, ""and gallery guards (parent/variant model)")return 0diff --git a/scripts/verify-docs-sync.py b/scripts/verify-docs-sync.pyindex 5f1bf60..13277f9 100644--- a/scripts/verify-docs-sync.py+++ b/scripts/verify-docs-sync.py@@ -286,6 +286,28 @@ def check_skill_reference_links(errors.append(f"SKILL.md links to missing reference {target!r}")+def check_reference_asset_links(+ errors: list[str], skill_directory: Path+) -> None:+ """Require every asset cited across skill documentation to exist on disk."""+ asset_dir = skill_directory / "assets"+ ref_dir = skill_directory / "references"+ md_paths = [skill_directory / "SKILL.md", *sorted(ref_dir.glob("*.md"))]+ asset_pattern = re.compile(r"assets/([A-Za-z0-9_.-]+\.html)")++ for path in md_paths:+ if not path.is_file():+ continue+ content = path.read_text(encoding="utf-8")+ for match in asset_pattern.finditer(content):+ asset_name = match.group(1)+ target = asset_dir / asset_name+ if not target.is_file():+ errors.append(+ f"{path.name} cites missing asset 'assets/{asset_name}'"+ )++def scanner_visible_support_references(markdown: str) -> list[str]:"""Return the local support paths a strict skill bundler will request."""normalized_markdown = markdown.replace("\\", "/")@@ -546,6 +568,7 @@ def main() -> int:SKILL.read_text(encoding="utf-8"),SKILL.parent,)+ check_reference_asset_links(errors, SKILL.parent)check_packaged_support_references(errors,SKILL.read_text(encoding="utf-8"),@@ -565,9 +588,9 @@ def main() -> int:return 1print("OK docs sync: description hooks, gallery reachability, README tree, "- "reference links, packaged support files, routing surfaces, manifest descriptions, "- "Factory install contract, type-count routing, High-Level invariants, "- "onboarding trust boundary, Line dark-skin contract"+ "reference links, asset citations, packaged support files, routing surfaces, "+ "manifest descriptions, Factory install contract, type-count routing, "+ "High-Level invariants, onboarding trust boundary, Line dark-skin contract")return 0diff --git a/skills/diagram-design/references/type-data-flow.md b/skills/diagram-design/references/type-data-flow.mdindex 0afee13..dab7447 100644--- a/skills/diagram-design/references/type-data-flow.md+++ b/skills/diagram-design/references/type-data-flow.md@@ -369,6 +369,3 @@ Above 4 lanes or 6 steps: split into two diagrams (e.g., ingestion pipeline / an- `assets/example-data-flow.html` — minimal light (the platform, 4-role × 5-step: Admin, Engineers, Scientists, Consumers). Gallery default.- `assets/example-data-flow-dark.html` — same, dark skin.- `assets/example-data-flow-full.html` — same, editorial-card frame.-- `assets/example-data-flow-extended.html` — exercises §4 color override: Access Control node in rust-red (governance), Clean & Stage node in slate-blue (data quality). Focal accent on Analyze step + Explore & Model node + anon-data arrow unchanged.-- `assets/example-data-flow-extended-dark.html` — extended pattern, dark skin.-- `assets/example-data-flow-extended-full.html` — extended pattern, editorial-card frame.diff --git a/skills/diagram-design/references/type-dp-integration.md b/skills/diagram-design/references/type-dp-integration.mdindex 7785352..347de48 100644--- a/skills/diagram-design/references/type-dp-integration.md+++ b/skills/diagram-design/references/type-dp-integration.md@@ -405,6 +405,3 @@ When this gets unwieldy:- `assets/example-dp-integration.html` — minimal light (1 footer = AD). Gallery default.- `assets/example-dp-integration-dark.html` — same, dark skin.- `assets/example-dp-integration-full.html` — same, editorial-card frame.-- `assets/example-dp-integration-extended.html` — exercises §4 color override + multi-footer: AD in rust-red, Observability (Prometheus/Grafana/Loki) in slate-blue. Canvas height grown to fit 2 footer rows.-- `assets/example-dp-integration-extended-dark.html` — extended pattern, dark skin.-- `assets/example-dp-integration-extended-full.html` — extended pattern, editorial-card frame.diff --git a/skills/diagram-design/references/type-it-state.md b/skills/diagram-design/references/type-it-state.mdindex 78080da..9d87452 100644--- a/skills/diagram-design/references/type-it-state.md+++ b/skills/diagram-design/references/type-it-state.md@@ -396,8 +396,6 @@ Before emitting SVG, verify **every** item:- `assets/example-it-state.html` — minimal light (NatStat canonical: 3 zones, 9 components, 8 connectors, 0 footer bars, SQL Server tinted olive). Gallery default.- `assets/example-it-state-dark.html` — same, dark skin.- `assets/example-it-state-full.html` — same, editorial-card frame with summary cards.-- `assets/example-it-state-extended.html` — exercises §4 color override + footer bars: 2 footer bars (Identity Manager + Observability) below the zones, third custom color on Analyst Machines (slate-blue, data-quality concern).-- `assets/example-it-state-extended-dark.html` — extended pattern, dark skin.---@@ -467,4 +465,4 @@ dark: falseWhen the source row matches the destination row's y range (e.g., Survey at y=108 with Shared Drive at y=80–148), prefer **side-edge** entry — a single horizontal path with a fully visible arrow. When the source row is offset, detour through the destination's nearest zone background to enter a side edge rather than approaching a top/bottom edge from the wrong side.-The extended example (§9 line 4) demonstrates footer bars + a third custom color and proves `viewBox_h` grows correctly when `N_footer > 0`.+When footer bars are added (`N_footer > 0`), `viewBox_h` grows according to the canvas formula in §2 to accommodate the footer rows and custom colors.diff --git a/skills/diagram-design/references/type-process.md b/skills/diagram-design/references/type-process.mdindex a6c555d..8447d06 100644--- a/skills/diagram-design/references/type-process.md+++ b/skills/diagram-design/references/type-process.md@@ -388,9 +388,9 @@ Above 6 lanes or 12 steps: split into two diagrams (overview + detail).----## 12. Worked example — full YAML for `example-process-extended.html`+## 12. Worked example — full YAML for an extended process variant-The extended example diagram is fully described by the following inputs. Every coordinate in the rendered SVG is derivable from this block via §2 + §3 + §4. This is the canonical proof that the parametric contract works end-to-end.+The following input block describes an extended process workflow with custom colors and lanes. Every coordinate in the rendered SVG is derivable from this block via §2 + §3 + §4, demonstrating the parametric layout contract end-to-end.```yaml# Quarterly survey — end-to-end workflow (extended variant)@@ -461,15 +461,15 @@ dark: falseRun §2 of this reference with these inputs:- `n_lanes = 6`, `n_steps = 11`, `has_color_row = true` (3 nodes carry `color`).-- `viewBox_w = 140 + 11 * 112 + 28 = 1400`. ✓ matches rendered SVG.+- `viewBox_w = 140 + 11 * 112 + 28 = 1400`. ✓- `legend_h = 100`, `viewBox_h = 36 + 6 * 80 + 100 = 616`. ✓- Lane y_top = [36, 116, 196, 276, 356, 436]; lane mid = [76, 156, 236, 316, 396, 476]. ✓- Step cx = [198, 310, 422, 534, 646, 758, 870, 982, 1094, 1208, 1320] (the 8-px content-area gutter shifts every value by 8 from `140 + j*112 + 50`). ✓- Node 4 (HQ Review): step=3, lane="SVY" (k=3) → x = 534-50 = 484, y = 276+8 = 284. ✓- Node 5 (Error Checks): step=4, lane="IT" (k=1) → x = 646-50 = 596, y = 116+8 = 124. ✓-- Node 10 (Public Release): step=9, lane="CMM" (k=5) → x = 1208-50 = 1158, y = 436+8 = 444. ✓ *(Rendered uses x=1156 — 2-px tolerance from chip-width rounding on the step "10" label.)*+- Node 10 (Public Release): step=9, lane="CMM" (k=5) → x = 1208-50 = 1158, y = 436+8 = 444. ✓-The two coord drifts on the rightmost two nodes (chip width=20 for two-digit step numbers shifts the chip but not the node center math) are an artifact of the existing hand-tuned example, not a formula failure — a fresh generation from this YAML would produce x=1158 and the diagram would be visually indistinguishable from the shipped version.+A fresh generation from this YAML produces deterministic coordinates directly from the formula without manual tweaking.### 12.2 Adapting this YAML to a different process@@ -490,6 +490,3 @@ Everything else — viewBox sizing, chip positions, legend layout, dark-mode tok- `assets/example-process.html` — minimal light (quarterly survey: 11 steps, 6 divisions, data-type chips). Gallery default.- `assets/example-process-dark.html` — same, dark skin.- `assets/example-process-full.html` — same, editorial-card frame.-- `assets/example-process-extended.html` — exercises §4 color override: Build app in slate-blue (data quality), Train enumerators in rust-red (governance), Publish results in olive-green (data products). Focal accent on Pilot test step + node unchanged.-- `assets/example-process-extended-dark.html` — extended pattern, dark skin.-- `assets/example-process-extended-full.html` — extended pattern, editorial-card frame.