skills/og-image-dynamic/SKILL.md
--- name: og-image-dynamic description: Generate per-URL Open Graph images at runtime so every shared link unfurls with a distinct, branded preview card. Supports Cloudflare Workers (Satori), Vercel Edge (@vercel/og), and TanStack Start static builds. Use after shipping any app that gets shared on X/Reddit/LinkedIn/WhatsApp. category: quality-review argument-hint: [--runtime cf|vercel|node] [--route /api/og] [--template <file>] [--test] allowed-tools: Bash(*) Read Write Edit Glob Grep content-pi
npx skillsauth add RonanCodes/ronan-skills skills/og-image-dynamicInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Every share needs a preview card. A single static og-image.png for all URLs looks lazy and tanks click-through on Twitter/Reddit/LinkedIn previews. This skill wires up a /api/og.png endpoint that renders a per-URL, per-content image in <100ms and caches it at the edge.
/ro:og-image-dynamic # auto-detect runtime, wire default template
/ro:og-image-dynamic --runtime cf # Cloudflare Workers (Satori + resvg)
/ro:og-image-dynamic --runtime vercel # Vercel Edge (@vercel/og)
/ro:og-image-dynamic --route /api/og # custom route path
/ro:og-image-dynamic --test # open the endpoint with sample params
src/routes/api/og.$slug.ts or /api/og.png) that accepts query params and returns image/png.src/routes/__root.tsx (or the page-level route) so each route gets its own OG image URL.Cache-Control: public, max-age=86400, s-maxage=604800).@vercel/og pulls in @resvg/resvg-wasm which runs fine on Workers, but the lighter-weight approach uses satori + @resvg/resvg-wasm directly:
pnpm add satori @resvg/resvg-wasm
Route:
// src/routes/api/og.ts
import { createFileRoute } from '@tanstack/react-router'
import satori from 'satori'
import { Resvg } from '@resvg/resvg-wasm'
// Load a font and the wasm binary once (module-level); Workers isolates reuse them.
// Put Inter-Regular.woff and resvg.wasm in src/assets/ and import with `?url` or inline.
export const Route = createFileRoute('/api/og')({
server: {
handlers: {
GET: async ({ request }) => {
const { searchParams } = new URL(request.url)
const title = searchParams.get('title') ?? 'Default title'
const subtitle = searchParams.get('subtitle') ?? ''
const svg = await satori(
{
type: 'div',
props: {
style: {
display: 'flex',
flexDirection: 'column',
width: '1200px',
height: '630px',
padding: '80px',
background: 'linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%)',
color: 'white',
fontFamily: 'Inter',
},
children: [
{
type: 'div',
props: {
style: { fontSize: 72, fontWeight: 700, lineHeight: 1.1 },
children: title,
},
},
subtitle && {
type: 'div',
props: {
style: { fontSize: 36, marginTop: 24, opacity: 0.8 },
children: subtitle,
},
},
].filter(Boolean),
},
},
{
width: 1200,
height: 630,
fonts: [{ name: 'Inter', data: INTER_FONT, weight: 700, style: 'normal' }],
},
)
const png = new Resvg(svg).render().asPng()
return new Response(png, {
headers: {
'Content-Type': 'image/png',
'Cache-Control': 'public, max-age=86400, s-maxage=604800, immutable',
},
})
},
},
},
})
Font loading: satori requires a font binary passed as ArrayBuffer. On Workers, bundle via Vite:
import InterRegular from '@/assets/Inter-Regular.woff?url'
const INTER_FONT = await fetch(new URL(InterRegular, import.meta.url)).then((r) => r.arrayBuffer())
Wasm loading: @resvg/resvg-wasm needs explicit init on Workers. Follow their README's initWasm() step at module load.
Simpler — @vercel/og ships everything:
pnpm add @vercel/og
// app/api/og/route.tsx
import { ImageResponse } from '@vercel/og'
export const runtime = 'edge'
export async function GET(request: Request) {
const { searchParams } = new URL(request.url)
const title = searchParams.get('title') ?? 'Default title'
return new ImageResponse(
(
<div style={{ display: 'flex', fontSize: 72, color: 'white', background: '#0f172a', width: '100%', height: '100%', padding: 80 }}>
{title}
</div>
),
{ width: 1200, height: 630 },
)
}
In TanStack Start, set per-route meta in the file-based route:
// src/routes/posts/$slug.tsx
export const Route = createFileRoute('/posts/$slug')({
loader: async ({ params }) => fetchPost(params.slug),
head: ({ loaderData }) => ({
meta: [
{ property: 'og:title', content: loaderData.title },
{ property: 'og:image', content: `/api/og?title=${encodeURIComponent(loaderData.title)}` },
{ name: 'twitter:card', content: 'summary_large_image' },
{ name: 'twitter:image', content: `/api/og?title=${encodeURIComponent(loaderData.title)}` },
],
}),
})
# Local dev
curl -sL 'http://localhost:3000/api/og?title=Hello&subtitle=World' -o /tmp/og.png && open /tmp/og.png
# Production unfurl — real test uses platform debuggers:
# - Twitter/X: https://cards-dev.twitter.com/validator
# - Facebook/Meta: https://developers.facebook.com/tools/debug/
# - LinkedIn: https://www.linkedin.com/post-inspector/
# - Discord unfurls on paste into any channel.
Always verify on the actual platform. OG unfurl caches are aggressive (LinkedIn 7+ days); if the preview looks stale, add a cache-buster ?v=2 to the final URL.
title.slice(0, 80) + '…' in the route.Cache-Control: public, max-age=86400, s-maxage=604800, immutable
max-age=86400 — browser caches 1 day.s-maxage=604800 — Cloudflare / Vercel edge caches 1 week.immutable — tells caches never to revalidate (safe because any content change changes the URL via query params).If using query params for dynamic content, the URL is the cache key — different params = different cached image. No need for a cache-invalidation strategy.
glyphhanger or pre-subset with fontTools.twitter:image, not og:image. Set both.?v=N during dev.ratelimit binding; Vercel: use @upstash/ratelimit)./ro:posthog — track which OG-image URLs actually get shared (share events with item_id)/ro:seo-launch-ready — complementary meta-tag + sitemap setup/ro:cf-ship / /ro:fly-deploy — deploy targets where this runs/ro:app-polish — umbrella skill that invokes this as check #3testing
--- name: linear-pipeline description: The Fable orchestrator for a single dispatched Linear ticket. Holds almost no context itself; it receives `--issue <ID> --detached`, decides the stage sequence, and fans out a sub-agent per stage, passing forward only each stage's artifact (never re-derived, never inlined into its own context). Step zero, before any planning or stage routing, is a boundary triage against `canon/security-boundary.md` (#199): a match tags Ronan Connolly and stops the run, no
development
--- name: in-your-face description: Capture a chat-only answer into a durable artifact (markdown + HTML, PDF when cheap) and launch it automatically so the user cannot miss it. Use when user says "in your face", "don't let me lose this", "save that answer", "make that durable", or right after answering a substantive side question (a recipe, comparison, how-to, or generated prompt) that would otherwise die with the context. category: workflow argument-hint: [--no-open] [--vault <short>] [hint of
tools
One-shot headless OpenAI Codex CLI calls for background/admin AI tasks — summaries, classification, extraction, admin glue. The default engine for anything that runs AI constantly in the background (daemon-driven, per-event), because it bills the flat ChatGPT subscription instead of Claude usage or per-token API spend, and it keeps working while Claude is rate-limited. NEVER for coding — coding stays Claude. Use when a skill or daemon needs a cheap always-on AI call, when the user says "use codex", "ask codex", "codex as backup", or when building a background summarizer/classifier into a listener or loop. Reads auth from ~/.codex/auth.json (ChatGPT account, no API key).
research
Turn a warranty rejection, repair quote, or RMA email into a cited decision brief — legal read (NL/EU consumer law), is the part user-serviceable, live part and new-unit prices, repair-vs-DIY-vs-new economics, before-you-send-it checklist, deadlines. Use when the user pastes or screenshots a repair quote, warranty rejection, "not covered" email, onderzoekskosten fee, or asks "should I repair or replace this".