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: add lifecycle phase map semantic pattern (#228)
Cathryn Lavery92ca02925ae3
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonindex ed15217..22d4d0f 100644--- a/.claude-plugin/marketplace.json+++ b/.claude-plugin/marketplace.json@@ -1,7 +1,7 @@{"name": "diagram-design","metadata": {- "description": "Create architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart, loop, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, waterfall, treemap, line, Gantt, scatter, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, database schema diagrams as HTML/SVG/PNG."+ "description": "Create architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart, loop, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, waterfall, treemap, line, Gantt, scatter, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, database schema, lifecycle phase maps. HTML/SVG/PNG."},"owner": {"name": "Cathryn Lavery"diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonindex 7b736fa..b1a967a 100644--- a/.claude-plugin/plugin.json+++ b/.claude-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "diagram-design",- "description": "Create architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart, loop, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, waterfall, treemap, line, Gantt, scatter, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, database schema diagrams as HTML/SVG/PNG.",+ "description": "Create architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart, loop, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, waterfall, treemap, line, Gantt, scatter, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, database schema, lifecycle phase maps. HTML/SVG/PNG.","version": "2.6.23","author": {"name": "Cathryn Lavery",diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.jsonindex 49b6bdd..437b9a9 100644--- a/.codex-plugin/plugin.json+++ b/.codex-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "diagram-design",- "description": "Create architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart, loop, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, waterfall, treemap, line, Gantt, scatter, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, database schema diagrams as HTML/SVG/PNG.",+ "description": "Create architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart, loop, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, waterfall, treemap, line, Gantt, scatter, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, database schema, lifecycle phase maps. HTML/SVG/PNG.","version": "2.6.23","author": {"name": "Cathryn Lavery",@@ -26,7 +26,7 @@"interface": {"displayName": "Diagram Design","shortDescription": "Create editorial technical and product diagrams as standalone HTML.",- "longDescription": "Create branded architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart (polar/radial lollipop), loop/flywheel, nested, tree, org chart, layer stack, Venn, pyramid/funnel, treemap, bar, waterfall, line, Gantt and scatter charts, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, or database schema diagrams as standalone HTML/SVG/PNG. Redraw .drawio/.drawio.png/.drawio.svg, Mermaid .mmd, or Excalidraw .excalidraw sources at a chosen size/detail; onboard brand tokens from a website; add semantic patterns, callouts, accessible motion, or sketchy/hand-drawn styling.",+ "longDescription": "Create branded architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart (polar/radial lollipop), loop/flywheel, nested, tree, org chart, layer stack, Venn, pyramid/funnel, treemap, bar, waterfall, line, Gantt and scatter charts, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, or database schema diagrams as standalone HTML/SVG/PNG. Redraw .drawio/.drawio.png/.drawio.svg, Mermaid .mmd, or Excalidraw .excalidraw sources at a chosen size/detail; onboard brand tokens from a website; add lifecycle phase maps, semantic patterns, callouts, accessible motion, or sketchy/hand-drawn styling.","developerName": "Cathryn Lavery","category": "Productivity","capabilities": [diff --git a/.factory-plugin/plugin.json b/.factory-plugin/plugin.jsonindex 7b736fa..b1a967a 100644--- a/.factory-plugin/plugin.json+++ b/.factory-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "diagram-design",- "description": "Create architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart, loop, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, waterfall, treemap, line, Gantt, scatter, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, database schema diagrams as HTML/SVG/PNG.",+ "description": "Create architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart, loop, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, waterfall, treemap, line, Gantt, scatter, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, database schema, lifecycle phase maps. HTML/SVG/PNG.","version": "2.6.23","author": {"name": "Cathryn Lavery",diff --git a/.github/pr-visual-proof/228/dark.png b/.github/pr-visual-proof/228/dark.pngnew file mode 100644index 0000000..f7153f4Binary files /dev/null and b/.github/pr-visual-proof/228/dark.png differdiff --git a/.github/pr-visual-proof/228/full.png b/.github/pr-visual-proof/228/full.pngnew file mode 100644index 0000000..e6bcc3fBinary files /dev/null and b/.github/pr-visual-proof/228/full.png differdiff --git a/.github/pr-visual-proof/228/light.png b/.github/pr-visual-proof/228/light.pngnew file mode 100644index 0000000..4463788Binary files /dev/null and b/.github/pr-visual-proof/228/light.png differdiff --git a/README.md b/README.mdindex a3d8d47..178798c 100644--- a/README.md+++ b/README.md@@ -291,7 +291,7 @@ cp skills/diagram-design/assets/template-motion.html my-diagram.html # optional### Semantic patterns and optional motion-When behavior matters, the skill chooses a semantic pattern first and a visual type second. The eight routed patterns cover fan-in queues and bottlenecks, repeated stage slots, unstructured-input transformation, paired policy traces, secure paved roads, governance catalogs, compensating security layers, and traceable block decomposition. Each pattern defines its triggers, primitives, budget, anti-patterns, static fallback, and nearest visual type in [`semantic-patterns.md`](skills/diagram-design/references/semantic-patterns.md).+When behavior matters, the skill chooses a semantic pattern first and a visual type second. The nine routed patterns cover fan-in queues and bottlenecks, repeated stage slots, unstructured-input transformation, paired policy traces, secure paved roads, governance catalogs, compensating security layers, traceable block decomposition, and lifecycle phase maps. Each pattern defines its triggers, primitives, budget, anti-patterns, static fallback, and nearest visual type in [`semantic-patterns.md`](skills/diagram-design/references/semantic-patterns.md).Motion is optional and does not create another visual type. [`animation.md`](skills/diagram-design/references/animation.md) defines `none`, `reveal`, `step`, and `loop` modes with a complete static first frame, deterministic timing, and controls when interaction is available. Reduced-motion output shows the complete static frame and hides/disables playback controls. Motion HTML uses the exact reviewed controller from `template-motion.html`; arbitrary or modified inline scripts, remote assets, CSS imports, and executable HTML attributes are rejected. The default is `none`: ordinary output remains static and script-free. [`example-policy-trace-animated.html`](skills/diagram-design/assets/example-policy-trace-animated.html) is the self-contained interactive example.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 86ad0ec..8501f28 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@@ -8,7 +8,7 @@ Auditing behavior-rich figures (queues, policy traces, trust boundaries) showed## Decision-Behavior is a separate axis. The semantic patterns in `references/semantic-patterns.md` (eight as of this writing; see Amendments) each route to the **nearest existing visual type** for layout; a pattern owns semantic primitives and a tighter budget, never a second layout grammar. The visual-type count only moves when a genuinely new *layout* grammar appears (it did in v2.5.10 — see [ADR 0007](0007-new-layout-grammars.md), 28 → 38 — and again for Polar, 38 → 39).+Behavior is a separate axis. The semantic patterns in `references/semantic-patterns.md` (nine as of this writing; see Amendments) each route to the **nearest existing visual type** for layout; a pattern owns semantic primitives and a tighter budget, never a second layout grammar. The visual-type count only moves when a genuinely new *layout* grammar appears (it did in v2.5.10 — see [ADR 0007](0007-new-layout-grammars.md), 28 → 38 — and again for Polar, 38 → 39).## Consequences@@ -28,4 +28,6 @@ Behavior is a separate axis. The semantic patterns in `references/semantic-patte**2026-09-06 — the count is 40.** Waterfall was admitted under the same escape clause: a running total anchored by start/end bars and bridged by signed floating deltas is a layout grammar no existing type provides (bar compares independent categories, the dumbbell states two endpoints without the path, pyramid ranks one funnel, Sankey splits and merges). The per-grammar argument is in [ADR 0011](0011-waterfall-is-a-running-total-grammar.md); it ships the full §10 set, and the counters named above move 39 → 40 together with the prose.+**2026-09-15 — the pattern count is nine.** Lifecycle phase map was added for one subject's progress through primary phases, waits, retries, cancellation, and terminal outcomes. It routes to the existing State Machine type and adds banding plus a tighter nine-state/ten-transition budget, not a new layout grammar. Request and message lifecycles remain Sequence diagrams under ADR 0007. See [issue #226](https://github.com/cathrynlavery/diagram-design/issues/226).+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/0007-new-layout-grammars.md b/docs/adr/0007-new-layout-grammars.mdindex 0f3b937..65eda42 100644--- a/docs/adr/0007-new-layout-grammars.md+++ b/docs/adr/0007-new-layout-grammars.md@@ -34,7 +34,7 @@ Kept out on purpose, so the next audit does not relitigate them.| Requested | Covered by ||---|---|| System context, component, API interaction | **Architecture** (a boundary or a zoom level, not a new grammar) |-| UML sequence, request lifecycle, sequence/state combination | **Sequence** |+| UML sequence, request lifecycle, message lifecycle, sequence/state combination | **Sequence** — actor messages and timing remain the grammar; one subject's phase progression may use the Lifecycle phase map semantic pattern routed to State Machine (ADR 0002) || UML state machine | **State** || UML activity, activity diagram | **Swimlane** + **flowchart** — the fork/join bar alone does not earn a type || UML component, UML deployment | **Architecture**, **deployment** |diff --git a/scripts/test-verify-docs-sync.py b/scripts/test-verify-docs-sync.pyindex e002069..ed27f79 100644--- a/scripts/test-verify-docs-sync.py+++ b/scripts/test-verify-docs-sync.py@@ -151,6 +151,18 @@ def main() -> int:if len(errors) != 1 or "lost the lexical hook" not in errors[0]:raise AssertionError(f"missing routing hook was not rejected: {errors}")+ document = json.loads(codex.read_text(encoding="utf-8"))+ document["description"] = short.replace("lifecycle phase", "subject progress")+ document["interface"]["longDescription"] = document["interface"]["longDescription"].replace(+ "lifecycle phase", "subject progress"+ )+ codex.write_text(json.dumps(document), encoding="utf-8")+ errors = []+ verify.check_manifest_descriptions(errors, root)+ lifecycle_errors = [error for error in errors if "discovery hook 'lifecycle phase'" in error]+ if len(lifecycle_errors) != 2:+ raise AssertionError(f"missing lifecycle discovery hooks were not rejected: {errors}")+for length in (1024, 1025):errors: list[str] = []markdown = f"---\nname: fixture\ndescription: {'x' * length}\n---\n"@@ -1002,6 +1014,27 @@ diagram-design/raise AssertionError(f"variant with missing parent not caught: {errs}")print("OK gallery: variant with missing parent caught")+ lifecycle_trio = [+ "example-state-lifecycle.html",+ "example-state-lifecycle-dark.html",+ "example-state-lifecycle-full.html",+ ]++ # 10. Lifecycle is a complete State variant and reuses eyebrow 04.+ html = make_gallery_html(+ make_tab("state", "04"),+ make_tab("state-lifecycle", "04", parent="state"),+ )+ errs = run_gallery_check(html, [+ "example-state.html",+ "example-state-dark.html",+ "example-state-full.html",+ *lifecycle_trio,+ ])+ if errs:+ raise AssertionError(f"valid lifecycle State variant failed: {errs}")+ print("OK gallery: lifecycle phase map is a complete State variant")+with tempfile.TemporaryDirectory(prefix="verify-docs-sync-assets-") as asset_tmp:tmp_skill_dir = Path(asset_tmp)tmp_asset_dir = tmp_skill_dir / "assets"diff --git a/scripts/test-verify-semantic-motion.py b/scripts/test-verify-semantic-motion.pyindex e24f0ed..3203e7e 100644--- a/scripts/test-verify-semantic-motion.py+++ b/scripts/test-verify-semantic-motion.py@@ -63,7 +63,7 @@ def main() -> int:raise AssertionError(f"missing semantic router was accepted: {errors}")print("OK: missing semantic-pattern router link is rejected")- # Dropping one of the seven named patterns must be rejected.+ # Dropping one of the nine named patterns must be rejected.missing_pattern = scratch / "missing-pattern.md"missing_pattern.write_text(original_skill.read_text(encoding="utf-8").replace(@@ -79,6 +79,24 @@ def main() -> int:):raise AssertionError(f"missing semantic pattern was accepted: {errors}")print("OK: missing semantic-pattern name is rejected")++ # The new lifecycle route must remain discoverable from SKILL.md.+ missing_lifecycle = scratch / "missing-lifecycle.md"+ missing_lifecycle.write_text(+ original_skill.read_text(encoding="utf-8").replace(+ "**Lifecycle phase map** → State Machine",+ "**Generic lifecycle** → State Machine",+ ),+ encoding="utf-8",+ )+ module.SKILL = missing_lifecycle+ errors = module.verify_markdown()+ if not any(+ "does not route semantic pattern: Lifecycle phase map" in error+ for error in errors+ ):+ raise AssertionError(f"missing lifecycle route was accepted: {errors}")+ print("OK: missing lifecycle phase-map route is rejected")finally:module.SKILL = original_skilldiff --git a/scripts/verify-docs-sync.py b/scripts/verify-docs-sync.pyindex ccdf13e..1cf4013 100644--- a/scripts/verify-docs-sync.py+++ b/scripts/verify-docs-sync.py@@ -57,6 +57,7 @@ DESCRIPTION_ALIASES = {"line chart": "line","scatter plot": "scatter",}+DISCOVERY_HOOKS = ("lifecycle phase",)ROUTING_SURFACES = {Path("commands/export-diagram.md"): "references/export.md",Path("commands/import-drawio.md"): "references/import-drawio.md",@@ -180,6 +181,11 @@ def check_description(errors: list[str]) -> None:f"description lost the lexical hook for type {name!r} "f"(expected {key!r} in the SKILL.md frontmatter description)")+ for hook in DISCOVERY_HOOKS:+ if hook not in description:+ errors.append(+ f"SKILL.md frontmatter description lost discovery hook {hook!r}"+ )def gallery_types(source: str) -> list[str]:@@ -1146,6 +1152,11 @@ def check_manifest_descriptions(errors: list[str], root: Path) -> None:f"type {name!r} (expected {hook!r}) — it must name every "f"type the SKILL.md description names")+ for hook in DISCOVERY_HOOKS:+ if hook not in text:+ errors.append(+ f"{relative.as_posix()} {key!r} lost discovery hook {hook!r}"+ )def font_families(url: str) -> set[str]:diff --git a/scripts/verify-semantic-motion.py b/scripts/verify-semantic-motion.pyindex d49e9ec..7738add 100644--- a/scripts/verify-semantic-motion.py+++ b/scripts/verify-semantic-motion.py@@ -32,6 +32,7 @@ PATTERN_NAMES = ("Governance / control catalog","Compensating security layers","Traceable block decomposition",+ "Lifecycle phase map",)PATTERN_FIELDS = ("Selection triggers:",diff --git a/skills/diagram-design/SKILL.md b/skills/diagram-design/SKILL.mdindex b8cb308..304bfb9 100644--- a/skills/diagram-design/SKILL.md+++ b/skills/diagram-design/SKILL.md@@ -1,6 +1,6 @@---name: diagram-design-description: Create branded architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart (polar/radial lollipop), loop/flywheel, nested, tree, org chart, layer stack, Venn, pyramid/funnel, treemap, bar, waterfall, line, Gantt and scatter charts, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, or database schema diagrams as standalone HTML/SVG/PNG. Redraw .drawio/.drawio.png/.drawio.svg, Mermaid .mmd, or Excalidraw .excalidraw sources at a chosen size/detail; onboard brand tokens from a website; add semantic patterns, callouts, accessible motion, or sketchy/hand-drawn styling.+description: Create branded architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, polar chart (polar/radial lollipop), loop/flywheel, nested, tree, org chart, layer stack, Venn, pyramid/funnel, treemap, bar, waterfall, line, Gantt and scatter charts, high-level, process, medallion, data flow, DP integration, DP security matrix, Sankey, fishbone, Wardley map, kanban, user journey, deployment, dependency graph, UML class, story map, or database schema diagrams as standalone HTML/SVG/PNG. Redraw .drawio/.drawio.png/.drawio.svg, Mermaid .mmd, or Excalidraw .excalidraw sources at a chosen size/detail; onboard brand tokens from a website; add lifecycle phase maps, semantic patterns, callouts, accessible motion, or sketchy/hand-drawn styling.license: MITmetadata:version: "2.6"@@ -20,15 +20,11 @@ Forty visual types. Semantic patterns describe behavior independently; type refeDon't silently ship default-skinned diagrams into a branded project.-First check the project root for a `.diagram-design` marker and resolve it per [`references/profiles.md`](references/profiles.md). A valid marker whose profile exists selects that file directly and skips this gate; `profile: default` also skips it. A malformed or missing-profile marker follows the visible failure handling in that reference. Never copy a marker-selected profile over the installed working copy.+First resolve any project `.diagram-design` marker per [`references/profiles.md`](references/profiles.md); a successfully resolved marker selects its profile and bypasses this gate. That reference owns failures, the protected default, and save behavior.-Open [`references/style-guide.md`](references/style-guide.md) and check the default tokens. If they're still the shipped defaults (paper `#f5f5f5`, ink `#2d3142`, accent `#eb6c36` atomic-tangerine), **pause and ask the user**:+For a markerless project, open [`references/style-guide.md`](references/style-guide.md). If it still has the shipped paper, ink, and accent tokens, **pause and present the choices from [`references/onboarding.md`](references/onboarding.md)**, then follow the selected method; saved profiles route to `references/profiles.md`.-> *"This is your first diagram in this project. The style guide is still at the default (neutral white-smoke + atomic-tangerine). Do you want to customize it to match your brand first? Options: (a) pull from your website URL, (b) extract from an installed skill, (c) extract from a local folder / design-system directory, (d) paste tokens manually, (e) proceed with the default for now, (f) load a saved client profile."*--Then branch per the matching section of [`references/onboarding.md`](references/onboarding.md); for **(f)** follow [`references/profiles.md`](references/profiles.md).--**Once the style guide has been customized** (or the user explicitly opted for default), skip this gate on subsequent runs. A leading profile header names the copied-in active profile. Without a header, any semantic-role value or typography family differing from shipped defaults means **custom-unsaved**: skip the gate and offer to save it as a profile. All-default tokens with no marker/header trigger the gate. At the end of every onboarding method, offer to save the result as a named client profile per `references/profiles.md`.+After customization or an explicit default choice, skip this gate. Detect and save active/custom profiles exactly as `references/profiles.md` specifies.---@@ -76,6 +72,7 @@ When behavior, state, enforcement, or risk carries the meaning, first load [`ref| Controls grouped by where they are enforced | **Governance / control catalog** → Layer stack || Defenses compensate for prior gaps and residual risk propagates | **Compensating security layers** → Layer stack || Hierarchical, ID-addressable decomposition needing per-block I/O, constraints, and a code link | **Traceable block decomposition** → Tree |+| One subject progresses through phases, waits, retries, cancellation, and terminal outcomes | **Lifecycle phase map** → State Machine |The 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.diff --git a/skills/diagram-design/assets/example-state-lifecycle-dark.html b/skills/diagram-design/assets/example-state-lifecycle-dark.htmlnew file mode 100644index 0000000..b30555a--- /dev/null+++ b/skills/diagram-design/assets/example-state-lifecycle-dark.html@@ -0,0 +1,88 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>Newsletter publication lifecycle · State machine</title>+ <link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet">+ <style>+ *, *::before, *::after { box-sizing:border-box; margin:0; padding:0; }+ :root { --color-paper:#2d3142; --color-ink:#f5f5f5; --color-muted:#bfc0c0; --color-accent:#f08a59; --font-sans:'Geist',system-ui,sans-serif; --font-serif:'Instrument Serif',serif; --font-mono:'Geist Mono',ui-monospace,monospace; }+ body { font-family:var(--font-sans); background:var(--color-paper); color:var(--color-ink); min-height:100vh; display:flex; align-items:center; justify-content:center; padding:3rem 2rem; }+ .frame { max-width:1200px; width:100%; overflow-x:auto; }+ .eyebrow { font-family:var(--font-mono); font-size:0.66rem; font-weight:500; letter-spacing:0.18em; text-transform:uppercase; color:var(--color-muted); margin-bottom:0.5rem; }+ h1 { font-family:var(--font-serif); font-size:clamp(1.5rem,2.4vw + 0.75rem,2rem); font-weight:400; letter-spacing:-0.02em; line-height:1.15; margin-bottom:1.5rem; }+ svg { width:100%; min-width:900px; display:block; }+ svg text { font-family:'Geist',sans-serif; }+ .band { fill:rgba(245,245,245,0.035); stroke:rgba(245,245,245,0.14); }+ .flow { fill:none; stroke:#bfc0c0; stroke-width:1.2; }+ .flow.retry { stroke-dasharray:5 4; }+ .flow.accent { stroke:#f08a59; stroke-width:1.4; }+ .mask { fill:#2d3142; }+ .phase { fill:#393e53; stroke:#f5f5f5; }+ .support { fill:#2d3142; stroke:#bfc0c0; stroke-dasharray:5 4; }+ .terminal { fill:rgba(245,245,245,0.04); stroke:#bfc0c0; }+ .terminal.failed { stroke-width:1.5; stroke-dasharray:3 3; }+ </style>+</head>+<body>+ <div class="frame">+ <p class="eyebrow">State · Lifecycle phase map</p>+ <h1>Newsletter publication lifecycle</h1>+ <svg viewBox="0 0 1000 520" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="state-lifecycle-dark-title state-lifecycle-dark-desc">+ <title id="state-lifecycle-dark-title">Newsletter publication lifecycle</title>+ <desc id="state-lifecycle-dark-desc">A dark lifecycle phase map with Draft, Editing, Scheduled, Sending, and Sent on the primary rail; Approval and Delivery Retry in a recovery band; and Cancelled and Failed terminal outcomes.</desc>+ <defs>+ <pattern id="lifecycle-dark-dots" width="22" height="22" patternUnits="userSpaceOnUse"><circle cx="1" cy="1" r="0.9" fill="rgba(245,245,245,0.10)"/></pattern>+ <marker id="lifecycle-dark-arrow" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0,8 3,0 6" fill="#bfc0c0"/></marker>+ <marker id="lifecycle-dark-arrow-accent" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0,8 3,0 6" fill="#f08a59"/></marker>+ </defs>+ <rect width="100%" height="100%" fill="#2d3142"/>+ <rect width="100%" height="100%" fill="url(#lifecycle-dark-dots)" opacity="0.55"/>+ <rect class="band" x="24" y="44" width="952" height="120" rx="8"/>+ <rect class="band" x="24" y="400" width="952" height="104" rx="8"/>+ <g fill="#bfc0c0" font-size="8" font-family="'Geist Mono',monospace" letter-spacing="0.14em"><text x="40" y="64">WAIT / RECOVERY</text><text x="40" y="208">PRIMARY PHASES</text><text x="40" y="420">TERMINAL OUTCOMES</text></g>++ <line class="flow" x1="40" y1="256" x2="64" y2="256" marker-end="url(#lifecycle-dark-arrow)"/>+ <line class="flow" x1="214" y1="256" x2="244" y2="256" marker-end="url(#lifecycle-dark-arrow)"/>+ <path class="flow" d="M319 220 V176 H369 V140" marker-end="url(#lifecycle-dark-arrow)"/>+ <path class="flow" d="M449 140 V176 H499 V220" marker-end="url(#lifecycle-dark-arrow)"/>+ <line class="flow" x1="574" y1="256" x2="604" y2="256" marker-end="url(#lifecycle-dark-arrow)"/>+ <line class="flow accent" x1="754" y1="256" x2="800" y2="256" marker-end="url(#lifecycle-dark-arrow-accent)"/>+ <path class="flow retry" d="M649 220 V176 H639 V140" marker-end="url(#lifecycle-dark-arrow)"/>+ <path class="flow retry" d="M719 140 V188 H709 V220" marker-end="url(#lifecycle-dark-arrow)"/>+ <path class="flow" d="M499 292 V416" marker-end="url(#lifecycle-dark-arrow)"/>+ <path class="flow" d="M604 104 H584 V380 H749 V416" marker-end="url(#lifecycle-dark-arrow)"/>++ <g font-family="'Geist Mono',monospace" font-size="7" text-anchor="middle" letter-spacing="0.08em" fill="#bfc0c0">+ <rect class="mask" x="27" y="238" width="32" height="12" rx="2"/><text x="43" y="247">NEW</text>+ <rect class="mask" x="215" y="238" width="28" height="12" rx="2"/><text x="229" y="247">WRITE</text>+ <rect class="mask" x="326" y="158" width="48" height="12" rx="2"/><text x="350" y="167">SUBMIT</text>+ <rect class="mask" x="448" y="158" width="56" height="12" rx="2"/><text x="476" y="167">APPROVE</text>+ <rect class="mask" x="575" y="238" width="28" height="12" rx="2"/><text x="589" y="247">START</text>+ <rect class="mask" x="760" y="238" width="34" height="12" rx="2"/><text x="777" y="247" fill="#f08a59">DELIVER</text>+ <rect class="mask" x="620" y="158" width="46" height="12" rx="2"/><text x="643" y="167">ERROR</text>+ <rect class="mask" x="700" y="180" width="42" height="12" rx="2"/><text x="721" y="189">RETRY</text>+ <rect class="mask" x="474" y="350" width="52" height="12" rx="2"/><text x="500" y="359">CANCEL</text>+ <rect class="mask" x="588" y="362" width="66" height="12" rx="2"/><text x="621" y="371">EXHAUSTED</text>+ </g>+ <circle cx="34" cy="256" r="6" fill="#f5f5f5"/>++ <g text-anchor="middle" font-family="'Geist',sans-serif">+ <g><rect class="phase" x="64" y="220" width="150" height="72" rx="8"/><text x="139" y="251" fill="#f5f5f5" font-size="12" font-weight="600">Draft</text><text x="139" y="270" fill="#bfc0c0" font-size="8" font-family="'Geist Mono',monospace">content exists</text></g>+ <g><rect class="phase" x="244" y="220" width="150" height="72" rx="8"/><text x="319" y="251" fill="#f5f5f5" font-size="12" font-weight="600">Editing</text><text x="319" y="270" fill="#bfc0c0" font-size="8" font-family="'Geist Mono',monospace">owner revises</text></g>+ <g><rect class="phase" x="424" y="220" width="150" height="72" rx="8"/><text x="499" y="251" fill="#f5f5f5" font-size="12" font-weight="600">Scheduled</text><text x="499" y="270" fill="#bfc0c0" font-size="8" font-family="'Geist Mono',monospace">send time set</text></g>+ <g><rect class="phase" x="604" y="220" width="150" height="72" rx="8"/><text x="679" y="251" fill="#f5f5f5" font-size="12" font-weight="600">Sending</text><text x="679" y="270" fill="#bfc0c0" font-size="8" font-family="'Geist Mono',monospace">provider active</text></g>+ <g><rect x="800" y="220" width="150" height="72" rx="8" fill="rgba(240,138,89,0.08)" stroke="#f08a59"/><circle cx="824" cy="244" r="7" fill="none" stroke="#f08a59"/><circle cx="824" cy="244" r="4" fill="#f08a59"/><text x="875" y="251" fill="#f5f5f5" font-size="12" font-weight="600">Sent</text><text x="875" y="270" fill="#bfc0c0" font-size="8" font-family="'Geist Mono',monospace">delivery complete</text></g>+ </g>++ <g text-anchor="middle">+ <g><rect class="support" x="334" y="68" width="150" height="72" rx="8"/><rect x="344" y="78" width="34" height="12" rx="2" fill="none" stroke="rgba(191,192,192,0.50)"/><text x="361" y="87" fill="#bfc0c0" font-size="7" font-family="'Geist Mono',monospace">WAIT</text><text x="409" y="111" fill="#f5f5f5" font-size="12" font-weight="600" font-family="'Geist',sans-serif">Approval</text><text x="409" y="126" fill="#bfc0c0" font-size="8" font-family="'Geist Mono',monospace">editor decision</text></g>+ <g><rect class="support" x="604" y="68" width="150" height="72" rx="8"/><rect x="614" y="78" width="52" height="12" rx="2" fill="none" stroke="rgba(191,192,192,0.50)"/><text x="640" y="87" fill="#bfc0c0" font-size="7" font-family="'Geist Mono',monospace">RECOVERY</text><text x="679" y="111" fill="#f5f5f5" font-size="12" font-weight="600" font-family="'Geist',sans-serif">Delivery Retry</text><text x="679" y="126" fill="#bfc0c0" font-size="8" font-family="'Geist Mono',monospace">attempt 1 of 3</text></g>+ <g><rect class="terminal" x="424" y="416" width="150" height="72" rx="8"/><rect x="434" y="426" width="54" height="12" rx="2" fill="none" stroke="rgba(191,192,192,0.50)"/><text x="461" y="435" fill="#bfc0c0" font-size="7" font-family="'Geist Mono',monospace">TERMINAL</text><text x="499" y="459" fill="#f5f5f5" font-size="12" font-weight="600" font-family="'Geist',sans-serif">Cancelled</text><text x="499" y="474" fill="#bfc0c0" font-size="8" font-family="'Geist Mono',monospace">stopped by owner</text></g>+ <g><rect class="terminal failed" x="674" y="416" width="150" height="72" rx="8"/><rect x="684" y="426" width="54" height="12" rx="2" fill="none" stroke="rgba(191,192,192,0.50)"/><text x="711" y="435" fill="#bfc0c0" font-size="7" font-family="'Geist Mono',monospace">TERMINAL</text><text x="749" y="459" fill="#f5f5f5" font-size="12" font-weight="600" font-family="'Geist',sans-serif">Failed</text><text x="749" y="474" fill="#bfc0c0" font-size="8" font-family="'Geist Mono',monospace">retries exhausted</text></g>+ </g>+ </svg>+ </div>+</body>+</html>diff --git a/skills/diagram-design/assets/example-state-lifecycle-full.html b/skills/diagram-design/assets/example-state-lifecycle-full.htmlnew file mode 100644index 0000000..d8b0dca--- /dev/null+++ b/skills/diagram-design/assets/example-state-lifecycle-full.html@@ -0,0 +1,112 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>Newsletter publication lifecycle · State machine</title>+ <link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet">+ <style>+ *, *::before, *::after { box-sizing:border-box; margin:0; padding:0; }+ :root { --color-paper:#f5f5f5; --color-paper-2:#ececec; --color-ink:#2d3142; --color-muted:#4f5d75; --color-soft:#7a8399; --color-rule:rgba(45,49,66,0.12); --color-accent:#eb6c36; --font-sans:'Geist',system-ui,sans-serif; --font-serif:'Instrument Serif',serif; --font-mono:'Geist Mono',ui-monospace,monospace; }+ body { font-family:var(--font-sans); background:var(--color-paper); min-height:100vh; padding:3rem 2rem; color:var(--color-ink); }+ .container { max-width:1200px; margin:0 auto; }+ .header { margin-bottom:2.5rem; }+ .header-eyebrow { font-family:var(--font-mono); font-size:0.66rem; font-weight:500; letter-spacing:0.18em; text-transform:uppercase; color:var(--color-muted); margin-bottom:0.75rem; }+ h1 { font-family:var(--font-serif); font-size:clamp(1.75rem,3vw + 1rem,2.5rem); font-weight:400; letter-spacing:-0.02em; line-height:1.1; margin-bottom:0.5rem; }+ .subtitle { font-size:1rem; line-height:1.55; color:var(--color-muted); max-width:64ch; }+ .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:900px; display:block; }+ svg text { font-family:'Geist',sans-serif; }+ .band { fill:rgba(79,93,117,0.035); stroke:rgba(45,49,66,0.12); }+ .flow { fill:none; stroke:#4f5d75; stroke-width:1.2; }+ .flow.retry { stroke-dasharray:5 4; }+ .flow.accent { stroke:#eb6c36; stroke-width:1.4; }+ .mask { fill:#f5f5f5; }+ .phase { fill:#fff; stroke:#2d3142; }+ .support { fill:#f5f5f5; stroke:#4f5d75; stroke-dasharray:5 4; }+ .terminal { fill:rgba(45,49,66,0.04); stroke:#4f5d75; }+ .terminal.failed { stroke-width:1.5; stroke-dasharray:3 3; }+ .cards { display:grid; grid-template-columns:1.2fr 1fr 1fr; gap:1rem; margin-top:1.5rem; }+ .card { background:#fff; border-radius:6px; border:1px solid var(--color-rule); padding:1.25rem; }+ .card .eyebrow { font-family:var(--font-mono); font-size:0.5rem; letter-spacing:0.18em; text-transform:uppercase; color:var(--color-muted); margin-bottom:0.5rem; }+ .card-header { display:flex; align-items:center; gap:0.6rem; margin-bottom:0.875rem; padding-bottom:0.875rem; border-bottom:1px solid rgba(45,49,66,0.08); }+ .card-dot { width:7px; height:7px; border-radius:50%; background:var(--color-muted); flex:0 0 auto; }+ .card-dot.coral { background:var(--color-accent); }+ .card h3 { font-size:0.875rem; font-weight:600; }+ .card p, .card ul { color:var(--color-muted); font-size:0.8125rem; line-height:1.55; list-style:none; }+ .card li { margin-bottom:0.3rem; padding-left:0.875rem; position:relative; }+ .card li::before { content:'—'; position:absolute; left:0; color:rgba(45,49,66,0.25); }+ .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; }+ @media (max-width:820px) { .cards { grid-template-columns:1fr; } }+ </style>+</head>+<body>+ <div class="container">+ <div class="header">+ <p class="header-eyebrow">State · Lifecycle phase map</p>+ <h1>Newsletter publication lifecycle</h1>+ <p class="subtitle">Five primary phases stay readable as one rail. Approval and retry leave the rail without becoming phases, while cancellation and exhausted delivery remain explicit terminal outcomes.</p>+ </div>+ <div class="diagram-container">+ <svg viewBox="0 0 1000 520" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="state-lifecycle-full-title state-lifecycle-full-desc">+ <title id="state-lifecycle-full-title">Newsletter publication lifecycle</title>+ <desc id="state-lifecycle-full-desc">A lifecycle phase map with Draft, Editing, Scheduled, Sending, and Sent on the primary rail; Approval and Delivery Retry in a recovery band; and Cancelled and Failed terminal outcomes.</desc>+ <defs>+ <pattern id="lifecycle-full-dots" width="22" height="22" patternUnits="userSpaceOnUse"><circle cx="1" cy="1" r="0.9" fill="rgba(45,49,66,0.10)"/></pattern>+ <marker id="lifecycle-full-arrow" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0,8 3,0 6" fill="#4f5d75"/></marker>+ <marker id="lifecycle-full-arrow-accent" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0,8 3,0 6" fill="#eb6c36"/></marker>+ </defs>+ <rect width="100%" height="100%" fill="#f5f5f5"/><rect width="100%" height="100%" fill="url(#lifecycle-full-dots)" opacity="0.55"/>+ <rect class="band" x="24" y="44" width="952" height="120" rx="8"/><rect class="band" x="24" y="400" width="952" height="104" rx="8"/>+ <g fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace" letter-spacing="0.14em"><text x="40" y="64">WAIT / RECOVERY</text><text x="40" y="208">PRIMARY PHASES</text><text x="40" y="420">TERMINAL OUTCOMES</text></g>++ <line class="flow" x1="40" y1="256" x2="64" y2="256" marker-end="url(#lifecycle-full-arrow)"/>+ <line class="flow" x1="214" y1="256" x2="244" y2="256" marker-end="url(#lifecycle-full-arrow)"/>+ <path class="flow" d="M319 220 V176 H369 V140" marker-end="url(#lifecycle-full-arrow)"/>+ <path class="flow" d="M449 140 V176 H499 V220" marker-end="url(#lifecycle-full-arrow)"/>+ <line class="flow" x1="574" y1="256" x2="604" y2="256" marker-end="url(#lifecycle-full-arrow)"/>+ <line class="flow accent" x1="754" y1="256" x2="800" y2="256" marker-end="url(#lifecycle-full-arrow-accent)"/>+ <path class="flow retry" d="M649 220 V176 H639 V140" marker-end="url(#lifecycle-full-arrow)"/>+ <path class="flow retry" d="M719 140 V188 H709 V220" marker-end="url(#lifecycle-full-arrow)"/>+ <path class="flow" d="M499 292 V416" marker-end="url(#lifecycle-full-arrow)"/>+ <path class="flow" d="M604 104 H584 V380 H749 V416" marker-end="url(#lifecycle-full-arrow)"/>++ <g font-family="'Geist Mono',monospace" font-size="7" text-anchor="middle" letter-spacing="0.08em" fill="#4f5d75">+ <rect class="mask" x="27" y="238" width="32" height="12" rx="2"/><text x="43" y="247">NEW</text>+ <rect class="mask" x="215" y="238" width="28" height="12" rx="2"/><text x="229" y="247">WRITE</text>+ <rect class="mask" x="326" y="158" width="48" height="12" rx="2"/><text x="350" y="167">SUBMIT</text>+ <rect class="mask" x="448" y="158" width="56" height="12" rx="2"/><text x="476" y="167">APPROVE</text>+ <rect class="mask" x="575" y="238" width="28" height="12" rx="2"/><text x="589" y="247">START</text>+ <rect class="mask" x="760" y="238" width="34" height="12" rx="2"/><text x="777" y="247" fill="#eb6c36">DELIVER</text>+ <rect class="mask" x="620" y="158" width="46" height="12" rx="2"/><text x="643" y="167">ERROR</text>+ <rect class="mask" x="700" y="180" width="42" height="12" rx="2"/><text x="721" y="189">RETRY</text>+ <rect class="mask" x="474" y="350" width="52" height="12" rx="2"/><text x="500" y="359">CANCEL</text>+ <rect class="mask" x="588" y="362" width="66" height="12" rx="2"/><text x="621" y="371">EXHAUSTED</text>+ </g>+ <circle cx="34" cy="256" r="6" fill="#2d3142"/>++ <g text-anchor="middle" font-family="'Geist',sans-serif">+ <g><rect class="phase" x="64" y="220" width="150" height="72" rx="8"/><text x="139" y="251" fill="#2d3142" font-size="12" font-weight="600">Draft</text><text x="139" y="270" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace">content exists</text></g>+ <g><rect class="phase" x="244" y="220" width="150" height="72" rx="8"/><text x="319" y="251" fill="#2d3142" font-size="12" font-weight="600">Editing</text><text x="319" y="270" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace">owner revises</text></g>+ <g><rect class="phase" x="424" y="220" width="150" height="72" rx="8"/><text x="499" y="251" fill="#2d3142" font-size="12" font-weight="600">Scheduled</text><text x="499" y="270" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace">send time set</text></g>+ <g><rect class="phase" x="604" y="220" width="150" height="72" rx="8"/><text x="679" y="251" fill="#2d3142" font-size="12" font-weight="600">Sending</text><text x="679" y="270" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace">provider active</text></g>+ <g><rect x="800" y="220" width="150" height="72" rx="8" fill="rgba(235,108,54,0.08)" stroke="#eb6c36"/><circle cx="824" cy="244" r="7" fill="none" stroke="#eb6c36"/><circle cx="824" cy="244" r="4" fill="#eb6c36"/><text x="875" y="251" fill="#2d3142" font-size="12" font-weight="600">Sent</text><text x="875" y="270" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace">delivery complete</text></g>+ </g>+ <g text-anchor="middle">+ <g><rect class="support" x="334" y="68" width="150" height="72" rx="8"/><rect x="344" y="78" width="34" height="12" rx="2" fill="none" stroke="rgba(79,93,117,0.45)"/><text x="361" y="87" fill="#4f5d75" font-size="7" font-family="'Geist Mono',monospace">WAIT</text><text x="409" y="111" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist',sans-serif">Approval</text><text x="409" y="126" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace">editor decision</text></g>+ <g><rect class="support" x="604" y="68" width="150" height="72" rx="8"/><rect x="614" y="78" width="52" height="12" rx="2" fill="none" stroke="rgba(79,93,117,0.45)"/><text x="640" y="87" fill="#4f5d75" font-size="7" font-family="'Geist Mono',monospace">RECOVERY</text><text x="679" y="111" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist',sans-serif">Delivery Retry</text><text x="679" y="126" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace">attempt 1 of 3</text></g>+ <g><rect class="terminal" x="424" y="416" width="150" height="72" rx="8"/><rect x="434" y="426" width="54" height="12" rx="2" fill="none" stroke="rgba(79,93,117,0.45)"/><text x="461" y="435" fill="#4f5d75" font-size="7" font-family="'Geist Mono',monospace">TERMINAL</text><text x="499" y="459" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist',sans-serif">Cancelled</text><text x="499" y="474" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace">stopped by owner</text></g>+ <g><rect class="terminal failed" x="674" y="416" width="150" height="72" rx="8"/><rect x="684" y="426" width="54" height="12" rx="2" fill="none" stroke="rgba(79,93,117,0.45)"/><text x="711" y="435" fill="#4f5d75" font-size="7" font-family="'Geist Mono',monospace">TERMINAL</text><text x="749" y="459" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist',sans-serif">Failed</text><text x="749" y="474" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace">retries exhausted</text></g>+ </g>+ </svg>+ </div>++ <div class="cards">+ <div class="card"><p class="eyebrow">THE HEADLINE</p><div class="card-header"><span class="card-dot coral"></span><h3>Progress owns the primary rail</h3></div><p>Draft through Sent answers the reader's first question: where is this newsletter now? Supporting behavior stays visible without breaking that scan.</p></div>+ <div class="card"><div class="card-header"><span class="card-dot"></span><h3>Wait and recovery are not phases</h3></div><ul><li>Approval pauses Editing</li><li>Retry returns to Sending</li><li>Dashed paths mark detours</li></ul></div>+ <div class="card"><div class="card-header"><span class="card-dot"></span><h3>Every stop names its cause</h3></div><ul><li>Cancelled is owner initiated</li><li>Failed means retries exhausted</li><li>Text and dashes carry meaning</li></ul></div>+ </div>+ <div class="footer"><span>DIAGRAM DESIGN · STATE MACHINE</span><span>9 STATES · 10 TRANSITIONS</span></div>+ </div>+</body>+</html>diff --git a/skills/diagram-design/assets/example-state-lifecycle.html b/skills/diagram-design/assets/example-state-lifecycle.htmlnew file mode 100644index 0000000..88a3035--- /dev/null+++ b/skills/diagram-design/assets/example-state-lifecycle.html@@ -0,0 +1,92 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>Newsletter publication lifecycle · State machine</title>+ <link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet">+ <style>+ *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }+ :root { --color-paper:#f5f5f5; --color-ink:#2d3142; --color-muted:#4f5d75; --color-accent:#eb6c36; --font-sans:'Geist',system-ui,sans-serif; --font-serif:'Instrument Serif',serif; --font-mono:'Geist Mono',ui-monospace,monospace; }+ body { font-family:var(--font-sans); background:var(--color-paper); color:var(--color-ink); min-height:100vh; display:flex; align-items:center; justify-content:center; padding:3rem 2rem; }+ .frame { max-width:1200px; width:100%; overflow-x:auto; }+ .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; }+ svg { width:100%; min-width:900px; display:block; }+ svg text { font-family:'Geist',sans-serif; }+ </style>+</head>+<body>+ <div class="frame">+ <p class="eyebrow">State · Lifecycle phase map</p>+ <h1>Newsletter publication lifecycle</h1>++ <svg viewBox="0 0 1000 520" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="state-lifecycle-title state-lifecycle-desc">+ <title id="state-lifecycle-title">Newsletter publication lifecycle</title>+ <desc id="state-lifecycle-desc">A lifecycle phase map with Draft, Editing, Scheduled, Sending, and Sent on the primary rail; Approval and Delivery Retry in a recovery band; and Cancelled and Failed terminal outcomes.</desc>+ <defs>+ <pattern id="lifecycle-dots" width="22" height="22" patternUnits="userSpaceOnUse"><circle cx="1" cy="1" r="0.9" fill="rgba(45,49,66,0.10)"/></pattern>+ <marker id="lifecycle-arrow" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0,8 3,0 6" fill="#4f5d75"/></marker>+ <marker id="lifecycle-arrow-accent" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0,8 3,0 6" fill="#eb6c36"/></marker>+ </defs>++ <rect width="100%" height="100%" fill="#f5f5f5"/>+ <rect width="100%" height="100%" fill="url(#lifecycle-dots)" opacity="0.55"/>+ <rect x="24" y="44" width="952" height="120" rx="8" fill="rgba(79,93,117,0.035)" stroke="rgba(45,49,66,0.12)"/>+ <rect x="24" y="400" width="952" height="104" rx="8" fill="rgba(45,49,66,0.035)" stroke="rgba(45,49,66,0.12)"/>+ <text x="40" y="64" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace" letter-spacing="0.14em">WAIT / RECOVERY</text>+ <text x="40" y="208" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace" letter-spacing="0.14em">PRIMARY PHASES</text>+ <text x="40" y="420" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace" letter-spacing="0.14em">TERMINAL OUTCOMES</text>++ <!-- Ten labeled transitions, drawn before states. -->+ <line x1="40" y1="256" x2="64" y2="256" stroke="#4f5d75" stroke-width="1.2" marker-end="url(#lifecycle-arrow)"/>+ <line x1="214" y1="256" x2="244" y2="256" stroke="#4f5d75" stroke-width="1.2" marker-end="url(#lifecycle-arrow)"/>+ <path d="M319 220 V176 H369 V140" fill="none" stroke="#4f5d75" stroke-width="1.2" marker-end="url(#lifecycle-arrow)"/>+ <path d="M449 140 V176 H499 V220" fill="none" stroke="#4f5d75" stroke-width="1.2" marker-end="url(#lifecycle-arrow)"/>+ <line x1="574" y1="256" x2="604" y2="256" stroke="#4f5d75" stroke-width="1.2" marker-end="url(#lifecycle-arrow)"/>+ <line x1="754" y1="256" x2="800" y2="256" stroke="#eb6c36" stroke-width="1.4" marker-end="url(#lifecycle-arrow-accent)"/>+ <path d="M649 220 V176 H639 V140" fill="none" stroke="#4f5d75" stroke-width="1.2" stroke-dasharray="5,4" marker-end="url(#lifecycle-arrow)"/>+ <path d="M719 140 V188 H709 V220" fill="none" stroke="#4f5d75" stroke-width="1.2" stroke-dasharray="5,4" marker-end="url(#lifecycle-arrow)"/>+ <path d="M499 292 V416" fill="none" stroke="#4f5d75" stroke-width="1.2" marker-end="url(#lifecycle-arrow)"/>+ <path d="M604 104 H584 V380 H749 V416" fill="none" stroke="#4f5d75" stroke-width="1.2" marker-end="url(#lifecycle-arrow)"/>++ <!-- Opaque masks keep every transition label clear of its stroke. -->+ <g font-family="'Geist Mono',monospace" font-size="7" text-anchor="middle" letter-spacing="0.08em" fill="#4f5d75">+ <rect x="27" y="238" width="32" height="12" rx="2" fill="#f5f5f5"/><text x="43" y="247">NEW</text>+ <rect x="215" y="238" width="28" height="12" rx="2" fill="#f5f5f5"/><text x="229" y="247">WRITE</text>+ <rect x="326" y="158" width="48" height="12" rx="2" fill="#f5f5f5"/><text x="350" y="167">SUBMIT</text>+ <rect x="448" y="158" width="56" height="12" rx="2" fill="#f5f5f5"/><text x="476" y="167">APPROVE</text>+ <rect x="575" y="238" width="28" height="12" rx="2" fill="#f5f5f5"/><text x="589" y="247">START</text>+ <rect x="760" y="238" width="34" height="12" rx="2" fill="#f5f5f5"/><text x="777" y="247" fill="#eb6c36">DELIVER</text>+ <rect x="620" y="158" width="46" height="12" rx="2" fill="#f5f5f5"/><text x="643" y="167">ERROR</text>+ <rect x="700" y="180" width="42" height="12" rx="2" fill="#f5f5f5"/><text x="721" y="189">RETRY</text>+ <rect x="474" y="350" width="52" height="12" rx="2" fill="#f5f5f5"/><text x="500" y="359">CANCEL</text>+ <rect x="588" y="362" width="66" height="12" rx="2" fill="#f5f5f5"/><text x="621" y="371">EXHAUSTED</text>+ </g>++ <circle cx="34" cy="256" r="6" fill="#2d3142"/>++ <!-- Primary rail: five phases. -->+ <g font-family="'Geist',sans-serif" text-anchor="middle">+ <g><rect x="64" y="220" width="150" height="72" rx="8" fill="#fff" stroke="#2d3142"/><text x="139" y="251" fill="#2d3142" font-size="12" font-weight="600">Draft</text><text x="139" y="270" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace">content exists</text></g>+ <g><rect x="244" y="220" width="150" height="72" rx="8" fill="#fff" stroke="#2d3142"/><text x="319" y="251" fill="#2d3142" font-size="12" font-weight="600">Editing</text><text x="319" y="270" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace">owner revises</text></g>+ <g><rect x="424" y="220" width="150" height="72" rx="8" fill="#fff" stroke="#2d3142"/><text x="499" y="251" fill="#2d3142" font-size="12" font-weight="600">Scheduled</text><text x="499" y="270" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace">send time set</text></g>+ <g><rect x="604" y="220" width="150" height="72" rx="8" fill="#fff" stroke="#2d3142"/><text x="679" y="251" fill="#2d3142" font-size="12" font-weight="600">Sending</text><text x="679" y="270" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace">provider active</text></g>+ <g><rect x="800" y="220" width="150" height="72" rx="8" fill="rgba(235,108,54,0.08)" stroke="#eb6c36"/><circle cx="824" cy="244" r="7" fill="none" stroke="#eb6c36"/><circle cx="824" cy="244" r="4" fill="#eb6c36"/><text x="875" y="251" fill="#2d3142" font-size="12" font-weight="600">Sent</text><text x="875" y="270" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace">delivery complete</text></g>+ </g>++ <!-- Supporting states. -->+ <g text-anchor="middle">+ <g><rect x="334" y="68" width="150" height="72" rx="8" fill="#f5f5f5" stroke="#4f5d75" stroke-dasharray="5,4"/><rect x="344" y="78" width="34" height="12" rx="2" fill="none" stroke="rgba(79,93,117,0.45)"/><text x="361" y="87" fill="#4f5d75" font-size="7" font-family="'Geist Mono',monospace">WAIT</text><text x="409" y="111" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist',sans-serif">Approval</text><text x="409" y="126" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace">editor decision</text></g>+ <g><rect x="604" y="68" width="150" height="72" rx="8" fill="#f5f5f5" stroke="#4f5d75" stroke-dasharray="5,4"/><rect x="614" y="78" width="52" height="12" rx="2" fill="none" stroke="rgba(79,93,117,0.45)"/><text x="640" y="87" fill="#4f5d75" font-size="7" font-family="'Geist Mono',monospace">RECOVERY</text><text x="679" y="111" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist',sans-serif">Delivery Retry</text><text x="679" y="126" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace">attempt 1 of 3</text></g>+ </g>++ <!-- Terminal outcomes use text, shape, and dash differences. -->+ <g text-anchor="middle">+ <g><rect x="424" y="416" width="150" height="72" rx="8" fill="rgba(45,49,66,0.04)" stroke="#4f5d75"/><rect x="434" y="426" width="54" height="12" rx="2" fill="none" stroke="rgba(79,93,117,0.45)"/><text x="461" y="435" fill="#4f5d75" font-size="7" font-family="'Geist Mono',monospace">TERMINAL</text><text x="499" y="459" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist',sans-serif">Cancelled</text><text x="499" y="474" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace">stopped by owner</text></g>+ <g><rect x="674" y="416" width="150" height="72" rx="8" fill="rgba(45,49,66,0.04)" stroke="#4f5d75" stroke-width="1.5" stroke-dasharray="3,3"/><rect x="684" y="426" width="54" height="12" rx="2" fill="none" stroke="rgba(79,93,117,0.45)"/><text x="711" y="435" fill="#4f5d75" font-size="7" font-family="'Geist Mono',monospace">TERMINAL</text><text x="749" y="459" fill="#2d3142" font-size="12" font-weight="600" font-family="'Geist',sans-serif">Failed</text><text x="749" y="474" fill="#4f5d75" font-size="8" font-family="'Geist Mono',monospace">retries exhausted</text></g>+ </g>+ </svg>+ </div>+</body>+</html>diff --git a/skills/diagram-design/assets/index.html b/skills/diagram-design/assets/index.htmlindex 991d1dc..18da438 100644--- a/skills/diagram-design/assets/index.html+++ b/skills/diagram-design/assets/index.html@@ -220,6 +220,9 @@<button class="tab" data-type="state"><span class="eyebrow">04</span>State</button>+ <button class="tab new" data-type="state-lifecycle" data-parent-type="state">+ <span class="eyebrow">04</span>State · lifecycle+ </button><button class="tab" data-type="er"><span class="eyebrow">05</span>ER</button>diff --git a/skills/diagram-design/references/semantic-patterns.md b/skills/diagram-design/references/semantic-patterns.mdindex 4508a94..9130ebb 100644--- a/skills/diagram-design/references/semantic-patterns.md+++ b/skills/diagram-design/references/semantic-patterns.md@@ -16,6 +16,7 @@ Use one primary pattern per figure. A second pattern may supply at most one supp| Which controls apply at each enforcement surface | **Governance / control catalog** | Layer stack || How defenses reduce risk and what risk remains | **Compensating security layers** | Layer stack || Which sub-elements a system decomposes into, each independently citable and traced to its implementation | **Traceable block decomposition** | Tree |+| How one subject progresses through phases, waits, retries, cancellation, and terminal outcomes | **Lifecycle phase map** | State Machine |## 1. Fan-in queue / bottleneck@@ -131,6 +132,20 @@ Use one primary pattern per figure. A second pattern may supply at most one supp**A note on provenance, not a claim of compliance:** "block," noun-phrase naming, and "flow port" are SysML Block Definition Diagram vocabulary, used because this pattern documents structure, the thing SysML's naming convention is for (IDEF0's verb-phrase convention documents *functions* instead — the wrong fit here). This is SysML-*informed* vocabulary applied to Tree's existing layout grammar, not a claim of SysML compliance: no OCL constraints, no XMI interchange, no tool-certified conformance, and no IDEF0 compliance either.+## 9. Lifecycle phase map++**Selection triggers:** One subject advances through a small set of named phases, while waits, retries, cancellation, recovery, and terminal outcomes are as important as the happy path. Use this for the subject's lifecycle, not for messages exchanged between actors.++**Required primitives:** A left-to-right primary phase rail; 4–5 ordered phase states; a separate interruption/recovery band for waits or retries; a separate terminal-outcome band; labeled transitions; distinct terminal state boxes for cancellation and failure when both can occur. Those labeled boxes are sufficient terminal outcomes; optional start/end pseudo-state markers follow the State Machine reference and count toward the transition budget.++**Complexity budget:** 4–5 primary phases, ≤2 supporting wait/recovery states, ≤2 terminal states, ≤9 states, and ≤10 transitions. Split lifecycle overview from dense guard logic once either ceiling is reached.++**Anti-patterns:** Actor lifelines or message arrows disguised as phases; a request/response exchange that belongs in Sequence; every guard and event from the underlying implementation; interruption states placed on the primary rail; cancellation and failure collapsed into one color-only state; a retry loop with no labeled re-entry point.++**Static fallback:** Show the complete primary rail, every supporting state, both terminal outcomes, and all labeled transitions in one frame. Position and band labels must distinguish progress, interruption/recovery, and termination without relying on color.++**Nearest visual type:** **State Machine**. Use **Sequence** when actor messages or request timing carry the story; use ordinary **State Machine** without this pattern when dense transition logic and guards matter more than one subject's progress.+## Composition rules- The semantic pattern may specialize status, boundary, queue, or propagation primitives; the selected type still owns page axis, connector grammar, spacing, and type-specific limits.diff --git a/skills/diagram-design/references/type-state.md b/skills/diagram-design/references/type-state.mdindex c5fe97a..7e8cbb2 100644--- a/skills/diagram-design/references/type-state.md+++ b/skills/diagram-design/references/type-state.md@@ -1,6 +1,12 @@# State Machine-**Best for:** finite state logic — order status, auth state, connection lifecycle, form wizard, job queue status.+**Best for:** finite state logic — order status, auth state, connection lifecycle, form wizard, job queue status — and the [`Lifecycle phase map`](semantic-patterns.md#9-lifecycle-phase-map) pattern when one subject's progress, waits, retries, cancellation, and outcomes are the story.++## Routing distinctions++- Use **Sequence** for time-ordered messages between actors, including request/message lifecycles.+- Use ordinary **State Machine** for dense transition logic where events, guards, and legal transitions dominate.+- Use the **Lifecycle phase map** semantic pattern for one subject moving through 4–5 primary phases with separate wait/recovery and terminal-outcome bands.## Layout conventions- States are rounded rectangles (`rx=8`), labeled in Geist.@@ -19,3 +25,6 @@- `assets/example-state.html` — minimal light- `assets/example-state-dark.html` — minimal dark- `assets/example-state-full.html` — full editorial+- `assets/example-state-lifecycle.html` — lifecycle phase map, minimal light+- `assets/example-state-lifecycle-dark.html` — lifecycle phase map, minimal dark+- `assets/example-state-lifecycle-full.html` — lifecycle phase map, full editorial