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(type): add service blueprint visual type (#360)
Matt Van Horn9dcaff87fcdd
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonindex da88ea9..f5d492b 100644--- a/.claude-plugin/marketplace.json+++ b/.claude-plugin/marketplace.json@@ -1,7 +1,7 @@{"name": "diagram-design","metadata": {- "description": "Architecture, architecture delta, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar, loop, nested, tree, org chart, layer stack, exploded/plan, 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, journey, deployment, dependency graph, UML class, story map, DB schema, lifecycle phases."+ "description": "Architecture, architecture delta, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar, loop, nested, tree, org chart, layer stack, exploded/plan, 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, journey, deployment, dependency, blueprint, UML class, story map, schema, lifecycle phase."},"owner": {"name": "Cathryn Lavery"diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonindex 71f6b24..e979375 100644--- a/.claude-plugin/plugin.json+++ b/.claude-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "diagram-design",- "description": "Architecture, architecture delta, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar, loop, nested, tree, org chart, layer stack, exploded/plan, 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, journey, deployment, dependency graph, UML class, story map, DB schema, lifecycle phases.",+ "description": "Architecture, architecture delta, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar, loop, nested, tree, org chart, layer stack, exploded/plan, 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, journey, deployment, dependency, blueprint, UML class, story map, schema, lifecycle phase.","version": "2.6.81","author": {"name": "Cathryn Lavery",diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.jsonindex 8ddee58..f425b42 100644--- a/.codex-plugin/plugin.json+++ b/.codex-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "diagram-design",- "description": "Architecture, architecture delta, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar, loop, nested, tree, org chart, layer stack, exploded/plan, 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, journey, deployment, dependency graph, UML class, story map, DB schema, lifecycle phases.",+ "description": "Architecture, architecture delta, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar, loop, nested, tree, org chart, layer stack, exploded/plan, 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, journey, deployment, dependency, blueprint, UML class, story map, schema, lifecycle phase.","version": "2.6.81","author": {"name": "Cathryn Lavery",@@ -26,7 +26,7 @@"interface": {"displayName": "Diagram Design","shortDescription": "Create editorial diagrams",- "longDescription": "Diagram Design turns a description of your system, process, or data into an editorial diagram that matches your brand. Editorial diagrams your designer won't hate. No Figma. No generic rounded boxes. No 30-minute color-picking sessions.\n\nDescribe what you need and get a self-contained HTML file with inline SVG that opens in any browser and exports to SVG or PNG. Point it at your website once and it reads your colors and fonts, so every diagram looks like the rest of your site. It also redraws draw.io, Mermaid, and Excalidraw files at the size and level of detail you choose.\n\nEvery node earns its place. The accent color is reserved for the one or two things the reader should look at first.\n\n44 diagram types: architecture, architecture delta, 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, exploded axonometric, axonometric site/floor plan, Venn, pyramid/funnel, treemap and marimekko, heatmap, bar and dumbbell, waterfall, line (slopegraph, ridgeline, streamgraph, bump), Gantt and scatter charts (bubble, beeswarm), 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, and database schema. Plus lifecycle phase maps, block decomposition trees, semantic patterns, callouts, accessible motion, and sketchy hand-drawn styling.",+ "longDescription": "Diagram Design turns a description of your system, process, or data into an editorial diagram that matches your brand. Editorial diagrams your designer won't hate. No Figma. No generic rounded boxes. No 30-minute color-picking sessions.\n\nDescribe what you need and get a self-contained HTML file with inline SVG that opens in any browser and exports to SVG or PNG. Point it at your website once and it reads your colors and fonts, so every diagram looks like the rest of your site. It also redraws draw.io, Mermaid, and Excalidraw files at the size and level of detail you choose.\n\nEvery node earns its place. The accent color is reserved for the one or two things the reader should look at first.\n\n45 diagram types: architecture, architecture delta, 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, exploded axonometric, axonometric site/floor plan, Venn, pyramid/funnel, treemap and marimekko, heatmap, bar and dumbbell, waterfall, line (slopegraph, ridgeline, streamgraph, bump), Gantt and scatter charts (bubble, beeswarm), high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, service blueprint, deployment, dependency graph, UML class, story map, and database schema. Plus lifecycle phase maps, block decomposition trees, semantic patterns, callouts, accessible motion, and sketchy hand-drawn styling.","developerName": "LittleMight","category": "Creativity","capabilities": [diff --git a/.factory-plugin/plugin.json b/.factory-plugin/plugin.jsonindex 71f6b24..e979375 100644--- a/.factory-plugin/plugin.json+++ b/.factory-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "diagram-design",- "description": "Architecture, architecture delta, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar, loop, nested, tree, org chart, layer stack, exploded/plan, 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, journey, deployment, dependency graph, UML class, story map, DB schema, lifecycle phases.",+ "description": "Architecture, architecture delta, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar, loop, nested, tree, org chart, layer stack, exploded/plan, 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, journey, deployment, dependency, blueprint, UML class, story map, schema, lifecycle phase.","version": "2.6.81","author": {"name": "Cathryn Lavery",diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex b458f19..7d24209 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -368,6 +368,16 @@ jobs:id: waterfall_testsrun: python scripts/test-verify-waterfall.py+ - name: Verify service-blueprint visibility line and stage grid+ if: always()+ id: service_blueprint+ run: python scripts/verify-service-blueprint.py --all++ - name: Verify service-blueprint checker+ if: always()+ id: service_blueprint_tests+ run: python scripts/test-verify-service-blueprint.py+- name: Verify ridgeline shared amplitudeif: always()id: ridgeline@@ -568,6 +578,8 @@ jobs:echo "| Sankey Checker | ${{ steps.sankey_tests.outcome == 'success' && '✅ Passed' || (steps.sankey_tests.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARYecho "| Waterfall Running-Total Conservation | ${{ steps.waterfall.outcome == 'success' && '✅ Passed' || (steps.waterfall.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARYecho "| Waterfall Checker | ${{ steps.waterfall_tests.outcome == 'success' && '✅ Passed' || (steps.waterfall_tests.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY+ echo "| Service Blueprint Visibility Line & Grid | ${{ steps.service_blueprint.outcome == 'success' && '✅ Passed' || (steps.service_blueprint.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARY+ echo "| Service Blueprint Checker | ${{ steps.service_blueprint_tests.outcome == 'success' && '✅ Passed' || (steps.service_blueprint_tests.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARYecho "| Ridgeline Shared Amplitude | ${{ steps.ridgeline.outcome == 'success' && '✅ Passed' || (steps.ridgeline.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARYecho "| Ridgeline Checker | ${{ steps.ridgeline_tests.outcome == 'success' && '✅ Passed' || (steps.ridgeline_tests.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARYecho "| Bubble Position & Area | ${{ steps.bubble.outcome == 'success' && '✅ Passed' || (steps.bubble.outcome == 'skipped' && '⏭️ Skipped' || '❌ Failed') }} |" >> $GITHUB_STEP_SUMMARYdiff --git a/.maintainer-policy.json b/.maintainer-policy.jsonindex cc4a07c..b26f9b9 100644--- a/.maintainer-policy.json+++ b/.maintainer-policy.json@@ -100,6 +100,8 @@"python3 scripts/test-verify-sankey.py","python3 scripts/verify-waterfall.py --all","python3 scripts/test-verify-waterfall.py",+ "python3 scripts/verify-service-blueprint.py --all",+ "python3 scripts/test-verify-service-blueprint.py","python3 scripts/verify-bubble.py --all","python3 scripts/test-verify-bubble.py","python3 scripts/verify-bump.py --all",diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 9c8e06c..fb5440f 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 44 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 45 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.@@ -91,6 +91,8 @@ Every validation gate below must pass before a PR is ready. They also run automa| Sankey checker behaves (pass + adversarial cases) | `python3 scripts/test-verify-sankey.py` || Waterfall running-total conservation and signed-bridge geometry | `python3 scripts/verify-waterfall.py --all` || Waterfall checker behaves (pass + adversarial cases) | `python3 scripts/test-verify-waterfall.py` |+| Service-blueprint visibility line, stage grid, and census | `python3 scripts/verify-service-blueprint.py --all` |+| Service-blueprint checker behaves (pass + adversarial cases) | `python3 scripts/test-verify-service-blueprint.py` || Bubble positions sit on shared axis scales and area encodes every declared size | `python3 scripts/verify-bubble.py --all` || Bubble checker behaves (pass + adversarial cases) | `python3 scripts/test-verify-bubble.py` || Bump vertices sit exactly on one rank grid and every endpoint label is placed on both axes | `python3 scripts/verify-bump.py --all` |@@ -191,6 +193,8 @@ python3 scripts/test-plugin-package.py \&& python3 scripts/test-verify-sankey.py \&& python3 scripts/verify-waterfall.py --all \&& python3 scripts/test-verify-waterfall.py \+ && python3 scripts/verify-service-blueprint.py --all \+ && python3 scripts/test-verify-service-blueprint.py \&& python3 scripts/verify-bubble.py --all \&& python3 scripts/test-verify-bubble.py \&& python3 scripts/verify-bump.py --all \@@ -207,7 +211,7 @@ python3 scripts/test-plugin-package.py \- **`verify-plugin-package.py`:** if it reports a version change, drop the manifest edits from your branch — versions are bumped on `main` after merge, never in a PR. If packaging validation fails, keep all native marketplaces pointed at the repository root and keep the shared skill at `skills/diagram-design/SKILL.md`.- **`lint-skin.py`:** the failure message names the file, line, and category (`color`, `font-family`, `a11y`, `external-asset`, `pure-black`, `script`). Colors must come from the palette in `skills/diagram-design/references/style-guide.md`; fonts from the allowed list; diagrams must satisfy the accessible SVG contract (see below). The linter also requires the SHA-pinned controller from `template-motion.html` verbatim and rejects remote resources, CSS `@import`, non-fragment CSS `url()`, event handlers, `srcdoc`, executable URLs, and extra scripts.- **`verify-*.py`:** the extractor's real behavior no longer matches its fixture or the documentation, or the reference/command/prompt wiring drifted. Fix the source of truth — do not widen a test to avoid a failure.-- **`verify-screenshot-freshness.py`:** a canonical minimal-light example or its committed PNG changed without a synchronized catalog refresh. Before the first regeneration, install the renderer with `python3 -m pip install playwright && python3 -m playwright install chromium`. Then run `python3 scripts/render-canonical-screenshots.py`, inspect all 44 renders, and commit the updated PNGs plus `docs/screenshots/manifest.json`. The gate hashes example sources in their canonical LF form, so a checkout that converts LF to CRLF still passes; `scripts/test-verify-screenshot-freshness.py` covers that case, real source drift, and raw PNG digests.+- **`verify-screenshot-freshness.py`:** a canonical minimal-light example or its committed PNG changed without a synchronized catalog refresh. Before the first regeneration, install the renderer with `python3 -m pip install playwright && python3 -m playwright install chromium`. Then run `python3 scripts/render-canonical-screenshots.py`, inspect all 45 renders, and commit the updated PNGs plus `docs/screenshots/manifest.json`. The gate hashes example sources in their canonical LF form, so a checkout that converts LF to CRLF still passes; `scripts/test-verify-screenshot-freshness.py` covers that case, real source drift, and raw PNG digests.- **`build-readme-thumbs.py --check`:** a README preview is missing, stale, corrupt, the wrong size, orphaned, or no longer links to its full PNG. Install the pinned renderer with `python3 -m pip install Pillow==12.1.1`, run `python3 scripts/build-readme-thumbs.py`, inspect the preview changes, and commit the WebPs plus `docs/screenshots/thumbs/manifest.json`.- **`verify-marimekko.py`:** a column is drawn off its category's share of the width, a segment off its series' share of the column, the columns do not share one plot height or one gutter, segments leave a gap or overlap, a series changes order between columns, a second segment wears the accent, anything positions a segment or a bound label from a `transform` attribute, an inline `style`, or a `<style>` rule, or a label, caption or key disagrees with the rect it binds. Fix the geometry or the declaration so they state one thing — never widen a column or pad a segment to fit a label, and never drop a category or a series to tidy the grid.- **`verify-slopegraph.py`:** the two axes disagree about scale or origin, or an endpoint is drawn somewhere other than where its own declared value belongs. Fix the coordinate, never the label — and never move a point to stop two endpoint labels colliding, because crowded labels mean the values really are close.diff --git a/README.md b/README.mdindex 9f1b34d..e155f71 100644--- a/README.md+++ b/README.md@@ -7,7 +7,7 @@</picture></h1>-**An agent skill that draws diagrams as one self-contained HTML + SVG file, in your brand.<br>44 diagram types. No shadows. No Mermaid slop.**+**An agent skill that draws diagrams as one self-contained HTML + SVG file, in your brand.<br>45 diagram types. No shadows. No Mermaid slop.**[](https://github.com/cathrynlavery/diagram-design/stargazers)[](https://skills.sh/cathrynlavery/diagram-design/diagram-design)@@ -218,7 +218,7 @@ The model already understood the content. What it was missing was taste, so I wr## What it makes-44 diagram types, each in three static variants: minimal light, minimal dark, and full-editorial. Open any of them directly in a browser. There is no build step, JavaScript, or external image dependency.+45 diagram types, each in three static variants: minimal light, minimal dark, and full-editorial. Open any of them directly in a browser. There is no build step, JavaScript, or external image dependency.<table><tr>@@ -294,7 +294,7 @@ The model already understood the content. What it was missing was taste, so I wr<tr><td align="center" width="33%"><a href="docs/screenshots/axonometric-plan.png"><img src="docs/screenshots/thumbs/axonometric-plan.webp" alt="Axonometric plan"></a><br><b>Axonometric plan</b><br><sub>Rooms and buildings on one plate</sub></td><td align="center" width="33%"><a href="docs/screenshots/heatmap.png"><img src="docs/screenshots/thumbs/heatmap.webp" alt="Heatmap"></a><br><b>Heatmap</b><br><sub>Value per row × column cell</sub></td>- <td align="center" width="33%"></td>+ <td align="center" width="33%"><a href="docs/screenshots/service-blueprint.png"><img src="docs/screenshots/thumbs/service-blueprint.webp" alt="Service blueprint"></a><br><b>Service blueprint</b><br><sub>Frontstage and backstage on a shared stage grid</sub></td></tr></table>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 e9bcd43..52acb79 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@@ -38,4 +38,6 @@ Behavior is a separate axis. The semantic patterns in `references/semantic-patte**2026-10-04 · the count is 44.** Axonometric plan was admitted under the same escape clause: boxes standing on one shared plate in their real positions, painted back to front by footprint, with tags on the rooms and roofs they name, is a layout grammar no existing type provides (exploded axonometric lifts parts of one object apart, nested has no geography, deployment is a logical topology). It ships the full §10 set and moves the canonical counters 43 → 44 together; see [ADR 0014](0014-axonometric-plan.md).+**2026-10-09 · the count is 45.** Service blueprint was admitted under the same escape clause: a shared stage grid with required customer / frontstage / backstage rows split by a line of visibility is a layout grammar no existing type provides (journey is a sentiment curve, swimlane is flow across owners, process is sequential handoffs, kanban is a state census, story map cuts on scope). It ships the full §10 set and moves the canonical counters 44 → 45 together; see [ADR 0015](0015-service-blueprint-is-a-visibility-line-grammar.md).+The decision itself is unchanged — semantic patterns still never add a type, and the count still moves only for a new *layout* grammar. What this amendment records is the procedure: the two counters are this ADR's enforcement, so a PR that edits them without amending this file has quietly made itself the authority. Amend here in the same PR, or the number in the test is just whatever the last contributor typed.diff --git a/docs/adr/0015-service-blueprint-is-a-visibility-line-grammar.md b/docs/adr/0015-service-blueprint-is-a-visibility-line-grammar.mdnew file mode 100644index 0000000..b29e311--- /dev/null+++ b/docs/adr/0015-service-blueprint-is-a-visibility-line-grammar.md@@ -0,0 +1,32 @@+# ADR 0015 — Service blueprint is a visibility-line grammar++**Status:** accepted++## Context++A journey map already shows what a person *does* and how it *feels*. The other half of the same story — what the service does in front of the customer, what stays hidden, and which support processes hold it up — had no layout grammar. ADR 0002 sets the bar for growth: a new type is justified only when a genuinely new **layout grammar** appears; a new *behavior* is a semantic pattern routed onto an existing type.++The nearest candidates were audited against that bar:++- **User journey** — the load-bearing element is a sentiment curve. No visibility line, no backstage layer, one persona's feelings.+- **Swimlane** — the load-bearing element is flow across owner lanes. Arrows are the claim. No stage census, no visibility line.+- **Process** — sequential nodes and data handoffs. No layered split of what is onstage vs offstage.+- **Kanban** — state census in columns, deliberately no connectors. Closest cousin structurally, but columns are *states*, not narrative stages, and there is no visibility line.+- **Story map** — narrative backbone × release slices. The cut line is scope, not visibility.+- **Layer stack** — abstraction bands with no stage columns.++No existing grammar forces (a) stages as equal columns, (b) required customer / frontstage / backstage rows, and (c) a visibility line that is the figure. Those three constraints *are* the figure.++## Decision++Add **Service blueprint** as visual type #45 with the full §10 shipping set: `references/type-service-blueprint.md`, the three example variants, a gallery tab, the selection-table row and frontmatter hook, a §7 budget row (6 stages, required customer/frontstage/backstage, optional evidence/support, 1 focal cell), the canonical screenshot, and an executable contract.++The grammar is declared, not inferred: each layer group states `data-layer`, each cell states `data-stage` and `data-name`, and the visibility line states `data-role="visibility"`. `scripts/verify-service-blueprint.py` fails on layer order, visibility placement and contrast, stage-grid alignment, census, focal count, budget, printed-label drift, or CSS-moved marks; `scripts/test-verify-service-blueprint.py` proves both polarities per ADR 0005.++v1 draws no connector arrows. Stage order is the sequence; wait times and system names are cell text. That is a scoped departure from swimlane, not a missing feature of it.++## Consequences++- The verifiable count moves to 45 in `verify-docs-sync.py`, `verify-semantic-motion.py`, the screenshot catalog scripts, and ADR 0002's amendment log — a conscious edit, by design.+- Native plugin descriptions pay the 500-character Cowork cap with a `blueprint` alias (and a short trim of `dependency graph` → `dependency`), matching the ADR 0014 precedent. SKILL.md frontmatter and the Codex `longDescription` keep the full name.+- `type-journey.md`, `type-swimlane.md`, and `type-process.md` each gain a one-line "Not this type" pointer so the router stays unambiguous in both directions.diff --git a/docs/pr-previews/service-blueprint/service-blueprint-dark.png b/docs/pr-previews/service-blueprint/service-blueprint-dark.pngnew file mode 100644index 0000000..98ab266Binary files /dev/null and b/docs/pr-previews/service-blueprint/service-blueprint-dark.png differdiff --git a/docs/pr-previews/service-blueprint/service-blueprint-full.png b/docs/pr-previews/service-blueprint/service-blueprint-full.pngnew file mode 100644index 0000000..369fea9Binary files /dev/null and b/docs/pr-previews/service-blueprint/service-blueprint-full.png differdiff --git a/docs/pr-previews/service-blueprint/service-blueprint-light.png b/docs/pr-previews/service-blueprint/service-blueprint-light.pngnew file mode 100644index 0000000..d8ed1b8Binary files /dev/null and b/docs/pr-previews/service-blueprint/service-blueprint-light.png differdiff --git a/docs/screenshots/manifest.json b/docs/screenshots/manifest.jsonindex 20b7084..2987d3d 100644--- a/docs/screenshots/manifest.json+++ b/docs/screenshots/manifest.json@@ -362,6 +362,15 @@"width": 2560,"height": 1110},+ {+ "slug": "service-blueprint",+ "source": "skills/diagram-design/assets/example-service-blueprint.html",+ "screenshot": "docs/screenshots/service-blueprint.png",+ "source_sha256": "e7c29fa4e09c5a7cff1ec75ee2310e3f1d623f4df80854dc2d72a2dd87c31c87",+ "screenshot_sha256": "abc6eb3aa96281f821749dcb7983e77084db1257bd5d6d848a0172677346fce9",+ "width": 2560,+ "height": 1442+ },{"slug": "deployment","source": "skills/diagram-design/assets/example-deployment.html",diff --git a/docs/screenshots/service-blueprint.png b/docs/screenshots/service-blueprint.pngnew file mode 100644index 0000000..f080f57Binary files /dev/null and b/docs/screenshots/service-blueprint.png differdiff --git a/docs/screenshots/thumbs/manifest.json b/docs/screenshots/thumbs/manifest.jsonindex e2a93e8..82a30c6 100644--- a/docs/screenshots/thumbs/manifest.json+++ b/docs/screenshots/thumbs/manifest.json@@ -321,6 +321,15 @@"quality": 82,"thumb_sha256": "6df85f1cf5744e9a8122519344a3eb9169bfaf2290b82f5ff8dfcbbedbb4d470"},+ {+ "thumb": "service-blueprint.webp",+ "source": "docs/screenshots/service-blueprint.png",+ "source_sha256": "abc6eb3aa96281f821749dcb7983e77084db1257bd5d6d848a0172677346fce9",+ "width": 600,+ "height": 338,+ "quality": 82,+ "thumb_sha256": "596cc7b26023a39ac6fcf45ad84e24f3a4745db8eb9f66b08aa696f7abbdd176"+ },{"thumb": "state.webp","source": "docs/screenshots/state.png",diff --git a/docs/screenshots/thumbs/service-blueprint.webp b/docs/screenshots/thumbs/service-blueprint.webpnew file mode 100644index 0000000..523e55aBinary files /dev/null and b/docs/screenshots/thumbs/service-blueprint.webp differdiff --git a/scripts/render-canonical-screenshots.py b/scripts/render-canonical-screenshots.pyindex 611b103..b12ee62 100644--- a/scripts/render-canonical-screenshots.py+++ b/scripts/render-canonical-screenshots.py@@ -1,5 +1,5 @@#!/usr/bin/env python3-"""Render the 44 canonical minimal-light examples and record their digests."""+"""Render the canonical minimal-light examples and record their digests."""from __future__ import annotations@@ -22,8 +22,8 @@ from screenshot_catalog import (def main() -> int:slugs = canonical_slugs()- if len(slugs) != 44 or len(slugs) != len(set(slugs)):- raise SystemExit(f"expected 44 unique canonical types; found {len(slugs)}")+ if len(slugs) != 45 or len(slugs) != len(set(slugs)):+ raise SystemExit(f"expected 45 unique canonical types; found {len(slugs)}")SCREENSHOT_DIR.mkdir(parents=True, exist_ok=True)entries: list[dict[str, object]] = []diff --git a/scripts/test-verify-service-blueprint.py b/scripts/test-verify-service-blueprint.pynew file mode 100644index 0000000..4ef09d4--- /dev/null+++ b/scripts/test-verify-service-blueprint.py@@ -0,0 +1,327 @@+#!/usr/bin/env python3+"""Adversarial tests for verify-service-blueprint.py — both polarities.++Per ADR 0005, a geometric contract in this repo is a checker plus fixtures+that prove it fires when it should and stays quiet when it shouldn't. Every+mutation below is a blueprint that still renders perfectly — the defects are+layer, visibility, grid, and census lies, which is exactly what no other gate+reads.++Usage: python3 scripts/test-verify-service-blueprint.py+Exit: 0 all pass, 1 a case failed.+"""++from __future__ import annotations++import subprocess+import sys+import tempfile+from pathlib import Path++ROOT = Path(__file__).resolve().parent.parent+CHECKER = ROOT / "scripts/verify-service-blueprint.py"+GOOD = ROOT / "skills/diagram-design/assets/example-service-blueprint.html"+SHIPPED = sorted(GOOD.parent.glob("example-service-blueprint*.html"))+++def run(*args: str, timeout: float | None = None) -> tuple[int, str]:+ result = subprocess.run(+ [sys.executable, str(CHECKER), *args],+ capture_output=True,+ timeout=timeout,+ text=True,+ encoding="utf-8",+ errors="replace",+ )+ return result.returncode, (result.stdout or "") + (result.stderr or "")+++def write(directory: Path, name: str, source: str) -> Path:+ path = directory / name+ path.write_text(source, encoding="utf-8")+ return path+++def main() -> int:+ source = GOOD.read_text(encoding="utf-8")+ failures: list[str] = []++ for path in SHIPPED:+ code, output = run(str(path))+ if code != 0:+ failures.append(f"shipped example failed: {path.name}\n{output}")+ else:+ print(f"OK: shipped {path.name} passes")+ code, output = run("--all")+ if code != 0:+ failures.append(f"--all failed on the shipped set\n{output}")+ else:+ print("OK: --all passes on the shipped set")++ cases = (+ (+ "swap two layers: customer and frontstage labels trade places",+ 'data-layer="customer"',+ 'data-layer="frontstage-hold"',+ "layer order",+ True,+ ),+ (+ "drop the visibility line",+ '<line x1="96" y1="268" x2="1200" y2="268" stroke="rgba(45,49,66,0.55)" stroke-width="2" data-role="visibility"/>',+ "",+ "visibility",+ False,+ ),+ (+ "put the visibility line above the customer row",+ '<line x1="96" y1="268" x2="1200" y2="268" stroke="rgba(45,49,66,0.55)" stroke-width="2" data-role="visibility"/>',+ '<line x1="96" y1="50" x2="1200" y2="50" stroke="rgba(45,49,66,0.55)" stroke-width="2" data-role="visibility"/>',+ "visibility",+ False,+ ),+ (+ "shift one cell off its column",+ '<rect x="544" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="hit-limit" data-name="Retry payment"/>',+ '<rect x="568" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="hit-limit" data-name="Retry payment"/>',+ "stage grid",+ False,+ ),+ (+ "drop a backstage cell",+ '<rect x="96" y="272" width="208" height="64" rx="4" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="sign-up" data-name="CRM write"/>',+ "",+ "census",+ False,+ ),+ (+ "two focal cells",+ 'data-stage="sign-up" data-name="Welcome"',+ 'data-stage="sign-up" data-name="Welcome" data-focal="true"',+ "focal",+ False,+ ),+ (+ "seven stages",+ '<rect x="96" y="24" width="208" height="48" fill="none" data-stage="sign-up"/>',+ '<rect x="96" y="24" width="208" height="48" fill="none" data-stage="sign-up"/>\n'+ ' <rect x="96" y="24" width="208" height="48" fill="none" data-stage="extra-six"/>\n'+ ' <rect x="96" y="24" width="208" height="48" fill="none" data-stage="extra-seven"/>',+ "at most 6 stages",+ False,+ ),+ (+ "CSS translate on a cell",+ " </style>",+ ' [data-name] { transform: translateY(80px); }\n </style>',+ "CSS 'transform' declaration",+ False,+ ),+ (+ "move one customer cell below the visibility line",+ '<rect x="544" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="hit-limit" data-name="Retry payment"/>',+ '<rect x="544" y="400" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="hit-limit" data-name="Retry payment"/>',+ "visibility: customer cell 'Retry payment'",+ False,+ ),+ (+ "widen one cell into the next stage",+ '<rect x="544" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="hit-limit" data-name="Retry payment"/>',+ '<rect x="544" y="128" width="400" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="hit-limit" data-name="Retry payment"/>',+ "runs past its stage column",+ False,+ ),+ (+ "transparent visibility line",+ 'stroke-width="2" data-role="visibility"/>',+ 'stroke-width="2" opacity="0" data-role="visibility"/>',+ "visibility: stroke contrast",+ False,+ ),+ (+ "second cell painted with the accent but no data-focal",+ 'fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="sign-up" data-name="CRM write"',+ 'fill="rgba(191,69,32,0.12)" stroke="#bf4520" stroke-width="1" data-stage="sign-up" data-name="CRM write"',+ "painted with the accent",+ False,+ ),+ (+ "cell label moved by a transform",+ '<text x="648" y="164"',+ '<text x="648" y="164" transform="translate(0,500)"',+ "text carries transform",+ False,+ ),+ (+ "stage header moved by a transform",+ '<rect x="96" y="24" width="208" height="48" fill="none" data-stage="sign-up"/>',+ '<rect x="96" y="24" width="208" height="48" fill="none" data-stage="sign-up" transform="translate(40,0)"/>',+ "stage header carries transform",+ False,+ ),+ (+ "cell label inside a translated group",+ '<text x="648" y="164"',+ '<g transform="translate(0,500)"><text x="648" y="164"',+ "text carries ancestor transform",+ False,+ ),+ (+ "printed text disagrees with data-name",+ ">Retry payment</text>",+ ">Call support</text>",+ "printed",+ False,+ ),+ (+ "cell widened by an inline CSS width",+ '<rect x="544" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="hit-limit" data-name="Retry payment"/>',+ '<rect x="544" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="hit-limit" data-name="Retry payment" style="width:400px"/>',+ "sets its size in CSS",+ False,+ ),+ (+ "cells stretched by a stylesheet height",+ " </style>",+ " rect[data-stage] { height: 300px; }\n </style>",+ "CSS 'height' declaration can resize",+ False,+ ),+ (+ "classed cell widened from the stylesheet",+ '<rect x="544" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="hit-limit" data-name="Retry payment"/>',+ '<rect x="544" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="hit-limit" data-name="Retry payment" class="wide"/><style>.wide { width: 400px; }</style>',+ "CSS 'width' declaration can resize",+ False,+ ),+ (+ "cell widened by a selector with a quoted space",+ " </style>",+ ' rect[data-name="Retry payment"] { width: 400px; }\n </style>',+ "CSS 'width' declaration can resize",+ False,+ ),+ (+ "cells widened through :is()",+ " </style>",+ " :is(rect, circle) { width: 400px; }\n </style>",+ "CSS 'width' declaration can resize",+ False,+ ),+ (+ "cells widened by an attribute selector with a hash in its value",+ " </style>",+ ' [fill="#ffffff"] { width: 400px; }\n </style>',+ "CSS 'width' declaration can resize",+ False,+ ),+ )++ with tempfile.TemporaryDirectory() as tmp:+ directory = Path(tmp)+ mutated = source+ # First case is a two-step swap.+ step = mutated.replace('data-layer="customer"', 'data-layer="frontstage-hold"', 1)+ step = step.replace('data-layer="frontstage"', 'data-layer="customer"', 1)+ step = step.replace('data-layer="frontstage-hold"', 'data-layer="frontstage"', 1)+ name, _old, _new, fragment, _ = cases[0]+ if step == mutated:+ failures.append(f"could not build the {name!r} fixture")+ else:+ path = write(directory, "swap-layers.html", step)+ code, output = run(str(path))+ if code == 0 or fragment not in output:+ failures.append(+ f"{name}: expected a finding containing {fragment!r}, got:\n{output}"+ )+ else:+ print(f"OK: {name} fails by name")++ for name, old, new, fragment, _swap in cases[1:]:+ if old not in mutated:+ failures.append(f"could not build the {name!r} fixture (anchor missing)")+ continue+ path = write(directory, name.replace(" ", "-") + ".html", mutated.replace(old, new, 1))+ code, output = run(str(path))+ if code == 0 or fragment not in output:+ failures.append(+ f"{name}: expected a finding containing {fragment!r}, got:\n{output}"+ )+ else:+ print(f"OK: {name} fails by name")++ # Sizing HTML around the figure is page layout, not a mark, even when+ # the selector uses an attribute.+ wrapper = source.replace(+ " </style>", ' div[class="diagram-container"] { width: 100%; }\n </style>', 1+ )+ if wrapper == source:+ failures.append("could not build the HTML-wrapper fixture")+ else:+ code, output = run(str(write(directory, "html-wrapper-width.html", wrapper)))+ if code != 0:+ failures.append(f"HTML-only attribute selector was rejected:\n{output}")+ else:+ print("OK: HTML-only attribute selector passes")++ # Alternatives inside :is() that only name HTML are page layout too.+ is_wrapper = source.replace(+ " </style>",+ ' :is(div[class="diagram-container"], section) { width: 100%; }\n </style>',+ 1,+ )+ code, output = run(str(write(directory, "html-is-wrapper-width.html", is_wrapper)))+ if code != 0:+ failures.append(f":is() over HTML-only alternatives was rejected:\n{output}")+ else:+ print("OK: :is() over HTML-only alternatives passes")++ # An escaped quote inside an attribute value does not end the value.+ escaped_wrapper = source.replace(+ " </style>", ' [data-note="6\\" preview"].frame { width: 100%; }\n </style>', 1+ )+ code, output = run(str(write(directory, "escaped-quote-wrapper.html", escaped_wrapper)))+ if code != 0:+ failures.append(f"escaped-quote wrapper rule was rejected:\n{output}")+ else:+ print("OK: escaped-quote wrapper rule passes")++ # Every column widened past the spacing: the gutters stay equal but+ # are negative, so neighbouring stages overlap.+ overlap = source.replace('width="208"', 'width="240"').replace(+ 'x2="1200" y2="268"', 'x2="1232" y2="268"'+ )+ if overlap == source:+ failures.append("could not build the overlapping-columns fixture")+ else:+ code, output = run(str(write(directory, "overlapping-columns.html", overlap)))+ if code == 0 or "columns overlap" not in output:+ failures.append(f"overlapping columns: expected 'columns overlap', got:\n{output}")+ else:+ print("OK: overlapping columns fail by name")++ # Single-quoted attributes are valid SVG; a cell written that way+ # must still be checked. Evidence cells are not in the census, so a+ # skipped one could sit below the line without any finding.+ retry = '<rect x="96" y="80" width="208" height="48" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="sign-up" data-name="Welcome email"/>'+ moved = retry.replace('y="80"', 'y="400"').replace('"', "'")+ if retry not in source:+ failures.append("could not build the single-quoted-cell fixture (anchor missing)")+ else:+ code, output = run(str(write(directory, "single-quoted-cell.html", source.replace(retry, moved, 1))))+ if code == 0 or "visibility: evidence cell 'Welcome email'" not in output:+ failures.append(f"single-quoted cell: expected a visibility finding, got:\n{output}")+ else:+ print("OK: single-quoted cell below the line fails by name")++ if failures:+ print("FAIL")+ for item in failures:+ print(item)+ return 1+ print("OK service-blueprint verifier: shipped files pass, named mutations fail")+ return 0+++if __name__ == "__main__":+ sys.exit(main())diff --git a/scripts/test-verify-streamgraph.py b/scripts/test-verify-streamgraph.pyindex 4bdcfb3..ae9a922 100644--- a/scripts/test-verify-streamgraph.py+++ b/scripts/test-verify-streamgraph.py@@ -316,9 +316,37 @@ def run_cases(h):name="figure.html",)+ # A renamed chart whose band paths declare data-layer but drop+ # data-values is still claimed by its markup; the missing values are the+ # finding, so the file must not slip out of scope.+ h.expect_finding(+ "renamed layer paths missing data-values fail closed, not skipped",+ PLAIN_HEAD.replace("<title>t</title>", "<title>Build minutes by team</title>")+ + ' <path data-layer="Docs" d="M 80 230 L 160 230 Z" fill="#2d3142"/>\n'+ + ' <path data-layer="Unit" d="M 80 240 L 160 240 Z" fill="#4f5d75"/>\n'+ + TAIL,+ r"presents as a streamgraph but declares 0 verifiable layer",+ name="figure.html",+ )++ # The same row grouping a service blueprint uses (data-layer on <g>) does+ # not claim a file on its own.+ h.expect_out_of_scope(+ "data-layer on row groups alone does not claim the file",+ PLAIN_HEAD+ + ' <g data-layer="customer"><rect x="0" y="0" width="4" height="4"/></g>\n'+ + TAIL,+ "figure.html",+ )+# The detector must not drag the other example types into scope.+ # Service blueprint reuses data-layer on row groups; those files must+ # stay out of scope because no band mark carries data-layer.for other in ("example-line.html", "example-slopegraph.html",- "example-sankey.html", "example-treemap.html"):+ "example-sankey.html", "example-treemap.html",+ "example-service-blueprint.html",+ "example-service-blueprint-dark.html",+ "example-service-blueprint-full.html"):path = ROOT / "skills/diagram-design/assets" / otherif path.exists():h.expect_out_of_scope(diff --git a/scripts/verify-docs-sync.py b/scripts/verify-docs-sync.pyindex d25f58b..f6065bd 100644--- a/scripts/verify-docs-sync.py+++ b/scripts/verify-docs-sync.py@@ -65,7 +65,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 = 44+VISUAL_TYPE_COUNT = 45AGENT_SKILLS_DESCRIPTION_MAX = 1024PLUGIN_DESCRIPTION_MAX = 500# Types whose selection-table name differs from its description vocabulary.@@ -78,6 +78,8 @@ DESCRIPTION_ALIASES = {"exploded axonometric": "exploded","axonometric plan": "plan","user journey": "journey",+ "service blueprint": "blueprint",+ "dependency graph": "dependency",}DISCOVERY_HOOKS = ("lifecycle phase",)ROUTING_SURFACES = {diff --git a/scripts/verify-screenshot-freshness.py b/scripts/verify-screenshot-freshness.pyindex a14b567..bc74351 100644--- a/scripts/verify-screenshot-freshness.py+++ b/scripts/verify-screenshot-freshness.py@@ -21,8 +21,8 @@ from screenshot_catalog import (def main() -> int:errors: list[str] = []slugs = canonical_slugs()- if len(slugs) != 44 or len(slugs) != len(set(slugs)):- errors.append(f"expected 44 unique canonical types; found {len(slugs)}")+ if len(slugs) != 45 or len(slugs) != len(set(slugs)):+ errors.append(f"expected 45 unique canonical types; found {len(slugs)}")if not MANIFEST.is_file():errors.append("docs/screenshots/manifest.json is missing")@@ -97,7 +97,7 @@ def main() -> int:for error in errors:print(f" - {error}")return 1- print("OK screenshot freshness: 44 canonical sources and PNG digests match")+ print("OK screenshot freshness: 45 canonical sources and PNG digests match")return 0diff --git a/scripts/verify-semantic-motion.py b/scripts/verify-semantic-motion.pyindex 819dbe4..cc09250 100644--- a/scripts/verify-semantic-motion.py+++ b/scripts/verify-semantic-motion.py@@ -28,7 +28,7 @@ ANIMATION = ROOT / "skills/diagram-design/references/animation.md"EXAMPLE = ROOT / "skills/diagram-design/assets/example-policy-trace-animated.html"ADR_0002 = ROOT / "docs/adr/0002-semantic-patterns-do-not-expand-the-taxonomy.md"MAX_SKILL_BYTES = 40_000-VISUAL_TYPE_COUNT = 44+VISUAL_TYPE_COUNT = 45PATTERN_NAMES = ("Fan-in queue / bottleneck",diff --git a/scripts/verify-service-blueprint.py b/scripts/verify-service-blueprint.pynew file mode 100644index 0000000..a41b59e--- /dev/null+++ b/scripts/verify-service-blueprint.py@@ -0,0 +1,972 @@+#!/usr/bin/env python3+"""Verify the invariants a service blueprint can silently break.++A service blueprint's whole claim is a **shared stage grid split by a line of+visibility**: customer and frontstage sit above it, backstage (and support)+sit below it. Every way of breaking that claim still renders — nothing errors,+and neither `lint-skin.py` nor `verify-geometry.py` reads a cell against the+layer it belongs to or a stage header against the column it occupies.++Each layer group declares `data-layer`, each cell declares `data-stage` plus+`data-name`, and the visibility line declares `data-role="visibility"`. The+checker holds the drawing to those declarations:++1. LAYER ORDER — optional evidence, then customer, frontstage, backstage, then+ optional support, top to bottom. A missing required layer, a duplicate, or+ a row in the wrong vertical order fails closed.+2. VISIBILITY — exactly one `data-role="visibility"` line, spanning the plot,+ sitting between the frontstage row bottom and the backstage row top (±2px),+ with every evidence / customer / frontstage cell above it and every+ backstage / support cell below it, and a stroke that clears 3:1 against+ paper once rgba alpha, `stroke-opacity`, and `opacity` are combined.+3. STAGE GRID — every cell sits inside its stage header's column (left and+ right edge); column widths equal; gutters equal.+4. CENSUS — every stage has a customer, frontstage, and backstage cell. Empty+ is allowed only with an explicit `—` / `Not applicable` `data-name`.+5. FOCAL — at most one `data-focal="true"` cell, and no other row mark+ painted with the accent.+6. BUDGET — at most 6 stages; no extra `data-layer` values.+7. PRINT — each cell's visible text contains its `data-name`.+8. NO CSS MOTION OF MARKS — `transform` / geometry properties in attributes,+ inline style, or `<style>`, on cells, stage headers, rule lines, and text,+ or on any group that contains them.++Usage:+ python3 scripts/verify-service-blueprint.py --all+ python3 scripts/verify-service-blueprint.py skills/diagram-design/assets/example-service-blueprint.html++Exit: 0 clean, 1 findings, 2 usage.+"""++from __future__ import annotations++import argparse+import math+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)+LINE_RE = re.compile(r"<line\b(?P<attrs>[^>]*?)/?>", re.IGNORECASE)+TEXT_RE = re.compile(+ r"<text\b(?P<attrs>[^>]*)>(?P<body>.*?)</text>", re.IGNORECASE | re.DOTALL+)+# Both quote styles are valid SVG; a skipped attribute would hide a mark+# from every check.+ATTR_RE = re.compile(r"""(?P<name>[\w:-]+)\s*=\s*(?:"(?P<dq>[^"]*)"|'(?P<sq>[^']*)')""")+TAG_RE = re.compile(r"<[^>]+>")+# CSS width/height redraw a rect at a size its attributes do not state.+CSS_SIZE_RE = re.compile(r"(?:^|[{;}\n])\s*(?P<prop>width|height)\s*:", re.IGNORECASE)+COMMENT_CSS_RE = re.compile(r"/\*.*?\*/", re.DOTALL)+CSS_RULE_RE = re.compile(r"(?P<selector>[^{}]+)\{(?P<body>[^{}]*)\}")+SVG_MARK_ELEMENTS = frozenset(+ {"rect", "line", "text", "tspan", "g", "path", "polygon", "polyline", "circle", "ellipse", "use"}+)+SVG_MARK_TAG_RE = re.compile(+ r"<(?:rect|line|text|tspan|g|path|polygon|polyline|circle|ellipse|use)\b[^>]*>", re.IGNORECASE+)+SVG_TOKEN_RE = re.compile(r"""\b(?:class|id)\s*=\s*(?:"([^"]*)"|'([^']*)')""")+COMMENT_RE = re.compile(r"<!--.*?-->", re.DOTALL)+GROUP_OPEN_RE = re.compile(r"<(?:g|svg)\b(?P<attrs>[^>]*?)(?P<selfclose>/?)>", re.IGNORECASE)+GROUP_CLOSE_RE = re.compile(r"</(?:g|svg)\s*>", re.IGNORECASE)+STYLE_RE = re.compile(r"<style\b[^>]*>(?P<body>.*?)</style>", re.IGNORECASE | re.DOTALL)+CSS_MOVES_MARK_RE = re.compile(+ r"(?:^|[{;}\n])\s*(?:-(?:webkit|moz|ms|o)-)?"+ r"(?P<prop>transform|translate|rotate|scale|x|y"+ r"|offset(?:-(?:path|distance|position|anchor|rotate))?)\s*:",+ re.IGNORECASE,+)+RGBA_RE = re.compile(+ r"rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)", re.IGNORECASE+)+HEX_RE = re.compile(r"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$")+PAPER_RE = re.compile(r"--color-paper\s*:\s*(#[0-9a-fA-F]{6})")+ACCENT_RE = re.compile(r"--color-accent\s*:\s*(#[0-9a-fA-F]{6})")+TEXT_OPEN_RE = re.compile(r"<text\b(?P<attrs>[^>]*)>", re.IGNORECASE)+STYLE_PAINT_RE = re.compile(+ r"(?:^|;)\s*(?P<prop>opacity|stroke-opacity|stroke|stroke-width|display|visibility)\s*:",+ re.IGNORECASE,+)++CANONICAL_LAYERS = ("evidence", "customer", "frontstage", "backstage", "support")+REQUIRED_LAYERS = ("customer", "frontstage", "backstage")+VISIBLE_LAYERS = frozenset({"evidence", "customer", "frontstage"})+HIDDEN_LAYERS = frozenset({"backstage", "support"})+EMPTY_NAMES = frozenset({"—", "-", "not applicable", "n/a"})+MAX_STAGES = 6+GEOMETRY_TOLERANCE = 2.0+WCAG_NON_TEXT = 3.0+++def attrs_of(tag_attrs: str) -> dict[str, str]:+ return {+ m.group("name").lower(): m.group("dq") if m.group("dq") is not None else m.group("sq")+ for m in ATTR_RE.finditer(tag_attrs)+ }+++def parse_number(raw: str | None) -> float | None:+ if raw is None:+ return None+ try:+ value = float(raw)+ return value if math.isfinite(value) else None+ except (TypeError, ValueError):+ return None+++def transform_carrier(attrs: dict[str, str]) -> str | None:+ if "transform" in attrs:+ return f"transform={attrs['transform']!r}"+ style = attrs.get("style")+ if style is not None:+ found = CSS_MOVES_MARK_RE.search(style)+ if found is not None:+ return f"style={style!r} (the {found.group('prop').lower()} property)"+ return None+++def transformed_spans(source: str) -> list[tuple[int, int, str]]:+ events: list[tuple[int, int, str | None]] = []+ for match in GROUP_OPEN_RE.finditer(source):+ if match.group("selfclose"):+ continue+ attrs = attrs_of(match.group("attrs"))+ events.append((match.start(), 0, transform_carrier(attrs)))+ for match in GROUP_CLOSE_RE.finditer(source):+ events.append((match.start(), 1, None))+ events.sort(key=lambda event: (event[0], event[1]))++ spans: list[tuple[int, int, str]] = []+ stack: list[tuple[int, str | None]] = []+ for position, kind, how in events:+ if kind == 0:+ stack.append((position, how))+ elif stack:+ start, transformed_by = stack.pop()+ if transformed_by is not None:+ spans.append((start, position, transformed_by))+ for start, transformed_by in stack:+ if transformed_by is not None:+ spans.append((start, len(source), transformed_by))+ return spans+++def layer_at(source: str, offset: int) -> str | None:+ stack: list[str | None] = []+ events: list[tuple[int, int, str | None]] = []+ for match in GROUP_OPEN_RE.finditer(source):+ if match.group("selfclose"):+ continue+ attrs = attrs_of(match.group("attrs"))+ events.append((match.start(), 0, attrs.get("data-layer")))+ for match in GROUP_CLOSE_RE.finditer(source):+ events.append((match.start(), 1, None))+ events.sort(key=lambda event: (event[0], event[1]))+ current: str | None = None+ covering: str | None = None+ for position, kind, layer in events:+ if position > offset:+ break+ if kind == 0:+ stack.append(current)+ if layer:+ current = layer+ elif stack:+ current = stack.pop()+ covering = current+ return covering+++# Contrast helpers match verify-dumbbell.py (sRGB, WCAG 1.4.11).+def _channel(component: int) -> float:+ fraction = component / 255.0+ if fraction <= 0.04045:+ return fraction / 12.92+ return ((fraction + 0.055) / 1.055) ** 2.4+++def relative_luminance(color: str) -> float:+ value = color.lstrip("#")+ if len(value) == 3:+ value = "".join(ch * 2 for ch in value)+ red, green, blue = (int(value[i : i + 2], 16) for i in (0, 2, 4))+ return 0.2126 * _channel(red) + 0.7152 * _channel(green) + 0.0722 * _channel(blue)+++def contrast(foreground: str, background: str) -> float:+ first, second = relative_luminance(foreground), relative_luminance(background)+ lighter, darker = max(first, second), min(first, second)+ return (lighter + 0.05) / (darker + 0.05)+++def composite(foreground: str, alpha: float, background: str) -> str:+ fore = [int(foreground.lstrip("#")[i : i + 2], 16) for i in (0, 2, 4)]+ back = [int(background.lstrip("#")[i : i + 2], 16) for i in (0, 2, 4)]+ blended = [round(fore[i] * alpha + back[i] * (1 - alpha)) for i in range(3)]+ return "#%02x%02x%02x" % tuple(blended)+++def parse_hex(color: str) -> str | None:+ value = color.strip()+ if not HEX_RE.match(value):+ return None+ if len(value) == 4:+ return "#" + "".join(ch * 2 for ch in value[1:])+ return value.lower()+++def paint_base(paint: str | None) -> tuple[str, float] | None:+ """(#rrggbb, alpha) for a hex or rgba paint, else None."""+ if paint is None:+ return None+ rgba = RGBA_RE.fullmatch(paint.strip())+ if rgba:+ hex_color = "#%02x%02x%02x" % (+ int(rgba.group(1)),+ int(rgba.group(2)),+ int(rgba.group(3)),+ )+ return hex_color, float(rgba.group(4))+ parsed = parse_hex(paint)+ if parsed is None:+ return None+ return parsed, 1.0+++def visible_stroke(attrs: dict[str, str], paper: str) -> tuple[str | None, str | None]:+ """(painted color, None) or (None, why the paint cannot be measured).++ The rgba alpha, `stroke-opacity`, and `opacity` all multiply into what the+ browser paints, so each one is combined before contrast is measured.+ Paint set through inline style is not read, so it is rejected.+ """+ style = attrs.get("style")+ if style is not None:+ found = STYLE_PAINT_RE.search(style)+ if found is not None:+ return None, (+ f"inline style sets {found.group('prop').lower()!r}; put the paint in "+ "presentation attributes so contrast can be measured"+ )+ if attrs.get("display", "").strip().lower() == "none" or attrs.get(+ "visibility", ""+ ).strip().lower() in {"hidden", "collapse"}:+ return None, "the line is hidden by display/visibility"+ width = attrs.get("stroke-width")+ if width is not None:+ parsed_width = parse_number(width)+ if parsed_width is None or parsed_width <= 0:+ return None, f"stroke-width={width!r} does not draw a visible line"+ base = paint_base(attrs.get("stroke"))+ if base is None:+ return None, "stroke is not a parseable hex or rgba color"+ color, alpha = base+ for name in ("stroke-opacity", "opacity"):+ raw = attrs.get(name)+ if raw is None:+ continue+ value = parse_number(raw)+ if value is None or not 0 <= value <= 1:+ return None, f"{name}={raw!r} is not a number between 0 and 1"+ alpha *= value+ return composite(color, alpha, paper), None+++class Cell:+ __slots__ = ("layer", "stage", "name", "x", "y", "w", "h", "focal", "index")++ def __init__(+ self,+ index: int,+ layer: str,+ stage: str,+ name: str,+ x: float,+ y: float,+ w: float,+ h: float,+ focal: bool,+ ) -> None:+ self.index = index+ self.layer = layer+ self.stage = stage+ self.name = name+ self.x = x+ self.y = y+ self.w = w+ self.h = h+ self.focal = focal++ @property+ def bottom(self) -> float:+ return self.y + self.h+++class Header:+ __slots__ = ("stage", "x", "w")++ def __init__(self, stage: str, x: float, w: float) -> None:+ self.stage = stage+ self.x = x+ self.w = w+++class RowMark:+ """Any rect inside a data-layer row: a cell or its underlay."""++ __slots__ = ("x", "y", "paints", "name", "focal")++ def __init__(+ self, x: float | None, y: float | None, paints: list[str], name: str | None, focal: bool+ ) -> None:+ self.x = x+ self.y = y+ self.paints = paints+ self.name = name+ self.focal = focal+++def rect_paints(attrs: dict[str, str]) -> list[str]:+ paints = [attrs[key] for key in ("fill", "stroke") if key in attrs]+ style = attrs.get("style")+ if style:+ for declaration in style.split(";"):+ prop, _, value = declaration.partition(":")+ if prop.strip().lower() in {"fill", "stroke"}:+ paints.append(value.strip())+ return paints+++def parse_marks(+ source: str, errors: list[str], row_marks: list[RowMark] | None = None+) -> tuple[list[Header], list[Cell], list[dict[str, str]]]:+ source = COMMENT_RE.sub("", source)+ headers: list[Header] = []+ cells: list[Cell] = []+ visibility: list[dict[str, str]] = []++ for match in RECT_RE.finditer(source):+ attrs = attrs_of(match.group("attrs"))+ if row_marks is not None and layer_at(source, match.start()) is not None:+ row_marks.append(+ RowMark(+ parse_number(attrs.get("x")),+ parse_number(attrs.get("y")),+ rect_paints(attrs),+ attrs.get("data-name"),+ attrs.get("data-focal", "").lower() == "true",+ )+ )+ stage = attrs.get("data-stage")+ name = attrs.get("data-name")+ x = parse_number(attrs.get("x"))+ y = parse_number(attrs.get("y"))+ w = parse_number(attrs.get("width"))+ h = parse_number(attrs.get("height"))+ if stage is None:+ continue+ if x is None or w is None or w <= 0:+ errors.append(+ f"stage {stage!r} mark is missing a finite x/width; the stage grid "+ "cannot be checked"+ )+ continue+ if name is None:+ headers.append(Header(stage, x, w))+ continue+ if y is None or h is None or h <= 0:+ errors.append(+ f"cell {name!r} is missing a finite y/height; layer order cannot be checked"+ )+ continue+ layer = layer_at(source, match.start())+ if layer is None:+ errors.append(+ f"cell {name!r} is not inside a data-layer group; wrap each row "+ "so layer order is declared"+ )+ continue+ focal = attrs.get("data-focal", "").lower() == "true"+ cells.append(Cell(len(cells), layer, stage, name, x, y, w, h, focal))++ for match in LINE_RE.finditer(source):+ attrs = attrs_of(match.group("attrs"))+ if attrs.get("data-role") == "visibility":+ visibility.append(attrs)++ return headers, cells, visibility+++def check_transforms(source: str, errors: list[str]) -> None:+ source = COMMENT_RE.sub("", source)+ spans = transformed_spans(source)++ def enclosing(offset: int) -> str | None:+ for start, end, how in spans:+ if start <= offset <= end:+ return f"ancestor {how}"+ return None++ for match in RECT_RE.finditer(source):+ attrs = attrs_of(match.group("attrs"))+ if "data-stage" not in attrs and "data-name" not in attrs:+ continue+ kind = "cell" if "data-name" in attrs else "stage header"+ how = transform_carrier(attrs) or enclosing(match.start())+ if how is not None:+ errors.append(+ f"service-blueprint {kind} carries {how}; bake the movement into its "+ "coordinates so the verifier checks what the browser draws"+ )+ sized = CSS_SIZE_RE.search(attrs.get("style", ""))+ if sized is not None:+ errors.append(+ f"service-blueprint {kind} {attrs.get('data-name') or attrs.get('data-stage')!r} "+ f"sets its size in CSS (the {sized.group('prop').lower()} property); state "+ "width and height as attributes so the verifier checks what the browser draws"+ )++ # The printed and header checks read text by its x/y, so a transform on a+ # label (or on a group holding it) draws it somewhere the checks never look.+ for match in TEXT_OPEN_RE.finditer(source):+ attrs = attrs_of(match.group("attrs"))+ how = transform_carrier(attrs) or enclosing(match.start())+ if how is not None:+ errors.append(+ f"service-blueprint text carries {how}; bake the movement into its "+ "x/y so the verifier checks what the browser draws"+ )++ for match in LINE_RE.finditer(source):+ attrs = attrs_of(match.group("attrs"))+ if attrs.get("data-role") not in {+ "visibility",+ "interaction",+ "internal-interaction",+ }:+ continue+ how = transform_carrier(attrs) or enclosing(match.start())+ if how is not None:+ errors.append(+ f"service-blueprint {attrs.get('data-role')} line carries {how}; bake "+ "the movement into its coordinates so the verifier checks what the "+ "browser draws"+ )++ # Class and id names carried by SVG marks themselves; HTML chrome around+ # the figure (cards, captions) does not count.+ svg_tokens = {+ token+ for tag in SVG_MARK_TAG_RE.finditer(source)+ for match in SVG_TOKEN_RE.finditer(tag.group(0))+ for token in (match.group(1) or match.group(2) or "").split()+ }+ for match in STYLE_RE.finditer(source):+ found = CSS_MOVES_MARK_RE.search(match.group("body"))+ if found is not None:+ errors.append(+ f"CSS {found.group('prop').lower()!r} declaration can move verified "+ "service-blueprint geometry; bake the movement into the coordinates instead"+ )+ for rule in CSS_RULE_RE.finditer(COMMENT_CSS_RE.sub(" ", match.group("body"))):+ sized = CSS_SIZE_RE.search(rule.group("body"))+ if sized is None:+ continue+ for part in split_selector_list(rule.group("selector")):+ if selector_can_reach_marks(part, svg_tokens):+ errors.append(+ f"CSS {sized.group('prop').lower()!r} declaration can resize "+ f"service-blueprint marks ({part.strip()}); state sizes as attributes instead"+ )+ break+++def _selector_boundaries(selector: str, stops: str) -> list[int]:+ """Offsets of stop characters outside quoted strings, brackets and parens."""+ found: list[int] = []+ depth = 0+ quote = ""+ index = 0+ while index < len(selector):+ char = selector[index]+ if quote:+ if char == "\\":+ index += 2+ continue+ if char == quote:+ quote = ""+ elif char in "\"'":+ quote = char+ elif char in "[(":+ depth += 1+ elif char in "])":+ depth = max(0, depth - 1)+ elif depth == 0 and (char in stops or (" " in stops and char.isspace())):+ found.append(index)+ index += 1+ return found+++def split_selector_list(selectors: str) -> list[str]:+ """Split a selector list on top-level commas only."""+ parts: list[str] = []+ start = 0+ for comma in _selector_boundaries(selectors, ","):+ parts.append(selectors[start:comma])+ start = comma + 1+ parts.append(selectors[start:])+ return [part for part in parts if part.strip()]+++def selector_subject(selector: str) -> str:+ """The last compound of a selector, after its final top-level combinator."""+ text = selector.strip()+ cuts = _selector_boundaries(text, " >+~")+ return text[cuts[-1] + 1:].strip() if cuts else text+++def _pseudo_functions(compound: str) -> tuple[str, list[tuple[str, str]]]:+ """Split a compound into its text outside :name(...) and those functions."""+ outside: list[str] = []+ functions: list[tuple[str, str]] = []+ index = 0+ while index < len(compound):+ match = re.match(r":{1,2}([\w-]+)\(", compound[index:])+ if match is None:+ outside.append(compound[index])+ index += 1+ continue+ depth = 1+ cursor = index + match.end()+ quote = ""+ while cursor < len(compound) and depth:+ char = compound[cursor]+ if quote:+ if char == "\\":+ cursor += 1+ elif char == quote:+ quote = ""+ elif char in "\"'":+ quote = char+ elif char == "(":+ depth += 1+ elif char == ")":+ depth -= 1+ cursor += 1+ functions.append((match.group(1).lower(), compound[index + match.end():cursor - 1]))+ index = cursor+ return "".join(outside), functions+++def _without_attribute_values(compound: str) -> str:+ """Replace each [attribute...] block, quotes included, with an empty []."""+ out: list[str] = []+ depth = 0+ quote = ""+ escaped = False+ for char in compound:+ if depth:+ if escaped:+ escaped = False+ elif char == "\\":+ escaped = True+ elif quote:+ if char == quote:+ quote = ""+ elif char in "\"'":+ quote = char+ elif char == "]":+ depth = 0+ out.append("]")+ continue+ if char == "[":+ depth = 1+ out.append("[")+ continue+ out.append(char)+ return "".join(out)+++# Pseudo-classes whose argument is a selector list the element itself must match.+MATCHES_ANY = frozenset({"is", "where", "matches", "-webkit-any", "-moz-any"})+++def selector_can_reach_marks(selector: str, svg_tokens: set[str]) -> bool:+ """Whether a selector's subject can be one of the diagram's SVG marks.++ A named element decides it: an SVG shape or text element can be a mark;+ any other element (div, svg, section) is page layout. :is()/:where()+ lists are read: the subject can be a mark only if some alternative can.+ With no element named, a class or id that no SVG mark carries rules the+ subject out; anything else (attributes, other pseudo-classes, a mark's+ own class) is treated as able to reach a mark.+ """+ subject = selector_subject(selector)+ if not subject:+ return False+ outside, functions = _pseudo_functions(subject)+ # Attribute values are data, not selectors: "#ffffff" in [fill="#ffffff"]+ # is not an id.+ outside = _without_attribute_values(outside)+ element = re.match(r"[A-Za-z][\w-]*", outside)+ if element is not None:+ return element.group(0).lower() in SVG_MARK_ELEMENTS+ for name, argument in functions:+ if name in MATCHES_ANY and not any(+ selector_can_reach_marks(alternative, svg_tokens)+ for alternative in split_selector_list(argument)+ ):+ return False+ names = set(re.findall(r"[.#]([\w-]+)", outside))+ if names and not names <= svg_tokens:+ return False+ return True+++def check_layers(cells: list[Cell], errors: list[str]) -> dict[str, list[Cell]]:+ by_layer: dict[str, list[Cell]] = {}+ for cell in cells:+ by_layer.setdefault(cell.layer, []).append(cell)++ unknown = sorted(layer for layer in by_layer if layer not in CANONICAL_LAYERS)+ if unknown:+ errors.append(+ f"budget: extra data-layer values {unknown}; allowed layers are "+ + ", ".join(CANONICAL_LAYERS)+ )++ for required in REQUIRED_LAYERS:+ if required not in by_layer:+ errors.append(+ f"layer order: missing required {required} row; a blueprint needs "+ "customer, frontstage, and backstage"+ )++ present = [layer for layer in CANONICAL_LAYERS if layer in by_layer]+ actual = sorted(+ (layer for layer in by_layer if layer in CANONICAL_LAYERS),+ key=lambda layer: min(cell.y for cell in by_layer[layer]),+ )+ if actual != present:+ errors.append(+ "layer order: rows must run evidence (optional), customer, frontstage, "+ f"backstage, support (optional) top to bottom; found {actual}"+ )+ else:+ # Every cell, not just each row's topmost one: a single cell that drops+ # into the next row's band breaks the order the reader sees.+ for upper, lower in zip(present, present[1:]):+ lower_top = min(cell.y for cell in by_layer[lower])+ for cell in by_layer[upper]:+ if cell.bottom > lower_top + GEOMETRY_TOLERANCE:+ errors.append(+ f"layer order: {upper} cell {cell.name!r} ends at "+ f"y={cell.bottom:g}, below the {lower} row top at y={lower_top:g}"+ )+ return by_layer+++def check_visibility(+ source: str,+ cells: list[Cell],+ headers: list[Header],+ visibility: list[dict[str, str]],+ errors: list[str],+) -> None:+ if len(visibility) != 1:+ errors.append(+ f"visibility: exactly one data-role=\"visibility\" line is required; "+ f"found {len(visibility)}"+ )+ if not visibility:+ return++ attrs = visibility[0]+ x1 = parse_number(attrs.get("x1"))+ x2 = parse_number(attrs.get("x2"))+ y1 = parse_number(attrs.get("y1"))+ y2 = parse_number(attrs.get("y2"))+ if None in (x1, x2, y1, y2):+ errors.append("visibility: line is missing finite x1/x2/y1/y2 coordinates")+ return+ if abs(y1 - y2) > 1:+ errors.append("visibility: the line must be horizontal across the plot")+ y = (y1 + y2) / 2+ left, right = min(x1, x2), max(x1, x2)+ if headers:+ plot_left = min(header.x for header in headers)+ plot_right = max(header.x + header.w for header in headers)+ if left > plot_left + GEOMETRY_TOLERANCE or right < plot_right - GEOMETRY_TOLERANCE:+ errors.append(+ "visibility: line must span the plot, from the first stage header "+ "to the last"+ )++ front = [cell for cell in cells if cell.layer == "frontstage"]+ back = [cell for cell in cells if cell.layer == "backstage"]+ if front and back:+ front_bottom = max(cell.bottom for cell in front)+ back_top = min(cell.y for cell in back)+ if not (front_bottom - GEOMETRY_TOLERANCE <= y <= back_top + GEOMETRY_TOLERANCE):+ errors.append(+ "visibility: the line must sit between the frontstage row bottom and "+ f"the backstage row top (±{GEOMETRY_TOLERANCE:g}px); drawn at y={y:g}, "+ f"frontstage ends at {front_bottom:g}, backstage starts at {back_top:g}"+ )++ # Every cell on its own side of the line, not just the row extremes the+ # check above reads: one customer cell below the line reads as hidden work.+ for cell in cells:+ if cell.layer in VISIBLE_LAYERS and cell.bottom > y + GEOMETRY_TOLERANCE:+ errors.append(+ f"visibility: {cell.layer} cell {cell.name!r} reaches y={cell.bottom:g}, "+ f"below the line of visibility at y={y:g}"+ )+ elif cell.layer in HIDDEN_LAYERS and cell.y < y - GEOMETRY_TOLERANCE:+ errors.append(+ f"visibility: {cell.layer} cell {cell.name!r} starts at y={cell.y:g}, "+ f"above the line of visibility at y={y:g}"+ )++ paper_match = PAPER_RE.search(source)+ if paper_match is None:+ errors.append("visibility: contrast cannot be checked without --color-paper")+ return+ paper = paper_match.group(1).lower()+ painted, why = visible_stroke(attrs, paper)+ if painted is None:+ errors.append(f"visibility: {why}")+ return+ ratio = contrast(painted, paper)+ if ratio < WCAG_NON_TEXT:+ errors.append(+ f"visibility: stroke contrast is {ratio:.3f}:1 against paper, under the "+ f"{WCAG_NON_TEXT:.1f}:1 WCAG 1.4.11 asks"+ )+++def check_grid(headers: list[Header], cells: list[Cell], errors: list[str]) -> None:+ if not headers:+ errors.append("stage grid: no stage headers declare data-stage")+ return+ seen: dict[str, Header] = {}+ for header in headers:+ if header.stage in seen:+ errors.append(f"stage grid: duplicate stage header {header.stage!r}")+ continue+ seen[header.stage] = header+ ordered = sorted(seen.values(), key=lambda header: header.x)+ if len(ordered) > MAX_STAGES:+ errors.append(+ f"budget: {len(ordered)} stages; at most {MAX_STAGES} stages on one blueprint"+ )+ widths = {round(header.w, 4) for header in ordered}+ if len(widths) > 1:+ errors.append(f"stage grid: column widths must be equal; found {sorted(widths)}")+ if len(ordered) >= 2:+ gutters = [+ round(ordered[i + 1].x - (ordered[i].x + ordered[i].w), 4)+ for i in range(len(ordered) - 1)+ ]+ if len(set(gutters)) > 1:+ errors.append(f"stage grid: gutters must be equal; found {gutters}")+ if any(gutter < 0 for gutter in gutters):+ errors.append(f"stage grid: columns overlap; gutters must be zero or more, found {gutters}")+ by_stage = {header.stage: header for header in ordered}+ for cell in cells:+ header = by_stage.get(cell.stage)+ if header is None:+ errors.append(+ f"stage grid: cell {cell.name!r} declares data-stage={cell.stage!r} "+ "with no matching header"+ )+ continue+ if abs(cell.x - header.x) > GEOMETRY_TOLERANCE:+ errors.append(+ f"stage grid: cell {cell.name!r} x={cell.x:g} does not match its "+ f"stage header column at x={header.x:g}"+ )+ if cell.x + cell.w > header.x + header.w + GEOMETRY_TOLERANCE:+ errors.append(+ f"stage grid: cell {cell.name!r} right edge x={cell.x + cell.w:g} runs "+ f"past its stage column, which ends at x={header.x + header.w:g}"+ )+++def check_census(headers: list[Header], cells: list[Cell], errors: list[str]) -> None:+ stages = [header.stage for header in sorted(headers, key=lambda item: item.x)]+ # Unique while preserving order.+ unique_stages: list[str] = []+ for stage in stages:+ if stage not in unique_stages:+ unique_stages.append(stage)+ index = {(cell.layer, cell.stage): cell for cell in cells}+ duplicates = len(cells) - len(index)+ if duplicates:+ errors.append("census: duplicate cells share a layer and stage")+ for stage in unique_stages:+ for layer in REQUIRED_LAYERS:+ cell = index.get((layer, stage))+ if cell is None:+ errors.append(+ f"census: stage {stage!r} is missing a {layer} cell (empty allowed "+ "only with an explicit — / Not applicable data-name)"+ )+ elif not cell.name.strip():+ errors.append(+ f"census: {layer} cell on stage {stage!r} has a blank data-name"+ )+++def check_focal(+ source: str, cells: list[Cell], row_marks: list[RowMark], errors: list[str]+) -> None:+ focals = [cell for cell in cells if cell.focal]+ if len(focals) > 1:+ errors.append(+ f"focal: at most one cell may set data-focal; found {len(focals)}"+ )++ # The accent is what the reader sees, not the attribute: any row mark+ # painted with it must be the declared focal cell (or its underlay).+ accents: set[str] = set()+ accent_match = ACCENT_RE.search(source)+ if accent_match is not None:+ accents.add(accent_match.group(1).lower())+ for mark in row_marks:+ if mark.focal:+ for paint in mark.paints:+ base = paint_base(paint)+ if base is not None and base[0] != "#ffffff":+ accents.add(base[0])+ if not accents:+ return+ focal_spots = {(cell.x, cell.y) for cell in focals}+ for mark in row_marks:+ if mark.focal:+ continue+ painted = [+ paint+ for paint in mark.paints+ if (base := paint_base(paint)) is not None and base[0] in accents+ ]+ if not painted:+ continue+ if mark.name is None and (mark.x, mark.y) in focal_spots:+ continue+ label = repr(mark.name) if mark.name is not None else f"at x={mark.x}, y={mark.y}"+ errors.append(+ f"focal: cell {label} is painted with the accent ({painted[0]}) but is "+ "not the data-focal cell; one accent cell per blueprint"+ )+++def check_printed(source: str, cells: list[Cell], errors: list[str]) -> None:+ source = COMMENT_RE.sub("", source)+ texts: list[tuple[float, float, str]] = []+ for match in TEXT_RE.finditer(source):+ attrs = attrs_of(match.group("attrs"))+ x = parse_number(attrs.get("x"))+ y = parse_number(attrs.get("y"))+ if x is None or y is None:+ continue+ body = TAG_RE.sub("", match.group("body"))+ body = (+ body.replace("&", "&")+ .replace("<", "<")+ .replace(">", ">")+ .replace(" ", " ")+ )+ texts.append((x, y, re.sub(r"\s+", " ", body).strip()))++ for cell in cells:+ collected = [+ body+ for x, y, body in texts+ if cell.x - 1 <= x <= cell.x + cell.w + 1+ and cell.y - 1 <= y <= cell.bottom + 6+ ]+ haystack = " ".join(collected)+ if cell.name not in haystack:+ errors.append(+ f"printed: cell {cell.name!r} has no visible text containing its "+ "data-name"+ )+++def verify_file(path: Path) -> list[str]:+ errors: list[str] = []+ source = path.read_text(encoding="utf-8")+ check_transforms(source, errors)+ row_marks: list[RowMark] = []+ headers, cells, visibility = parse_marks(source, errors, row_marks)+ if not cells:+ errors.append(+ "no cells declare data-stage and data-name; the blueprint data contract "+ "is missing"+ )+ return errors+ check_layers(cells, errors)+ check_visibility(source, cells, headers, visibility, errors)+ check_grid(headers, cells, errors)+ check_census(headers, cells, errors)+ check_focal(source, cells, row_marks, errors)+ check_printed(source, cells, errors)+ return errors+++def main() -> int:+ parser = argparse.ArgumentParser(+ description="Verify service-blueprint visibility-line grammar and stage grid."+ )+ parser.add_argument("paths", nargs="*", help="service-blueprint example HTML files")+ parser.add_argument(+ "--all",+ action="store_true",+ help="check every shipped example-service-blueprint*.html",+ )+ args = parser.parse_args()++ if args.all:+ paths = sorted(ASSET_DIR.glob("example-service-blueprint*.html"))+ if not paths:+ print(+ "FAIL service-blueprint: --all found no example-service-blueprint*.html "+ "under the skill assets"+ )+ return 2+ elif args.paths:+ paths = [Path(p) for p in args.paths]+ else:+ parser.print_usage()+ return 2++ failed = False+ for path in paths:+ if not path.is_file():+ print(f"FAIL {path}: no such file")+ failed = True+ continue+ findings = verify_file(path)+ if findings:+ failed = True+ print(f"FAIL {path}")+ for finding in findings:+ print(f" - {finding}")+ else:+ print(f"OK {path}")+ if failed:+ return 1+ print(+ f"OK service-blueprint: {len(paths)} file(s) keep the visibility line on a "+ "shared stage grid"+ )+ return 0+++if __name__ == "__main__":+ sys.exit(main())diff --git a/scripts/verify-streamgraph.py b/scripts/verify-streamgraph.pyindex f2123b1..3a666fd 100644--- a/scripts/verify-streamgraph.py+++ b/scripts/verify-streamgraph.py@@ -156,6 +156,9 @@ DIGIT_RE = re.compile(r"\d")# live markup is held to the contract even when the parser finds no complete# layer - that is check_source's fail-closed case, not a skip.DECLARES_LAYER_RE = re.compile(r"\bdata-layer\s*=", re.IGNORECASE)+# Opening <g> tags. A data-layer on a group is a row (service blueprint),+# not a band; only data-layer on any other tag claims the file.+GROUP_OPEN_TAG_RE = re.compile(r"<g\b[^>]*>", re.IGNORECASE)# Path grammar: absolute M/C/L/Z and numbers only. Relative commands, arcs,# shorthand curves and H/V would need a transform stack this checker refuses# to half-implement; a partial parse looks like coverage without being it.@@ -419,10 +422,19 @@ def looks_like_streamgraph(path: Path, source: str) -> bool:commented-out draft of a layer cannot pull another example type intoscope; a mangled tag whose bytes still say `data-layer=` can, and thenthe parser finding no complete layer is exactly what is reported.++ `data-layer` on a `<g>` is not the signal. Service-blueprint rows reuse+ that attribute for customer / frontstage / backstage groups, which are+ not stacked bands. Bands are marks, so `data-layer` anywhere outside a+ group's opening tag still claims the file, whether or not `data-values`+ is present: a band missing its values is a finding, not a skip."""+ if path.name.startswith("example-service-blueprint"):+ return Falseif path.name.startswith("example-streamgraph"):return True- if DECLARES_LAYER_RE.search(HTML_COMMENT_RE.sub(" ", source)):+ live = HTML_COMMENT_RE.sub(" ", source)+ if DECLARES_LAYER_RE.search(GROUP_OPEN_TAG_RE.sub(" ", live)):return Truedescribed = named_text(parse_document(source))return "streamgraph" in described or "stream graph" in describeddiff --git a/skills/diagram-design/SKILL.md b/skills/diagram-design/SKILL.mdindex 1165d42..abc51b6 100644--- a/skills/diagram-design/SKILL.md+++ b/skills/diagram-design/SKILL.md@@ -1,6 +1,6 @@---name: diagram-design-description: Create branded architecture, architecture delta, 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, exploded axonometric, axonometric plan, Venn, pyramid/funnel, treemap and marimekko, heatmap, bar and dumbbell, waterfall, line (slopegraph, ridgeline, streamgraph, bump), Gantt and scatter charts (bubble, beeswarm), 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, Mermaid, and .excalidraw import, plus lifecycle phase maps, block decomposition trees, and onboarding guidance.+description: Create branded architecture, architecture delta, 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, exploded axonometric, axonometric plan, Venn, pyramid/funnel, treemap and marimekko, heatmap, bar and dumbbell, waterfall, line (slopegraph, ridgeline, streamgraph, bump), Gantt and scatter charts (bubble, beeswarm), high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, service blueprint, deployment, dependency graph, UML class, story map, or database schema diagrams as HTML/SVG/PNG, with .drawio, Mermaid, and .excalidraw import, plus lifecycle phase maps, block decomposition trees, and onboarding guidance.license: MITmetadata:version: "2.6"@@ -10,7 +10,7 @@ metadata:Create diagrams as self-contained HTML files with inline SVG and an editorial design system.-Forty-four visual types. Semantic patterns describe behavior; type references describe layout.+Forty-five visual types. Semantic patterns describe behavior; type references describe layout.---@@ -49,7 +49,7 @@ Applied to schematics:## 2. When to Use-Use for any of the 44 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 45 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:**@@ -80,7 +80,7 @@ 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 (44)+### Visual-type guide (45)| If you're showing… | Use | Reference ||---|---|---|@@ -123,6 +123,7 @@ The pattern owns semantic primitives and its tighter budget; the type owns layou| Value chain against evolution — what to build, buy, and what is moving | **Wardley map** | [type-wardley.md](references/type-wardley.md) || Work-in-progress by state, with WIP limits and blocked items | **Kanban** | [type-kanban.md](references/type-kanban.md) || What a person does across stages of an experience, and how it feels | **User journey** | [type-journey.md](references/type-journey.md) |+| What the customer does vs what the service hides, across stages, with a line of visibility | **Service blueprint** | [type-service-blueprint.md](references/type-service-blueprint.md) || Where software runs — zones, hosts, artifacts, replicas, ports | **Deployment** | [type-deployment.md](references/type-deployment.md) || What depends on what, with fan-in and cycles a tree cannot express | **Dependency graph** | [type-dependency.md](references/type-dependency.md) || Classes with operations, inheritance, composition (other UML routes elsewhere) | **UML class** | [type-uml-class.md](references/type-uml-class.md) |diff --git a/skills/diagram-design/assets/example-service-blueprint-dark.html b/skills/diagram-design/assets/example-service-blueprint-dark.htmlnew file mode 100644index 0000000..67033fb--- /dev/null+++ b/skills/diagram-design/assets/example-service-blueprint-dark.html@@ -0,0 +1,170 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>Trial to paid — what the customer never sees · Service blueprint</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: 1280px; 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;+ color: var(--color-ink);+ margin-bottom: 1.5rem;+ }+ .diagram-container { width: 100%; overflow-x: auto; }+ svg { width: 100%; min-width: 1280px; display: block; }+ @media print {+ .diagram-container { overflow-x: visible; }+ svg { min-width: 0; }+ }+ </style>+</head>+<body>+ <div class="frame">+ <p class="eyebrow">Service blueprint · Diagram Design</p>+ <h1>Trial to paid — what the customer never sees</h1>++ <div class="diagram-container">+ <svg viewBox="0 0 1280 720" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="service-blueprint-dark-title service-blueprint-dark-desc">+ <title id="service-blueprint-dark-title">Trial to paid — what the customer never sees</title>+ <desc id="service-blueprint-dark-desc">Service blueprint of a trial-to-paid path across five stages, with customer and frontstage actions above a line of visibility and a focal backstage dunning-job timeout under Hit the limit.</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"/>+ <rect x="96" y="272" width="1104" height="120" fill="rgba(245,245,245,0.04)"/>+ <rect x="96" y="24" width="208" height="48" fill="none" data-stage="sign-up"/>+ <text x="200" y="40" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.14em">STAGE 1</text>+ <text x="200" y="60" fill="#f5f5f5" font-size="12" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">Sign up</text>+ <rect x="320" y="24" width="208" height="48" fill="none" data-stage="activate"/>+ <text x="424" y="40" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.14em">STAGE 2</text>+ <text x="424" y="60" fill="#f5f5f5" font-size="12" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">Activate</text>+ <rect x="544" y="24" width="208" height="48" fill="none" data-stage="hit-limit"/>+ <text x="648" y="40" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.14em">STAGE 3</text>+ <text x="648" y="60" fill="#f5f5f5" font-size="12" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">Hit the limit</text>+ <rect x="768" y="24" width="208" height="48" fill="none" data-stage="upgrade"/>+ <text x="872" y="40" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.14em">STAGE 4</text>+ <text x="872" y="60" fill="#f5f5f5" font-size="12" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">Upgrade</text>+ <rect x="992" y="24" width="208" height="48" fill="none" data-stage="invoice"/>+ <text x="1096" y="40" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.14em">STAGE 5</text>+ <text x="1096" y="60" fill="#f5f5f5" font-size="12" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">First invoice</text>+ <line x1="96" y1="196" x2="1200" y2="196" stroke="rgba(245,245,245,0.18)" stroke-width="1" data-role="interaction"/>+ <line x1="96" y1="268" x2="1200" y2="268" stroke="rgba(245,245,245,0.55)" stroke-width="2" data-role="visibility"/>+ <line x1="96" y1="340" x2="1200" y2="340" stroke="rgba(245,245,245,0.18)" stroke-width="1" data-role="internal-interaction"/>+ <g data-layer="evidence">+ <text x="88" y="107" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" text-anchor="end" letter-spacing="0.12em">EVIDENCE</text>+ <rect x="96" y="80" width="208" height="48" rx="4" fill="rgba(245,245,245,0.04)" stroke="#bfc0c0" stroke-width="1" data-stage="sign-up" data-name="Welcome email"/>+ <text x="200" y="108" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Welcome email</text>+ <rect x="320" y="80" width="208" height="48" rx="4" fill="rgba(245,245,245,0.04)" stroke="#bfc0c0" stroke-width="1" data-stage="activate" data-name="Product UI"/>+ <text x="424" y="108" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Product UI</text>+ <rect x="544" y="80" width="208" height="48" rx="4" fill="rgba(245,245,245,0.04)" stroke="#bfc0c0" stroke-width="1" data-stage="hit-limit" data-name="Paywall"/>+ <text x="648" y="108" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Paywall</text>+ <rect x="768" y="80" width="208" height="48" rx="4" fill="rgba(245,245,245,0.04)" stroke="#bfc0c0" stroke-width="1" data-stage="upgrade" data-name="Checkout form"/>+ <text x="872" y="108" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Checkout form</text>+ <rect x="992" y="80" width="208" height="48" rx="4" fill="rgba(245,245,245,0.04)" stroke="#bfc0c0" stroke-width="1" data-stage="invoice" data-name="PDF invoice"/>+ <text x="1096" y="108" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">PDF invoice</text>+ </g>+ <g data-layer="customer">+ <text x="88" y="163" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" text-anchor="end" letter-spacing="0.12em">CUSTOMER</text>+ <rect x="96" y="128" width="208" height="64" rx="4" fill="rgba(245,245,245,0.04)" stroke="#bfc0c0" stroke-width="1" data-stage="sign-up" data-name="Create account"/>+ <text x="200" y="164" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Create account</text>+ <rect x="320" y="128" width="208" height="64" rx="4" fill="rgba(245,245,245,0.04)" stroke="#bfc0c0" stroke-width="1" data-stage="activate" data-name="Use product"/>+ <text x="424" y="164" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Use product</text>+ <rect x="544" y="128" width="208" height="64" rx="4" fill="rgba(245,245,245,0.04)" stroke="#bfc0c0" stroke-width="1" data-stage="hit-limit" data-name="Retry payment"/>+ <text x="648" y="164" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Retry payment</text>+ <rect x="768" y="128" width="208" height="64" rx="4" fill="rgba(245,245,245,0.04)" stroke="#bfc0c0" stroke-width="1" data-stage="upgrade" data-name="Pick plan"/>+ <text x="872" y="164" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Pick plan</text>+ <rect x="992" y="128" width="208" height="64" rx="4" fill="rgba(245,245,245,0.04)" stroke="#bfc0c0" stroke-width="1" data-stage="invoice" data-name="Read bill"/>+ <text x="1096" y="164" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Read bill</text>+ </g>+ <g data-layer="frontstage">+ <text x="88" y="235" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" text-anchor="end" letter-spacing="0.12em">FRONTSTAGE</text>+ <rect x="96" y="200" width="208" height="64" rx="4" fill="rgba(245,245,245,0.04)" stroke="#bfc0c0" stroke-width="1" data-stage="sign-up" data-name="Welcome"/>+ <text x="200" y="236" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Welcome</text>+ <rect x="320" y="200" width="208" height="64" rx="4" fill="rgba(245,245,245,0.04)" stroke="#bfc0c0" stroke-width="1" data-stage="activate" data-name="In-app nags"/>+ <text x="424" y="236" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">In-app nags</text>+ <rect x="544" y="200" width="208" height="64" rx="4" fill="rgba(245,245,245,0.04)" stroke="#bfc0c0" stroke-width="1" data-stage="hit-limit" data-name="Pay modal"/>+ <text x="648" y="236" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Pay modal</text>+ <rect x="768" y="200" width="208" height="64" rx="4" fill="rgba(245,245,245,0.04)" stroke="#bfc0c0" stroke-width="1" data-stage="upgrade" data-name="Checkout"/>+ <text x="872" y="236" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Checkout</text>+ <rect x="992" y="200" width="208" height="64" rx="4" fill="rgba(245,245,245,0.04)" stroke="#bfc0c0" stroke-width="1" data-stage="invoice" data-name="Receipt"/>+ <text x="1096" y="236" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Receipt</text>+ </g>+ <g data-layer="backstage">+ <text x="88" y="307" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" text-anchor="end" letter-spacing="0.12em">BACKSTAGE</text>+ <rect x="96" y="272" width="208" height="64" rx="4" fill="rgba(245,245,245,0.08)" stroke="#bfc0c0" stroke-width="1" data-stage="sign-up" data-name="CRM write"/>+ <text x="200" y="308" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">CRM write</text>+ <rect x="320" y="272" width="208" height="64" rx="4" fill="rgba(245,245,245,0.08)" stroke="#bfc0c0" stroke-width="1" data-stage="activate" data-name="Usage meter"/>+ <text x="424" y="308" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Usage meter</text>+ <rect x="544" y="272" width="208" height="64" rx="4" fill="rgba(240,138,89,0.18)" stroke="#f08a59" stroke-width="1" data-stage="hit-limit" data-name="dunning-job timeout" data-focal="true"/>+ <text x="648" y="300" fill="#f08a59" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle" font-weight="600">dunning-job timeout</text>+ <text x="648" y="318" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">dunning-job · 4h</text>+ <rect x="768" y="272" width="208" height="64" rx="4" fill="rgba(245,245,245,0.08)" stroke="#bfc0c0" stroke-width="1" data-stage="upgrade" data-name="Tax calc"/>+ <text x="872" y="308" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Tax calc</text>+ <rect x="992" y="272" width="208" height="64" rx="4" fill="rgba(245,245,245,0.08)" stroke="#bfc0c0" stroke-width="1" data-stage="invoice" data-name="Ledger"/>+ <text x="1096" y="308" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Ledger</text>+ </g>+ <g data-layer="support">+ <text x="88" y="371" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" text-anchor="end" letter-spacing="0.12em">SUPPORT</text>+ <rect x="96" y="344" width="208" height="48" rx="4" fill="rgba(245,245,245,0.08)" stroke="#bfc0c0" stroke-width="1" data-stage="sign-up" data-name="Email"/>+ <text x="200" y="372" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Email</text>+ <rect x="320" y="344" width="208" height="48" rx="4" fill="rgba(245,245,245,0.08)" stroke="#bfc0c0" stroke-width="1" data-stage="activate" data-name="Analytics"/>+ <text x="424" y="372" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Analytics</text>+ <rect x="544" y="344" width="208" height="48" rx="4" fill="rgba(245,245,245,0.08)" stroke="#bfc0c0" stroke-width="1" data-stage="hit-limit" data-name="Card processor"/>+ <text x="648" y="372" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Card processor</text>+ <rect x="768" y="344" width="208" height="48" rx="4" fill="rgba(245,245,245,0.08)" stroke="#bfc0c0" stroke-width="1" data-stage="upgrade" data-name="—"/>+ <text x="872" y="372" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">—</text>+ <rect x="992" y="344" width="208" height="48" rx="4" fill="rgba(245,245,245,0.08)" stroke="#bfc0c0" stroke-width="1" data-stage="invoice" data-name="GL"/>+ <text x="1096" y="372" fill="#f5f5f5" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">GL</text>+ </g>+ <line x1="96" y1="448" x2="1200" y2="448" stroke="rgba(245,245,245,0.14)" stroke-width="0.8"/>+ <text x="96" y="468" fill="#bfc0c0" font-size="8" font-family="'Geist Mono', monospace" letter-spacing="0.18em">LEGEND</text>+ <line x1="96" y1="492" x2="124" y2="492" stroke="rgba(245,245,245,0.55)" stroke-width="2"/>+ <text x="132" y="496" fill="#bfc0c0" font-size="8.5" font-family="'Geist', sans-serif">Line of visibility</text>+ <rect x="280" y="484" width="16" height="10" rx="2" fill="rgba(245,245,245,0.08)" stroke="#bfc0c0" stroke-width="1"/>+ <text x="304" y="494" fill="#bfc0c0" font-size="8.5" font-family="'Geist', sans-serif">Backstage layer</text>+ <rect x="456" y="484" width="16" height="10" rx="2" fill="rgba(240,138,89,0.18)" stroke="#f08a59" stroke-width="1"/>+ <text x="480" y="494" fill="#bfc0c0" font-size="8.5" font-family="'Geist', sans-serif">Focal cell · timeout</text>+ </svg>+ </div>+ </div>+</body>+</html>diff --git a/skills/diagram-design/assets/example-service-blueprint-full.html b/skills/diagram-design/assets/example-service-blueprint-full.htmlnew file mode 100644index 0000000..38401d9--- /dev/null+++ b/skills/diagram-design/assets/example-service-blueprint-full.html@@ -0,0 +1,263 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>Trial to paid — what the customer never sees · Service blueprint</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: #5a6580;+ --color-rule: rgba(45,49,66,0.12);+ --color-accent: #bf4520;+ --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: 1280px; 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;+ color: var(--color-ink);+ margin-bottom: 0.5rem;+ }+ .subtitle {+ font-family: var(--font-sans);+ font-size: 1rem;+ line-height: 1.55;+ color: var(--color-muted);+ max-width: 58ch;+ }+ .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: 1280px; display: block; }+ @media print {+ .diagram-container { overflow-x: visible; }+ svg { min-width: 0; }+ }+ .cards { display: grid; grid-template-columns: 1.15fr 1fr 0.85fr; gap: 1rem; margin-top: 1.5rem; }+ @media (max-width: 900px) { .cards { grid-template-columns: 1fr; } }+ .card {+ background: #ffffff;+ 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-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }+ .card-dot.coral { background: var(--color-accent); }+ .card-dot.ink { background: var(--color-ink); }+ .card-dot.muted { background: var(--color-muted); }+ .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-soft);+ 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">Service blueprint · Diagram Design</p>+ <h1>Trial to paid — what the customer never sees</h1>+ <p class="subtitle">Five stages from signup to the first invoice. The customer still sees Retry payment; the failure is a backstage dunning-job timeout sitting below the line of visibility.</p>+ </div>+ <div class="diagram-container">+ <svg viewBox="0 0 1280 720" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="service-blueprint-full-title service-blueprint-full-desc">+ <title id="service-blueprint-full-title">Trial to paid — what the customer never sees</title>+ <desc id="service-blueprint-full-desc">Service blueprint of a trial-to-paid path across five stages, with customer and frontstage actions above a line of visibility and a focal backstage dunning-job timeout under Hit the limit.</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"/>+ <rect x="96" y="272" width="1104" height="120" fill="rgba(45,49,66,0.03)"/>+ <rect x="96" y="24" width="208" height="48" fill="none" data-stage="sign-up"/>+ <text x="200" y="40" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.14em">STAGE 1</text>+ <text x="200" y="60" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">Sign up</text>+ <rect x="320" y="24" width="208" height="48" fill="none" data-stage="activate"/>+ <text x="424" y="40" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.14em">STAGE 2</text>+ <text x="424" y="60" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">Activate</text>+ <rect x="544" y="24" width="208" height="48" fill="none" data-stage="hit-limit"/>+ <text x="648" y="40" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.14em">STAGE 3</text>+ <text x="648" y="60" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">Hit the limit</text>+ <rect x="768" y="24" width="208" height="48" fill="none" data-stage="upgrade"/>+ <text x="872" y="40" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.14em">STAGE 4</text>+ <text x="872" y="60" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">Upgrade</text>+ <rect x="992" y="24" width="208" height="48" fill="none" data-stage="invoice"/>+ <text x="1096" y="40" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.14em">STAGE 5</text>+ <text x="1096" y="60" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">First invoice</text>+ <line x1="96" y1="196" x2="1200" y2="196" stroke="rgba(45,49,66,0.18)" stroke-width="1" data-role="interaction"/>+ <line x1="96" y1="268" x2="1200" y2="268" stroke="rgba(45,49,66,0.55)" stroke-width="2" data-role="visibility"/>+ <line x1="96" y1="340" x2="1200" y2="340" stroke="rgba(45,49,66,0.18)" stroke-width="1" data-role="internal-interaction"/>+ <g data-layer="evidence">+ <text x="88" y="107" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="end" letter-spacing="0.12em">EVIDENCE</text>+ <rect x="96" y="80" width="208" height="48" rx="4" fill="#ffffff"/>+ <rect x="96" y="80" width="208" height="48" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="sign-up" data-name="Welcome email"/>+ <text x="200" y="108" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Welcome email</text>+ <rect x="320" y="80" width="208" height="48" rx="4" fill="#ffffff"/>+ <rect x="320" y="80" width="208" height="48" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="activate" data-name="Product UI"/>+ <text x="424" y="108" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Product UI</text>+ <rect x="544" y="80" width="208" height="48" rx="4" fill="#ffffff"/>+ <rect x="544" y="80" width="208" height="48" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="hit-limit" data-name="Paywall"/>+ <text x="648" y="108" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Paywall</text>+ <rect x="768" y="80" width="208" height="48" rx="4" fill="#ffffff"/>+ <rect x="768" y="80" width="208" height="48" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="upgrade" data-name="Checkout form"/>+ <text x="872" y="108" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Checkout form</text>+ <rect x="992" y="80" width="208" height="48" rx="4" fill="#ffffff"/>+ <rect x="992" y="80" width="208" height="48" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="invoice" data-name="PDF invoice"/>+ <text x="1096" y="108" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">PDF invoice</text>+ </g>+ <g data-layer="customer">+ <text x="88" y="163" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="end" letter-spacing="0.12em">CUSTOMER</text>+ <rect x="96" y="128" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="96" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="sign-up" data-name="Create account"/>+ <text x="200" y="164" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Create account</text>+ <rect x="320" y="128" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="320" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="activate" data-name="Use product"/>+ <text x="424" y="164" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Use product</text>+ <rect x="544" y="128" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="544" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="hit-limit" data-name="Retry payment"/>+ <text x="648" y="164" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Retry payment</text>+ <rect x="768" y="128" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="768" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="upgrade" data-name="Pick plan"/>+ <text x="872" y="164" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Pick plan</text>+ <rect x="992" y="128" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="992" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="invoice" data-name="Read bill"/>+ <text x="1096" y="164" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Read bill</text>+ </g>+ <g data-layer="frontstage">+ <text x="88" y="235" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="end" letter-spacing="0.12em">FRONTSTAGE</text>+ <rect x="96" y="200" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="96" y="200" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="sign-up" data-name="Welcome"/>+ <text x="200" y="236" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Welcome</text>+ <rect x="320" y="200" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="320" y="200" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="activate" data-name="In-app nags"/>+ <text x="424" y="236" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">In-app nags</text>+ <rect x="544" y="200" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="544" y="200" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="hit-limit" data-name="Pay modal"/>+ <text x="648" y="236" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Pay modal</text>+ <rect x="768" y="200" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="768" y="200" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="upgrade" data-name="Checkout"/>+ <text x="872" y="236" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Checkout</text>+ <rect x="992" y="200" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="992" y="200" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="invoice" data-name="Receipt"/>+ <text x="1096" y="236" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Receipt</text>+ </g>+ <g data-layer="backstage">+ <text x="88" y="307" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="end" letter-spacing="0.12em">BACKSTAGE</text>+ <rect x="96" y="272" width="208" height="64" rx="4" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="sign-up" data-name="CRM write"/>+ <text x="200" y="308" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">CRM write</text>+ <rect x="320" y="272" width="208" height="64" rx="4" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="activate" data-name="Usage meter"/>+ <text x="424" y="308" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Usage meter</text>+ <rect x="544" y="272" width="208" height="64" rx="4" fill="rgba(191,69,32,0.12)" stroke="#bf4520" stroke-width="1" data-stage="hit-limit" data-name="dunning-job timeout" data-focal="true"/>+ <text x="648" y="300" fill="#bf4520" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle" font-weight="600">dunning-job timeout</text>+ <text x="648" y="318" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">dunning-job · 4h</text>+ <rect x="768" y="272" width="208" height="64" rx="4" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="upgrade" data-name="Tax calc"/>+ <text x="872" y="308" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Tax calc</text>+ <rect x="992" y="272" width="208" height="64" rx="4" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="invoice" data-name="Ledger"/>+ <text x="1096" y="308" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Ledger</text>+ </g>+ <g data-layer="support">+ <text x="88" y="371" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="end" letter-spacing="0.12em">SUPPORT</text>+ <rect x="96" y="344" width="208" height="48" rx="4" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="sign-up" data-name="Email"/>+ <text x="200" y="372" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Email</text>+ <rect x="320" y="344" width="208" height="48" rx="4" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="activate" data-name="Analytics"/>+ <text x="424" y="372" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Analytics</text>+ <rect x="544" y="344" width="208" height="48" rx="4" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="hit-limit" data-name="Card processor"/>+ <text x="648" y="372" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Card processor</text>+ <rect x="768" y="344" width="208" height="48" rx="4" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="upgrade" data-name="—"/>+ <text x="872" y="372" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">—</text>+ <rect x="992" y="344" width="208" height="48" rx="4" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="invoice" data-name="GL"/>+ <text x="1096" y="372" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">GL</text>+ </g>+ <line x1="96" y1="448" x2="1200" y2="448" stroke="rgba(45,49,66,0.10)" stroke-width="0.8"/>+ <text x="96" y="468" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" letter-spacing="0.18em">LEGEND</text>+ <line x1="96" y1="492" x2="124" y2="492" stroke="rgba(45,49,66,0.55)" stroke-width="2"/>+ <text x="132" y="496" fill="#4f5d75" font-size="8.5" font-family="'Geist', sans-serif">Line of visibility</text>+ <rect x="280" y="484" width="16" height="10" rx="2" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1"/>+ <text x="304" y="494" fill="#4f5d75" font-size="8.5" font-family="'Geist', sans-serif">Backstage layer</text>+ <rect x="456" y="484" width="16" height="10" rx="2" fill="rgba(191,69,32,0.12)" stroke="#bf4520" stroke-width="1"/>+ <text x="480" y="494" fill="#4f5d75" font-size="8.5" font-family="'Geist', sans-serif">Focal cell · timeout</text>+ </svg>+ </div>+ <div class="cards">+ <div class="card">+ <p class="eyebrow">THE FINDING</p>+ <div class="card-header"><span class="card-dot coral"></span><h3>dunning-job timeout</h3></div>+ <p>Under Hit the limit, the customer row still says Retry payment. The timeout lives on the backstage row, below the line of visibility — a billing job, not a copy problem on the pay modal.</p>+ </div>+ <div class="card">+ <div class="card-header"><span class="card-dot ink"></span><h3>The line is the claim</h3></div>+ <p>Stages are equal columns. Layers are labeled rows. Everything above the heavy rule is onstage; everything below it is hidden. No arrows: stage order is the sequence, and wait times are cell text.</p>+ </div>+ <div class="card">+ <div class="card-header"><span class="card-dot muted"></span><h3>Recovery after the dip</h3></div>+ <p>Upgrade and First invoice restore the walk: tax calc and ledger post below the line, checkout and receipt stay above it. The timeout is the one accent cell the figure exists to show.</p>+ </div>+ </div>+ <div class="footer">+ <span>trial to paid · service blueprint</span>+ <span>example · diagram design</span>+ </div>+ </div>+</body>+</html>diff --git a/skills/diagram-design/assets/example-service-blueprint.html b/skills/diagram-design/assets/example-service-blueprint.htmlnew file mode 100644index 0000000..fa480e9--- /dev/null+++ b/skills/diagram-design/assets/example-service-blueprint.html@@ -0,0 +1,185 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>Trial to paid — what the customer never sees · Service blueprint</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: #bf4520;+ --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: 1280px; 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;+ color: var(--color-ink);+ margin-bottom: 1.5rem;+ }+ .diagram-container { width: 100%; overflow-x: auto; }+ svg { width: 100%; min-width: 1280px; display: block; }+ @media print {+ .diagram-container { overflow-x: visible; }+ svg { min-width: 0; }+ }+ </style>+</head>+<body>+ <div class="frame">+ <p class="eyebrow">Service blueprint · Diagram Design</p>+ <h1>Trial to paid — what the customer never sees</h1>++ <div class="diagram-container">+ <svg viewBox="0 0 1280 720" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="service-blueprint-title service-blueprint-desc">+ <title id="service-blueprint-title">Trial to paid — what the customer never sees</title>+ <desc id="service-blueprint-desc">Service blueprint of a trial-to-paid path across five stages, with customer and frontstage actions above a line of visibility and a focal backstage dunning-job timeout under Hit the limit.</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"/>+ <rect x="96" y="272" width="1104" height="120" fill="rgba(45,49,66,0.03)"/>+ <rect x="96" y="24" width="208" height="48" fill="none" data-stage="sign-up"/>+ <text x="200" y="40" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.14em">STAGE 1</text>+ <text x="200" y="60" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">Sign up</text>+ <rect x="320" y="24" width="208" height="48" fill="none" data-stage="activate"/>+ <text x="424" y="40" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.14em">STAGE 2</text>+ <text x="424" y="60" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">Activate</text>+ <rect x="544" y="24" width="208" height="48" fill="none" data-stage="hit-limit"/>+ <text x="648" y="40" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.14em">STAGE 3</text>+ <text x="648" y="60" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">Hit the limit</text>+ <rect x="768" y="24" width="208" height="48" fill="none" data-stage="upgrade"/>+ <text x="872" y="40" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.14em">STAGE 4</text>+ <text x="872" y="60" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">Upgrade</text>+ <rect x="992" y="24" width="208" height="48" fill="none" data-stage="invoice"/>+ <text x="1096" y="40" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle" letter-spacing="0.14em">STAGE 5</text>+ <text x="1096" y="60" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist', sans-serif" text-anchor="middle">First invoice</text>+ <line x1="96" y1="196" x2="1200" y2="196" stroke="rgba(45,49,66,0.18)" stroke-width="1" data-role="interaction"/>+ <line x1="96" y1="268" x2="1200" y2="268" stroke="rgba(45,49,66,0.55)" stroke-width="2" data-role="visibility"/>+ <line x1="96" y1="340" x2="1200" y2="340" stroke="rgba(45,49,66,0.18)" stroke-width="1" data-role="internal-interaction"/>+ <g data-layer="evidence">+ <text x="88" y="107" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="end" letter-spacing="0.12em">EVIDENCE</text>+ <rect x="96" y="80" width="208" height="48" rx="4" fill="#ffffff"/>+ <rect x="96" y="80" width="208" height="48" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="sign-up" data-name="Welcome email"/>+ <text x="200" y="108" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Welcome email</text>+ <rect x="320" y="80" width="208" height="48" rx="4" fill="#ffffff"/>+ <rect x="320" y="80" width="208" height="48" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="activate" data-name="Product UI"/>+ <text x="424" y="108" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Product UI</text>+ <rect x="544" y="80" width="208" height="48" rx="4" fill="#ffffff"/>+ <rect x="544" y="80" width="208" height="48" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="hit-limit" data-name="Paywall"/>+ <text x="648" y="108" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Paywall</text>+ <rect x="768" y="80" width="208" height="48" rx="4" fill="#ffffff"/>+ <rect x="768" y="80" width="208" height="48" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="upgrade" data-name="Checkout form"/>+ <text x="872" y="108" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Checkout form</text>+ <rect x="992" y="80" width="208" height="48" rx="4" fill="#ffffff"/>+ <rect x="992" y="80" width="208" height="48" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="invoice" data-name="PDF invoice"/>+ <text x="1096" y="108" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">PDF invoice</text>+ </g>+ <g data-layer="customer">+ <text x="88" y="163" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="end" letter-spacing="0.12em">CUSTOMER</text>+ <rect x="96" y="128" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="96" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="sign-up" data-name="Create account"/>+ <text x="200" y="164" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Create account</text>+ <rect x="320" y="128" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="320" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="activate" data-name="Use product"/>+ <text x="424" y="164" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Use product</text>+ <rect x="544" y="128" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="544" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="hit-limit" data-name="Retry payment"/>+ <text x="648" y="164" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Retry payment</text>+ <rect x="768" y="128" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="768" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="upgrade" data-name="Pick plan"/>+ <text x="872" y="164" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Pick plan</text>+ <rect x="992" y="128" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="992" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="invoice" data-name="Read bill"/>+ <text x="1096" y="164" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Read bill</text>+ </g>+ <g data-layer="frontstage">+ <text x="88" y="235" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="end" letter-spacing="0.12em">FRONTSTAGE</text>+ <rect x="96" y="200" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="96" y="200" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="sign-up" data-name="Welcome"/>+ <text x="200" y="236" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Welcome</text>+ <rect x="320" y="200" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="320" y="200" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="activate" data-name="In-app nags"/>+ <text x="424" y="236" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">In-app nags</text>+ <rect x="544" y="200" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="544" y="200" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="hit-limit" data-name="Pay modal"/>+ <text x="648" y="236" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Pay modal</text>+ <rect x="768" y="200" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="768" y="200" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="upgrade" data-name="Checkout"/>+ <text x="872" y="236" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Checkout</text>+ <rect x="992" y="200" width="208" height="64" rx="4" fill="#ffffff"/>+ <rect x="992" y="200" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142" stroke-width="1" data-stage="invoice" data-name="Receipt"/>+ <text x="1096" y="236" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Receipt</text>+ </g>+ <g data-layer="backstage">+ <text x="88" y="307" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="end" letter-spacing="0.12em">BACKSTAGE</text>+ <rect x="96" y="272" width="208" height="64" rx="4" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="sign-up" data-name="CRM write"/>+ <text x="200" y="308" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">CRM write</text>+ <rect x="320" y="272" width="208" height="64" rx="4" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="activate" data-name="Usage meter"/>+ <text x="424" y="308" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Usage meter</text>+ <rect x="544" y="272" width="208" height="64" rx="4" fill="rgba(191,69,32,0.12)" stroke="#bf4520" stroke-width="1" data-stage="hit-limit" data-name="dunning-job timeout" data-focal="true"/>+ <text x="648" y="300" fill="#bf4520" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle" font-weight="600">dunning-job timeout</text>+ <text x="648" y="318" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="middle">dunning-job · 4h</text>+ <rect x="768" y="272" width="208" height="64" rx="4" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="upgrade" data-name="Tax calc"/>+ <text x="872" y="308" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Tax calc</text>+ <rect x="992" y="272" width="208" height="64" rx="4" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="invoice" data-name="Ledger"/>+ <text x="1096" y="308" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Ledger</text>+ </g>+ <g data-layer="support">+ <text x="88" y="371" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" text-anchor="end" letter-spacing="0.12em">SUPPORT</text>+ <rect x="96" y="344" width="208" height="48" rx="4" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="sign-up" data-name="Email"/>+ <text x="200" y="372" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Email</text>+ <rect x="320" y="344" width="208" height="48" rx="4" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="activate" data-name="Analytics"/>+ <text x="424" y="372" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Analytics</text>+ <rect x="544" y="344" width="208" height="48" rx="4" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="hit-limit" data-name="Card processor"/>+ <text x="648" y="372" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">Card processor</text>+ <rect x="768" y="344" width="208" height="48" rx="4" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="upgrade" data-name="—"/>+ <text x="872" y="372" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">—</text>+ <rect x="992" y="344" width="208" height="48" rx="4" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1" data-stage="invoice" data-name="GL"/>+ <text x="1096" y="372" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif" text-anchor="middle">GL</text>+ </g>+ <line x1="96" y1="448" x2="1200" y2="448" stroke="rgba(45,49,66,0.10)" stroke-width="0.8"/>+ <text x="96" y="468" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace" letter-spacing="0.18em">LEGEND</text>+ <line x1="96" y1="492" x2="124" y2="492" stroke="rgba(45,49,66,0.55)" stroke-width="2"/>+ <text x="132" y="496" fill="#4f5d75" font-size="8.5" font-family="'Geist', sans-serif">Line of visibility</text>+ <rect x="280" y="484" width="16" height="10" rx="2" fill="rgba(45,49,66,0.06)" stroke="#4f5d75" stroke-width="1"/>+ <text x="304" y="494" fill="#4f5d75" font-size="8.5" font-family="'Geist', sans-serif">Backstage layer</text>+ <rect x="456" y="484" width="16" height="10" rx="2" fill="rgba(191,69,32,0.12)" stroke="#bf4520" stroke-width="1"/>+ <text x="480" y="494" fill="#4f5d75" font-size="8.5" font-family="'Geist', sans-serif">Focal cell · timeout</text>+ </svg>+ </div>+ </div>+</body>+</html>diff --git a/skills/diagram-design/assets/index.html b/skills/diagram-design/assets/index.htmlindex 6d76a2a..6841ad6 100644--- a/skills/diagram-design/assets/index.html+++ b/skills/diagram-design/assets/index.html@@ -442,6 +442,9 @@<button class="tab" data-type="db-schema"><span class="eyebrow">44</span>Database schema</button>+ <button class="tab" data-type="service-blueprint">+ <span class="eyebrow">45</span>Service blueprint+ </button></div><divdiff --git a/skills/diagram-design/references/layout-budget.md b/skills/diagram-design/references/layout-budget.mdindex f3276e6..6be585f 100644--- a/skills/diagram-design/references/layout-budget.md+++ b/skills/diagram-design/references/layout-budget.md@@ -55,6 +55,7 @@ These are the per-type limits. The universal rows in SKILL.md §7 (9 nodes, 12 a| Max components / links (wardley) | 9 / 12, 2 movement arrows || Max columns / cards (kanban) | 5 / 12 total, 4 per column || Max stages / rows (user journey) | 6 / 3, 2 pain markers |+| Max stages / layers (service blueprint) | 6 stages; required customer / frontstage / backstage; optional evidence / support; 1 focal cell || Max zones / nodes / paths (deployment) | 3 / 6 / 8, 9 artifacts || Max nodes / edges (dependency) | 9 / 14, 4 ranks, 1 cycle || Max classes / relationships (UML class) | 7 / 8, 5 members per compartment |diff --git a/skills/diagram-design/references/onboarding.md b/skills/diagram-design/references/onboarding.mdindex 8ba2f9f..363139a 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-exampAfter onboarding, the user should:-1. Open `assets/index.html` (gallery) and confirm the new palette feels coherent across all 44 visual types.+1. Open `assets/index.html` (gallery) and confirm the new palette feels coherent across all 45 visual types.2. If any type looks off, they usually need to tune `muted` (often too dark or too light against the new `paper`).---diff --git a/skills/diagram-design/references/semantic-patterns.md b/skills/diagram-design/references/semantic-patterns.mdindex 91b2f43..637ba9d 100644--- a/skills/diagram-design/references/semantic-patterns.md+++ b/skills/diagram-design/references/semantic-patterns.md@@ -1,6 +1,6 @@# Semantic patterns-Semantic patterns describe **what a system does**; the 44 visual types describe **how information is arranged**. Choose a pattern first when behavior, state, enforcement, or risk is load-bearing, then use its nearest visual type as the layout grammar. If no pattern matches, choose a visual type directly.+Semantic patterns describe **what a system does**; the 45 visual types describe **how information is arranged**. Choose a pattern first when behavior, state, enforcement, or risk is load-bearing, then use its nearest visual type as the layout grammar. If no pattern matches, choose a visual type directly.Use one primary pattern per figure. A second pattern may supply at most one supporting primitive; if both need full treatment, split overview and detail. Labels and outcomes must remain complete in a static frame.diff --git a/skills/diagram-design/references/type-journey.md b/skills/diagram-design/references/type-journey.mdindex 850d6bc..cd041a0 100644--- a/skills/diagram-design/references/type-journey.md+++ b/skills/diagram-design/references/type-journey.md@@ -2,6 +2,8 @@**Best for:** what a person does across the stages of an experience and how it *feels* at each one. The sentiment curve is the load-bearing element — without it this is just a process diagram with extra rows, so if you can't name a sentiment for every stage, use **Process** or **Timeline** instead.+**Not this type:** frontstage vs backstage on a shared stage grid, with a line of visibility → **Service blueprint** (`type-service-blueprint.md`). A blueprint is a census of what the customer can see versus what the service hides; it has no sentiment curve.+## Layout conventionsVertical stack, top to bottom, for one persona:diff --git a/skills/diagram-design/references/type-process.md b/skills/diagram-design/references/type-process.mdindex aa63688..91e28e2 100644--- a/skills/diagram-design/references/type-process.md+++ b/skills/diagram-design/references/type-process.md@@ -2,7 +2,7 @@**Best for:** sequential business processes with multiple actors/divisions where the reader needs to see *who* does *what*, *what data* enters and leaves each step, and *which tools* are used — not just the step order. Covers responsibility audits, data-quality gate reviews, cross-divisional handoff maps, and end-to-end workflow documentation.-Prefer swimlane (simpler) when the data types and tools don't matter. Prefer process when each step's input/output payload and responsible team must be legible at a glance.+Prefer swimlane (simpler) when the data types and tools don't matter. Prefer process when each step's input/output payload and responsible team must be legible at a glance. Prefer **Service blueprint** (`type-service-blueprint.md`) when the claim is onstage vs offstage across stages — a line of visibility, not sequential handoffs.This type is **parametric** — the inputs schema in §1 drives every coordinate via the formulas in §2. Two generations from the same inputs must produce visually identical SVG. The rule shapes mirror `type-data-flow.md` so color override, IN/OUT chip semantic, and reproducibility checklist read identically across types.diff --git a/skills/diagram-design/references/type-service-blueprint.md b/skills/diagram-design/references/type-service-blueprint.mdnew file mode 100644index 0000000..e138997--- /dev/null+++ b/skills/diagram-design/references/type-service-blueprint.md@@ -0,0 +1,103 @@+# Service Blueprint++**Best for:** showing how a service actually runs across a few stages — what the customer does, what they can see, and what stays hidden. The **line of visibility** is the load-bearing element: customer and frontstage actions sit above it, backstage and support sit below it, on one shared stage grid. Use it when the reader needs to see that a failure is a billing job, a queue, or a fraud check even though the customer row still looks like a simple retry.++**Not this type:**++- Sentiment across stages, no backstage → **User journey** (`type-journey.md`). A journey's load-bearing element is the feeling curve. If you cannot name a frontstage/backstage split, you are not drawing a blueprint.+- Flow with handoffs across named owners → **Swimlane** (`type-swimlane.md`). Arrows are the claim there. A blueprint is a census: stage order is the sequence, and wait times are cell text.+- Sequential nodes with data payloads → **Process** (`type-process.md`).+- One person's phases, waits, retries → **Lifecycle phase map** on State machine (`semantic-patterns.md` § 9).+- State census in columns, no visibility line → **Kanban** (`type-kanban.md`). Columns there are *states*, not narrative stages.+- Narrative backbone × release slices → **Story map** (`type-story-map.md`). The cut line is scope, not visibility.+- Abstraction bands with no stage columns → **Layer stack** (`type-layers.md`).++## Layout conventions++- **Orientation:** stages as equal columns (left → right in narrative order), layers as labeled rows (top → bottom). No connector arrows in this version — that is swimlane territory.+- **ViewBox:** `0 0 1280 720` for the minimal examples. Full editorial keeps the same SVG and adds cards.+- **Left margin:** 96px for layer labels. Geist Mono 8px, uppercase, horizontal, `text-anchor="end"` at x=88. **Never** `writing-mode: vertical`.+- **Stage grid:** 4–6 columns. The worked example is 5 × 208px with 16px gutters (`col_x = 96 + i·224`). Each header carries `data-stage` on a rect at the column origin; every cell in that column uses the same `x`.+- **Layer order, top to bottom:**+ 1. Physical evidence (optional) — 48px+ 2. Customer actions (required) — 64px+ 3. Line of interaction (hairline)+ 4. Frontstage actions — onstage staff or the visible product (required) — 64px+ 5. **Line of visibility** (load-bearing; heavier than the other lines)+ 6. Backstage actions (required) — 64px+ 7. Line of internal interaction (hairline)+ 8. Support processes (optional) — 48px+- **Hairlines:** 8px band including stroke. Interaction and internal-interaction are 1px `rule` (`data-role="interaction"` / `data-role="internal-interaction"`). Visibility is 2px `ink` at 0.55 opacity (`data-role="visibility"`), which must clear 3:1 on paper — 0.45 fails that bar on light paper, so do not go thinner.+- **Cells:** one action per stage per layer. Geist 12px, one line, centered on the column. A second muted mono line is allowed for a system or wait (`dunning-job · 4h`). Empty required cells are allowed only with an explicit `—` or `Not applicable` as `data-name` and as the printed text.+- **Fills:** customer and frontstage are paper/white with `ink` stroke. Backstage and support take a light `ink` tint so the below-the-line band reads as hidden work, not another onstage row.+- **Focal cell (≤1, optional):** the failure, wait, or handoff the figure exists to show — usually on or below the visibility line. Accent fill `rgba(191,69,32,0.12)` (dark: `rgba(240,138,89,0.18)`), accent stroke, `data-focal="true"`.+- **Legend:** horizontal strip after a hairline rule, three keys in this order — visibility line, backstage layer, focal cell.++### Machine-readable data contract++Every layer group: `data-layer="evidence|customer|frontstage|backstage|support"`.++Every cell: `data-stage="<stage-id>"` matching a header `data-stage`, plus `data-name` for the printed action.++Visibility line: `data-role="visibility"`. The two hairlines: `data-role="interaction"` and `data-role="internal-interaction"`.++Optional focal cell: `data-focal="true"` on at most one cell.++No `transform`, geometry `style`, or `<style>` rules that move marks.++`scripts/verify-service-blueprint.py` reads these and fails the build when the drawing and the declaration disagree.++### Service-blueprint element pattern++```svg+<!-- Stage header at column origin x=96; cells in this column reuse that x -->+<rect x="96" y="24" width="208" height="48" fill="none" data-stage="sign-up"/>+<text x="200" y="60" fill="#2d3142" font-size="12" font-weight="600"+ font-family="'Geist', sans-serif" text-anchor="middle">Sign up</text>++<g data-layer="customer">+ <rect x="544" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142"+ stroke-width="1" data-stage="hit-limit" data-name="Retry payment"/>+ <text x="648" y="164" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif"+ text-anchor="middle">Retry payment</text>+</g>++<!-- Visibility line: 2px ink @ 0.55, between frontstage bottom and backstage top -->+<line x1="96" y1="268" x2="1200" y2="268" stroke="rgba(45,49,66,0.55)" stroke-width="2"+ data-role="visibility"/>++<g data-layer="backstage">+ <rect x="544" y="272" width="208" height="64" rx="4" fill="rgba(191,69,32,0.12)"+ stroke="#bf4520" stroke-width="1" data-stage="hit-limit"+ data-name="dunning-job timeout" data-focal="true"/>+ <text x="648" y="300" fill="#bf4520" font-size="12" font-weight="600"+ font-family="'Geist', sans-serif" text-anchor="middle">dunning-job timeout</text>+ <text x="648" y="318" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace"+ text-anchor="middle">dunning-job · 4h</text>+</g>+```++## Anti-patterns++- **No visibility line**, or a line that sits in the wrong gap (not between frontstage and backstage). Without the line this is just a table of rows.+- **Sentiment curve on a blueprint.** That is a journey; split the figures.+- **Arrows crossing layers.** That is a swimlane.+- **Accent on every failing cell.** One focal cell; the rest of the grid is census.+- **Empty required layers** with no `—` / `Not applicable` mark.+- **More than 6 stages**; more than two lines of cell text.+- **`writing-mode` vertical layer labels.** Horizontal only, in the left margin.++## Honesty rules++- **The grid is a census, not a flow chart.** Stage order is the sequence. Wait times and system names are cell text, not edges.+- **Required layers are complete.** Every stage has a customer cell, a frontstage cell, and a backstage cell. An empty slot still occupies its column and says so.+- **The visibility line is checkable.** It spans the plot, sits in the frontstage/backstage gap, and its stroke clears 3:1 against paper.+- **Printed text matches `data-name`.** A cell that draws "Retry payment" and declares another action is two stories.++These rules are executable: `scripts/verify-service-blueprint.py` reads the declarations and fails on layer order, visibility, grid, census, focal, budget, printed-label, contrast, or CSS-moved marks. `scripts/test-verify-service-blueprint.py` proves both polarities — the shipped examples pass, and each mutation class above fails with a named finding.++## Examples++- `assets/example-service-blueprint.html` — minimal light. *Trial to paid — what the customer never sees*, 5 stages, focal backstage `dunning-job timeout` under "Hit the limit".+- `assets/example-service-blueprint-dark.html` — minimal dark, same data.+- `assets/example-service-blueprint-full.html` — full editorial: container framing + 3 varied-width summary cards + footer.diff --git a/skills/diagram-design/references/type-swimlane.md b/skills/diagram-design/references/type-swimlane.mdindex 0c69373..c931839 100644--- a/skills/diagram-design/references/type-swimlane.md+++ b/skills/diagram-design/references/type-swimlane.md@@ -2,6 +2,8 @@**Best for:** cross-functional processes, RACI-style flows, vendor handoffs, multi-team shipping workflows.+**Not this type:** what the customer sees vs what stays hidden, on one shared stage grid → **Service blueprint** (`type-service-blueprint.md`). A blueprint has no arrows; stage order is the sequence.+## Layout conventions- Horizontal lanes (or vertical columns) — one per actor/team. Label each lane in the left margin (or top) with an `eyebrow`-role label.- Lane dividers: 1px hairlines.