Skip to content

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

Guard current diagram type counts and document public updates (#396)

Cathryn Lavery3b7c1864476b
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index ee0dc3c..de5201d 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -237,7 +237,9 @@ Treemaps get a second geometric gate, because their whole claim is that area *is
### Docs sync
-`python3 scripts/verify-docs-sync.py` fails CI if the SKILL.md description loses a type's lexical hook, the gallery can't reach a shipped example, the README tree names a file that doesn't exist, a relative reference link is broken, a support path is not shipped inside the skill package, or a command/prompt surface drifts from its routed reference. It also holds the type count in one place: commands may not state a count at all, and any count the README states must equal the number of `references/type-*.md` files. The gallery gives each type one number, 01 to N in document order, and every other example is a lettered variant (`04a`, `04b`) placed directly after its type. `python3 scripts/test-verify-docs-sync.py` exercises these checks adversarially.
+`python3 scripts/verify-docs-sync.py` fails CI if the SKILL.md description loses a type's lexical hook, the gallery can't reach a shipped example, the README tree names a file that doesn't exist, a relative reference link is broken, a support path is not shipped inside the skill package, or a command/prompt surface drifts from its routed reference. It also holds the type count in one place: commands may not state a count at all, and counts in reader-facing docs must equal the number of `references/type-*.md` files. The gallery gives each type one number, 01 to N in document order, and every other example is a lettered variant (`04a`, `04b`) placed directly after its type. `python3 scripts/test-verify-docs-sync.py` exercises these checks adversarially.
+
+The same count check covers this guide, `SKILL.md`, and the current onboarding and semantic-pattern references. Historical changelog entries and ADRs keep the count that was accurate when they were written. After a new type merges, a maintainer must also update the repository's GitHub About description, [Cathryn's profile README](https://github.com/cathrynlavery/cathrynlavery/blob/main/README.md), and [diagramdesign.dev](https://diagramdesign.dev); those live outside this CI check.
The skill also ships `skills/diagram-design/scripts/self_check.py`, a distilled output checker installed agents can run on their own generated diagrams; `python3 scripts/test-self-check.py` keeps it honest.
@@ -306,6 +308,7 @@ Settled policies live as short records in `docs/adr/` — one pinned motion cont
2. Add the row to the selection table in `skills/diagram-design/SKILL.md` §3 **and** the type's name to the frontmatter `description` — `verify-docs-sync.py` fails if the description loses or lacks a type's lexical hook.
3. Add the three example variants (see above) and register them in the gallery (`assets/index.html`) with the next type number; extra examples of an existing type go directly after it as lettered variants (`data-parent-type`, eyebrow `04a`). `verify-docs-sync.py` fails on any shipped example the gallery can't reach and on any numbered tab without a matching `type-*.md`.
4. Run the full gate suite — new examples are linted automatically by `--all`.
+5. After merge, the maintainer updates the GitHub About description, Cathryn's profile README, and diagramdesign.dev to the new count, then checks the live pages. Contributors do not need write access to those surfaces.
## Changing the icon set
diff --git a/scripts/test-verify-docs-sync.py b/scripts/test-verify-docs-sync.py
index 3dde000..8241ecc 100644
--- a/scripts/test-verify-docs-sync.py
+++ b/scripts/test-verify-docs-sync.py
@@ -1493,6 +1493,10 @@ diagram-design/
counted = root / "commands"
counted.mkdir(parents=True, exist_ok=True)
+ for relative in verify.COUNT_SURFACES[4:]:
+ surface = root / relative
+ surface.parent.mkdir(parents=True, exist_ok=True)
+ surface.write_text("See the shipped visual types.\n", encoding="utf-8")
drawio = counted / "import-drawio.md"
mermaid = counted / "import-mermaid.md"
excalidraw = counted / "import-excalidraw.md"
@@ -1584,6 +1588,31 @@ diagram-design/
if len(errors) != 1 or "commands/import-mermaid.md" not in errors[0]:
raise AssertionError(f"a command may not state even the shipped count: {errors}")
mermaid.write_text(routed, encoding="utf-8")
+ for relative in verify.COUNT_SURFACES[4:]:
+ surface = root / relative
+ surface.write_text("The skill draws 4 visual types.\n", encoding="utf-8")
+ errors = []
+ verify.check_type_counts(errors, root)
+ if len(errors) != 1 or relative.as_posix() not in errors[0]:
+ raise AssertionError(f"a stale count in {relative} was not reported: {errors}")
+ surface.write_text("See the shipped visual types.\n", encoding="utf-8")
+ skill_surface = root / "skills/diagram-design/SKILL.md"
+ skill_surface.write_text("See §3 visual-type guide.\n", encoding="utf-8")
+ errors = []
+ verify.check_type_counts(errors, root)
+ if errors:
+ raise AssertionError(f"a section number was mistaken for a type count: {errors}")
+ skill_surface.write_text("### Visual-type guide (3)\n", encoding="utf-8")
+ errors = []
+ verify.check_type_counts(errors, root)
+ if errors:
+ raise AssertionError(f"the shipped guide heading count was rejected: {errors}")
+ skill_surface.write_text("### Visual-type guide (4)\n", encoding="utf-8")
+ errors = []
+ verify.check_type_counts(errors, root)
+ if len(errors) != 1 or "SKILL.md" not in errors[0]:
+ raise AssertionError(f"a stale guide heading count was not reported: {errors}")
+ skill_surface.write_text("See the shipped visual types.\n", encoding="utf-8")
for path in references.glob("type-shipped-*.md"):
path.unlink()
diff --git a/scripts/verify-docs-sync.py b/scripts/verify-docs-sync.py
index 8328547..d25f58b 100644
--- a/scripts/verify-docs-sync.py
+++ b/scripts/verify-docs-sync.py
@@ -21,10 +21,9 @@ fifteenth nearly did (#217); the sixteenth guards the ADR 0004 split:
8. Every support path a strict skill bundler can extract from SKILL.md must be
a literal file shipped inside the skill package.
9. Import command surfaces must route to the visual-type taxonomy instead of
- hardcoding a count that becomes stale when a type is added. README is the
- same surface by another route: it carries the count in prose a user reads
- before installing, so any count it states must equal the number of shipped
- type-*.md references.
+ hardcoding a count that becomes stale when a type is added. Counts in the
+ README, contribution guide, skill, and current references must equal the
+ number of shipped type-*.md references.
10. The High-Level reproducibility checklist must agree with its canvas formula
and retain sequential numbering.
11. The canonical dark Line example must keep the dark-skin tokens and canvas.
@@ -627,15 +626,13 @@ def check_factory_install_surface(errors: list[str], root: Path) -> None:
# adds a type, and is the one file such a PR has no reason to open. Both import
# commands were left at 27 while the selection table moved on.
# The phrasing varies, so match the count rather than the one sentence it went
-# stale in. Four forms carry it: the bare count standing in for the table
+# stale in. Direct forms include the bare count standing in for the table
# (`one of the 27`), a count attached to the taxonomy noun with room for
-# adjectives between, in either order (`28 visual types`, `28 supported visual
-# diagram types`, `28 types of visual diagrams`), a count bound to the noun as
-# a hyphenated modifier (`39-type catalog`), and a count quantifying the whole
-# set (`all 39 diagrams`). The first three insist on that noun so an unrelated
-# quantity — `accepts 2 file types` — is not rejected by a gate about the
-# visual taxonomy. The last two are checked only in a sentence with a nearby
-# visual-taxonomy cue (`catalog`, `gallery`, `render`, `shipped`, and so on),
+# adjectives between (`28 supported visual diagram types`, `28 types of visual
+# diagrams`), and the selection heading (`Visual-type guide (44)`). Contextual
+# forms include a hyphenated modifier (`39-type catalog`) and a count of the
+# whole set (`all 39 diagrams`). They require a nearby visual-taxonomy cue
+# (`catalog`, `gallery`, `render`, `shipped`, and so on),
# so ordinary prose such as `a 10-type taxonomy` and `all 12 diagrams in the
# appendix` remains valid while the README's stale phrases stay covered.
#
@@ -652,8 +649,9 @@ _COUNT_CONTEXT = r"visual|catalog|gallery|render(?:er|ing)?|example|shipped|stat
_COUNT_SENTENCE = rf"[^.!?\n]*\b(?:{_COUNT_CONTEXT})\b"
HARDCODED_COUNT_RE = re.compile(
r"one\s+of\s+(?:the\s+)?\d+\b"
- r"|\b\d+\s+(?:[\w-]+\s+){0,2}?(?:visual|diagram)[\s-]+types?\b"
+ r"|(?<!§)\b\d+\s+(?:[\w-]+\s+){0,2}?(?:visual|diagram)[\s-]+types?\b"
r"|\b\d+\s+types?\s+of\s+(?:[\w-]+\s+){0,2}?diagrams?\b"
+ r"|\bvisual-type\s+guide\s*\(\s*\d+\s*\)"
rf"|(?={_COUNT_SENTENCE})[^.!?\n]*?\b\d+-type\b"
rf"|(?={_COUNT_SENTENCE})[^.!?\n]*?\ball\s+\d+\s+diagrams?\b",
re.IGNORECASE,
@@ -663,15 +661,16 @@ COUNT_SURFACES = (
Path("commands/import-mermaid.md"),
Path("commands/import-excalidraw.md"),
Path("README.md"),
+ Path("CONTRIBUTING.md"),
+ Path("skills/diagram-design/SKILL.md"),
+ Path("skills/diagram-design/references/onboarding.md"),
+ Path("skills/diagram-design/references/semantic-patterns.md"),
)
-# README is the one surface allowed to state the count, because a reader
-# deciding whether to install wants the number. It is held to the shipped
-# count instead: every numeral README attaches to the taxonomy must equal the
-# number of type-*.md references, so adding a type without updating README
-# fails here rather than leaving the number stale. Commands stay count-free.
-VERIFIED_COUNT_SURFACES = frozenset({Path("README.md")})
+# Reader-facing docs may state the count, but it must match the shipped type
+# references. Import commands stay count-free and route to SKILL.md instead.
+VERIFIED_COUNT_SURFACES = frozenset(COUNT_SURFACES[3:])
TYPE_REFERENCE_GLOB = "skills/diagram-design/references/type-*.md"
@@ -680,8 +679,7 @@ def shipped_type_count(root: Path) -> int:
def check_type_counts(errors: list[str], root: Path) -> None:
- """No command may write the visual-type count as a numeral; README may
- only write the shipped count."""
+ """Commands stay count-free; reader-facing docs use the shipped count."""
shipped = shipped_type_count(root)
for relative in COUNT_SURFACES:
path = root / relative
diff --git a/skills/diagram-design/references/onboarding.md b/skills/diagram-design/references/onboarding.md
index c9ed665..8ba2f9f 100644
--- a/skills/diagram-design/references/onboarding.md
+++ b/skills/diagram-design/references/onboarding.md
@@ -161,7 +161,7 @@ Write the new tokens to `style-guide.md`. Suggest running the `/regenerate-examp
After onboarding, the user should:
-1. Open `assets/index.html` (gallery) and confirm the new palette feels coherent across all 44 types.
+1. Open `assets/index.html` (gallery) and confirm the new palette feels coherent across all 44 visual types.
2. If any type looks off, they usually need to tune `muted` (often too dark or too light against the new `paper`).
---