Token导航 LogoToken导航TokenDH.com
图像处理权限需确认github未标认证来源可访问许可证需确认审计未展示

opengraph-imagesopengraph 图片

Agent Skill

用于辅助图像生成、图片编辑、视觉素材处理或图像模型工作流。它适合让 Agent 根据文本生成图片、处理背景、整理视觉提示词或调用相关图像工具。使用时需要确认输入图片、版权来源、输出格式和模型限制;涉及人物、品牌、商品或公开展示素材时,应额外核对授权、真实性和内容合规边界。

总安装

588

周安装

24

GitHub Stars

20

下载量

190
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:opengraph-images(opengraph 图片)
来源仓库:https://github.com/sgcarstrends/sgcarstrends
仓库路径:skills/opengraph-images
安装命令:
npx skills add https://github.com/sgcarstrends/sgcarstrends --skill opengraph-images
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/sgcarstrends/sgcarstrends --skill opengraph-images

简介

opengraph-images 用于辅助图像生成、图片编辑、视觉素材处理或图像模型工作流。

  • 适合让 Agent 根据文本生成图片、处理背景、整理视觉提示词或调用相关图像工具。
  • 使用时需要确认输入图片、版权来源、输出格式和模型限制。
  • 涉及人物、品牌、商品或公开展示素材时,应额外核对授权、真实性和内容合规边界。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

name
opengraph-images
description
Create dynamic OpenGraph images for social media sharing using Next.js ImageResponse API. Use when adding OG images to new pages, updating existing OG images, or implementing page-specific social previews.
allowed-tools
Read, Edit, Write, Grep, Glob

OpenGraph Images Skill

This skill helps you create consistent, branded OpenGraph images for social media sharing across the web application.

When to Use This Skill

  • Creating dynamic OG images for new pages
  • Updating existing OG image content/styling
  • Implementing page-specific social previews
  • Adding custom fonts to OG images
  • Debugging OG image rendering issues

Key Files

FilePurpose
apps/web/src/app/opengraph-image.pngStatic homepage OG image
apps/web/src/app/about/opengraph-image.tsxDynamic About page OG image
apps/web/src/app/blog/[slug]/opengraph-image.tsxDynamic blog post OG images
apps/web/assets/fonts/Geist font files for OG images

Standard Configuration

Required Exports

import { ImageResponse } from "next/og";

// Alt text for accessibility
export const alt = "Page Title - MotorMetrics";

// Standard OG image dimensions
export const size = {
  width: 1200,
  height: 630,
};

// Image format
export const contentType = "image/png";

Font Loading

Load Geist fonts from assets/fonts/ for consistent typography:

import { readFile } from "node:fs/promises";
import { join } from "node:path";

export default async function Image() {
  const [geistRegular, geistSemiBold, geistBold] = await Promise.all([
    readFile(join(process.cwd(), "assets/fonts/Geist-Regular.ttf")),
    readFile(join(process.cwd(), "assets/fonts/Geist-SemiBold.ttf")),
    readFile(join(process.cwd(), "assets/fonts/Geist-Bold.ttf")),
  ]);

  return new ImageResponse(
    // JSX content
    <div>...</div>,
    {
      ...size,
      fonts: [
        { name: "Geist", data: geistRegular, style: "normal", weight: 400 },
        { name: "Geist", data: geistSemiBold, style: "normal", weight: 500 },
        { name: "Geist", data: geistBold, style: "normal", weight: 700 },
      ],
    },
  );
}

Design Structure

Standard Layout Pattern

OG images follow a consistent three-part structure:

┌────────────────────────────────────────────┐
│  [Eyebrow Chip]  (page context indicator)  │
│                                            │
│  Main Headline                             │
│  With Gradient Text                        │
│                                            │
│  Subheadline description text that         │
│  provides additional context               │
└────────────────────────────────────────────┘

Eyebrow Chip

Small pill-shaped indicator that signals page type/context:

<div
  style={{
    display: "flex",
    alignItems: "center",
    gap: 8,
    padding: "8px 16px",
    backgroundColor: "rgba(37, 99, 235, 0.05)",
    border: "1px solid rgba(37, 99, 235, 0.2)",
    borderRadius: 9999,
    marginBottom: 32,
  }}
>
  <div
    style={{
      width: 8,
      height: 8,
      borderRadius: "50%",
      backgroundColor: "#2563eb",
    }}
  />
  <span
    style={{
      fontSize: 16,
      fontWeight: 500,
      color: "rgba(10, 10, 10, 0.9)",
      letterSpacing: "0.025em",
    }}
  >
    Behind the Data
  </span>
</div>

Eyebrow Text Guidelines:

Page TypeEyebrow Text
HomepageSingapore Car Market Data
AboutBehind the Data
Blog PostBlog / Analysis / Insights
COECOE Bidding Results
CarsVehicle Registrations

Main Headline

Two-line headline with gradient text on the second line:

<div
  style={{
    display: "flex",
    flexDirection: "column",
    fontSize: 64,
    fontWeight: 700,
    color: "#0a0a0a",
    lineHeight: 1.1,
    letterSpacing: "-0.025em",
    marginBottom: 24,
  }}
>
  <span>First Line of</span>
  <span
    style={{
      backgroundImage: "linear-gradient(to right, #2563eb, rgba(37, 99, 235, 0.7))",
      backgroundClip: "text",
      color: "transparent",
    }}
  >
    Gradient Headline
  </span>
</div>

Subheadline

Supporting description text:

<div
  style={{
    display: "flex",
    fontSize: 24,
    color: "rgba(10, 10, 10, 0.7)",
    lineHeight: 1.5,
    maxWidth: 700,
    fontWeight: 400,
  }}
>
  Description text that provides additional context about the page content.
</div>

Colour Palette

ElementColourValue
BackgroundLight gray#f5f5f5
Primary textNear black#0a0a0a
Secondary textMutedrgba(10, 10, 10, 0.7)
Primary blueBrand#2563eb
Gradient endLighter bluergba(37, 99, 235, 0.7)
Chip backgroundTintedrgba(37, 99, 235, 0.05)
Chip borderSubtlergba(37, 99, 235, 0.2)

Static vs Dynamic OG Images

Use Static PNG When:

  • Content never changes (homepage)
  • No page-specific data needed
  • Maximum performance required
src/app/opengraph-image.png  # Just place the file

Use Dynamic TSX When:

  • Content varies by page/route (blog posts, about)
  • Need custom fonts
  • Dynamic data from database
// src/app/[route]/opengraph-image.tsx
export default async function Image({ params }) {
  // Fetch data, generate dynamic content
}

Dynamic Route OG Images

For routes with dynamic segments (e.g., blog posts):

import { getAllPosts, getPostBySlug } from "@web/queries/posts";
import { ImageResponse } from "next/og";

interface Props {
  params: Promise<{ slug: string }>;
}

export const size = { width: 1200, height: 630 };
export const dynamic = "force-static";

export async function generateStaticParams() {
  const posts = await getAllPosts();
  return posts.map((post) => ({ slug: post.slug }));
}

const Image = async ({ params }: Props) => {
  const { slug } = await params;
  const post = await getPostBySlug(slug);

  if (!post) {
    return new Response("Not found", { status: 404 });
  }

  return new ImageResponse(
    <div style={{ /* ... */ }}>
      {post.title}
    </div>,
    {
      ...size,
      headers: {
        "Cache-Control": "public, max-age=31536000, s-maxage=31536000, immutable",
      },
    },
  );
};

export default Image;

Caching Headers

For static/infrequently changing OG images:

return new ImageResponse(content, {
  ...size,
  headers: {
    "Cache-Control": "public, max-age=31536000, s-maxage=31536000, immutable",
  },
});

Important Constraints

ImageResponse JSX Limitations

The ImageResponse API uses Satori for rendering, which has constraints:

  • No CSS classes - Use inline style objects only
  • Limited CSS properties - Flexbox works, Grid doesn't
  • No external images - Must be base64 or absolute URLs
  • Font files required - Must load .ttf files explicitly
  • No React hooks - Server-side only

Common Style Gotchas

// ❌ Won't work
<div className="flex gap-4">

// ✅ Use inline styles
<div style={{ display: "flex", gap: 16 }}>

// ❌ CSS Grid not supported
<div style={{ display: "grid" }}>

// ✅ Use Flexbox
<div style={{ display: "flex", flexWrap: "wrap" }}>

Testing OG Images

  1. Local development: Visit http://localhost:3000/about/opengraph-image directly
  2. Social debuggers:

- Facebook Sharing Debugger - Twitter Card Validator - LinkedIn Post Inspector

  1. OG Preview tools: opengraph.xyz

File Organization

src/app/
├── opengraph-image.png           # Static homepage OG
├── about/
│   └── opengraph-image.tsx       # Dynamic About OG
├── blog/
│   └── [slug]/
│       └── opengraph-image.tsx   # Dynamic blog post OG
├── cars/
│   └── opengraph-image.tsx       # Dynamic cars section OG
└── coe/
    └── opengraph-image.tsx       # Dynamic COE section OG

Validation Checklist

When creating/updating OG images:

  • [ ] Exports alt, size, and contentType
  • [ ] Uses standard 1200x630 dimensions
  • [ ] Follows three-part structure (eyebrow, headline, subheadline)
  • [ ] Uses brand colours from palette
  • [ ] Loads Geist fonts for custom typography
  • [ ] Uses inline styles only (no CSS classes)
  • [ ] Eyebrow text clearly indicates page context
  • [ ] Headline is concise and fits on two lines max
  • [ ] Subheadline provides useful context
  • [ ] Tested in social media debuggers

Related Files

  • apps/web/CLAUDE.md - Web app conventions
  • apps/web/assets/fonts/ - Geist font files
  • apps/web/src/config/index.ts - Site title and URL constants

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.75%
按下载量换算74

Claude

29.31%
按下载量换算56

Cursor

18.01%
按下载量换算34

Gemini CLI

8.45%
按下载量换算16

安全审计

暂无安全审计结果可展示。

权限和风险

权限需确认

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills