Community이미지github.com

og-image-kit

웹사이트의 모든 페이지에 대해 Open Graph / Twitter (X) 공유 이미지를 생성하고 og:* 및 twitter:* 메타 태그를 연결한 후 소셜 미리보기를 검증합니다.

og-image-kit란 무엇인가요?

og-image-kit은 웹사이트의 모든 공개 페이지에 대해 1200×630 크기의 공유 이미지를 생성하고 올바른 og:* 및 twitter:* 메타 태그를 설정한 후, 실제 소셜 미리보기가 제대로 표시되는지 검증하는 AI 에이전트 스킬입니다. Next.js App Router (opengraph-image.tsx + next/og ImageResponse), Astro (빌드 타임에 satori와 resvg를 사용한 PNG 생성), 정적 사이트 (Pillow 스크립트) 등 다양한 기술 스택을 지원합니다. 사용자가 '링크가 X/Slack/LinkedIn/WeChat에서 이상하게 보여요', '소셜 공유 카드가 필요해요', '사이트 출시 전에 OG 이미지를 확인하고 싶어요'와 같은 요청을 할 때 자동으로 적합한 스택을 감지하고 필요한 코드를 생성/수정합니다. 또한 scripts/check_og.py를 통해 메타 태그의 존재 여부, 이미지 URL의 절대 경로 여부, 이미지 크기와 형식 등을 자동으로 검증하여 문제를 조기에 발견할 수 있도록 합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/getpaidskills/skills/tree/HEAD/skills/og-image-kit

Installed? Explore more 이미지 skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

og-image-kit은(는) 무엇을 하나요?

목표: 모든 공개 페이지가 1200×630 공유 이미지와 올바른 og:* / twitter:* 태그를 가지며, 단순히 작성하는 것에 그치지 않고 scripts/check_og.py를 통해 검증까지 완료합니다.

1단계 — 스택 감지

코드를 작성하기 전에 먼저 저장소를 확인하세요:

신호스택이동
package.json에 next가 있고 app/ (또는 src/app/) 디렉터리가 있음Next.js App Router2A 단계로
next가 있지만 pages/만 있음Next.js Pages Router2C 단계 (정적) 또는 ImageResponse로 /api/og 추가
package.json에 astro가 있음Astro2B 단계로
일반 HTML, Hugo, Jekyll, Vite SPA, 기타 모든 것정적2C 단계로

또한 확인할 사항: 사이트의 표준 기본 URL (NEXT_PUBLIC_SITE_URL, astro.config.*의 site), 브랜드 색상, 로고, 사용 중인 폰트. 찾을 수 없는 경우에만 사용자에게 문의하세요.

2A 단계 — Next.js App Router

  1. 루트 레이아웃이 metadataBase를 내보내는지 확인하세요 (OG URL은 절대 경로여야 함):
    export const metadata = { metadataBase: new URL(process.env.NEXT_PUBLIC_SITE_URL ?? "http://localhost:3000") }
    
  2. assets/nextjs/opengraph-image.tsx를 app/opengraph-image.tsx로 복사합니다 (사이트 기본값). BRAND, 색상 및 태그라인을 수정하세요.
  3. 동적 라우트 (블로그 게시물, 제품)의 경우 해당 라우트 세그먼트에 복사합니다 (예: app/blog/[slug]/opengraph-image.tsx). assets/nextjs/dynamic-opengraph-image.tsx를 사용하며, 이 파일은 params를 읽고 데이터 소스에서 제목을 가져옵니다. Next.js 15+에서 params는 Promise이므로 await하세요.
  4. X 카드가 달라야 하는 경우에만 twitter-image.tsx를 추가하고, 그렇지 않으면 메타데이터에 twitter: { card: "summary_large_image" }를 설정하면 Next.js가 OG 이미지를 재사용합니다.
  5. 페이지별 텍스트: 각 페이지의 metadata / generateMetadata에서 title과 description을 설정하세요.
  6. 사용자 정의 폰트: fetch(new URL("./Inter-Bold.ttf", import.meta.url)) 또는 readFile을 통해 TTF/OTF (WOFF2 아님)를 로드합니다. CJK 텍스트는 CJK 폰트 파일이 필요하며, 그렇지 않으면 상자로 렌더링됩니다 — 크기를 줄이기 위해 서브셋을 사용하세요.

준수해야 할 제한 사항 (next/og / satori): flexbox만 사용 가능 (grid 없음), 여러 자식을 가진 모든 div에는 display: "flex"가 필요하며, 번들을 작게 유지하세요 — Next.js ImageResponse 문서에는 JSX + CSS + 폰트 + 이미지에 대해 500 KB 제한이 명시되어 있습니다. 큰 폰트는 렌더링 속도를 저하시키므로 서브셋을 사용하세요.

2B 단계 — Astro

assets/astro/og-endpoint.ts를 src/pages/og/[...slug].png.ts로 사용하세요. satori + @resvg/resvg-js를 사용하여 빌드 시점에 페이지당 PNG를 렌더링합니다 (npm i satori @resvg/resvg-js). 레이아웃에서 다음과 같이 참조합니다:

<meta property="og:image" content={new URL(`/og/${slug}.png`, Astro.site)} />

astro.config.mjs에서 Astro.site를 설정해야 합니다. 폰트 파일: src/assets/fonts/에 TTF를 넣으세요.

2C 단계 — 정적 사이트 / 기타

PNG를 한 번 생성하고 커밋합니다:

python3 scripts/generate_og.py --pages pages.json --out public/og --brand "Acme" --bg "#0f172a" --fg "#ffffff" --accent "#38bdf8"

pages.json은 {"slug": "pricing", "title": "...", "subtitle": "..."} 목록입니다 (assets/pages.example.json 참조). Pillow가 필요합니다 (pip install pillow). 브랜드 폰트 또는 CJK 텍스트 (예: Noto Sans SC)의 경우 --font path/to/font.ttf를 전달하세요. 그런 다음 각 페이지에 태그를 추가합니다 (references/meta-tags.md의 템플릿 참조).

3단계 — 필수 태그 (모든 페이지)

<meta property="og:title" content="Page title" />
<meta property="og:description" content="한 문장, ≤ ~160자" />
<meta property="og:image" content="https://example.com/og/page.png" />   <!-- 절대 URL -->
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:url" content="https://example.com/page" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary_large_image" />

Next.js는 metadata + opengraph-image.tsx에서 이를 생성하므로 중복으로 수동 작성하지 마세요.

4단계 — 검증 (건너뛰지 마세요)

실행 중인 사이트 (개발 서버, 프리뷰 배포 또는 프로덕션)에 대해 실행합니다:

python3 scripts/check_og.py http://localhost:3000/ http://localhost:3000/pricing
python3 scripts/check_og.py --json https://example.com/   # 기계 판독 가능

각 페이지를 가져와서 필수 태그, og:image가 절대 경로인지, 접근 가능한지, 이미지 content-type인지, 약 1.91:1 비율이며 최소 600px 너비이고 5 MB 미만인지 확인합니다. 오류가 있으면 종료 코드 1을 반환합니다. ERROR로 표시된 모든 항목을 수정하고, WARN 항목은 권장 사항입니다.

참고: 소셜 플랫폼은 미리보기를 캐시합니다. 수정 후에는 플랫폼 자체 디버거 (LinkedIn Post Inspector, Facebook Sharing Debugger)를 사용하여 다시 스크랩하세요. X는 더 이상 공개 검증 도구가 없으므로 초안/DM에 게시하여 확인하세요. localhost URL은 해당 도구로 스크랩할 수 없으므로 먼저 배포하세요.

이미지 디자인 규칙

  • 1200×630, PNG, ~60 px 안전 여백 내에 텍스트; 제목 ≤ ~60자, 최대 3줄.
  • 높은 대비; 피드에서는 작게 (~500 px 너비) 표시됩니다. 50% 확대/축소로 테스트하세요.
  • 브랜드 이름/로고 포함; 작은 텍스트 (< 1200 너비에서 28 px)는 피하세요.
  • 플랫폼별 참고 사항은 references/platform-specs.md를 참조하세요.

완료 조건

  • 모든 색인 가능한 페이지가 og:title, og:description, og:image (절대 경로), twitter:card를 반환합니다.
  • check_og.py가 홈 페이지와 각 라우트 유형의 페이지 하나 이상에 대해 종료 코드 0을 반환합니다.
  • 이미지가 올바르게 보입니다 (PNG 하나를 열어서 확인).

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

getpaidskills/agents-md-starter

Creates or upgrades a repository's AGENTS.md (read by Codex, Cursor, and other agents) and a CLAUDE.md that imports it, so Claude Code, Codex, Cursor and Gemini CLI share one set of project rules. Scans the repo to detect languages, package manager, real build/test/lint commands, framework, directory layout and existing rule files (.cursorrules, .cursor/rules, CLAUDE.md, copilot-instructions), then writes a concise, verified rules file. Use when the user asks to set up AGENTS.md or CLAUDE.md, "project rules", "make Claude Code and Codex follow the same conventions", onboard an agent to a repo, or migrate .cursorrules.

getpaidskills/directory-launch-kit

Prepares a product for submission to launch platforms and directories (Product Hunt, Show HN, BetaList, Uneed, Fazier, SaaSHub, TinyLaunch, AI tool directories, agent-skill marketplaces, Reddit, V2EX and more) without submitting anything itself. Picks only the directories the product fits, writes the copy for each form within its field limits from one product.json, resizes screenshots to each platform's sizes (Product Hunt 1270x760 gallery and 240x240 thumbnail, 1200x630 OG), builds a tracker CSV, re-checks prices and rules on the live pages, and later verifies which listings went live and whether their backlinks are follow or nofollow. Use when the user asks where to launch, how to submit to Product Hunt or AI directories, wants launch copy, a directory list, backlinks, or a launch tracker.

getpaidskills/launch-checklist

Pre-launch audit for a website or SaaS - checks SEO tags (title, description, canonical, lang, Open Graph), robots.txt, sitemap.xml, favicon and apple-touch-icon, real 404 status, HTTPS redirect, legal pages (privacy, terms, refund), image alt text, page weight and response time, plus a payment self-check (webhook signature, raw body, idempotency, refunds, secrets, success-page grants), then lists the problems and fixes them in the codebase. Ships a no-dependency crawler script (audit_site.py) that produces a pass/warn/fail report. Use when the user says they are about to launch, ship, go live, submit to Product Hunt or AI directories, or asks "is my site ready", "SEO check", "why is my site not indexed", or wants a launch checklist, or asks whether their payment or webhook setup is safe.

getpaidskills/legal-pages

Drafts a Privacy Policy, Terms of Service and Refund Policy for a SaaS, digital product or website from a short questionnaire, adapted to the payment provider (Creem, Paddle, Lemon Squeezy as Merchant of Record, or Stripe/direct) and to where users are (EU/UK GDPR, California CCPA/CPRA, China PIPL notes), then renders them as Markdown, HTML or Next.js pages and links them in the footer. Output is a starting template, NOT legal advice - the user must review it and have it checked by a qualified lawyer. Use when the user needs privacy policy, terms, refund policy, legal pages, or a payment provider (Paddle/Creem/Lemon Squeezy/Stripe) review asks for them.

관련 스킬