agentleFS
kevin-burnskevin-burns/claude-skills/social-image-prep/SKILL.md

social-image-prep

Skill7 starsChanged 4 months agoMITView on GitHub

Resize and format an image for a social platform: LinkedIn, Bluesky, Reddit, Hacker News and others. Use for "resize for LinkedIn", "image for social", "prepare this image for posting", or any request to fit an image to a specific platform's dimensions.

  • Installs packages

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 6 are distinctive, and 1 is 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.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check which image tool is available (run once per session):

    line 27
  2. Distinctive:

    Check source dimensions and format

    line 103
  3. Distinctive:

    Ask which platforms (or do all if user says "all")

    line 105
  4. Distinctive:

    Verify file size (especially Bluesky 1MB limit -- lower quality to 80 if needed)

    line 107
  5. Distinctive:

    If the user says "prep for all platforms", generate all applicable presets.

    line 113
  6. Distinctive:

    Always output JPEG for social posts (smaller files, universal support).

    line 117
  7. Very specific:

    Verify file size after conversion with ls -lh (or dir on Windows).

    line 122

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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 image prep

Resize and format images for social media posting. One source image, multiple platform-ready outputs.

Platform specs

PlatformPost image sizeAspect ratioMax file sizeFormatsNotes
LinkedIn1200 x 6271.91:15 MBJPG, PNGNo WebP. Links in post body kill reach.
Bluesky1000 x 56316:91 MBJPG, PNGLongest side compressed to 1000px. No animated GIFs. Up to 4 images/post.
Bluesky (square)1000 x 10001:11 MBJPG, PNGAlternative for square crops.
Bluesky (portrait)800 x 10004:51 MBJPG, PNGFor vertical images.
Reddit1200 x 6281.91:120 MBJPG, PNG, GIFPreview thumbnail crops to center.
HNN/AN/AN/AN/AText only. Use og:image on linked page.
YouTube thumbnail1280 x 72016:92 MBJPG, PNGMin width 640px.
og:image (generic)1200 x 6301.91:1--JPG, PNGFor link previews across platforms.

Tool detection

Check which image tool is available (run once per session):

  1. sips -- macOS built-in. No install needed.
  2. magick (ImageMagick 7+) -- Linux, Windows, macOS. Install: brew install imagemagick, apt install imagemagick, choco install imagemagick.
  3. convert (ImageMagick 6) -- legacy Linux installs.
  4. Python PIL -- fallback. uv run --with Pillow python3 script.py

Pick the first one available. Prefer sips on macOS, magick elsewhere.

Resize commands by tool

sips (macOS)

# Check dimensions
sips -g pixelWidth -g pixelHeight -g format INPUT

# Resize (stretches to exact dimensions)
sips -z HEIGHT WIDTH INPUT --out OUTPUT.jpg -s format jpeg -s formatOptions 90

# Aspect-ratio-safe: resize width, then crop height
sips --resampleWidth 1200 INPUT --out /tmp/resized.jpg -s format jpeg
sips --cropToHeightWidth 627 1200 /tmp/resized.jpg --out OUTPUT.jpg

Note: sips -z takes height then width (not width then height).

ImageMagick (magick / convert)

# Check dimensions
magick identify INPUT

# Resize and crop to exact dimensions (gravity center)
magick INPUT -resize 1200x627^ -gravity center -extent 1200x627 -quality 90 OUTPUT.jpg

# Simple resize (may distort)
magick INPUT -resize 1200x627! -quality 90 OUTPUT.jpg

The ^ suffix fills the target area (may overshoot one dimension), then -extent crops to exact size. This is aspect-ratio-safe in one command.

For ImageMagick 6, replace magick with convert.

Python PIL (fallback)

# uv run --with Pillow python3 script.py
from PIL import Image

img = Image.open("INPUT")

# Aspect-ratio-safe resize + crop
target = (1200, 627)
ratio = max(target[0] / img.width, target[1] / img.height)
resized = img.resize((int(img.width * ratio), int(img.height * ratio)), Image.LANCZOS)
left = (resized.width - target[0]) // 2
top = (resized.height - target[1]) // 2
cropped = resized.crop((left, top, left + target[0], top + target[1]))
cropped.save("OUTPUT.jpg", "JPEG", quality=90)

Platform presets

Preset nameWidthHeightQualityNotes
linkedin120062790
bluesky100056385Keep under 1MB
bluesky-square1000100085
bluesky-portrait800100085
reddit120062890
youtube128072090
og120063090

Workflow

  1. Check source dimensions and format
  2. Detect available image tool
  3. Ask which platforms (or do all if user says "all")
  4. Resize for each target using aspect-ratio-safe crop
  5. Verify file size (especially Bluesky 1MB limit -- lower quality to 80 if needed)
  6. Report output paths and file sizes
  7. Name outputs with platform suffix: image-linkedin.jpg, image-bluesky.jpg

Batch mode

If the user says "prep for all platforms", generate all applicable presets. Output to the same directory as the source, or to a user-specified directory.

Notes

  • Always output JPEG for social posts (smaller files, universal support). PNG only if transparency is needed.
  • WebP is not accepted by LinkedIn or most social platforms. Always convert to JPG or PNG.
  • Bluesky has a 1MB hard limit. If output exceeds 1MB, reduce quality to 80, then 75.
  • HN is text-only. If you need an image for HN, set it as og:image in the linked page's meta tags.
  • LinkedIn penalizes posts edited within the first hour. Get the image right before posting.
  • Verify file size after conversion with ls -lh (or dir on Windows).

Provenance

This skill drives whichever image tool is already installed and bundles none of them:

  • sips — Apple's Scriptable Image Processing System, built into macOS.
  • ImageMagick (magick / convert) — © ImageMagick Studio LLC, ImageMagick License (Apache-2.0-compatible). Installed separately via brew/apt/choco.
  • Pillow (PIL) — © Jeffrey A. Clark and contributors, MIT-CMU license. Run on demand via uv run --with Pillow.

The platform specs and presets are compiled from each platform's public guidance and may change over time. The skill is not affiliated with or endorsed by any of the platforms or tools above. The MIT license covers this skill's content, not the wrapped tools.

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.