agentleFS
y-a-v-ay-a-v-a/skills/social-preview/SKILL.md

social-preview

Skill0 starsChanged 19 days agoMITView on GitHub

Generate a GitHub social preview image (1280×640 PNG) for the current repo. Builds a throwaway social-preview.html styled after the project's own look (webapp theme colors, fonts, layout) with a minimal tagline from the README, screenshots it with headless Chrome, and iterates with the user until approved. Use when the user asks for a social preview, OG image, open-graph image, or repo card image.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. kinqsradio/orbyn-fullstack-skills★ 4same name
    2. orbyn-dev/orbyn-fullstack-skills★ 4same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository14 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 6 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read README.md (and package.json description or similar) to learn what the project is.

    line 18
  2. Very specific:

    Only render the real app for reference if it costs nothing: a static index.html you can open directly, or a dev server that is already …

    line 25
  3. Distinctive:

    Never install dependencies or start builds just for this skill.

    line 27
  4. Distinctive:

    Not a webapp (CLI, library)?

    line 28
  5. Distinctive:

    Byline name: ask the user which name to credit via an AskUserQuestion tool call.

    line 30
  6. Very specific:

    Write social-preview.html in the session scratchpad directory (not the repo).

    line 37
  7. Distinctive:

    Safe area: keep the name, tagline, and anything essential at least 40pt from every edge (GitHub's own template rule — edges get cropped on …

    line 43
  8. Distinctive:

    Default composition: project name large, the tagline under it, plus a

    line 47
  9. Distinctive:

    Keep even the smallest text (byline, captions) at ≥ 28px on the 1280-wide canvas so it stays readable at 640×320.

    line 55
  10. Very specific:

    Verify the output: sips -g pixelWidth -g pixelHeight social-preview.png must report 1280×640.

    line 82

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Social preview generator

Produce social-preview.png (exactly 1280×640) in the repo root, ready for manual upload at GitHub → repo Settings → General → Social preview. There is no API for that upload — always end by reminding the user to do it by hand.

1. Gather material

  • Read README.md (and package.json description or similar) to learn what the project is. Distill a very short tagline — one line, roughly ≤ 60 characters. The project name comes from the repo/package name unless the README uses a nicer display name.
  • Detect whether this is a webapp: look for public/, index.html, stylesheets, framework configs, templates. If so, read its CSS/HTML for theme colors, fonts, and layout idioms and echo that visual language in the card.
  • Only render the real app for reference if it costs nothing: a static index.html you can open directly, or a dev server that is already running. Never install dependencies or start builds just for this skill.
  • Not a webapp (CLI, library)? Fall back to a tasteful typographic card derived from the README's tone and any logo/badge assets in the repo.
  • Byline name: ask the user which name to credit via an AskUserQuestion tool call. Offer git config user.name as the recommended first option, plus a "No byline" option; the user can type any other name via "Other". Ask once, here — never re-ask during the iteration loop.

2. Write the throwaway HTML

Write social-preview.html in the session scratchpad directory (not the repo).

Rules for the page:

  • Canvas is exactly 1280×640: html,body{margin:0} and a single 1280×640 container with overflow:hidden. No scrollbars, no page margins.
  • Safe area: keep the name, tagline, and anything essential at least 40pt from every edge (GitHub's own template rule — edges get cropped on some surfaces). At CSS 96dpi that is ~53px on the 1280×640 canvas; use ≥ 54px insets. Decorative elements may bleed to the edges.
  • Default composition: project name large, the tagline under it, plus a decorative motif in the project's visual language (shapes, gradients, patterns echoing the app's theme). No GitHub logo, no URL, no clutter.
  • Attribution: include a small, quiet byline with the name chosen in step 1 (omit the byline entirely if the user chose none). Small type, muted color, inside the safe area, never competing with the name/tagline.
  • Legibility at half size: the 1280×640 canvas is typically displayed at ~640×320 CSS pixels (retina/2×), so every text size is effectively halved. Keep even the smallest text (byline, captions) at ≥ 28px on the 1280-wide canvas so it stays readable at 640×320.
  • Fonts: prefer fonts shipped in the repo or the font stack its CSS declares (system fonts are fine). Only pull a webfont (e.g. Google Fonts <link>) when the project's identity hinges on it — headless Chrome will fetch it.

3. Screenshot with headless Chrome

Find a Chrome binary, first hit wins:

  1. /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
  2. command -v google-chrome || command -v chromium || command -v chromium-browser

Then:

"$CHROME" --headless --disable-gpu \
  --screenshot="<repo-root>/social-preview.png" \
  --window-size=1280,640 \
  --force-device-scale-factor=1 \
  --hide-scrollbars \
  --virtual-time-budget=5000 \
  "file:///<scratchpad>/social-preview.html"

(--virtual-time-budget gives webfonts time to load before capture.)

Verify the output: sips -g pixelWidth -g pixelHeight social-preview.png must report 1280×640. If not, fix the HTML/flags — do not ship a wrong-size image.

4. Approval loop, then clean up

  • Send the PNG to the user (SendUserFile) and ask for reactions.
  • Iterate: tweak the HTML, re-run the same screenshot command, resend. Keep social-preview.html alive during this loop.
  • Once the user approves: delete the throwaway HTML, leave social-preview.png in the repo root, and do not commit it unless asked.
  • Close with the reminder: upload it manually at GitHub → Settings → General → Social preview (minimum 640×320, this file is the recommended 1280×640).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.