social-preview
Skill2 starsChanged 11 months agoMITView on GitHub
This skill should be used when the user asks to "generate social preview", "create social image", "github social preview", "repository preview image", "og image", "social media card", "create repo image", "github card image", or needs to create an image that captures a project's spirit and purpose for social media sharing. Analyzes project files to understand intent and generates optimized SVG graphics or AI-generated images.
- Reads credentials
- Sends data out
1 other project uses a version of this.
Adopted by
Most recently taken up by
- thatrebeccarae/claude-marketingtheir own version, first seen Feb 23, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- thatrebeccarae/claude-marketing★ 159same 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 repository4 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- citation-cffSkill
- readme-enhanceSkill
- repo-metadataSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
27 rules. About 0 are common, 17 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈17
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
All generated images must meet GitHub's social preview requirements:
- Very specific: line 34
Look for optional settings file at .claude/github-social.local.md.
- Distinctive: line 36
If file exists, parse YAML frontmatter for:
- Very specific: line 52
If no config exists, use defaults: provider: svg, svg_style: minimal.
- Very specific: line 110
When provider: svg or not configured, generate a clean SVG file directly.
- Distinctive: line 116
No raster images or complex filters
- Very specific: line 181
If dark_mode: true or dark_mode: both:
- Very specific: line 185
If both: save as [name].svg and [name]-dark.svg
- Very specific: line 188
Write SVG content to output_path (default: .github/social-preview.svg)
- Distinctive: line 189
Verify SVG file size < 50KB (warn if larger)
- Distinctive: line 195
Verify JPG meets requirements:
- Very specific: line 198
If dark_mode: both, generate dark variant SVG and JPG:
- Very specific: line 210
Verify API key: Check $OPENAI_API_KEY or configured api_key_env
- Very specific: line 278
When provider: manual or API generation fails:
- Distinctive: line 306
Verify valid XML structure
- Distinctive: line 307
Check SVG file size < 50KB (warn if 50-100KB, error if >100KB)
- Distinctive: line 308
Verify viewBox is 1280x640
- Distinctive: line 313
If exceeds 1MB, recompress with lower quality
- Distinctive: line 316
Verify file exists at output path
- Distinctive: line 317
Check dimensions meet requirements (≥640x320, recommended 1280x640)
- Distinctive: line 318
Check file size is under 1MB
- Distinctive: line 319
If exceeds 1MB, compress progressively
- Very specific: line 329
If upload_to_repo: true is configured (or --upload flag provided):
- Distinctive: line 336
Read the SVG source file and JPG output file
- Distinctive: line 340
Use GitHub API to check if files exist
- Distinctive: line 341
If exist, retrieve the SHA for update operation
- Distinctive: line 410
Ask user to describe the project purpose, then proceed with that information.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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.
Files
Social Preview Image Generator
Generate social preview images for GitHub repositories by analyzing project intent, purpose, and spirit. Create images that capture what a project does and why it matters.
Overview
This skill analyzes a project's codebase, documentation, and configuration to understand its purpose, then generates:
- SVG graphics (default) - Clean, minimal vector graphics generated directly
- AI-generated images - Via DALL-E 3 or Gemini when configured
- Text prompts - For manual use with Midjourney or other tools
GitHub Image Requirements
All generated images must meet GitHub's social preview requirements:
- Minimum: 640x320 pixels
- Recommended: 1280x640 pixels (2:1 aspect ratio)
- Maximum file size: 1MB
- Formats: JPG (required for GitHub), SVG (source file)
- Default outputs:
.github/social-preview.svg- Editable source file.github/social-preview.jpg- Always generated for GitHub upload
IMPORTANT: GitHub's social preview setting requires a raster image (JPG/PNG). SVG generation MUST ALWAYS also produce a JPG file.
Workflow
Step 1: Check for Configuration
Look for optional settings file at .claude/github-social.local.md.
If file exists, parse YAML frontmatter for:
provider: Image generation provider (svg, dalle-3, gemini, manual) - default: svgapi_key_env: Environment variable name containing API key (for dalle-3 or gemini)svg_style: SVG style preference (minimal, geometric, illustrated) - default: minimaldark_mode: Dark mode support (false, true, both) - default: falseoutput_path: Where to save the imagedimensions: Image dimensions (default: 1280x640)include_text: Whether to include project name in imagecolors: Color scheme preference (auto, dark, light, custom)upload_to_repo: Whether to upload the image to the GitHub repository
Command-line overrides (highest priority):
--provider=svg|dalle-3|gemini|manual--dark-mode(generates dark variant or both)--upload(upload to repository)
If no config exists, use defaults: provider: svg, svg_style: minimal.
Step 2: Analyze Project
Gather project context by reading available files:
Primary sources (check in order):
README.md- Project description, features, purposepackage.json/Cargo.toml/pyproject.toml/go.mod- Name, description, keywordsCLAUDE.md- Project context and guidelines.github/FUNDING.yml- Project goals/sustainability info
Secondary sources (if primary insufficient):
- Source code structure (main entry points)
- License file (project nature: open source, commercial)
- Documentation directory
- Configuration files
Extract these elements:
- Project name: Official name
- Purpose: What problem does it solve?
- Domain: What field/industry? (DevTools, AI, Finance, etc.)
- Technology: Primary language/framework
- Spirit: What makes it unique? What's its personality?
- Keywords: Key concepts, features, or themes
Step 3: Design Visual Concept
Based on analysis, design a visual concept that:
- Represents the domain visually
- DevTools: Terminal aesthetics, code patterns, geometric shapes
- AI/ML: Neural networks, data flows, abstract intelligence
- Web: Browser elements, connectivity, responsive layouts
- Data: Charts, graphs, structured patterns
- Security: Shields, locks, protective barriers
- Infrastructure: Cloud shapes, server racks, pipelines
- Captures the project's spirit
- Fast/Performance: Motion lines, streamlined shapes
- Reliable/Stable: Solid foundations, balanced compositions
- Modern/Cutting-edge: Gradients, futuristic elements
- Simple/Minimal: Clean lines, whitespace, focused elements
- Powerful/Feature-rich: Layered elements, depth
- Applies style preferences
- Minimal: Clean lines, 3-5 shapes max, generous whitespace
- Geometric: 8-15 shapes, grid/flow arrangements, abstract metaphors
- Illustrated: Organic paths, hand-drawn aesthetic, warm colors
Step 4: Generate Output Based on Provider
Route to appropriate generation method based on provider setting.
Step 4a: Generate SVG (Default)
When provider: svg or not configured, generate a clean SVG file directly.
SVG Design Principles:
- Simple geometric shapes (rectangles, circles, paths)
- Clean sans-serif typography (system fonts)
- Maximum 3-4 colors from domain palette
- No raster images or complex filters
- Viewbox: 0 0 1280 640
- File size target: <50KB
SVG Template Structure:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 640">
<defs>
<!-- Optional: gradients, patterns -->
<linearGradient id="bg-gradient" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:[color1]"/>
<stop offset="100%" style="stop-color:[color2]"/>
</linearGradient>
</defs>
<!-- Background -->
<rect width="1280" height="640" fill="url(#bg-gradient)"/>
<!-- Domain-specific visual elements (3-15 shapes based on svg_style) -->
<!-- Project name (if include_text: true) -->
<text x="640" y="340"
font-family="-apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif"
font-size="72" font-weight="700"
text-anchor="middle" fill="[text-color]">
[PROJECT-NAME]
</text>
<!-- Optional tagline -->
<text x="640" y="400"
font-family="-apple-system, BlinkMacSystemFont, 'Inter', sans-serif"
font-size="24" font-weight="400"
text-anchor="middle" fill="[secondary-text-color]" opacity="0.8">
[tagline]
</text>
</svg>SVG Style Guidelines:
Minimal (default):
- 3-5 simple shapes maximum
- Single gradient or solid background
- Project name as focal point
- Generous whitespace (60%+ empty space)
- Subtle accent shapes
Geometric:
- 8-15 geometric shapes
- Grid or flow-based arrangement
- Represents domain metaphor abstractly
- More visual complexity, balanced composition
Illustrated:
- Organic SVG paths with curves
- Hand-drawn aesthetic using stroke variations
- Warm, approachable color palette
- Textured appearance via path styling
Domain-Specific SVG Patterns:
See references/svg-templates.md for complete templates by domain.
Dark Mode Support:
If dark_mode: true or dark_mode: both:
- Invert background: light (#f8fafc) ↔ dark (#0f172a)
- Adjust text colors for contrast
- Adjust accent colors for dark backgrounds
- If
both: save as[name].svgand[name]-dark.svg
Save SVG and Convert to JPG:
- Write SVG content to
output_path(default:.github/social-preview.svg) - Verify SVG file size < 50KB (warn if larger)
- MANDATORY: Convert SVG to JPG:
# Convert SVG to JPG at 1280x640, quality 90 convert .github/social-preview.svg -resize 1280x640! -quality 90 -background white -flatten .github/social-preview.jpg - Verify JPG meets requirements:
- Dimensions: 1280x640
- File size: < 1MB (compress if needed)
- If
dark_mode: both, generate dark variant SVG and JPG:.github/social-preview-dark.svg.github/social-preview-dark.jpg
Note: The JPG is the file to upload to GitHub's social preview setting. The SVG is kept as an editable source.
Step 4b: Generate with DALL-E 3
When provider: dalle-3:
- Verify API key: Check
$OPENAI_API_KEYor configuredapi_key_env - Craft optimized prompt (see Step 4d for prompt structure)
- Call DALL-E API:
curl -s https://api.openai.com/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "dall-e-3",
"prompt": "[generated prompt]",
"n": 1,
"size": "1792x1024",
"quality": "hd",
"response_format": "b64_json"
}'- Process response:
# Decode base64 and resize to 1280x640
echo "[base64_data]" | base64 -d > temp_image.png
convert temp_image.png -resize 1280x640! -quality 90 .github/social-preview.pngStep 4c: Generate with Gemini (Nano Banana)
When provider: gemini:
- Verify API key: Check
$GEMINI_API_KEYor configuredapi_key_env - Select model:
gemini-2.5-flash-image- Fast, efficient (default)gemini-3-pro-image-preview- Higher quality with reasoning, better text rendering
- Craft optimized prompt (see Step 4d for prompt structure)
- Call Gemini API:
curl -X POST \
"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image:generateContent" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{
"parts": [{"text": "[generated prompt]"}]
}],
"generationConfig": {
"responseModalities": ["IMAGE"],
"imageConfig": {
"aspectRatio": "16:9"
}
}
}'- Process response:
- Extract image data from response
- Save to output path
- Resize if needed to 1280x640
Step 4d: Generate Text Prompt (Manual)
When provider: manual or API generation fails:
Prompt structure:
[Style description], [Main subject/concept], [Visual elements representing project],
[Color palette], [Composition notes], [Technical specs]
Negative prompt: [Elements to avoid]Example prompt for a CLI tool:
Abstract geometric composition, terminal-inspired design with command line aesthetics,
interconnected nodes representing automation workflows, dark background with cyan and
magenta accent gradients, centered composition with depth layers, clean professional
tech aesthetic, 1280x640 pixels, high contrast, modern minimalist
Negative prompt: text, watermarks, realistic photos, cluttered, busy patternsInclude project name in prompt if include_text: true:
... with stylized text "PROJECT-NAME" integrated into design ...Step 5: Verify Output
For SVG output (always accompanied by JPG):
- Verify valid XML structure
- Check SVG file size < 50KB (warn if 50-100KB, error if >100KB)
- Verify viewBox is 1280x640
- Verify JPG was created:
- File exists at
.github/social-preview.jpg - Dimensions are exactly 1280x640
- File size is under 1MB
- If exceeds 1MB, recompress with lower quality
- File exists at
For AI-generated image output (PNG/JPG from DALL-E/Gemini):
- Verify file exists at output path
- Check dimensions meet requirements (≥640x320, recommended 1280x640)
- Check file size is under 1MB
- If exceeds 1MB, compress progressively
Report success with:
- SVG file location and size
- JPG file location and size (for GitHub upload)
- Dimensions (1280x640)
- Provider used
Step 6: Upload to Repository (Optional)
If upload_to_repo: true is configured (or --upload flag provided):
- Detect repository info:
- Parse
git remote get-url originto extract owner and repo name - Determine current branch with
git branch --show-current
- Parse
- Prepare upload (upload BOTH files):
- Read the SVG source file and JPG output file
- Encode content as base64 for GitHub API
- Check for existing files:
- Use GitHub API to check if files exist
- If exist, retrieve the SHA for update operation
- Upload via GitHub MCP tool (both SVG and JPG):
# Upload JPG (for GitHub social preview) owner: [detected owner] repo: [detected repo] path: .github/social-preview.jpg content: [base64 encoded JPG] message: "chore: update social preview image" branch: [current or default branch] sha: [existing file SHA if updating]# Upload SVG (editable source) owner: [detected owner] repo: [detected repo] path: .github/social-preview.svg content: [base64 encoded SVG] message: "chore: update social preview source SVG" branch: [current or default branch] sha: [existing file SHA if updating] - Report upload status:
- Confirm successful upload with commit URLs
- Remind user: The JPG file is what should be selected in GitHub settings
- Provide GitHub settings link for activating the social preview
Note: To set as actual social preview, users must:
- Go to repository Settings → General
- Scroll to "Social preview"
- Click "Edit" and select the JPG image (
.github/social-preview.jpg)
Color Palettes by Domain
DevTools/CLI:
- Background: #0f172a (slate-900), #1e293b (slate-800)
- Accent: #06b6d4 (cyan-500), #22d3ee (cyan-400)
- Text: #f8fafc (slate-50)
AI/ML:
- Background: #1e1b4b (indigo-950), #312e81 (indigo-900)
- Accent: #8b5cf6 (violet-500), #a78bfa (violet-400)
- Text: #f8fafc (slate-50)
Web/Frontend:
- Background: #0c4a6e (sky-900), #075985 (sky-800)
- Accent: #3b82f6 (blue-500), #60a5fa (blue-400)
- Text: #f8fafc (slate-50)
Data/Analytics:
- Background: #1e3a5f, #0f172a
- Accent: #f59e0b (amber-500), #3b82f6 (blue-500)
- Text: #f8fafc (slate-50)
Security:
- Background: #0f172a (slate-900), #1e293b (slate-800)
- Accent: #22c55e (green-500), #eab308 (yellow-500)
- Text: #f8fafc (slate-50)
Infrastructure:
- Background: #1e293b (slate-800), #334155 (slate-700)
- Accent: #06b6d4 (cyan-500), #64748b (slate-500)
- Text: #f8fafc (slate-50)
Error Handling
No README or project files found: Ask user to describe the project purpose, then proceed with that information.
API key not found (for dalle-3 or gemini): Fall back to SVG generation or prompt-only output with instructions.
Image generation fails:
- Report the error
- Fall back to SVG generation
- Or output the prompt for manual use
SVG file too large (>100KB):
- Simplify shapes (reduce complexity)
- Remove unnecessary elements
- Warn user and suggest switching to minimal style
Additional Resources
Reference Files
references/svg-templates.md- Complete SVG templates by domainreferences/prompt-patterns.md- Detailed prompt patterns by domainreferences/provider-apis.md- API documentation for supported providers
Example Files
examples/config-svg.md- Example SVG configuration (default)examples/config-dalle.md- Example DALL-E configurationexamples/config-gemini.md- Example Gemini configuration
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
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.

