chompyy 0.1.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/README.md +82 -8
  2. package/THIRD_PARTY_NOTICES.md +29 -1
  3. package/dist/appstate.js +121 -4
  4. package/dist/away.js +191 -25
  5. package/dist/blueprint.js +102 -7
  6. package/dist/board.js +143 -15
  7. package/dist/catalog.js +81 -0
  8. package/dist/claudesettings.js +23 -0
  9. package/dist/cli.js +804 -55
  10. package/dist/coldstart.js +208 -0
  11. package/dist/config.js +43 -8
  12. package/dist/costs.js +162 -0
  13. package/dist/deps.js +124 -0
  14. package/dist/dream.js +422 -0
  15. package/dist/duration.js +3 -3
  16. package/dist/gate.js +40 -5
  17. package/dist/history.js +308 -0
  18. package/dist/live.js +255 -0
  19. package/dist/livequota.js +42 -5
  20. package/dist/macapp.js +25 -2
  21. package/dist/pacing.js +189 -0
  22. package/dist/permissions.js +106 -0
  23. package/dist/picture.js +124 -0
  24. package/dist/picturetype.js +208 -0
  25. package/dist/preflight.js +168 -0
  26. package/dist/projects.js +5 -4
  27. package/dist/quota.js +31 -5
  28. package/dist/refresh.js +290 -0
  29. package/dist/report.js +41 -21
  30. package/dist/review.js +111 -11
  31. package/dist/runner.js +318 -10
  32. package/dist/taste.js +528 -0
  33. package/dist/tokens.js +75 -0
  34. package/dist/tokenstore.js +61 -0
  35. package/dist/trace.js +284 -0
  36. package/dist/triggers.js +193 -0
  37. package/dist/usage.js +467 -0
  38. package/dist/vendor/codeburn/prices.js +45 -0
  39. package/dist/verify.js +150 -0
  40. package/dist/verifycard.js +146 -0
  41. package/dist/workspace.js +132 -18
  42. package/package.json +4 -2
  43. package/skills/taste/SKILL.md +4 -1
  44. package/vendor/diagram-design/LICENSE +21 -0
  45. package/vendor/diagram-design/SKILL.md +399 -0
  46. package/vendor/diagram-design/UPSTREAM.md +18 -0
  47. package/vendor/diagram-design/assets/example-arc-diagram.html +111 -0
  48. package/vendor/diagram-design/assets/example-architecture-containment.html +205 -0
  49. package/vendor/diagram-design/assets/example-architecture-delta.html +193 -0
  50. package/vendor/diagram-design/assets/example-architecture.html +183 -0
  51. package/vendor/diagram-design/assets/example-axonometric-plan-campus.html +108 -0
  52. package/vendor/diagram-design/assets/example-axonometric-plan-coffee-shop.html +121 -0
  53. package/vendor/diagram-design/assets/example-axonometric-plan-warehouse.html +127 -0
  54. package/vendor/diagram-design/assets/example-axonometric-plan.html +114 -0
  55. package/vendor/diagram-design/assets/example-bar.html +129 -0
  56. package/vendor/diagram-design/assets/example-beeswarm.html +384 -0
  57. package/vendor/diagram-design/assets/example-box-plot.html +127 -0
  58. package/vendor/diagram-design/assets/example-bubble.html +147 -0
  59. package/vendor/diagram-design/assets/example-bump.html +142 -0
  60. package/vendor/diagram-design/assets/example-data-flow.html +143 -0
  61. package/vendor/diagram-design/assets/example-datalake.html +269 -0
  62. package/vendor/diagram-design/assets/example-db-schema.html +302 -0
  63. package/vendor/diagram-design/assets/example-dependency.html +224 -0
  64. package/vendor/diagram-design/assets/example-deployment.html +190 -0
  65. package/vendor/diagram-design/assets/example-dp-integration.html +81 -0
  66. package/vendor/diagram-design/assets/example-dp-security-matrix.html +88 -0
  67. package/vendor/diagram-design/assets/example-er.html +202 -0
  68. package/vendor/diagram-design/assets/example-event-modeling.html +64 -0
  69. package/vendor/diagram-design/assets/example-exploded-ai-stack.html +85 -0
  70. package/vendor/diagram-design/assets/example-exploded-keyboard.html +84 -0
  71. package/vendor/diagram-design/assets/example-exploded-phone.html +83 -0
  72. package/vendor/diagram-design/assets/example-exploded-unboxing.html +84 -0
  73. package/vendor/diagram-design/assets/example-exploded.html +83 -0
  74. package/vendor/diagram-design/assets/example-fishbone.html +152 -0
  75. package/vendor/diagram-design/assets/example-flowchart.html +163 -0
  76. package/vendor/diagram-design/assets/example-gantt.html +137 -0
  77. package/vendor/diagram-design/assets/example-heatmap.html +224 -0
  78. package/vendor/diagram-design/assets/example-high-level-vertical.html +325 -0
  79. package/vendor/diagram-design/assets/example-high-level.html +301 -0
  80. package/vendor/diagram-design/assets/example-import-drawio.html +185 -0
  81. package/vendor/diagram-design/assets/example-import-excalidraw.html +70 -0
  82. package/vendor/diagram-design/assets/example-import-mermaid.html +70 -0
  83. package/vendor/diagram-design/assets/example-import-plantuml.html +107 -0
  84. package/vendor/diagram-design/assets/example-it-state.html +128 -0
  85. package/vendor/diagram-design/assets/example-journey.html +148 -0
  86. package/vendor/diagram-design/assets/example-kanban.html +174 -0
  87. package/vendor/diagram-design/assets/example-layers.html +123 -0
  88. package/vendor/diagram-design/assets/example-line.html +111 -0
  89. package/vendor/diagram-design/assets/example-loop.html +100 -0
  90. package/vendor/diagram-design/assets/example-marimekko.html +148 -0
  91. package/vendor/diagram-design/assets/example-medallion.html +159 -0
  92. package/vendor/diagram-design/assets/example-nested.html +136 -0
  93. package/vendor/diagram-design/assets/example-org-chart.html +45 -0
  94. package/vendor/diagram-design/assets/example-polar.html +116 -0
  95. package/vendor/diagram-design/assets/example-process.html +64 -0
  96. package/vendor/diagram-design/assets/example-pyramid.html +119 -0
  97. package/vendor/diagram-design/assets/example-quadrant-consultant.html +166 -0
  98. package/vendor/diagram-design/assets/example-quadrant.html +135 -0
  99. package/vendor/diagram-design/assets/example-radar.html +139 -0
  100. package/vendor/diagram-design/assets/example-requirement-traceability.html +122 -0
  101. package/vendor/diagram-design/assets/example-ridgeline.html +104 -0
  102. package/vendor/diagram-design/assets/example-sankey.html +150 -0
  103. package/vendor/diagram-design/assets/example-sbgn.html +213 -0
  104. package/vendor/diagram-design/assets/example-scatter.html +141 -0
  105. package/vendor/diagram-design/assets/example-sequence-oauth.html +227 -0
  106. package/vendor/diagram-design/assets/example-sequence.html +222 -0
  107. package/vendor/diagram-design/assets/example-service-blueprint.html +185 -0
  108. package/vendor/diagram-design/assets/example-slopegraph.html +119 -0
  109. package/vendor/diagram-design/assets/example-state-lifecycle.html +92 -0
  110. package/vendor/diagram-design/assets/example-state.html +147 -0
  111. package/vendor/diagram-design/assets/example-steps.html +78 -0
  112. package/vendor/diagram-design/assets/example-story-map.html +184 -0
  113. package/vendor/diagram-design/assets/example-streamgraph.html +99 -0
  114. package/vendor/diagram-design/assets/example-swimlane.html +172 -0
  115. package/vendor/diagram-design/assets/example-timeline.html +135 -0
  116. package/vendor/diagram-design/assets/example-tree-block-decomposition.html +151 -0
  117. package/vendor/diagram-design/assets/example-tree.html +173 -0
  118. package/vendor/diagram-design/assets/example-treemap.html +107 -0
  119. package/vendor/diagram-design/assets/example-uml-class.html +188 -0
  120. package/vendor/diagram-design/assets/example-unit-grid.html +141 -0
  121. package/vendor/diagram-design/assets/example-venn.html +110 -0
  122. package/vendor/diagram-design/assets/example-wardley.html +153 -0
  123. package/vendor/diagram-design/assets/example-waterfall.html +129 -0
  124. package/vendor/diagram-design/assets/template-dark.html +99 -0
  125. package/vendor/diagram-design/assets/template.html +100 -0
  126. package/vendor/diagram-design/references/layout-budget.md +103 -0
  127. package/vendor/diagram-design/references/output-spec.md +277 -0
  128. package/vendor/diagram-design/references/primitive-annotation.md +36 -0
  129. package/vendor/diagram-design/references/primitive-sketchy.md +43 -0
  130. package/vendor/diagram-design/references/primitives-core.md +146 -0
  131. package/vendor/diagram-design/references/semantic-patterns.md +154 -0
  132. package/vendor/diagram-design/references/style-guide.md +234 -0
  133. package/vendor/diagram-design/references/type-architecture-delta.md +143 -0
  134. package/vendor/diagram-design/references/type-architecture.md +117 -0
  135. package/vendor/diagram-design/references/type-axonometric-plan.md +83 -0
  136. package/vendor/diagram-design/references/type-bar.md +108 -0
  137. package/vendor/diagram-design/references/type-data-flow.md +371 -0
  138. package/vendor/diagram-design/references/type-db-schema.md +48 -0
  139. package/vendor/diagram-design/references/type-dependency.md +113 -0
  140. package/vendor/diagram-design/references/type-deployment.md +45 -0
  141. package/vendor/diagram-design/references/type-dp-integration.md +407 -0
  142. package/vendor/diagram-design/references/type-dp-security-matrix.md +379 -0
  143. package/vendor/diagram-design/references/type-er.md +25 -0
  144. package/vendor/diagram-design/references/type-event-modeling.md +36 -0
  145. package/vendor/diagram-design/references/type-exploded.md +115 -0
  146. package/vendor/diagram-design/references/type-fishbone.md +75 -0
  147. package/vendor/diagram-design/references/type-flowchart.md +23 -0
  148. package/vendor/diagram-design/references/type-gantt.md +45 -0
  149. package/vendor/diagram-design/references/type-heatmap.md +80 -0
  150. package/vendor/diagram-design/references/type-high-level.md +470 -0
  151. package/vendor/diagram-design/references/type-it-state.md +468 -0
  152. package/vendor/diagram-design/references/type-journey.md +55 -0
  153. package/vendor/diagram-design/references/type-kanban.md +49 -0
  154. package/vendor/diagram-design/references/type-layers.md +26 -0
  155. package/vendor/diagram-design/references/type-line.md +337 -0
  156. package/vendor/diagram-design/references/type-loop.md +223 -0
  157. package/vendor/diagram-design/references/type-medallion.md +356 -0
  158. package/vendor/diagram-design/references/type-nested.md +22 -0
  159. package/vendor/diagram-design/references/type-org-chart.md +44 -0
  160. package/vendor/diagram-design/references/type-polar.md +136 -0
  161. package/vendor/diagram-design/references/type-process.md +490 -0
  162. package/vendor/diagram-design/references/type-pyramid.md +33 -0
  163. package/vendor/diagram-design/references/type-quadrant.md +81 -0
  164. package/vendor/diagram-design/references/type-radar.md +82 -0
  165. package/vendor/diagram-design/references/type-requirement-traceability.md +45 -0
  166. package/vendor/diagram-design/references/type-sankey.md +75 -0
  167. package/vendor/diagram-design/references/type-sbgn.md +80 -0
  168. package/vendor/diagram-design/references/type-scatter.md +276 -0
  169. package/vendor/diagram-design/references/type-sequence.md +130 -0
  170. package/vendor/diagram-design/references/type-service-blueprint.md +103 -0
  171. package/vendor/diagram-design/references/type-state.md +30 -0
  172. package/vendor/diagram-design/references/type-steps.md +180 -0
  173. package/vendor/diagram-design/references/type-story-map.md +46 -0
  174. package/vendor/diagram-design/references/type-swimlane.md +22 -0
  175. package/vendor/diagram-design/references/type-timeline.md +20 -0
  176. package/vendor/diagram-design/references/type-tree.md +24 -0
  177. package/vendor/diagram-design/references/type-treemap.md +137 -0
  178. package/vendor/diagram-design/references/type-uml-class.md +65 -0
  179. package/vendor/diagram-design/references/type-unit-grid.md +63 -0
  180. package/vendor/diagram-design/references/type-venn.md +26 -0
  181. package/vendor/diagram-design/references/type-wardley.md +39 -0
  182. package/vendor/diagram-design/references/type-waterfall.md +75 -0
  183. package/vendor/diagram-design/scripts/self_check.py +1177 -0
  184. package/vendor/diagram-design/scripts/verify_geometry.py +696 -0
@@ -0,0 +1,130 @@
1
+ # Sequence
2
+
3
+ **Best for:** request/response flows, protocol exchanges, multi-actor interactions over time, API call traces, incident reconstructions, auth/token refresh paths with branching.
4
+
5
+ ## Layout conventions
6
+ - Actors as boxes in a horizontal row at the top.
7
+ - **Lifelines**: dashed vertical lines descending from each actor to the bottom.
8
+ - Messages: horizontal arrows between lifelines; time flows top→down.
9
+ - **Activation bar**: narrow rectangle (`w=8`, muted fill, 0.8 hairline stroke) on a lifeline spanning the interval that actor holds control. Stack for nested calls.
10
+ - Self-messages: short U-shaped loop returning to the same lifeline; label right of the loop.
11
+ - Return messages: **dashed** stroke + **filled** marker (never open). Prefer muted; optionally match the originating call color when pairing multi-hop stacks. Headline success may use solid coral (see Message kinds).
12
+ - Coral on the primary success response or headline message — one, maybe two. Actor focal strokes do not count toward the coral message budget.
13
+ - When the flow **branches** (valid vs invalid token, retry, optional step), draw a **combined fragment** frame — do not invent free-floating if/else arrow clusters.
14
+
15
+ ## Message kinds
16
+
17
+ | Kind | Stroke | Marker | When |
18
+ |---|---|---|---|
19
+ | Call (sync) | solid muted or link-blue | filled | Request that expects a reply |
20
+ | Return | **dashed** muted (or match call color) | filled | Reply to a sync call — never solid |
21
+ | Async / fire-and-forget | dashed muted | **open** arrowhead | Beacons, events, one-way notify |
22
+ | Headline success | solid accent (≤1–2 messages) | accent filled | Primary happy-path response only |
23
+
24
+ ### Open arrowhead (async)
25
+
26
+ Define once in `<defs>` and use for fire-and-forget only:
27
+
28
+ ```svg
29
+ <marker id="arrow-open" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
30
+ <polyline points="0 0, 8 3, 0 6" fill="none" stroke="{muted}" stroke-width="1.2"/>
31
+ </marker>
32
+ ```
33
+
34
+ Dark mode: `muted` inverts with the skin, so the stroke needs no change. Do not fill the open marker — the hollow head is the async signal. Return messages keep the **filled** marker even when dashed.
35
+
36
+ ## Combined fragments (`alt` / `opt` / `loop`)
37
+
38
+ Use a rectangular **frame** that spans only the lifelines participating in the branch. Operator label uses the `eyebrow` role, uppercase, in a small tab at the top-left of the frame. Time still flows top→down inside the frame.
39
+
40
+ ### Frame primitive (shared)
41
+
42
+ ```svg
43
+ <!-- Frame: light ink wash + hairline. Label tab top-left. -->
44
+ <rect x="X" y="Y" width="W" height="H" rx="4"
45
+ fill="{ink @ 0.02}" stroke="{ink @ 0.22}" stroke-width="1"/>
46
+ <!-- Operator tab -->
47
+ <rect x="X" y="Y" width="40" height="16" rx="2"
48
+ fill="{paper}" stroke="{ink @ 0.22}" stroke-width="1"/>
49
+ <text x="X+20" y="Y+12" fill="{muted}" font-size="8"
50
+ font-family="{eyebrow}" text-anchor="middle"
51
+ letter-spacing="0.12em">ALT</text>
52
+ ```
53
+
54
+ Dark mode: the roles invert with the skin, so only the frame fill changes, to `ink @ 0.04` from `ink @ 0.02`. Stroke stays `ink @ 0.22`, tab fill stays `paper`, tab text stays `muted`.
55
+
56
+ ### Operators
57
+
58
+ | Operator | Regions | Divider | Guard label |
59
+ |---|---|---|---|
60
+ | `opt` | 1 | none | `[if condition]` under the tab (`arrow-label` role, 8px) |
61
+ | `alt` | **2 max** | dashed horizontal hairline across the frame | `[guard]` on region 1; `[else]` (or a second guard) on region 2 |
62
+ | `loop` | 1 | none | `[for each item]` or `[retry ≤ 3]` under the tab |
63
+
64
+ ### Guard + divider primitives
65
+
66
+ ```svg
67
+ <!-- Guard: left-aligned inside the frame, mono -->
68
+ <text x="X+12" y="GUARD_Y" fill="{muted}" font-size="8"
69
+ font-family="{arrow-label}" letter-spacing="0.04em">[token valid]</text>
70
+
71
+ <!-- alt region divider -->
72
+ <line x1="X+8" y1="DIV_Y" x2="X+W-8" y2="DIV_Y"
73
+ stroke="{ink @ 0.20}" stroke-width="1" stroke-dasharray="4,3"/>
74
+ ```
75
+
76
+ ### Fragment layout rules
77
+ - Frame left/right inset ≥12px from the outermost participating lifeline centers (so activation bars stay inside the frame).
78
+ - ≥24px between consecutive message y-levels inside a region (4px grid).
79
+ - Guard sits in the first ~20px under the tab; first message in that region is ≥24px below the guard baseline.
80
+ - Divider y on the 4px grid; ≥16px clear of messages above and below.
81
+ - Nested fragments: **max 1 level**. Prefer two separate diagrams over deep nesting.
82
+ - Default: **one** fragment per diagram. A second only if both stay under the complexity budget.
83
+ - Coral stays on **one** headline success message across the whole diagram (usually the happy-path return inside the first `alt` region, or the final success outside a loop). Do not coral both `alt` branches.
84
+
85
+ ### Out of scope (do not invent)
86
+ - `par`, `critical`, `break`, `ref`, and other UML operators — second PR if needed.
87
+ - Participant create/destroy, found/lost messages, duration timing bars.
88
+
89
+ ## Complexity budget (sequence-specific)
90
+ - Max lifelines: 5 (same as the §7 budget table in [layout-budget.md](layout-budget.md#complexity-budget-per-diagram)).
91
+ - Max messages (arrows): 12.
92
+ - Max combined fragments: 1 (hard default); 2 only if each is a single-region `opt`/`loop`.
93
+ - Max `alt` regions: 2.
94
+ - Max fragment nesting depth: 1.
95
+ - Max coral elements: 2 (prefer 1 for fragment diagrams).
96
+
97
+ If you exceed, split: overview (happy path) + detail (failure / refresh path).
98
+
99
+ ## Lifeline primitive
100
+ ```svg
101
+ <line x1="CX" y1="TOP" x2="CX" y2="BOTTOM"
102
+ stroke="{ink @ 0.20}" stroke-width="1" stroke-dasharray="3,3"/>
103
+ ```
104
+
105
+ ## Activation bar primitive
106
+ ```svg
107
+ <rect x="CX-4" y="TOP" width="8" height="H"
108
+ fill="{ink @ 0.06}" stroke="{muted}" stroke-width="0.8"/>
109
+ ```
110
+
111
+ ## Anti-patterns
112
+ - Message arrow pointing *upward* (reverses time — never).
113
+ - Activation bars that never close.
114
+ - Labels sitting over another lifeline — shorten or shift y into a gap.
115
+ - Swimlane-style lanes instead of lifelines (different grammar).
116
+ - Drawing `if/else` as two free-floating arrow clusters with **no** fragment frame.
117
+ - Nested `alt` inside `alt` (split into two diagrams).
118
+ - Fragment operator label in the `node-name` sans family — must be mono (`eyebrow`): `ALT` / `OPT` / `LOOP`.
119
+ - Coral on both `alt` branches.
120
+ - Frame that covers actors with no messages inside the fragment.
121
+ - Filled arrowhead on async fire-and-forget (use open marker).
122
+ - Open arrowhead on return messages (returns stay filled + dashed).
123
+
124
+ ## Examples
125
+ - `assets/example-sequence.html` — minimal light (cold-cache happy path)
126
+ - `assets/example-sequence-dark.html` — minimal dark
127
+ - `assets/example-sequence-full.html` — full editorial
128
+ - `assets/example-sequence-oauth.html` — special: bearer call + `alt` refresh (light)
129
+ - `assets/example-sequence-oauth-dark.html` — same special, dark
130
+ - `assets/example-sequence-oauth-full.html` — same special, full editorial
@@ -0,0 +1,103 @@
1
+ # Service Blueprint
2
+
3
+ **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.
4
+
5
+ **Not this type:**
6
+
7
+ - 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.
8
+ - 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.
9
+ - Sequential nodes with data payloads → **Process** (`type-process.md`).
10
+ - One person's phases, waits, retries → **Lifecycle phase map** on State machine (`semantic-patterns.md` § 9).
11
+ - State census in columns, no visibility line → **Kanban** (`type-kanban.md`). Columns there are *states*, not narrative stages.
12
+ - Narrative backbone × release slices → **Story map** (`type-story-map.md`). The cut line is scope, not visibility.
13
+ - Abstraction bands with no stage columns → **Layer stack** (`type-layers.md`).
14
+
15
+ ## Layout conventions
16
+
17
+ - **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.
18
+ - **ViewBox:** `0 0 1280 720` for the minimal examples. Full editorial keeps the same SVG and adds cards.
19
+ - **Left margin:** 96px for layer labels. Geist Mono 8px, uppercase, horizontal, `text-anchor="end"` at x=88. **Never** `writing-mode: vertical`.
20
+ - **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`.
21
+ - **Layer order, top to bottom:**
22
+ 1. Physical evidence (optional) — 48px
23
+ 2. Customer actions (required) — 64px
24
+ 3. Line of interaction (hairline)
25
+ 4. Frontstage actions — onstage staff or the visible product (required) — 64px
26
+ 5. **Line of visibility** (load-bearing; heavier than the other lines)
27
+ 6. Backstage actions (required) — 64px
28
+ 7. Line of internal interaction (hairline)
29
+ 8. Support processes (optional) — 48px
30
+ - **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.
31
+ - **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.
32
+ - **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.
33
+ - **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"`.
34
+ - **Legend:** horizontal strip after a hairline rule, three keys in this order — visibility line, backstage layer, focal cell.
35
+
36
+ ### Machine-readable data contract
37
+
38
+ Every layer group: `data-layer="evidence|customer|frontstage|backstage|support"`.
39
+
40
+ Every cell: `data-stage="<stage-id>"` matching a header `data-stage`, plus `data-name` for the printed action.
41
+
42
+ Visibility line: `data-role="visibility"`. The two hairlines: `data-role="interaction"` and `data-role="internal-interaction"`.
43
+
44
+ Optional focal cell: `data-focal="true"` on at most one cell.
45
+
46
+ No `transform`, geometry `style`, or `<style>` rules that move marks.
47
+
48
+ `scripts/verify-service-blueprint.py` reads these and fails the build when the drawing and the declaration disagree.
49
+
50
+ ### Service-blueprint element pattern
51
+
52
+ ```svg
53
+ <!-- Stage header at column origin x=96; cells in this column reuse that x -->
54
+ <rect x="96" y="24" width="208" height="48" fill="none" data-stage="sign-up"/>
55
+ <text x="200" y="60" fill="#2d3142" font-size="12" font-weight="600"
56
+ font-family="'Geist', sans-serif" text-anchor="middle">Sign up</text>
57
+
58
+ <g data-layer="customer">
59
+ <rect x="544" y="128" width="208" height="64" rx="4" fill="#ffffff" stroke="#2d3142"
60
+ stroke-width="1" data-stage="hit-limit" data-name="Retry payment"/>
61
+ <text x="648" y="164" fill="#2d3142" font-size="12" font-family="'Geist', sans-serif"
62
+ text-anchor="middle">Retry payment</text>
63
+ </g>
64
+
65
+ <!-- Visibility line: 2px ink @ 0.55, between frontstage bottom and backstage top -->
66
+ <line x1="96" y1="268" x2="1200" y2="268" stroke="rgba(45,49,66,0.55)" stroke-width="2"
67
+ data-role="visibility"/>
68
+
69
+ <g data-layer="backstage">
70
+ <rect x="544" y="272" width="208" height="64" rx="4" fill="rgba(191,69,32,0.12)"
71
+ stroke="#bf4520" stroke-width="1" data-stage="hit-limit"
72
+ data-name="dunning-job timeout" data-focal="true"/>
73
+ <text x="648" y="300" fill="#bf4520" font-size="12" font-weight="600"
74
+ font-family="'Geist', sans-serif" text-anchor="middle">dunning-job timeout</text>
75
+ <text x="648" y="318" fill="#4f5d75" font-size="8" font-family="'Geist Mono', monospace"
76
+ text-anchor="middle">dunning-job · 4h</text>
77
+ </g>
78
+ ```
79
+
80
+ ## Anti-patterns
81
+
82
+ - **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.
83
+ - **Sentiment curve on a blueprint.** That is a journey; split the figures.
84
+ - **Arrows crossing layers.** That is a swimlane.
85
+ - **Accent on every failing cell.** One focal cell; the rest of the grid is census.
86
+ - **Empty required layers** with no `—` / `Not applicable` mark.
87
+ - **More than 6 stages**; more than two lines of cell text.
88
+ - **`writing-mode` vertical layer labels.** Horizontal only, in the left margin.
89
+
90
+ ## Honesty rules
91
+
92
+ - **The grid is a census, not a flow chart.** Stage order is the sequence. Wait times and system names are cell text, not edges.
93
+ - **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.
94
+ - **The visibility line is checkable.** It spans the plot, sits in the frontstage/backstage gap, and its stroke clears 3:1 against paper.
95
+ - **Printed text matches `data-name`.** A cell that draws "Retry payment" and declares another action is two stories.
96
+
97
+ 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.
98
+
99
+ ## Examples
100
+
101
+ - `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".
102
+ - `assets/example-service-blueprint-dark.html` — minimal dark, same data.
103
+ - `assets/example-service-blueprint-full.html` — full editorial: container framing + 3 varied-width summary cards + footer.
@@ -0,0 +1,30 @@
1
+ # State Machine
2
+
3
+ **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.
4
+
5
+ ## Routing distinctions
6
+
7
+ - Use **Sequence** for time-ordered messages between actors, including request/message lifecycles.
8
+ - Use ordinary **State Machine** for dense transition logic where events, guards, and legal transitions dominate.
9
+ - Use the **Lifecycle phase map** semantic pattern for one subject moving through 4–5 primary phases with separate wait/recovery and terminal-outcome bands.
10
+
11
+ ## Layout conventions
12
+ - States are rounded rectangles (`rx=8`), labeled in the `node-name` role.
13
+ - **Start**: filled ink dot (`r=6`). **End**: ringed dot (outer `r=8` outline, inner filled `r=5`).
14
+ - Transitions: curved arrows labeled in the `arrow-label` role as `event [guard] / action` (omit sections you don't need).
15
+ - Self-loops curve above the state.
16
+ - Orient along the dominant flow direction (left→right or top→down); rearrange before crossing transitions.
17
+ - Coral on the state the reader should notice — typically the error state, or "happy completion".
18
+
19
+ ## Anti-patterns
20
+ - More transitions than states × 2 → likely two state machines.
21
+ - "From any state" transitions drawn from every state — use a single annotation (`* → Error on timeout`) instead.
22
+ - Unlabeled transitions (the whole point is *what triggers this*).
23
+
24
+ ## Examples
25
+ - `assets/example-state.html` — minimal light
26
+ - `assets/example-state-dark.html` — minimal dark
27
+ - `assets/example-state-full.html` — full editorial
28
+ - `assets/example-state-lifecycle.html` — lifecycle phase map, minimal light
29
+ - `assets/example-state-lifecycle-dark.html` — lifecycle phase map, minimal dark
30
+ - `assets/example-state-lifecycle-full.html` — lifecycle phase map, full editorial
@@ -0,0 +1,180 @@
1
+ # Steps
2
+
3
+ **Best for:** a short, ordered sequence of stages where the order is the claim and each stage needs a number, a compact visual cue, a title, and one brief explanation. Use it for methods, playbooks, onboarding paths, launch checklists, and “how it works” explainers.
4
+
5
+ Prefer **Timeline** when spacing encodes real elapsed time, **Flowchart** when the route branches, **Swimlane** when ownership and handoffs matter, and **Process** when each stage must expose actors, tools, or input/output payloads. Steps has one rail, no branches, no time scale, and no actor lanes.
6
+
7
+ ---
8
+
9
+ ## 1. Inputs
10
+
11
+ ```yaml
12
+ steps: # 3..7, left to right
13
+ - number: "01"
14
+ title: "Frame"
15
+ description: ["Define the decision", "and its success signal"]
16
+ icon: file # optional; from primitive-icons.md
17
+ - number: "02"
18
+ title: "Research"
19
+ description: ["Gather evidence from", "customers and operators"]
20
+ icon: users
21
+ - number: "03"
22
+ title: "Synthesize"
23
+ description: ["Turn observations into", "one testable direction"]
24
+ icon: search
25
+ focal: true
26
+ - number: "04"
27
+ title: "Decide"
28
+ description: ["Commit the scope and", "name the trade-offs"]
29
+ icon: database
30
+ - number: "05"
31
+ title: "Ship"
32
+ description: ["Release, measure, and", "feed learning forward"]
33
+ icon: container
34
+ dark: false
35
+ ```
36
+
37
+ Rules:
38
+
39
+ - `steps` contains 3–7 entries. Fewer than three is a list; more than seven needs grouping or a second diagram.
40
+ - Exactly one step is `focal: true`. It is the decision, transformation, or risk the figure exists to emphasize.
41
+ - `number` is two digits for fewer than 100 steps (`01`, `02`, …) so the rail scans evenly.
42
+ - `description` is one or two short lines, each no longer than 26 characters at the standard ramp. Rewrite rather than shrink.
43
+ - `icon` is optional and must come from [`primitive-icons.md`](primitive-icons.md). Omit icons from every step if a coherent set is unavailable; never mix line icons, emoji, and brand marks.
44
+
45
+ ---
46
+
47
+ ## 2. Layout grammar
48
+
49
+ The canonical `doc-wide` canvas is `1280×720`. All structural coordinates sit on the 4px grid.
50
+
51
+ ```text
52
+ outer_x = 80
53
+ rail_y = 240
54
+ rail_h = 48
55
+ n = len(steps)
56
+ usable_w = 1280 - 2 * outer_x
57
+ stage_w = min(224, 4 * floor(usable_w / (4 * n)))
58
+ content_w = n * stage_w
59
+ start_x = (1280 - content_w) / 2
60
+ stage_x(i) = start_x + i * stage_w
61
+ stage_cx(i) = stage_x(i) + stage_w / 2
62
+ medallion_cy = rail_y + rail_h / 2
63
+ medallion_r = 36
64
+ number_y = 164
65
+ number_rule_y = 184..220
66
+ title_y = 360
67
+ description_y = 388, 408
68
+ legend_rule_y = 600
69
+ legend_y = 636
70
+ ```
71
+
72
+ This yields a 224px stage for 3–5 steps, 184px for 6, and 160px for 7. Keep `stage_w` on the 4px grid, center the combined rail, and preserve at least 24px between description columns. If copy does not fit the narrower six- or seven-stage columns, widen the canvas or rewrite the copy; do not reduce the type ramp.
73
+
74
+ ### Rail
75
+
76
+ - Draw one contiguous horizontal rail from `stage_x(0)` to `stage_x(n-1) + stage_w`.
77
+ - Each stage owns one `stage_w × 48` segment. Alternate `ink @ 0.05` and `ink @ 0.09` fills to make the segmentation visible without introducing a series palette.
78
+ - The focal segment uses `accent-tint` with a 1px `accent` top and bottom rule.
79
+ - The rail itself expresses order. Do not add arrows between adjacent stages; they duplicate the layout.
80
+
81
+ ### Number and guide
82
+
83
+ - Number: `{eyebrow}` role, 8px, weight 600, letter-spacing `0.14em`, centered at `stage_cx(i)`.
84
+ - Guide: 1px vertical rule from `y=184` to `y=220`, `rule-solid`; focal guide uses `accent`.
85
+ - The number is `muted` by default and `accent` for the focal step.
86
+
87
+ ### Icon medallion
88
+
89
+ - Circle center `(stage_cx(i), 264)`, radius 36.
90
+ - Draw an opaque `paper` circle first so the rail does not show through, then a 1px outline.
91
+ - Default outline and icon use `ink`; focal outline and icon use `accent` and the circle may use `accent-tint`.
92
+ - Place one 24×24 primitive at `(stage_cx(i)-12, 252)`. Icons are decorative (`aria-hidden="true"`); the accessible name comes from the SVG title and description.
93
+
94
+ ### Copy block
95
+
96
+ - Title: `{node-name}` role, 12px, weight 600, centered at `y=360`.
97
+ - Description: `{sublabel}` role, 9px, centered, at most two lines at `y=388` and `y=408`.
98
+ - Titles use `ink`; descriptions use `muted`. The focal title may use `accent`; the description remains `muted`.
99
+
100
+ ---
101
+
102
+ ## 3. Focal and color rules
103
+
104
+ One step is focal. Treat its number, guide, rail segment, medallion outline/icon, and title as one visual unit. All remaining steps stay neutral.
105
+
106
+ Do not assign a different hue to every step. The familiar five-color infographic treatment turns sequence into a legend-reading task and conflicts with the global 1–2 accent rule. If stages genuinely encode categories rather than order, use a chart or another type whose color carries data.
107
+
108
+ ---
109
+
110
+ ## 4. Legend
111
+
112
+ Use a bottom strip only when the focal state needs explanation. The canonical examples show:
113
+
114
+ - neutral outlined medallion — `Stage`
115
+ - accent outlined medallion — `Focal stage`
116
+ - italic note — `Equal spacing shows order, not elapsed time.`
117
+
118
+ If the title or subtitle already names the focal stage and the distinction is obvious, remove the legend.
119
+
120
+ ---
121
+
122
+ ## 5. Reproducibility checklist
123
+
124
+ 1. Step count is 3–7 and exactly one entry is focal.
125
+ 2. Step origins, segment widths, medallion centers, and copy anchors derive from §2.
126
+ 3. The rail is contiguous; there are no gaps, arrowheads, or diagonal connectors.
127
+ 4. Every medallion has an opaque paper mask beneath its outline.
128
+ 5. Every step either has one icon from `primitive-icons.md` or all icons are omitted.
129
+ 6. Titles stay at 12px and descriptions at 9px; long copy is rewritten, not shrunk.
130
+ 7. The focal step is the only accent-bearing stage.
131
+ 8. The SVG uses the accessible SVG contract and the wrapper owns horizontal scrolling.
132
+
133
+ ---
134
+
135
+ ## 6. What `verify-steps.py` requires
136
+
137
+ The checker reads attributes, so every mark binds itself to its stage and draws exactly what it states.
138
+
139
+ - **Bindings.** Each stage has one rail `<rect data-role="rail">`, one medallion `<circle data-role="medallion">` and one number `<text data-role="number">`, all with the same unique `data-step`. Rails also carry `data-index` 1..n in left-to-right order. Exactly one rail and its medallion carry `data-focal="true"`.
140
+ - **Geometry.** Rails share `y`, `width` and `height` and touch end to end. Medallions are centered on their segment with one shared radius; numbers are centered on it at `x` and print the two-digit index. Every mark stays inside the viewBox.
141
+ - **Allowed attributes.** A rail may carry only `x y width height fill fill-opacity`, a medallion only `cx cy r fill stroke stroke-width`, a number only `x y fill font-size font-weight font-family text-anchor`, plus their `data-*` bindings. No `style`, `class`, `id`, `transform`, `dx`/`dy`, `opacity` or anything else. A number contains only its text.
142
+ - **Groups.** Marks sit only inside plain `<g>` groups of the one root `<svg>`, never inside `defs`, a nested `svg` or any other element. A group above a mark may carry only `aria-hidden fill stroke stroke-width stroke-linecap stroke-linejoin font-family font-size font-weight letter-spacing text-anchor`. No attribute may appear twice on any element.
143
+ - **Paint and type.** The first `<rect>` in the SVG is the paper (`#f5f5f5` light, `#2d3142` dark). Rails fill with a non-paper house ink above zero alpha. Medallion outlines and numbers use a house ink at 0.4 alpha or more. Numbers resolve to font-size 8 or more, a font family starting with Geist, Geist Mono or Instrument Serif, and `text-anchor="middle"`. Strokes are at most 4 wide.
144
+ - **Page and CSS.** Style marks with presentation attributes. Stylesheet rules that can reach the SVG may set only `box-sizing`, `margin`, `padding` and custom properties; nothing may move or hide the diagram. CONTRIBUTING.md lists the page rules in full.
145
+
146
+ A minimal three-stage figure that passes, with the second stage focal:
147
+
148
+ ```html
149
+ <svg viewBox="0 0 1280 720" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="steps-min-title steps-min-desc">
150
+ <title id="steps-min-title">Plan, build, ship</title>
151
+ <desc id="steps-min-desc">Three equal stages on one rail; build is the focal stage.</desc>
152
+ <rect width="100%" height="100%" fill="#f5f5f5"/>
153
+ <g aria-hidden="true">
154
+ <rect x="304" y="240" width="224" height="48" fill="rgba(45,49,66,0.05)" data-role="rail" data-step="plan" data-index="1"/>
155
+ <rect x="528" y="240" width="224" height="48" fill="rgba(191,69,32,0.08)" data-role="rail" data-step="build" data-index="2" data-focal="true"/>
156
+ <rect x="752" y="240" width="224" height="48" fill="rgba(45,49,66,0.05)" data-role="rail" data-step="ship" data-index="3"/>
157
+ </g>
158
+ <g font-family="'Geist Mono', monospace" font-size="8" font-weight="600" letter-spacing="0.14em" text-anchor="middle">
159
+ <text x="416" y="164" fill="#4f5d75" data-role="number" data-step="plan">01</text>
160
+ <text x="640" y="164" fill="#bf4520" data-role="number" data-step="build">02</text>
161
+ <text x="864" y="164" fill="#4f5d75" data-role="number" data-step="ship">03</text>
162
+ </g>
163
+ <g aria-hidden="true" fill="#f5f5f5" stroke-width="1">
164
+ <circle cx="416" cy="264" r="36" stroke="#2d3142" data-role="medallion" data-step="plan"/>
165
+ <circle cx="640" cy="264" r="36" stroke="none"/>
166
+ <circle cx="640" cy="264" r="36" fill="rgba(191,69,32,0.08)" stroke="#bf4520" data-role="medallion" data-step="build" data-focal="true"/>
167
+ <circle cx="864" cy="264" r="36" stroke="#2d3142" data-role="medallion" data-step="ship"/>
168
+ </g>
169
+ </svg>
170
+ ```
171
+
172
+ ---
173
+
174
+ ## 7. Anti-patterns
175
+
176
+ - Rainbow stage bands with no categorical meaning.
177
+ - Using Steps for dated events, branching decisions, actor handoffs, or feedback loops.
178
+ - Paragraphs under each stage; two short lines is the ceiling.
179
+ - A different icon style per stage, emoji mixed with line icons, or icons that repeat the title without adding recognition.
180
+ - Arrowheads between every adjacent segment. The left-to-right rail already says “next.”
@@ -0,0 +1,46 @@
1
+ # User Story Map
2
+
3
+ **Best for:** the Jeff Patton user story map — it answers "what is the whole story, and where do we cut the first release?" Narrative order runs left to right; priority runs top to bottom. The **release cut** is the editorial point of the diagram: a map without one is just a backlog in a grid.
4
+
5
+ This is neither **Kanban** nor **User journey**, and the distinction is load-bearing:
6
+
7
+ - **Kanban** shows *state* — columns are Todo/Doing/Done, there is no narrative order and nothing to slice.
8
+ - **User journey** shows *one persona's feelings* across stages via a sentiment curve.
9
+ - A **story map** has neither state nor sentiment. Its columns are **narrative order** and its rows are **release slices**. If you aren't slicing releases, use one of those two instead.
10
+
11
+ ## Layout conventions
12
+
13
+ Vertical stack, top to bottom:
14
+
15
+ 1. **Backbone** — up to 5 activities in left-to-right narrative order, as wide header cards (200px, `rx=6`, `ink @ 0.05` fill, `muted` stroke). Each card: the activity name in the `node-name` role, 12px, weight 600, above an `eyebrow`-role 8px uppercase tracked eyebrow (`ACTIVITY 1` … `ACTIVITY 5`). 24px gutters between cards.
16
+ 2. **Walking skeleton row** — directly under each activity, its user *steps* as smaller cards (`rx=4`, 32px tall, white fill, `ink` stroke), `node-name` family 12px. One or two per activity; reserve room for two so every activity's row bottom aligns even when it only has one step.
17
+ 3. **Release slices** — horizontal bands below the skeleton row, each a full-width lane with an `eyebrow`-role 8px uppercase tracked label (`MVP`, `RELEASE 2`, `LATER`) sitting in a 96px left margin. Band background alternates `ink @ 0.02` / none. Inside each band, story cards (`rx=4`, 48px tall) sit in their activity's column: story title in the `node-name` role, 12px, weight 600, plus a `sublabel`-role 9px estimate/ticket sublabel (e.g. `RPT-114 · 3pt`). Whenever any slice has a gap (an activity with no card in that row), add `rule` hairline column separators (0.8px, dashed `4,4`, 0.10 opacity) running from just under the backbone down to the bottom of the last slice, drawn before the cards — without them, a gappy grid reads as scattered rather than mapped to its activity.
18
+ 4. **The release cut line** — a full-width horizontal `accent` rule (1.5px) immediately under the MVP band, with a masked `arrow-label`-role 8px label `RELEASE CUT` at its right end. This is accent element one.
19
+ 5. **Legend** — horizontal strip at the bottom per the global rule (hairline separator above): one swatch for the default story card, one for the highest-risk treatment, one for the release-cut line.
20
+
21
+ ## Focal rule
22
+
23
+ Exactly 2 accent elements: the release cut line with its `RELEASE CUT` label (counts as one), and the single riskiest story card — drawn with `accent @ 0.05` fill, `accent` dashed `4,4` stroke, and a small rectangular `RISK` tag (`rx=2`, matching the type-tag primitive) — counts as the other. Nothing else on the map is `accent`.
24
+
25
+ ## Complexity budget
26
+
27
+ - Max 5 activities, max 3 release slices, max 12 story cards total, max 4 cards per slice.
28
+ - Max 2 accent elements (the release cut counts as one; the riskiest card counts as the other).
29
+ - Over budget on a single activity or slice → split into one map per activity, or collapse a slice into a count card rather than listing every item.
30
+
31
+ ## Anti-patterns
32
+
33
+ - **No release cut.** A map with no cut line is a backlog in a grid, not a map — the cut is the whole point.
34
+ - **Columns ordered by priority instead of narrative sequence.** The backbone is a story, left to right, in the order the user experiences it — not a ranked list.
35
+ - **Story cards that are features, not user-visible outcomes.** "Add a chart" is a story; "Refactor the charting service" is not — it belongs in a backlog ticket, not the map.
36
+ - **Slices named by date instead of by outcome.** `MVP` / `RELEASE 2` / `LATER` describe scope; `Q3` / `Q4` describe a calendar and drift the moment the schedule slips.
37
+ - **More than 3 slices.** Beyond MVP, next, and later, nobody believes the ordering — collapse the tail into "Later."
38
+ - **Mixing two personas in one map.** One map per persona, same as user journey.
39
+ - **Adding state columns.** That turns it into a kanban board — this type has no state.
40
+ - **Adding a sentiment curve.** That turns it into a user journey — this type has no feelings axis.
41
+
42
+ ## Examples
43
+
44
+ - `assets/example-story-map.html` — minimal light. *Reporting, first release*: four activities (`Find the data`, `Build the report`, `Share it`, `Trust it`), MVP/Release 2/Later slices, release cut under MVP, `Row-level permissions` flagged as the riskiest story.
45
+ - `assets/example-story-map-dark.html` — minimal dark, same data.
46
+ - `assets/example-story-map-full.html` — full editorial: container framing + 3 summary cards of varied widths + footer.
@@ -0,0 +1,22 @@
1
+ # Swimlane
2
+
3
+ **Best for:** cross-functional processes, RACI-style flows, vendor handoffs, multi-team shipping workflows.
4
+
5
+ **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.
6
+
7
+ ## Layout conventions
8
+ - Horizontal lanes (or vertical columns) — one per actor/team. Label each lane in the left margin (or top) with an `eyebrow`-role label.
9
+ - Lane dividers: 1px hairlines.
10
+ - Process steps are rectangles placed inside the lane of the actor performing them; arrows show flow.
11
+ - Handoffs (arrows crossing lane boundaries) are the most important edges — consider coral on the handoff that introduces the most coupling or latency.
12
+ - Don't force equal step count per lane; a lane with one step is fine.
13
+
14
+ ## Anti-patterns
15
+ - Lanes without labels.
16
+ - A step drawn across two lanes (pick one owner).
17
+ - Arrows that snake back and forth — reorder steps so the flow is mostly straight.
18
+
19
+ ## Examples
20
+ - `assets/example-swimlane.html` — minimal light
21
+ - `assets/example-swimlane-dark.html` — minimal dark
22
+ - `assets/example-swimlane-full.html` — full editorial
@@ -0,0 +1,20 @@
1
+ # Timeline
2
+
3
+ **Best for:** release history, project milestones, incident timelines, roadmaps, changelog visualizations.
4
+
5
+ ## Layout conventions
6
+ - Horizontal hairline baseline across the middle (`stroke-width=1`).
7
+ - Tick marks at time boundaries (quarters, months, sprints) with date labels below in the `arrow-label` role.
8
+ - Events: small filled circles (`r=4`) on the baseline. Labels alternate above and below to prevent collision, connected to the circle with a 1px hairline drop.
9
+ - Major milestones: `accent` circle (`r=6`) + bold `node-name`-role label.
10
+ - Time scale must be honest: if intervals are non-equal, space the circles non-equally. Don't fake linear spacing for aesthetics. Break the axis visibly if a region is too dense.
11
+
12
+ ## Anti-patterns
13
+ - Equal-spacing events that aren't equally spaced in time.
14
+ - Missing axis labels ("what unit is this?").
15
+ - Crowded labels without vertical offset — illegible.
16
+
17
+ ## Examples
18
+ - `assets/example-timeline.html` — minimal light
19
+ - `assets/example-timeline-dark.html` — minimal dark
20
+ - `assets/example-timeline-full.html` — full editorial
@@ -0,0 +1,24 @@
1
+ # Tree / Hierarchy
2
+
3
+ **Best for:** org charts, dependency trees, taxonomy, file trees, decision breakdowns, skill trees. For hierarchical, ID-addressable block decomposition with per-block I/O, constraints, and implementation traceability, load [`semantic-patterns.md`](semantic-patterns.md) § Traceable block decomposition first — it specializes this layout without changing it.
4
+
5
+ ## Layout conventions
6
+ - Root at top, children fan out below (or root at left, children to right).
7
+ - Nodes are small labeled rectangles (`rx=6`), `node-name` role 12px 600 name + optional `sublabel` role 9px. Width 120–180px, height 40–52px.
8
+ - **Connectors are orthogonal (elbow-style), never diagonal.** Parent drops a short vertical line, then a horizontal bus connects siblings, then each child has a short vertical drop into its top edge. 1px muted stroke.
9
+ - Leaf indicator: thinner stroke (0.8) or different fill — OR let terminal position do the work.
10
+ - Max depth: 4 (root + 3 tiers). Max breadth per level: 5.
11
+ - Coral on **one** node: root OR critical leaf. Not both.
12
+ - Draw connectors before nodes.
13
+
14
+ ## Anti-patterns
15
+ - Tree 5+ levels deep on a single page (illegible — split).
16
+ - Nodes of wildly varying widths — pick 2 widths max.
17
+ - Diagonal connector lines.
18
+ - Skipped levels (parent connected to grandchild with no middle).
19
+ - Coral on root AND a leaf.
20
+
21
+ ## Examples
22
+ - `assets/example-tree.html` — minimal light
23
+ - `assets/example-tree-dark.html` — minimal dark
24
+ - `assets/example-tree-full.html` — full editorial