Skip to content
FramesField
SKILL.md Developer / Local Tooling SKILL.md
Verified Nov 30, 2026

Satori OG Image and SVG Data Chart Skill

How to install this SKILL.md

Install into .claude/skills/, .cursor/skills/, or .agents/skills/ whenever you want your coding agent to build reproducible Open Graph cards or editorial data diagrams without opening Figma manually.

Installable SKILL.md teaching Claude Code, Cursor, and Codex to generate deterministic 1200x630 Open Graph share PNGs with Satori + sharp and crisp 1400px-wide retina SVG-to-WebP data charts directly from real frontmatter or JSON data—with XML escaping, daylight typography, and mandatory visual QA.

Compatible agent hosts
Claude Code Cursor Codex
Target tool: Satori / Sharp / SVG-to-WebP · License: MIT
  1. STEP 01
    Install the Satori OG & Data Chart skill

    Pick Claude Code, Cursor, or Codex below to save SKILL.md into your skills directory.

  2. STEP 02
    Ask for programmatic OG cards or data charts

    Your agent writes deterministic SVG or Satori renderers using your brand tokens and real repo data.

  3. STEP 03
    Visually inspect rendered PNG/WebP output

    Enforces explicit XML escaping, zero label overlap, exact numeric dimensions, and crisp retina density.

1. Install for your tool

Pick the app you use below for the exact verified command or config—zero manual guessing.

Direct raw file (SKILL.md) ↓
Claude Code (.claude/skills/) bash
Installs into .claude/skills/satori-og-and-svg-charts/SKILL.md for programmatic social cards and editorial charts.
mkdir -p .claude/skills/satori-og-and-svg-charts
curl -fsSL https://framesfield.com/raw/skills/satori-og-card-and-chart-generator-skill -o .claude/skills/satori-og-and-svg-charts/SKILL.md

2. Inspect or download the full SKILL.md file

This is the exact raw file served at /raw/skills/satori-og-card-and-chart-generator-skill.

Satori OG Image and SVG Data Chart Skill SKILL.md
---
name: satori-og-and-svg-charts
description: Generate deterministic 1200x630 Open Graph PNG share cards using Satori + sharp and crisp 1400px-wide editorial SVG-to-WebP data charts or architecture diagrams grounded in real structured data, enforcing XML escaping, collision-free typography, and visual inspection.
---

# Programmatic Satori OG Card & SVG Data Chart Protocol

Whenever generating Open Graph social share cards (`1200x630` PNG) or publication-grade data charts and architectural diagrams (`1400px` wide WebP), follow this deterministic code-driven design protocol instead of generating AI raster art:

## 1. Open Graph Social Cards (`1200 x 630` via Satori + Sharp)
- Load real local `.ttf` or `.woff` font buffers (never rely on remote Google Fonts fetches during CI/sandbox builds).
- Restrict Satori JSX strictly to supported Flexbox layout properties (`display: 'flex'`, explicit `flexDirection`, zero CSS Grid, zero unsupported `calc()`).
- Enforce clean editorial hierarchy: top mono kicker (`14px`), high-contrast title (`48–56px`, truncated cleanly at word boundary if `> 80` chars), concise 2-line subtitle (`22px`), and bottom metadata strip (left: category/metrics; right: verified date).
- Rasterize Satori's SVG string to PNG with `sharp(Buffer.from(svg)).png({ compressionLevel: 9 }).toBuffer()`.

## 2. Technical Data Charts & Diagrams (`1400px` SVG -> Retina WebP)
- Always escape XML reserved characters (`&`, `<`, `>`) inside `<text>` nodes—an unescaped `<path>` or `&` causes `sharp` / `librsvg` XML parse errors immediately.
- Render SVG at `density: 144` and `webp({ quality: 92, effort: 5 })` so hairline borders and `11px` monospace numbers stay razor-sharp on HiDPI monitors.
- **Collision-Prevention Rules:**
  1. Draw faint gridlines first (`stroke-opacity="0.55"`); place a clean white backdrop pill (`<rect fill="#FFFFFF" opacity="0.94">`) behind any text label that crosses a vertical gridline.
  2. Never slice text strings mid-word; wrap into explicit two-line stacked `<text>` elements with generous horizontal column padding (`>= 18px`).
  3. Place values inside long dark/signal bars in crisp `#FFFFFF` when bar width `> 220px`, and outside to the right otherwise.
  4. Use tabular monospace typography for all dollar amounts, percentages, pixel dimensions, and axis scales.

## 3. Mandatory Visual Inspection Gate
Never ship a freshly generated OG card or data chart without opening the rendered `.png` or `.webp` image and visually inspecting it for clipped margins, colliding labels, broken glyphs, or inaccurate axis scaling.

3. Test it right away (sample prompt & result)

Sample prompt / input
"Build a build-time 1200x630 Satori OG card renderer for our blog posts and a 1400x700 SVG-to-WebP bar chart comparing API costs from src/content/specs/*.json."
What happens when it runs
- Wires src/pages/og/[slug].png.ts loading bundled local .ttf fonts into Satori + sharp with exact 1200x630 PNG output.
- Generates scripts/generate-charts.mjs reading verified JSON specs, rendering crisp collision-free 1400x700 WebP at density 144.
- Visually opens and confirms zero text overlap before embedding with explicit width/height attributes.

What you need & known limits

Requirements

  • Node.js 18+ with satori and sharp installed
  • Local .ttf / .otf font files bundled inside the repo (no flaky runtime network font calls)

Watch out for

  • Satori supports CSS Flexbox only (not CSS Grid) and requires explicit display: 'flex' on multi-child containers
  • Librsvg inside sharp does not auto-wrap SVG <text> lines—break long sentences explicitly into stacked <text> nodes

Frequently Asked Questions

Why generate OG cards and charts via code instead of asking an AI image generator to draw charts?
Diffusion image models frequently hallucinate misspelled axis labels, uneven bar lengths, and wrong dollar amounts. Code-driven Satori and SVG-to-WebP renderers pull exact numbers directly from your repository JSON with guaranteed typography accuracy and zero per-image API cost.
Why use density: 144 when converting SVG to WebP with sharp?
Rendering SVG vectors at 144 DPI (2x baseline 72 DPI) produces crisp anti-aliased edges on thin 1px hairlines and small 11–12px monospace annotations without bloated PNG file sizes.
Use this page in AI tools or notes
raw .md