og-image-generation_skill

This skill generates dynamic social preview images for Next.js apps using file conventions and next/og, with server-side rendering and build-time caching.
  • TypeScript

8

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill andrelandgraf/fullstackrecipes --skill og-image-generation

  • SKILL.md465 B

Overview

This skill generates dynamic social preview (OG) images for Next.js apps using Next.js file conventions and the next/og library. It produces server-rendered JSX images that can be cached at build time for fast, consistent social previews. The approach is production-ready and integrates with existing Next.js routes and build pipelines.

How this skill works

You define image JSX components that follow Next.js routing and file conventions, then use the next/og library to render those components server-side into image bytes. Images are generated on the server and can be cached at build time so the same URL returns a pre-rendered image for social cards and link previews. The skill focuses on repeatable patterns and recipes to integrate this into a full-stack app reliably.

When to use it

  • When you need consistent, brand-aligned social preview images for links and content pages.
  • When you want server-side rendered images that avoid client-side rendering delays.
  • When you need images cached at build time for better performance and deterministic outputs.
  • When using Next.js and you prefer file-convention routing for OG endpoints.
  • When you want to generate dynamic images (title, author, date) per page or post.

Best practices

  • Keep image JSX components simple and deterministic to allow effective build-time caching.
  • Use fonts and assets that are accessible to the server render environment to avoid missing resources.
  • Render only essential content (title, logo, author) to keep image size and render time small.
  • Version or fingerprint static assets so cached images invalidate correctly on updates.
  • Test generated images across social platforms to confirm correct metadata and sizing.

Example use cases

  • Generating per-post social preview images that include post title, author, and category.
  • Creating marketing campaign images that are produced from a template and stamped with campaign metadata.
  • Auto-generating event or webinar preview images with date, speaker, and logo for calendar links.
  • Producing user profile preview cards for social sharing with avatars and user handle.

FAQ

Yes. If your image components are deterministic and use build-available assets, they can be rendered and cached at build time so the same URL returns the pre-rendered image.

Do I need client-side code to render OG images?

No. The next/og approach renders images server-side using JSX, so no client-side rendering is required for the image itself.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
og-image-generation skill by andrelandgraf/fullstackrecipes | VeilStrat