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(gallery): renumber ordinals 01–52 and gate contiguous order (#233)
Rufus Hsua742da5cf67c
diff --git a/scripts/test-verify-docs-sync.py b/scripts/test-verify-docs-sync.pyindex 03688d3..2bf0b2a 100644--- a/scripts/test-verify-docs-sync.py+++ b/scripts/test-verify-docs-sync.py@@ -1392,21 +1392,21 @@ diagram-design/ridge_trio = ["example-ridgeline.html", "example-ridgeline-dark.html", "example-ridgeline-full.html"]# 7. Variant sharing its parent's eyebrow is allowed (no error).- html = make_gallery_html(make_tab("line", "20"), make_tab("ridgeline", "20", parent="line"))+ html = make_gallery_html(make_tab("line", "01"), make_tab("ridgeline", "01", parent="line"))errs = run_gallery_check(html, line_trio + ridge_trio)if any("eyebrow" in e or "parent" in e for e in errs):raise AssertionError(f"valid parent/variant reuse raised error: {errs}")print("OK gallery: variant sharing parent eyebrow is allowed")# 8. Variant with wrong eyebrow number is caught.- html = make_gallery_html(make_tab("line", "20"), make_tab("ridgeline", "99", parent="line"))+ html = make_gallery_html(make_tab("line", "01"), make_tab("ridgeline", "99", parent="line"))errs = run_gallery_check(html, line_trio + ridge_trio)if not any("ridgeline" in e and "eyebrow" in e for e in errs):raise AssertionError(f"variant with wrong eyebrow not caught: {errs}")print("OK gallery: variant with wrong eyebrow number caught")# 9. Variant declaring a missing parent is caught.- html = make_gallery_html(make_tab("ridgeline", "20", parent="line"))+ html = make_gallery_html(make_tab("ridgeline", "01", parent="line"))errs = run_gallery_check(html, ridge_trio)if not any("ridgeline" in e and "line" in e for e in errs):raise AssertionError(f"variant with missing parent not caught: {errs}")@@ -1418,10 +1418,10 @@ diagram-design/"example-state-lifecycle-full.html",]- # 10. Lifecycle is a complete State variant and reuses eyebrow 04.+ # 10. Lifecycle is a complete State variant and reuses eyebrow 01.html = make_gallery_html(- make_tab("state", "04"),- make_tab("state-lifecycle", "04", parent="state"),+ make_tab("state", "01"),+ make_tab("state-lifecycle", "01", parent="state"),)errs = run_gallery_check(html, ["example-state.html",@@ -1433,6 +1433,45 @@ diagram-design/raise AssertionError(f"valid lifecycle State variant failed: {errs}")print("OK gallery: lifecycle phase map is a complete State variant")+ # 11. Out-of-order independent ordinals are caught (uniqueness alone is not enough).+ html = make_gallery_html(+ make_tab("bar", "01"),+ make_tab("waterfall", "03"),+ make_tab("line", "02"),+ )+ trio_files = (+ ["example-bar.html", "example-bar-dark.html", "example-bar-full.html"]+ + ["example-waterfall.html", "example-waterfall-dark.html", "example-waterfall-full.html"]+ + line_trio+ )+ errs = run_gallery_check(html, trio_files)+ if not any("contiguous ascending" in e for e in errs):+ raise AssertionError(f"out-of-order independent ordinals not caught: {errs}")+ print("OK gallery: out-of-order independent ordinals caught")++ # 12. Gapped independent ordinals are caught (e.g. missing 02).+ html = make_gallery_html(+ make_tab("bar", "01"),+ make_tab("waterfall", "02"),+ make_tab("line", "04"),+ )+ errs = run_gallery_check(html, trio_files)+ if not any("contiguous ascending" in e for e in errs):+ raise AssertionError(f"gapped independent ordinals not caught: {errs}")+ print("OK gallery: gapped independent ordinals caught")++ # 13. Contiguous ascending independent ordinals with mid-gallery variants pass.+ html = make_gallery_html(+ make_tab("bar", "01"),+ make_tab("waterfall", "02"),+ make_tab("line", "03"),+ make_tab("ridgeline", "03", parent="line"),+ )+ errs = run_gallery_check(html, trio_files + ridge_trio)+ if any("contiguous ascending" in e or "duplicate eyebrow" in e for e in errs):+ raise AssertionError(f"contiguous sequence with variants raised error: {errs}")+ print("OK gallery: contiguous ascending independent ordinals pass")+with tempfile.TemporaryDirectory(prefix="verify-docs-sync-assets-") as asset_tmp:tmp_skill_dir = Path(asset_tmp)tmp_asset_dir = tmp_skill_dir / "assets"@@ -1470,7 +1509,7 @@ diagram-design/"strict-bundler packaging, ""routing surfaces, Factory install contract, type-count routing, High-Level invariants, ""font-link parity, the Cyrillic title fallback order, the type-ramp contract, "- "and gallery guards (parent/variant model)"+ "and gallery guards (parent/variant model, contiguous ordinals)")return 0diff --git a/scripts/verify-docs-sync.py b/scripts/verify-docs-sync.pyindex 1303be0..b2998df 100644--- a/scripts/verify-docs-sync.py+++ b/scripts/verify-docs-sync.py@@ -215,7 +215,8 @@ def check_gallery(errors: list[str]) -> None:errors.append(f"gallery tab {name!r} points at a missing example-{name}.html")# Parse eyebrow numbers and parent-type bindings from tab buttons.# Variants (data-parent-type) may share their declared parent's eyebrow- # number; uniqueness is enforced only among independent (non-variant) types.+ # number; independent (non-variant) types must be unique and form a+ # contiguous ascending 01..N sequence in document order.tab_eyebrows: dict[str, str] = {} # data-type → eyebrow numbertab_parents: dict[str, str] = {} # data-type → data-parent-typefor m in re.finditer(r'<button([^>]*)>\s*<span class="eyebrow">(\d+)</span>', source):@@ -228,9 +229,11 @@ def check_gallery(errors: list[str]) -> None:tab_parents[tm.group(1)] = pm.group(1)# Enforce uniqueness among independent (non-variant) types.seen_eyebrows: dict[str, str] = {} # eyebrow → first independent type+ independent_order: list[tuple[str, str]] = [] # (type, eyebrow) in document orderfor t, num in tab_eyebrows.items():if t in tab_parents:continue+ independent_order.append((t, num))if num in seen_eyebrows:errors.append(f"gallery has duplicate eyebrow number {num!r} on independent types "@@ -238,6 +241,18 @@ def check_gallery(errors: list[str]) -> None:)else:seen_eyebrows[num] = t+ # Enforce that independent ordinals are contiguous and ascending 01..N+ # in document order. Uniqueness alone misses insertions that take the next+ # free number while landing mid-gallery (see #213).+ if independent_order:+ expected = [f"{i:02d}" for i in range(1, len(independent_order) + 1)]+ actual = [num for _, num in independent_order]+ if actual != expected:+ found = ", ".join(f"{t}={num}" for t, num in independent_order)+ errors.append(+ f"gallery independent eyebrow sequence must be contiguous ascending "+ f"01..{len(independent_order):02d} in document order; found {found}"+ )# Enforce that each variant's eyebrow matches its declared parent's.for t, parent in tab_parents.items():if parent not in tab_eyebrows:diff --git a/skills/diagram-design/assets/index.html b/skills/diagram-design/assets/index.htmlindex 18da438..b138511 100644--- a/skills/diagram-design/assets/index.html+++ b/skills/diagram-design/assets/index.html@@ -269,31 +269,31 @@<span class="eyebrow">19</span>Bar</button><button class="tab new" data-type="waterfall">- <span class="eyebrow">54</span>Waterfall+ <span class="eyebrow">20</span>Waterfall</button><button class="tab new" data-type="line">- <span class="eyebrow">20</span>Line+ <span class="eyebrow">21</span>Line</button><button class="tab new" data-type="gantt">- <span class="eyebrow">21</span>Gantt+ <span class="eyebrow">22</span>Gantt</button><button class="tab new" data-type="scatter">- <span class="eyebrow">22</span>Scatter+ <span class="eyebrow">23</span>Scatter</button><button class="tab new" data-type="bubble" data-parent-type="scatter">- <span class="eyebrow">22</span>Scatter · bubble+ <span class="eyebrow">23</span>Scatter · bubble</button><button class="tab new" data-type="beeswarm" data-parent-type="scatter">- <span class="eyebrow">22</span>Scatter · beeswarm+ <span class="eyebrow">23</span>Scatter · beeswarm</button><button class="tab new" data-type="medallion">- <span class="eyebrow">23</span>Medallion+ <span class="eyebrow">24</span>Medallion</button><button class="tab new" data-type="high-level">- <span class="eyebrow">24</span>High-Level+ <span class="eyebrow">25</span>High-Level</button><button class="tab new" data-type="process">- <span class="eyebrow">25</span>Process+ <span class="eyebrow">26</span>Process</button><button class="tab new" data-type="data-flow"><span class="eyebrow">27</span>Data flow@@ -308,79 +308,79 @@<span class="eyebrow">30</span>Treemap</button><button class="tab new" data-type="slopegraph" data-parent-type="line">- <span class="eyebrow">20</span>Line · slopegraph+ <span class="eyebrow">21</span>Line · slopegraph</button><button class="tab new" data-type="ridgeline" data-parent-type="line">- <span class="eyebrow">20</span>Line · ridgeline+ <span class="eyebrow">21</span>Line · ridgeline</button><button class="tab new" data-type="bump" data-parent-type="line">- <span class="eyebrow">20</span>Line · bump+ <span class="eyebrow">21</span>Line · bump</button><button class="tab new" data-type="dp-security-matrix">- <span class="eyebrow">33</span>DP security matrix+ <span class="eyebrow">31</span>DP security matrix</button><button class="tab new" data-type="it-state">- <span class="eyebrow">34</span>IT current-state+ <span class="eyebrow">32</span>IT current-state</button><button class="tab new" data-type="sankey">- <span class="eyebrow">35</span>Sankey+ <span class="eyebrow">33</span>Sankey</button><button class="tab new" data-type="fishbone">- <span class="eyebrow">36</span>Fishbone+ <span class="eyebrow">34</span>Fishbone</button><button class="tab new" data-type="wardley">- <span class="eyebrow">37</span>Wardley map+ <span class="eyebrow">35</span>Wardley map</button><button class="tab new" data-type="kanban">- <span class="eyebrow">38</span>Kanban+ <span class="eyebrow">36</span>Kanban</button><button class="tab new" data-type="journey">- <span class="eyebrow">39</span>User journey+ <span class="eyebrow">37</span>User journey</button><button class="tab new" data-type="deployment">- <span class="eyebrow">40</span>Deployment+ <span class="eyebrow">38</span>Deployment</button><button class="tab new" data-type="dependency">- <span class="eyebrow">41</span>Dependency graph+ <span class="eyebrow">39</span>Dependency graph</button><button class="tab new" data-type="uml-class">- <span class="eyebrow">42</span>UML class+ <span class="eyebrow">40</span>UML class</button><button class="tab new" data-type="story-map">- <span class="eyebrow">43</span>Story map+ <span class="eyebrow">41</span>Story map</button><button class="tab new" data-type="db-schema">- <span class="eyebrow">44</span>Database schema+ <span class="eyebrow">42</span>Database schema</button><button class="tab new" data-type="sequence-oauth">- <span class="eyebrow">45</span>Sequence · OAuth+ <span class="eyebrow">43</span>Sequence · OAuth</button><button class="tab new" data-type="import-drawio" data-single>- <span class="eyebrow">46</span>Import · draw.io+ <span class="eyebrow">44</span>Import · draw.io</button><button class="tab new" data-type="import-mermaid" data-single>- <span class="eyebrow">47</span>Import · Mermaid+ <span class="eyebrow">45</span>Import · Mermaid</button><button class="tab new" data-type="quadrant-consultant" data-single>- <span class="eyebrow">48</span>Quadrant · consultant+ <span class="eyebrow">46</span>Quadrant · consultant</button><button class="tab new" data-type="loop-terminal" data-single>- <span class="eyebrow">49</span>Loop · terminal+ <span class="eyebrow">47</span>Loop · terminal</button><button class="tab new" data-type="policy-trace-animated" data-single>- <span class="eyebrow">50</span>Policy trace · animated+ <span class="eyebrow">48</span>Policy trace · animated</button><button class="tab new" data-type="queue-animated" data-single>- <span class="eyebrow">51</span>Fan-in queue · animated+ <span class="eyebrow">49</span>Fan-in queue · animated</button><button class="tab new" data-type="paved-road-animated" data-single>- <span class="eyebrow">52</span>Secure paved road · animated+ <span class="eyebrow">50</span>Secure paved road · animated</button><button class="tab new" data-type="tree-block-decomposition">- <span class="eyebrow">53</span>Tree · block decomposition+ <span class="eyebrow">51</span>Tree · block decomposition</button><button class="tab new" data-type="import-excalidraw" data-single>- <span class="eyebrow">55</span>Import · Excalidraw+ <span class="eyebrow">52</span>Import · Excalidraw</button></div>