clawback share-card preview
Run .skills/scripts/preview_card.sh from the project root. It composes the exact card
the report GUI would let a user download/post for a run, so you can SEE it
without driving the browser.
.skills/scripts/preview_card.sh runs/<run> # -> charts/share_card.{svg,png}
.skills/scripts/preview_card.sh runs/<run> --out /tmp # write the pair elsewhere
What it does
benchmark/bin/preview_card.js --in <run>readssummary.json(→deriveHeroModel, the same hero logic the GUI uses) and the bare chartcharts/tokens_saved.bg.svg, encodes the chart as adata:URL exactly as the GUI does, and writes the composedcharts/share_card.svg(chart background → translucent dark scrim → hero headline/sub/tagline).- The wrapper then rasterizes that SVG to
charts/share_card.png, preferring headless Google Chrome (true 1200×630, renders the nested chart), falling back to macOSqlmanageQuick Look (offline, but pads to a square — the card is the top 630px; the white strip below is padding). If neither is present it leaves just the SVG with a note to open it in a browser.
Why SVG, then a best-effort PNG
The shipped share PNG is rasterized browser-side from this same SVG
(share_card.js svgToPngBlob, via canvas). Adding a Node rasterizer would
pull a native dependency the product avoids — so the SVG is the source of truth
and the PNG here is only a convenience for eyeballing. If the lines are crushed
under the scrim in this SVG, they are crushed in the shipped PNG too.
What to look for
- Chart lines read? The two cumulative lines + the shaded wedge should be
visible behind the headline — that is the whole point of the chart bg. If they
vanish into the scrim, the scrim is too dark for the line colours (WCAG
1.4.11 wants ≥3:1 for graphical objects); the fix lives in
share_card.js(shareCardSvg) and/or the bare line colours inbenchmark/bin/plot.js. - Headline + sub read? The percentage, the token sub-line, and the tagline must stay legible (≥3:1 large text) — a scrim light enough for the lines can in turn wash these out. Both constraints have to hold at once.
Not shipped
benchmark/, scripts/, and .skills/ are dev tooling — none ship in the npm
tarball (package.json files: bin, src, README.md, LICENSE).