Commit dd7f449
committed
fix: correct PNG resolution regression and inaccurate skill docs
Fixes found in a critical review of the previous commit:
- embed.ts: fix PNG resolution degradation on large diagrams. Export mode
was reusing the interactive fitToContainer() scaling, which silently
shrinks diagrams to fit an arbitrary viewport — a 21-node flowchart at
default settings rendered at 444x1736px instead of its natural 2024x7936px.
Export mode now always renders at true 1:1 scale.
- render.mjs: grow the PNG viewport to the diagram's natural size as a
defensive fallback; drop the fragile global-puppeteer createRequire hack
in favor of one consistent local-install story.
- SKILL.md/README: fix contradictory puppeteer install instructions
(SKILL.md said -g, README said local — only local works with this
script's ESM resolution). Remove the false "auto-installed via npx"
compatibility claim. Remove allowed-tools (Claude-specific syntax,
risky to pre-authorize Bash access across untested agents). Document
that --width/--height only bound PNG output and never affect SVG.
Also split the single diagram-guide.md into two verified reference docs,
researched via web search and fact-checked against MermZen's actual
renderer (not just recalled from training data):
- references/style-guide.md: diagram types, node-count thresholds,
direction/subgraph/shape conventions, hand-drawn-specific complexity
limits, gantt/ER/sequence-diagram tips
- references/syntax-guide.md: LLM-common Mermaid syntax mistakes (reserved
words, keyword collisions, quoting rules, classDef support by diagram
type). Several claims from initial research were verified or corrected
by actually rendering test cases: confirmed `end` as a bare node ID and
sequence participants named `Loop` break rendering; confirmed classDef
is a hard parse error in sequenceDiagram but a silent no-op in
classDiagram/erDiagram; disproved and removed an unverified claim about
underscores triggering markdown italics (doesn't reproduce on this
Mermaid version/config).1 parent 553dfcd commit dd7f449
8 files changed
Lines changed: 501 additions & 166 deletions
File tree
- skills/mermzen-render
- references
- scripts
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
256 | | - | |
| 255 | + | |
| 256 | + | |
257 | 257 | | |
258 | | - | |
| 258 | + | |
259 | 259 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
21 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
| |||
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
39 | 53 | | |
40 | 54 | | |
41 | 55 | | |
| |||
50 | 64 | | |
51 | 65 | | |
52 | 66 | | |
53 | | - | |
54 | | - | |
| 67 | + | |
| 68 | + | |
55 | 69 | | |
56 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
57 | 77 | | |
58 | 78 | | |
59 | 79 | | |
| |||
109 | 129 | | |
110 | 130 | | |
111 | 131 | | |
112 | | - | |
| 132 | + | |
113 | 133 | | |
114 | | - | |
115 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
116 | 140 | | |
117 | 141 | | |
118 | 142 | | |
119 | 143 | | |
120 | 144 | | |
121 | | - | |
| 145 | + | |
| 146 | + | |
122 | 147 | | |
123 | 148 | | |
This file was deleted.
0 commit comments