image · vercel-labs — Claude Code skill: JSON to SVG and PNG via Satori
Turns JSON specs into SVG and PNG images via Satori. Useful for generating OG images, social cards, and rendering AI-generated image specs.
npx skills add vercel-labs/json-render --skill image -a claude-codeWhat image does
The skill renders images from JSON structures using Satori: takes a spec with elements (Frame, Heading, Text, Box, Row, Column, Image, Divider, Spacer) and outputs an SVG string or PNG buffer. Frame is the mandatory root container; layout and content components nest inside. You can add custom components through Zod schemas.
renderToPng requires font data (fontData) and the @resvg/resvg-js package. SVG works without them. Exports are split: full package @json-render/image, component catalog /catalog, render functions only /render, server-side /server (no React or Satori).
Fits template-driven preview generation: the agent receives a structure, the skill assembles the image. The spec defines dimensions, colors, spacing, positioning — everything Satori supports in JSX.
What it helps with
- generate an OG image from a JSON schema
- create a social card programmatically
- render an image from an AI-generated spec
- turn structured data into PNG or SVG
- assemble a preview with text, background, and images from a template
Example prompts for the agent
- Create a 1200×630 OG image with a 'Hello World' heading on a dark background
- Render this JSON spec to PNG using the Inter font
- Build a social card: h1 heading, description text, logo on the right
How to install image
1Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill image -a claude-code2Manually: put the files in place
~/.claude/skills/image/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/image/
1Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill image -a codex2Manually: put the files in place
.agents/skills/image/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill image -a cursor2Manually: put the files in place
.cursor/skills/image/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install vercel-labs/json-render image2Manually: put the files in place
.github/skills/image/SKILL.md1Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill image -a gemini-cli2Platform CLI
gemini skills install https://github.com/vercel-labs/json-render --path skills/imageManually: put the files in place
.devin/skills/image/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add vercel-labs/json-render --skill image -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set20
The whole set →Other versions of image
Similar
Questions about image
How to install image in Claude Code?
Run npx skills add vercel-labs/json-render --skill image -a claude-code. The skill will appear in ~/.claude/skills/image/SKILL.md.
What does the image skill do?
It turns JSON specs into SVG and PNG images via Satori. Used for generating OG images, social cards, and rendering image specs created by AI.
Which components are available in image?
Standard set: Frame (root container), Box, Row, Column for layout, Heading, Text, Image for content, Divider and Spacer for decoration. You can add custom ones via Zod schemas.
Source text
SKILL.md · Apache-2.0
---
name: image
description: Image renderer for json-render that turns JSON specs into SVG and PNG images via Satori. Use when working with @json-render/image, generating OG images from JSON, creating social cards, or rendering AI-generated image specs.
---
# @json-render/image
Image renderer that converts JSON specs into SVG and PNG images using Satori.
## Quick Start
```typescript
import { renderToPng } from "@json-render/image/render";
import type { Spec } from "@json-render/core";
const spec: Spec = {
root: "frame",
elements: {
frame: {
type: "Frame",
props: { width: 1200, height: 630, backgroundColor: "#1a1a2e" },
children: ["heading"],
},
heading: {
type: "Heading",
props: { text: "Hello World", level: "h1", color: "#ffffff" },
children: [],
},
},
};
const png = await renderToPng(spec, {
fonts: [{ name: "Inter", data: fontData, weight: 400, style: "normal" }],
});
```
## Using Standard Components
```typescript
import { defineCatalog } from "@json-render/core";
import { schema, standardComponentDefinitions } from "@json-render/image";
export const imageCatalog = defineCatalog(schema, {
components: standardComponentDefinitions,
});
```
## Adding Custom Components
```typescript
import { z } from "zod";
const catalog = defineCatalog(schema, {
components: {
...standardComponentDefinitions,
Badge: {
props: z.object({ label: z.string(), color: z.string().nullable() }),
slots: [],
description: "A colored badge label",
},
},
});
```
## Standard Components
| Component | Category | Description |
|-----------|----------|-------------|
| `Frame` | Root | Root container. Defines width, height, background. Must be root. |
| `Box` | Layout | Container with padding, margin, border, absolute positioning |
| `Row` | Layout | Horizontal flex layout |
| `Column` | Layout | Vertical flex layout |
| `Heading` | Content | h1-h4 heading text |
| `Text` | Content | Body text with full styling |
| `Image` | Content | Image from URL |
| `Divider` | Decorative | Horizontal line separator |
| `Spacer` | Decorative | Empty vertical space |
## Key Exports
| Export | Purpose |
|--------|---------|
| `renderToSvg` | Render spec to SVG string |
| `renderToPng` | Render spec to PNG buffer (requires `@resvg/resvg-js`) |
| `schema` | Image element schema |
| `standardComponents` | Pre-built component registry |
| `standardComponentDefinitions` | Catalog definitions for AI prompts |
## Sub-path Exports
| Export | Description |
|--------|-------------|
| `@json-render/image` | Full package: schema, components, render functions |
| `@json-render/image/server` | Schema and catalog definitions only (no React/Satori) |
| `@json-render/image/catalog` | Standard component definitions and types |
| `@json-render/image/render` | Render functions only |
© vercel-labs · Apache-2.0 · vercel-labs/json-render