Skip to main content
skill CX Codex GP ChatGPT official · OpenAI

satori — Codex skill: what it does, how to install

Guides dynamic Open Graph image generation in Next.js using Satori and @vercel/og with HTML and CSS.

Install into Codex · Skills CLI (Vercel) All methods and platforms ↓
npx skills add openai/plugins --skill satori -a codex
Open on GitHub

What satori does

This skill teaches the agent how to build Open Graph graphics with Satori and @vercel/og. Satori converts JSX-styled HTML and CSS into SVG format. To produce PNGs, @vercel/og wraps Satori inside an ImageResponse class tailored for Vercel Edge Functions.

The underlying Yoga engine imposes strict layout rules. Everything relies on Flexbox, while display: grid and fixed positioning are unsupported. External stylesheets, animations, and CSS variables do not work. System fonts are completely absent. You must load every font file manually as an array buffer.

Install it if your Next.js application generates preview cards on the fly. Skip it if you generate static images at build time.

What it helps with

  • configure dynamic OG routes in Next.js App Router
  • convert JSX markup and CSS into SVG format
  • load custom TTF font files in edge runtimes
  • generate social cards from URL query parameters

Example prompts for the agent

  • Create an app/blog/[slug]/opengraph-image.tsx using ImageResponse from next/og
  • How do I load an Inter-Bold.ttf font buffer in Satori on the edge runtime?
  • Fix this OG banner layout to comply with Satori flexbox constraints

How to install satori

1Skills CLI (Vercel)

npx skills add openai/plugins --skill satori -a codex

2Manually: put the files in place

.agents/skills/satori/SKILL.md

For all projects use ~/.agents/skills/

From the same set201

The whole set →
supabase official supabase Guides the agent through database configuration and strict RLS policies in Supabase. CX Codex GP ChatGPT 8installs remotion-render official Remotion Exports videos and static stills from Remotion projects using CLI commands. CX Codex GP ChatGPT 3installs figma-create-new-file official Figma Creates blank Figma, FigJam, or Slides files inside draft folders. It resolves planKey and editor types before invoking Figma MCP tools. CX Codex GP ChatGPT 6installs swiftui-performance-audit official OpenAI Pinpoints SwiftUI runtime issues like frame drops, unresponsive taps, and excessive view body computations. Works code-first and guides Instruments profiling. CX Codex GP ChatGPT 109installs swiftui-liquid-glass official OpenAI This skill helps build and review SwiftUI Liquid Glass interfaces for iOS 26+. Use it when adopting the API or checking fallbacks, interaction, and design fit. CX Codex GP ChatGPT 121installs swiftui-ui-patterns official OpenAI This skill helps build and refactor SwiftUI interfaces, from navigation and state to layouts and controls. Use it for new screens or changes to an existing project. CX Codex GP ChatGPT 114installs swiftui-view-refactor official OpenAI Refactors SwiftUI view files into clean, testable structures with dedicated subview types and proper Observation ownership. CX Codex GP ChatGPT 113installs ios-memgraph-leaks official OpenAI Captures and inspects iOS leaks from a simulator process or .memgraph. Useful for tracing retained objects and checking a fix with before-and-after evidence. CX Codex GP ChatGPT 1,054installs

Similar

applicationinsights-web-ts Microsoft Set up Application Insights telemetry for browser apps, including page views, requests, and exceptions. Use it for RUM or to connect browser-side GenAI agent traces with backend spans. Claude Code GitHub Copilot 38installs podcast-generation microsoft Generates podcast-style audio narratives using Azure OpenAI GPT Realtime Mini over WebSocket. Integrates a FastAPI backend with a React audio player. Claude Code GitHub Copilot 29installs frontend-design official anthropics This skill guides intentional visual design for new interfaces and redesigns. Use it when a generic generated UI is not enough. Claude Code Claude.ai 1,025,790installs design-taste-frontend Leonxlnx This skill directs the design of public pages and work screens, then checks the result in a browser through screenshots. Use it when an interface feels generic or unfinished. Claude Code CX Codex Cursor +1 673,100installs prototype Matt Pocock Creates throwaway prototypes for checking state logic or exploring UI before committing the decision to the main codebase. Claude Code 986,201installs hyperframes heygen-com Instructs coding agents on creating, validating, and rendering HTML-based videos using the HyperFrames framework and CLI. Claude Code CX Codex Cursor +1 1,200,000installs hyperframes-cli heygen-com Controls HyperFrames video workflows from the CLI: audits layouts and contrast, edits timeline clips, captures snapshots, and renders locally or in cloud runtimes. Claude Code CX Codex Cursor +1 1,200,000installs webapp-testing official anthropics This skill tests local web apps with Playwright, helping agents debug UI behavior, capture screenshots, and inspect browser logs. Claude Code Claude.ai 186,758installs

Questions about satori

How do I install satori in Codex?

Run npx skills add openai/plugins --skill satori in your project terminal.

What does the satori skill do?

It guides AI in generating code for dynamic social preview cards using Next.js route conventions and edge-ready SVG rendering.

What are the CSS limitations in Satori?

Satori supports only Flexbox layouts via the Yoga engine. Grid, animations, pseudo-elements, and CSS variables are not supported.

Source text

SKILL.md · Apache-2.0
---
name: satori
description: Expert guidance for Satori — Vercel's library that converts HTML and CSS to SVG, commonly used to generate dynamic OG images for Next.js and other frameworks.
metadata:
  priority: 4
  docs:
    - "https://github.com/vercel/satori"
    - "https://nextjs.org/docs/app/api-reference/file-conventions/metadata/opengraph-image"
  sitemap: "https://nextjs.org/sitemap.xml"
  pathPatterns:
    - 'app/**/og/**'
    - 'app/**/og.*'
    - 'app/**/opengraph-image.*'
    - 'app/**/twitter-image.*'
    - 'src/app/**/og/**'
    - 'src/app/**/og.*'
    - 'src/app/**/opengraph-image.*'
    - 'src/app/**/twitter-image.*'
    - 'pages/api/og.*'
    - 'pages/api/og/**'
    - 'src/pages/api/og.*'
    - 'src/pages/api/og/**'
    - 'apps/*/app/**/og/**'
    - 'apps/*/app/**/og.*'
    - 'apps/*/app/**/opengraph-image.*'
    - 'apps/*/app/**/twitter-image.*'
  importPatterns:
    - 'satori'
    - 'satori/wasm'
    - '@vercel/og'
    - 'next/og'
  bashPatterns:
    - '\bnpm\s+(install|i|add)\s+[^\n]*\bsatori\b'
    - '\bpnpm\s+(install|i|add)\s+[^\n]*\bsatori\b'
    - '\bbun\s+(install|i|add)\s+[^\n]*\bsatori\b'
    - '\byarn\s+add\s+[^\n]*\bsatori\b'
    - '\bnpm\s+(install|i|add)\s+[^\n]*@vercel/og\b'
    - '\bpnpm\s+(install|i|add)\s+[^\n]*@vercel/og\b'
    - '\bbun\s+(install|i|add)\s+[^\n]*@vercel/og\b'
    - '\byarn\s+add\s+[^\n]*@vercel/og\b'
---

# Satori — HTML/CSS to SVG for OG Images

You are an expert in Satori and `@vercel/og` for generating dynamic Open Graph images.

## Overview

**Satori** converts JSX-like HTML and CSS into SVG. **`@vercel/og`** wraps Satori with an `ImageResponse` class that renders the SVG to PNG, designed to run in Vercel Edge Functions and other edge runtimes.

## Installation

```bash
# For Next.js projects (recommended — includes Satori + PNG rendering)
npm install @vercel/og

# Standalone Satori (SVG output only)
npm install satori
```

## Next.js App Router — OG Image Route (Recommended)

Next.js has built-in OG image support via the `ImageResponse` re-exported from `next/og`:

```tsx
// app/og/route.tsx  OR  app/opengraph-image.tsx
import { ImageResponse } from 'next/og'

export const runtime = 'edge'

export async function GET(request: Request) {
  return new ImageResponse(
    (
      <div
        style={{
          display: 'flex',
          fontSize: 60,
          color: 'white',
          background: 'linear-gradient(to bottom, #1a1a2e, #16213e)',
          width: '100%',
          height: '100%',
          alignItems: 'center',
          justifyContent: 'center',
        }}
      >
        Hello, OG Image!
      </div>
    ),
    { width: 1200, height: 630 }
  )
}
```

## Convention-Based OG Images (Next.js 13.3+)

Place an `opengraph-image.tsx` or `twitter-image.tsx` file in any route segment:

```tsx
// app/blog/[slug]/opengraph-image.tsx
import { ImageResponse } from 'next/og'

export const alt = 'Blog post image'
export const size = { width: 1200, height: 630 }
export const contentType = 'image/png'
export const runtime = 'edge'

export default async function Image({ params }: { params: { slug: string } }) {
  const post = await getPost(params.slug)

  return new ImageResponse(
    (
      <div
        style={{
          display: 'flex',
          flexDirection: 'column',
          alignItems: 'center',
          justifyContent: 'center',
          width: '100%',
          height: '100%',
          background: '#000',
          color: '#fff',
          fontSize: 48,
        }}
      >
        <div>{post.title}</div>
      </div>
    ),
    { ...size }
  )
}
```

Next.js auto-generates the `<meta property="og:image">` tag for these files.

## Standalone Satori (SVG Only)

```ts
import satori from 'satori'
import { readFileSync } from 'fs'

const svg = await satori(
  <div style={{ display: 'flex', color: 'black', fontSize: 40 }}>
    Hello from Satori
  </div>,
  {
    width: 1200,
    height: 630,
    fonts: [
      {
        name: 'Inter',
        data: readFileSync('./fonts/Inter-Regular.ttf'),
        weight: 400,
        style: 'normal',
      },
    ],
  }
)
```

## CSS Support and Limitations

Satori uses a subset of CSS with Flexbox layout (Yoga engine):

**Supported:**
- `display: flex` (default — all elements are flex containers)
- Flexbox properties: `flexDirection`, `alignItems`, `justifyContent`, `flexWrap`, `gap`
- Box model: `width`, `height`, `padding`, `margin`, `border`, `borderRadius`
- Typography: `fontSize`, `fontWeight`, `fontFamily`, `lineHeight`, `letterSpacing`, `textAlign`
- Colors: `color`, `background`, `backgroundColor`, `opacity`
- Backgrounds: `backgroundImage` (linear/radial gradients), `backgroundClip`
- Shadows: `boxShadow`, `textShadow`
- Transforms: `transform` (basic transforms)
- Overflow: `overflow: hidden`
- Position: `absolute`, `relative`
- White space: `whiteSpace`, `wordBreak`, `textOverflow`

**Not supported:**
- `display: grid` — use nested flex containers instead
- CSS animations or transitions
- `position: fixed` or `sticky`
- Pseudo-elements (`::before`, `::after`)
- Media queries
- CSS variables

## Fonts

Fonts must be loaded explicitly — there are no default system fonts:

```tsx
// Load font in edge runtime
const font = fetch(new URL('./Inter-Bold.ttf', import.meta.url)).then(
  (res) => res.arrayBuffer()
)

export async function GET() {
  const fontData = await font

  return new ImageResponse(
    (<div style={{ fontFamily: 'Inter' }}>Hello</div>),
    {
      width: 1200,
      height: 630,
      fonts: [{ name: 'Inter', data: fontData, weight: 700, style: 'normal' }],
    }
  )
}
```

For Google Fonts, fetch directly from the CDN or bundle the `.ttf` file.

## Dynamic Content from URL Parameters

```tsx
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: 60 }}>{title}</div>),
    { width: 1200, height: 630 }
  )
}
```

## Images in OG

Use `<img>` with absolute URLs:

```tsx
<img
  src="https://example.com/avatar.png"
  width={100}
  height={100}
  style={{ borderRadius: '50%' }}
/>
```

For local images, convert to base64 or use absolute deployment URLs.

## Key Patterns

1. **Use `next/og` in Next.js projects** — it re-exports `ImageResponse` with built-in optimizations
2. **Always set `runtime = 'edge'`** — Satori and `@vercel/og` are designed for edge runtimes
3. **Use `display: 'flex'` everywhere** — Satori defaults to flex layout, no block or grid support
4. **Load fonts explicitly** — no system fonts are available; bundle `.ttf`/`.woff` files or fetch from CDN
5. **Standard OG dimensions are 1200×630** — this is the most widely supported size
6. **Use convention files for automatic `<meta>` tags** — `opengraph-image.tsx` and `twitter-image.tsx`
7. **Inline styles only** — Satori does not support external CSS or CSS-in-JS libraries

## Official Resources

- [Satori GitHub](https://github.com/vercel/satori)
- [Vercel OG Image Generation](https://vercel.com/docs/functions/og-image-generation)
- [Next.js Metadata — OG Images](https://nextjs.org/docs/app/api-reference/file-conventions/metadata/opengraph-image)
- [Satori Playground](https://og-playground.vercel.app)

© Vercel Labs · Apache-2.0 · openai/plugins

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor