@taloswork/ose-shared 0.1.7 → 0.1.9

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 (166) hide show
  1. package/package.json +3 -3
  2. package/skills/cozy-static-svg/SKILL.md +76 -0
  3. package/skills/cozy-static-svg/references/approved-preview.png +0 -0
  4. package/skills/cozy-static-svg/references/cross-platform.md +73 -0
  5. package/skills/cozy-static-svg/references/moon_keeps_watch.svg +229 -0
  6. package/skills/cozy-static-svg/references/style-anchor.md +271 -0
  7. package/skills/cozy-static-svg/scripts/artkit.py +321 -0
  8. package/skills/cozy-static-svg/scripts/to_png.py +333 -0
  9. package/skills/diagram-design/SKILL.md +568 -0
  10. package/skills/diagram-design/assets/example-architecture-dark.html +182 -0
  11. package/skills/diagram-design/assets/example-architecture-full.html +194 -0
  12. package/skills/diagram-design/assets/example-architecture.html +183 -0
  13. package/skills/diagram-design/assets/example-bar-dark.html +129 -0
  14. package/skills/diagram-design/assets/example-bar-full.html +105 -0
  15. package/skills/diagram-design/assets/example-bar.html +129 -0
  16. package/skills/diagram-design/assets/example-data-flow-dark.html +143 -0
  17. package/skills/diagram-design/assets/example-data-flow-full.html +185 -0
  18. package/skills/diagram-design/assets/example-data-flow.html +143 -0
  19. package/skills/diagram-design/assets/example-datalake-dark.html +243 -0
  20. package/skills/diagram-design/assets/example-datalake-full.html +248 -0
  21. package/skills/diagram-design/assets/example-datalake.html +269 -0
  22. package/skills/diagram-design/assets/example-dp-integration-dark.html +80 -0
  23. package/skills/diagram-design/assets/example-dp-integration-full.html +90 -0
  24. package/skills/diagram-design/assets/example-dp-integration.html +80 -0
  25. package/skills/diagram-design/assets/example-dp-security-matrix-dark.html +31 -0
  26. package/skills/diagram-design/assets/example-dp-security-matrix-full.html +32 -0
  27. package/skills/diagram-design/assets/example-dp-security-matrix.html +88 -0
  28. package/skills/diagram-design/assets/example-er-dark.html +202 -0
  29. package/skills/diagram-design/assets/example-er-full.html +205 -0
  30. package/skills/diagram-design/assets/example-er.html +202 -0
  31. package/skills/diagram-design/assets/example-flowchart-dark.html +156 -0
  32. package/skills/diagram-design/assets/example-flowchart-full.html +159 -0
  33. package/skills/diagram-design/assets/example-flowchart.html +156 -0
  34. package/skills/diagram-design/assets/example-gantt-dark.html +137 -0
  35. package/skills/diagram-design/assets/example-gantt-full.html +127 -0
  36. package/skills/diagram-design/assets/example-gantt.html +137 -0
  37. package/skills/diagram-design/assets/example-high-level-dark.html +251 -0
  38. package/skills/diagram-design/assets/example-high-level-full.html +247 -0
  39. package/skills/diagram-design/assets/example-high-level-vertical-dark.html +274 -0
  40. package/skills/diagram-design/assets/example-high-level-vertical-full.html +252 -0
  41. package/skills/diagram-design/assets/example-high-level-vertical.html +325 -0
  42. package/skills/diagram-design/assets/example-high-level.html +301 -0
  43. package/skills/diagram-design/assets/example-import-drawio.html +185 -0
  44. package/skills/diagram-design/assets/example-import-mermaid.html +70 -0
  45. package/skills/diagram-design/assets/example-it-state-dark.html +90 -0
  46. package/skills/diagram-design/assets/example-it-state-full.html +69 -0
  47. package/skills/diagram-design/assets/example-it-state.html +128 -0
  48. package/skills/diagram-design/assets/example-layers-dark.html +123 -0
  49. package/skills/diagram-design/assets/example-layers-full.html +126 -0
  50. package/skills/diagram-design/assets/example-layers.html +123 -0
  51. package/skills/diagram-design/assets/example-line-dark.html +111 -0
  52. package/skills/diagram-design/assets/example-line-full.html +105 -0
  53. package/skills/diagram-design/assets/example-line.html +111 -0
  54. package/skills/diagram-design/assets/example-loop-dark.html +100 -0
  55. package/skills/diagram-design/assets/example-loop-full.html +137 -0
  56. package/skills/diagram-design/assets/example-loop-terminal.html +347 -0
  57. package/skills/diagram-design/assets/example-loop.html +100 -0
  58. package/skills/diagram-design/assets/example-medallion-dark.html +159 -0
  59. package/skills/diagram-design/assets/example-medallion-full.html +201 -0
  60. package/skills/diagram-design/assets/example-medallion.html +159 -0
  61. package/skills/diagram-design/assets/example-nested-dark.html +132 -0
  62. package/skills/diagram-design/assets/example-nested-full.html +135 -0
  63. package/skills/diagram-design/assets/example-nested.html +136 -0
  64. package/skills/diagram-design/assets/example-org-chart-dark.html +45 -0
  65. package/skills/diagram-design/assets/example-org-chart-full.html +45 -0
  66. package/skills/diagram-design/assets/example-org-chart.html +45 -0
  67. package/skills/diagram-design/assets/example-paved-road-animated.html +546 -0
  68. package/skills/diagram-design/assets/example-policy-trace-animated.html +490 -0
  69. package/skills/diagram-design/assets/example-process-dark.html +64 -0
  70. package/skills/diagram-design/assets/example-process-full.html +74 -0
  71. package/skills/diagram-design/assets/example-process.html +64 -0
  72. package/skills/diagram-design/assets/example-pyramid-dark.html +119 -0
  73. package/skills/diagram-design/assets/example-pyramid-full.html +122 -0
  74. package/skills/diagram-design/assets/example-pyramid.html +119 -0
  75. package/skills/diagram-design/assets/example-quadrant-consultant.html +166 -0
  76. package/skills/diagram-design/assets/example-quadrant-dark.html +135 -0
  77. package/skills/diagram-design/assets/example-quadrant-full.html +138 -0
  78. package/skills/diagram-design/assets/example-quadrant.html +135 -0
  79. package/skills/diagram-design/assets/example-queue-animated.html +577 -0
  80. package/skills/diagram-design/assets/example-radar-dark.html +139 -0
  81. package/skills/diagram-design/assets/example-radar-full.html +135 -0
  82. package/skills/diagram-design/assets/example-radar.html +139 -0
  83. package/skills/diagram-design/assets/example-scatter-dark.html +141 -0
  84. package/skills/diagram-design/assets/example-scatter-full.html +116 -0
  85. package/skills/diagram-design/assets/example-scatter.html +141 -0
  86. package/skills/diagram-design/assets/example-sequence-dark.html +222 -0
  87. package/skills/diagram-design/assets/example-sequence-full.html +388 -0
  88. package/skills/diagram-design/assets/example-sequence-oauth-dark.html +188 -0
  89. package/skills/diagram-design/assets/example-sequence-oauth-full.html +350 -0
  90. package/skills/diagram-design/assets/example-sequence-oauth.html +227 -0
  91. package/skills/diagram-design/assets/example-sequence.html +222 -0
  92. package/skills/diagram-design/assets/example-state-dark.html +147 -0
  93. package/skills/diagram-design/assets/example-state-full.html +150 -0
  94. package/skills/diagram-design/assets/example-state.html +147 -0
  95. package/skills/diagram-design/assets/example-swimlane-dark.html +172 -0
  96. package/skills/diagram-design/assets/example-swimlane-full.html +175 -0
  97. package/skills/diagram-design/assets/example-swimlane.html +172 -0
  98. package/skills/diagram-design/assets/example-timeline-dark.html +135 -0
  99. package/skills/diagram-design/assets/example-timeline-full.html +138 -0
  100. package/skills/diagram-design/assets/example-timeline.html +135 -0
  101. package/skills/diagram-design/assets/example-tree-dark.html +173 -0
  102. package/skills/diagram-design/assets/example-tree-full.html +176 -0
  103. package/skills/diagram-design/assets/example-tree.html +173 -0
  104. package/skills/diagram-design/assets/example-venn-dark.html +132 -0
  105. package/skills/diagram-design/assets/example-venn-full.html +135 -0
  106. package/skills/diagram-design/assets/example-venn.html +110 -0
  107. package/skills/diagram-design/assets/icons.html +230 -0
  108. package/skills/diagram-design/assets/index.html +369 -0
  109. package/skills/diagram-design/assets/template-dark.html +85 -0
  110. package/skills/diagram-design/assets/template-full.html +413 -0
  111. package/skills/diagram-design/assets/template-motion.html +434 -0
  112. package/skills/diagram-design/assets/template-terminal.html +173 -0
  113. package/skills/diagram-design/assets/template.html +86 -0
  114. package/skills/diagram-design/references/animation.md +141 -0
  115. package/skills/diagram-design/references/export.md +136 -0
  116. package/skills/diagram-design/references/import-drawio.md +171 -0
  117. package/skills/diagram-design/references/import-mermaid.md +126 -0
  118. package/skills/diagram-design/references/onboarding.md +297 -0
  119. package/skills/diagram-design/references/output-spec.md +181 -0
  120. package/skills/diagram-design/references/primitive-annotation.md +36 -0
  121. package/skills/diagram-design/references/primitive-icons.md +827 -0
  122. package/skills/diagram-design/references/primitive-sketchy.md +43 -0
  123. package/skills/diagram-design/references/primitive-terminal.md +76 -0
  124. package/skills/diagram-design/references/semantic-patterns.md +122 -0
  125. package/skills/diagram-design/references/style-guide.md +139 -0
  126. package/skills/diagram-design/references/type-architecture.md +78 -0
  127. package/skills/diagram-design/references/type-bar.md +48 -0
  128. package/skills/diagram-design/references/type-data-flow.md +374 -0
  129. package/skills/diagram-design/references/type-dp-integration.md +410 -0
  130. package/skills/diagram-design/references/type-dp-security-matrix.md +379 -0
  131. package/skills/diagram-design/references/type-er.md +23 -0
  132. package/skills/diagram-design/references/type-flowchart.md +23 -0
  133. package/skills/diagram-design/references/type-gantt.md +45 -0
  134. package/skills/diagram-design/references/type-high-level.md +458 -0
  135. package/skills/diagram-design/references/type-it-state.md +470 -0
  136. package/skills/diagram-design/references/type-layers.md +26 -0
  137. package/skills/diagram-design/references/type-line.md +44 -0
  138. package/skills/diagram-design/references/type-loop.md +223 -0
  139. package/skills/diagram-design/references/type-medallion.md +356 -0
  140. package/skills/diagram-design/references/type-nested.md +22 -0
  141. package/skills/diagram-design/references/type-org-chart.md +44 -0
  142. package/skills/diagram-design/references/type-process.md +495 -0
  143. package/skills/diagram-design/references/type-pyramid.md +33 -0
  144. package/skills/diagram-design/references/type-quadrant.md +81 -0
  145. package/skills/diagram-design/references/type-radar.md +80 -0
  146. package/skills/diagram-design/references/type-scatter.md +39 -0
  147. package/skills/diagram-design/references/type-sequence.md +130 -0
  148. package/skills/diagram-design/references/type-state.md +21 -0
  149. package/skills/diagram-design/references/type-swimlane.md +20 -0
  150. package/skills/diagram-design/references/type-timeline.md +20 -0
  151. package/skills/diagram-design/references/type-tree.md +24 -0
  152. package/skills/diagram-design/references/type-venn.md +26 -0
  153. package/skills/diagram-design/scripts/drawio_extract.py +856 -0
  154. package/skills/diagram-design/scripts/mermaid_extract.py +1285 -0
  155. package/skills/diagram-design/scripts/self_check.py +389 -0
  156. package/skills/document/bin/doc-gen.cjs +3 -6
  157. package/skills/document/bin/html2pptx.cjs +17 -9
  158. package/skills/document/bin/pptx-clone.cjs +41 -30
  159. package/skills/document/bin/pptx-embed-fonts.cjs +6 -2
  160. package/skills/document/bin/pptx-slide.cjs +46 -50
  161. package/skills/document/content-pipeline.md +54 -5
  162. package/skills/document/layouts/README.md +8 -0
  163. package/skills/document/layouts/blocks-2x2.tpl +19 -9
  164. package/skills/document/layouts/cards-3.tpl +1 -1
  165. package/skills/document/layouts/org-tree.tpl +1 -1
  166. package/skills/document/layouts/steps-vertical.tpl +1 -1
@@ -0,0 +1,80 @@
1
+ # Radar / Spider
2
+
3
+ **Best for:** comparing 3–5 entities across 3–5 quantitative criteria on a single normalized 0–N scale. Capability matrices, product or backend evaluations, framework/team scorecards. Where a comparison table starts running out of horizontal room, radar makes the shape of each option legible at a glance.
4
+
5
+ ## Layout conventions
6
+
7
+ - **N axes (3–5).** Equally spaced on a regular polygon-N. First axis at the top (`-90°`), going clockwise. **Above 5 → split or use a comparison table.**
8
+ - **Five concentric grid rings** at fractions `0.2 / 0.4 / 0.6 / 0.8 / 1.0` of the radius. Drawn as closed polygons connecting the axis vertices at that fraction. Inner four at `rule` 0.10 opacity, outer ring at `rule-solid` 0.20 (a hint stronger to anchor the chart).
9
+ - **Axis spokes** from center to each outer vertex. `rule-solid` 0.20 opacity. **No arrowheads.**
10
+ - **Axis labels:** one word per spoke (Jobs-minimal). Geist sans 11px weight 600. Place 16px outside the outer ring along the axis vector. Top/bottom = `text-anchor="middle"`; right side = `start`; left side = `end`.
11
+ - **Scale ticks** (e.g. `2 4 6 8 10`) only on the **first (top) axis** — putting numbers on every spoke clutters the chart fast. Geist Mono 8px, `muted`, anchored end at `cx − 6`.
12
+ - **Series polygon:** stroke 1.5px at the series color, fill the same color at `0.18` opacity (`0.22` in dark). Stroke 1.8px on the focal series — a subtle weight bump.
13
+ - **Vertex dots:** **only on the focal series**, `r=4` filled with the series color. Non-focal series are stroke-and-fill only. This is the load-bearing rule that keeps the chart readable at 4–5 series.
14
+ - **Drawing order:** dots-pattern bg → grid rings → axis spokes → axis labels → scale ticks → non-focal series (smallest area first) → focal series → focal vertex dots → legend.
15
+ - **Legend:** horizontal strip at the bottom (per the global rule). Swatch is a 16×8 rectangle (matches the polygon stroke+fill, not a circle), then the entity name. ~140px between entries. Optional italic tail on the right with the rationale (`"One coral. Position is the signal — color reserved for the recommended option."`).
16
+
17
+ ## Math
18
+
19
+ For axis `i` (0-indexed) of `N`, value `v` on scale `S`, center `(cx, cy)`, outer radius `R`:
20
+
21
+ ```
22
+ angle = -π/2 + 2π · i / N
23
+ x = cx + (v / S) · R · cos(angle)
24
+ y = cy + (v / S) · R · sin(angle)
25
+ ```
26
+
27
+ A series with values `[v0, v1, ..., v(N-1)]` becomes a `<polygon>` with `points="x0,y0 x1,y1 ..."`.
28
+
29
+ ### Pre-computed reference (N=5, cx=500, cy=240, R=160, S=10, integer-rounded)
30
+
31
+ | Fraction `f` | i=0 (top) | i=1 | i=2 | i=3 | i=4 |
32
+ |---|---|---|---|---|---|
33
+ | 0.2 | 500,208 | 530,230 | 519,266 | 481,266 | 470,230 |
34
+ | 0.4 | 500,176 | 561,220 | 538,292 | 462,292 | 439,220 |
35
+ | 0.6 | 500,144 | 591,211 | 556,317 | 444,317 | 409,211 |
36
+ | 0.8 | 500,112 | 622,201 | 575,343 | 425,343 | 378,201 |
37
+ | 1.0 | 500,80 | 652,191 | 594,369 | 406,369 | 348,191 |
38
+
39
+ For an arbitrary value `v` on axis `i`, take the unit offset from the row above for that axis (e.g. axis 1: offset `(152, -49)` from center) and scale by `v/S`. **Drop coords as integers — fractional pixels in SVG render fine, but integers keep the file scannable.**
40
+
41
+ ### Worked example (N=5)
42
+
43
+ Series `[9, 8, 9, 9, 9]` on a 0–10 scale becomes:
44
+
45
+ ```svg
46
+ <polygon points="500,96 622,201 585,356 415,356 363,196"
47
+ fill="rgba(235,108,54,0.18)" stroke="#eb6c36" stroke-width="1.8"/>
48
+ ```
49
+
50
+ Each vertex: `center + (v/10) · (outer_i − center)`, rounded to the nearest pixel.
51
+
52
+ ## Series palette
53
+
54
+ The skill's "1-focal" rule still holds: `accent` is reserved for the focal series, and a small editorial palette (`series-1` through `series-5`, defined in [`style-guide.md`](style-guide.md)) covers the non-focal series. Don't reach for free-form colors.
55
+
56
+ | Slot | Token | Light | Dark |
57
+ |---|---|---|---|
58
+ | Focal | `accent` | `#eb6c36` | `#f08a59` |
59
+ | 1 | `series-1` (sage) | `#7c8f6f` | `#9caf8f` |
60
+ | 2 | `series-2` (dusty-blue) | `#5e7a9b` | `#82a0c0` |
61
+ | 3 | `series-3` (mustard) | `#b8915a` | `#d3ad7a` |
62
+ | 4 | `series-4` (rust-brown) | `#9c6b50` | `#b88670` |
63
+ | 5 | `series-5` (slate) | `#6e6479` | `#8d8298` |
64
+
65
+ ## Anti-patterns
66
+
67
+ - **More than 5 series** → mush. Split into two charts (e.g. "best by latency" + "best by ops") or switch to a comparison table.
68
+ - **Axes on inconsistent native scales** (one 0–100, another 0–1) without normalization. **Always normalize to 0–N first** — radar polygons compare *shapes*, not absolute values.
69
+ - **Zero-baseline tricks** — starting the inner ring at v=5 to amplify differences. The grid starts at 0; if differences look small, that's the truthful reading.
70
+ - **Dots on every series.** Only the focal carries dots. Adding them to all 4–5 series turns the chart into a bead curtain.
71
+ - **Radar with 2 series** — a comparison bar chart or a 2-row table is clearer.
72
+ - **Non-quantitative axes.** All axes must be measurable on the same normalized scale. "Speed" + "color" + "year" mixes don't belong on a radar.
73
+ - **Mono-font axis labels.** Names go in Geist sans (the global rule). Mono is for technical sublabels only.
74
+ - **Rainbow palette.** Even with the new `series-*` tokens, you don't need all 5 in one chart — use only as many as you have non-focal entities.
75
+
76
+ ## Examples
77
+
78
+ - `assets/example-radar.html` — minimal light. 4 storage backends × 5 workload dimensions, MinIO focal.
79
+ - `assets/example-radar-dark.html` — minimal dark, same data.
80
+ - `assets/example-radar-full.html` — full editorial: container framing + 4 cards (one per backend) with varied widths + footer.
@@ -0,0 +1,39 @@
1
+ # Scatter Plot
2
+
3
+ **Best for:** correlation and distribution — two continuous variables plotted against each other. Use when the relationship (or lack of one) between variables is the message, or when you need to identify clusters, outliers, and high/low performers.
4
+
5
+ ## Layout conventions
6
+
7
+ - **Plot area margins:** left 80px, bottom 60px, top 40px, right 40px — inside `0 0 1000 500` viewBox.
8
+ - **Point count:** 5–30 points. Fewer → just describe the relationship in prose; more → bin into a density contour.
9
+ - **Axes:** X at y=420 (baseline), Y at x=80. Both use Geist Mono 8px gridline labels. Gridlines 4–6 per axis at equal intervals.
10
+ - **Point shape:** `<circle>` r=5 for standard points, r=6 for focal. Focal point in `accent` fill. Others in `muted @ 0.20` fill + `muted` stroke.
11
+ - **Labels on points (optional):** Geist Mono 8px next to a point. Use a paper-fill rect mask behind the label. Label at most 2–3 points; not all.
12
+ - **Trend line (optional):** `<line>` from lower-left to upper-right, stroke `rgba(45,49,66,0.25)` dashed 4,3. Never force a perfect fit — only add if the trend is visually obvious.
13
+ - **Quadrant dividers (optional):** light dashed lines at the median x and y to split into quadrants. Label each quadrant in Geist Mono 8px, muted.
14
+
15
+ ### Point pattern
16
+
17
+ ```svg
18
+ <!-- Non-focal point — paper mask + circle -->
19
+ <circle cx="X" cy="Y" r="5" fill="#f5f5f5"/>
20
+ <circle cx="X" cy="Y" r="5" fill="rgba(79,93,117,0.20)" stroke="#4f5d75" stroke-width="1"/>
21
+
22
+ <!-- Focal point -->
23
+ <circle cx="X" cy="Y" r="6" fill="#f5f5f5"/>
24
+ <circle cx="X" cy="Y" r="6" fill="rgba(235,108,54,0.15)" stroke="#eb6c36" stroke-width="1.2"/>
25
+ ```
26
+
27
+ ## Anti-patterns
28
+
29
+ - More than 30 points without clustering (jitter/mush).
30
+ - Forced trend line when the data is genuinely scattered — dishonest.
31
+ - Point labels on every point (label the focal and 1–2 notable outliers only).
32
+ - Bubble size encoding (use a third axis label or color instead; bubble area perception is unreliable).
33
+ - Axes that don't include zero when the absolute position matters; axes that do include zero when the range is tiny and far from zero.
34
+
35
+ ## Examples
36
+
37
+ - `assets/example-scatter.html` — minimal light
38
+ - `assets/example-scatter-dark.html` — minimal dark
39
+ - `assets/example-scatter-full.html` — full editorial
@@ -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="#4f5d75" stroke-width="1.2"/>
31
+ </marker>
32
+ ```
33
+
34
+ Dark mode: stroke `#bfc0c0` (muted on dark paper). 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 is Geist Mono, 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="rgba(45,49,66,0.02)" stroke="rgba(45,49,66,0.22)" stroke-width="1"/>
46
+ <!-- Operator tab -->
47
+ <rect x="X" y="Y" width="40" height="16" rx="2"
48
+ fill="#f5f5f5" stroke="rgba(45,49,66,0.22)" stroke-width="1"/>
49
+ <text x="X+20" y="Y+12" fill="#4f5d75" font-size="8"
50
+ font-family="'Geist Mono', monospace" text-anchor="middle"
51
+ letter-spacing="0.12em">ALT</text>
52
+ ```
53
+
54
+ Dark mode: frame fill `rgba(245,245,245,0.04)`, stroke `rgba(245,245,245,0.22)`, tab fill = dark `paper` (`#2d3142`), tab text = dark `muted` (`#bfc0c0`).
55
+
56
+ ### Operators
57
+
58
+ | Operator | Regions | Divider | Guard label |
59
+ |---|---|---|---|
60
+ | `opt` | 1 | none | `[if condition]` under the tab (Geist Mono 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="#4f5d75" font-size="8"
69
+ font-family="'Geist Mono', monospace" 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="rgba(45,49,66,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 SKILL.md §7).
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="rgba(45,49,66,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="rgba(45,49,66,0.06)" stroke="#4f5d75" 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 Geist sans — must be mono: `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,21 @@
1
+ # State Machine
2
+
3
+ **Best for:** finite state logic — order status, auth state, connection lifecycle, form wizard, job queue status.
4
+
5
+ ## Layout conventions
6
+ - States are rounded rectangles (`rx=8`), labeled in Geist.
7
+ - **Start**: filled ink dot (`r=6`). **End**: ringed dot (outer `r=8` outline, inner filled `r=5`).
8
+ - Transitions: curved arrows labeled in Geist Mono as `event [guard] / action` (omit sections you don't need).
9
+ - Self-loops curve above the state.
10
+ - Orient along the dominant flow direction (left→right or top→down); rearrange before crossing transitions.
11
+ - Coral on the state the reader should notice — typically the error state, or "happy completion".
12
+
13
+ ## Anti-patterns
14
+ - More transitions than states × 2 → likely two state machines.
15
+ - "From any state" transitions drawn from every state — use a single annotation (`* → Error on timeout`) instead.
16
+ - Unlabeled transitions (the whole point is *what triggers this*).
17
+
18
+ ## Examples
19
+ - `assets/example-state.html` — minimal light
20
+ - `assets/example-state-dark.html` — minimal dark
21
+ - `assets/example-state-full.html` — full editorial
@@ -0,0 +1,20 @@
1
+ # Swimlane
2
+
3
+ **Best for:** cross-functional processes, RACI-style flows, vendor handoffs, multi-team shipping workflows.
4
+
5
+ ## Layout conventions
6
+ - Horizontal lanes (or vertical columns) — one per actor/team. Label each lane in the left margin (or top) with a Geist Mono eyebrow.
7
+ - Lane dividers: 1px hairlines.
8
+ - Process steps are rectangles placed inside the lane of the actor performing them; arrows show flow.
9
+ - Handoffs (arrows crossing lane boundaries) are the most important edges — consider coral on the handoff that introduces the most coupling or latency.
10
+ - Don't force equal step count per lane; a lane with one step is fine.
11
+
12
+ ## Anti-patterns
13
+ - Lanes without labels.
14
+ - A step drawn across two lanes (pick one owner).
15
+ - Arrows that snake back and forth — reorder steps so the flow is mostly straight.
16
+
17
+ ## Examples
18
+ - `assets/example-swimlane.html` — minimal light
19
+ - `assets/example-swimlane-dark.html` — minimal dark
20
+ - `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 Geist Mono.
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: coral circle (`r=6`) + bold Geist 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.
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`), Geist 12px 600 name + optional Geist Mono 9px sublabel. 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
@@ -0,0 +1,26 @@
1
+ # Venn / Set Overlap
2
+
3
+ **Best for:** intersection of concepts/domains, shared attributes between categories, "where A meets B", ikigai-style frames (desirable × feasible × viable).
4
+
5
+ ## Layout conventions
6
+ - **Prefer 2 or 3 circles.** Avoid 4+ (unreadable — use a matrix instead).
7
+ - Circle stroke: 1px hairline, color per-set (ink, muted, soft).
8
+ - Circle fill: very low-opacity tint — `rgba(45,49,66,0.04)` for ink set, `rgba(79,93,117,0.05)` for muted. Tints compound naturally in overlap regions.
9
+ - Radii: equal when sets are comparable in size; proportional when sets are meaningfully different. Don't fake equal sizes for aesthetics.
10
+ - **Set labels** placed outside the circle, NEVER crossing the stroke. Geist 12–14px 600 for the set name, optional Geist Mono 9px sublabel.
11
+ - **Intersection labels** placed inside the overlap region, Geist 12px 600, centered. For small overlaps, use a leader line to a label in clear space.
12
+ - **Coral accent** on the ONE focal intersection — the "sweet spot". Either coral label stroke OR clipPath-bounded coral fill tint (`rgba(235,108,54,0.10)`).
13
+ - Circle centers and radii divisible by 4.
14
+
15
+ ## Anti-patterns
16
+ - Unlabeled regions — reader can't tell which set is which.
17
+ - Circles that don't overlap when overlap is the point.
18
+ - Equal-sized circles when sets are obviously different (dishonest).
19
+ - Coral on multiple overlap regions (focal signal dies).
20
+ - Labels sitting on top of circle strokes (illegible).
21
+ - 4+ circles where 2–3 would do.
22
+
23
+ ## Examples
24
+ - `assets/example-venn.html` — minimal light
25
+ - `assets/example-venn-dark.html` — minimal dark
26
+ - `assets/example-venn-full.html` — full editorial