Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Gh Og Share Images

ASecurity

Generate GitHub social preview images (1280x640 PNG) via iterative vision-guided refinement. Use when: social preview, GitHub share image, OG image for repo, social card, gh_share_image, preview image.

22 stars
0 votes
0 copies
0 views
Added 9/20/2026
documentationpythongobashgitapi

Works with

claude codecliapi

Security Analysis

A100/100

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add lev-os/agents --skill gh-og-share-images --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gh Og Share Images?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Gh Og Share Images
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lev-os-gh-og-share-images/badge)](https://www.skillsdirectory.com/skills/lev-os-gh-og-share-images)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: gh-og-share-images
description: >-
  Generate GitHub social preview images (1280x640 PNG) via iterative
  vision-guided refinement. Use when: social preview, GitHub share image,
  OG image for repo, social card, gh_share_image, preview image.
---

# gh-og-share-images

Generate GitHub social preview images (1280x640 PNG) for repositories via an iterative, vision-guided refinement process. Every image requires multiple passes of generation, visual inspection, and parameter tweaking before it's ready.

## Trigger phrases
- "generate social preview", "GitHub share image", "OG image for repo", "social card"
- "gh_share_image", "preview image for this repo"

## Core principle

**This is NOT a fire-and-forget script.** Every repo's illustration has different dimensions, colors, contrast, and composition. Every description has different length. The script `generate_og_image.py` is just the starting-point generator — the real work is the iterative visual review loop. Plan for **at least 5 passes** of generate → view → tweak → regenerate per image.

## Workflow (per repo)

### Step 1: Gather context
1. `gh repo view --json name,description,repositoryTopics,owner` for metadata
2. Find the hero/illustration image. Check:
   - Root: `*illustration*`, `*hero*`, `*banner*` (webp/png/jpg)
   - `docs/`, `images/`, `assets/`, `img/`, `.github/`
   - README.md first `![](...)` reference
3. **View the hero image** with the Read tool. Understand its composition — where the subject is, aspect ratio, color palette, busy vs clean areas.

### Step 2: Generate initial draft
Run `generate_og_image.py` with the repo path. This produces a first draft at `gh_og_share_image.png` (or `--output` path).

```bash
python3 $HOME/.claude/skills/gh-og-share-images/generate_og_image.py /path/to/repo --output /tmp/preview.png
```

### Step 3: Visual review (MANDATORY — at least 5 passes)

**Read the output image** with the Read tool every single time. Inspect for:

- **Hero image cropping**: Is the subject cut off? Is the important part visible? The script defaults to top-aligned crop, but some images need center or custom alignment.
- **Gradient overlay**: Is it too dark/light? Does it kill the illustration or leave text unreadable?
- **Text placement**: Does text overlap the interesting part of the illustration? Is it readable against the background?
- **Text content**: Is the description too long and wrapping awkwardly? Should it be shortened?
- **Topic badges**: Are they visible? Too many? Overlapping?
- **Overall composition**: Does it look good as a small thumbnail (how it appears on social media)?
- **Color harmony**: Does the text color work with the illustration palette?

### Step 4: Tweak and regenerate

Based on visual review, modify `generate_og_image.py` parameters or the script itself. Common adjustments:

| Problem | Fix |
|---------|-----|
| Subject cut off at top/bottom | Change crop alignment (top/center/bottom) in `create_hero_background` |
| Gradient too dark, kills illustration | Reduce alpha values, raise `gradient_start` ratio |
| Gradient too light, text unreadable | Increase alpha values, lower `gradient_start` ratio |
| Text covers the good part of the image | Adjust text Y positions, move text block up or down |
| Description too long, wraps ugly | Truncate description or reduce font size |
| Too many topic badges | Limit `topics[:N]` to fewer |
| Wrong hero image selected | Pass explicit image path or adjust `find_hero_image` priority |
| Image too busy for text overlay | Add text shadow/outline, or increase gradient coverage |
| Colors clash | Adjust text fill colors to complement the illustration |

### Step 5: Repeat Steps 3-4

Keep going until the image looks genuinely good. **Do not stop at "acceptable."** This image represents the repo on every social share.

### Step 6: Save final output
Save as `gh_og_share_image.png` in the repo root. Must be under 1MB (GitHub's limit). The script handles this automatically — it tries optimized PNG first, then falls back to high-quality JPEG (95 down). **Never reduce color depth to shrink file size — always prefer higher JPEG compression over quantization.** The user will manually upload via GitHub Settings > Social preview.

## Script reference

**`generate_og_image.py`** — Pillow-based generator. Key parameters to tweak per-repo:

- Canvas: 1280x640 (GitHub's required dimensions)
- Hero crop alignment (top/center/bottom)
- Gradient overlay start position and opacity range
- Text positions (bottom-anchored for hero images, centered for gradient-only)
- Font sizes: repo name (48px bold), description (32px), tags (20px), owner (24px)
- Border width (currently 24px)

**`batch_generate.sh`** — Iterates all repos in `~/projects/`. Useful for generating initial drafts, but **every output still needs individual visual review and refinement**.

## Dependencies
- Python 3 + Pillow
- `gh` CLI (for repo metadata)
- macOS font: `/System/Library/Fonts/HelveticaNeue.ttc`
- Claude Code with image understanding (for the visual review passes)

## Upload

GitHub has no API for social preview upload. After finalizing each image:
`Settings > Social preview > Edit > Upload an image`

Attribution

lev-oslev-os
View sourceMore from lev-os →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Context Fundamentals

Understand the components, mechanics, and constraints of context in agent systems. Use when designing agent architectures, debugging context-related failures, or optimizing context usage.

179001 votes

release-notes

Draft release notes and changelog entries from git history or merged PRs between two refs (tags/SHAs/branches), including breaking changes, migrations, and upgrade steps. Use when the user asks for release notes, changelog updates, or a GitHub Release draft.

1301 votes

docs-style-guide

Documentation style guide enforcer by @planetabhi. Applies and reviews the writing style guide when authoring or editing product documentation and tutorials. Use to check prose for voice, tense, word choice, inclusive language, formatting, code block, UI, Markdown, and number/date conventions.

11 votes

Caveman Help

Quick-reference card for all caveman modes, skills, and commands. One-shot display, not a persistent mode. Trigger: /caveman-help, "caveman help", "what caveman commands", "how do I use caveman".

1023330 votes

How It Works

Explain how claude-mem captures observations, when memory injection kicks in, and where data lives. Use when the user asks "how does claude-mem work?" or "what is this thing doing?".

929660 votes
View all in documentation →