[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-share-image-generator":3},{"slug":4,"name":4,"description":5,"files":6,"size":26,"readme":27},"share-image-generator","Generates a per-page Open Graph \u002F social share image (the picture shown when a link is posted on LinkedIn, X, Slack, iMessage) as a flat 2400×1260 JPG in the user's own brand colors and logo, rendered from a self-contained 1200×630 HTML canvas with headless Chrome. Use when the user asks for an \"OG image\", \"share image\", \"social card\", \"Twitter card\", \"og:image\", \"link preview image\", or \"make a share image for \u003Cpage>\". Takes headline, brand colors, logo and an optional product screenshot as input, checks the render for clipped text and missing fonts, saves the JPG into the project's static folder and gives the meta tags to wire in.",[7,11,14,17,20,23],{"path":8,"size":9,"executable":10},"SKILL.md",6346,false,{"path":12,"size":13,"executable":10},"assets\u002Ftemplate.html",4662,{"path":15,"size":16,"executable":10},"references\u002Fdesign.md",7483,{"path":18,"size":19,"executable":10},"scripts\u002Fpackage.json",334,{"path":21,"size":22,"executable":10},"scripts\u002Frender.mjs",7003,{"path":24,"size":25,"executable":10},"LICENSE.md",1069,26897,"---\nname: share-image-generator\ndescription: Generates a per-page Open Graph \u002F social share image (the picture shown when a link is posted on LinkedIn, X, Slack, iMessage) as a flat 2400×1260 JPG in the user's own brand colors and logo, rendered from a self-contained 1200×630 HTML canvas with headless Chrome. Use when the user asks for an \"OG image\", \"share image\", \"social card\", \"Twitter card\", \"og:image\", \"link preview image\", or \"make a share image for \u003Cpage>\". Takes headline, brand colors, logo and an optional product screenshot as input, checks the render for clipped text and missing fonts, saves the JPG into the project's static folder and gives the meta tags to wire in.\n---\n\n# Share Image Generator\n\nMakes the image that appears when one of the user's pages is shared: a flat JPG built from a 1200×630 HTML canvas in the user's brand, rendered at 2× for retina.\n\n- Design rules (canvas, layouts, type, contrast, copy, meta tags): [references\u002Fdesign.md](references\u002Fdesign.md). **Read it before writing the HTML.**\n- Starting canvas with the three layouts: [assets\u002Ftemplate.html](assets\u002Ftemplate.html).\n- Renderer and checker: `scripts\u002Frender.mjs`.\n\n`\u003Cskill-dir>` below means the folder this SKILL.md is in.\n\n## Workflow\n\n```\n- [ ] Step 1: Gather the inputs (page, headline, brand colors, logo, visual)\n- [ ] Step 2: Pick the layout and output path\n- [ ] Step 3: Write the HTML canvas from the template\n- [ ] Step 4: Render and fix every warning\n- [ ] Step 5: Look at the image, then report the file and the meta tags\n```\n\n### Step 1: Gather the inputs\n\nThe image is built from the **user's** brand, never a default theme and never another company's assets.\n\n1. **Page and headline.** Which page is this for? Take the headline from what the user said, else the page's H1 or `\u003Ctitle>`. Tighten to ≤ 8 words if needed, without adding claims (see the Copy section of the design reference).\n2. **Brand colors**: background, text, and primary\u002Faccent. If the user gave them, use them as given.\n3. **Logo**: a file path or URL to an SVG or PNG. If there isn't one, use a text wordmark of the product name in the brand font.\n4. **Font**: the font the site uses.\n5. **Product visual** (optional): a screenshot or image of the product for the split or peek layouts.\n\nIf the user didn't give colors or a logo, look in the project for them: CSS custom properties, the Tailwind theme or config, a `theme`\u002F`tokens` file, and logo files in `public\u002F`, `static\u002F`, `assets\u002F` or `src\u002Fassets\u002F`. **Show the user what you found** (hex values, the logo file path, the font) and ask them to confirm or give their own, in one short question. If there is no project and nothing was given, ask for the colors and logo before rendering. Don't invent a palette.\n\nFor a product visual of a live page, the `screenshot-capture` skill (or any headless browser) can grab one.\n\n### Step 2: Layout and output path\n\n- **Layout**: `layout-centered` by default; `layout-split` or `layout-peek` when there is a good product visual. If the user is unsure, render two layouts and let them pick.\n- **Slug**: kebab-case from the page (`pricing`, `blog-why-we-raised`, `home`).\n- **Output folder** = the project's static folder, served at the site root:\n\n| Project | Folder |\n|---|---|\n| Next.js, Vite, Nuxt 3+, Astro, Remix, Create React App | `public\u002F` |\n| SvelteKit, Hugo, Nuxt 2, Gatsby | `static\u002F` |\n| Plain HTML site | next to `index.html`, or its `images\u002F` folder |\n| No project | the current directory |\n\n  Output file: `\u003Cfolder>\u002Fog-\u003Cslug>.jpg`. If the project already has share images, match their folder and naming instead.\n\n- **Canvas HTML**: `.share-images\u002Fog-\u003Cslug>.html` in the project root (keep it so the image can be regenerated; suggest adding `.share-images\u002F` to `.gitignore` if the user doesn't want it committed).\n\n### Step 3: Write the canvas\n\nCopy `\u003Cskill-dir>\u002Fassets\u002Ftemplate.html` to the canvas path and edit it:\n\n- Set the CSS variables in `:root` to the brand inputs.\n- Set the font: a Google Fonts `\u003Clink>` if it's a Google font, or an `@font-face` pointing at the project's own font file with a path relative to the HTML file.\n- Put the logo in `.logo`: paste the SVG markup inline (best: no path issues, inherits color), or an `\u003Cimg>` with a path **relative to the HTML file** (e.g. `..\u002Fpublic\u002Flogo.svg`). Copying the logo next to the HTML also works.\n- Write the headline into the `h1` (keep `data-headline`) and the subline or proof into `.sub`, or delete `.sub`.\n- Keep one layout; delete the commented ones you didn't use.\n\nHard rules: one self-contained HTML file, inline `\u003Cstyle>`, no JS, no frameworks, no animation. Body exactly 1200×630 with `overflow: hidden`. Images that intentionally run off the edge get `data-bleed`.\n\n### Step 4: Render\n\nFirst run only: `cd \u003Cskill-dir>\u002Fscripts && npm install` (installs `playwright-core`; it drives the installed Google Chrome, or Playwright's Chromium via `npx playwright install chromium`).\n\n```bash\nnode \u003Cskill-dir>\u002Fscripts\u002Frender.mjs --html .share-images\u002Fog-\u003Cslug>.html --out public\u002Fog-\u003Cslug>.jpg\n```\n\nThe last stdout line is the output path. The script exits with code 3 and prints `WARNING:` lines when something is off:\n\n- **Elements spill off the canvas**: shorten the copy or reduce the font size; mark intentional bleeds with `data-bleed`.\n- **Headline wraps to 3+ lines**: shorten it, then step the font size down 4px at a time (not below 52px).\n- **Fonts not loaded**: fix the font link or `@font-face` path; never ship a fallback-font render.\n- **Assets failed to load**: fix the logo or visual path (relative to the HTML file).\n- **File over ~1 MB**: add `--quality 78` or `--scale 1`.\n\nFix and re-render until there are no warnings.\n\n### Step 5: Check and report\n\nOpen the JPG and run the quality checks from the design reference: the headline reads first and at a glance, nothing touches the edges, real brand font, strong contrast. Re-render if anything is off.\n\nReport:\n\n- The image path and its size (2400 × 1260)\n- The canvas HTML path (to regenerate later)\n- The meta tags for the page, with the absolute URL on the user's domain (see **Meta tags** in the design reference). Offer to add them to the page; edit the page only if the user says yes.\n\nFor a set of pages, reuse the same canvas with only the headline (and visual) changed, so the cards look like one brand.\n"]