feature-image/SKILL.md
Generate a branded social media image announcing a new feature or update. Analyzes git history, auto-detects brand from codebase (Tailwind, CSS vars, design tokens), replicates UI elements, and captures via Playwright. Use when the user wants to create an announcement image, says 'feature image,' 'announcement graphic,' 'social image for feature,' or wants to visually announce a code change.
npx skillsauth add Shpigford/skills feature-imageInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate a branded social media image for announcing a feature or update. The image is built as an HTML page styled to match the project's brand, then screenshotted with Playwright.
npx playwright --version 2>/dev/null || (echo "Installing Playwright..." && npx playwright install chromium)
If installation fails, inform the user and suggest npm install -D playwright && npx playwright install chromium.
Analyze the recent git history to understand what feature/update to announce:
Check recent commits:
git log --oneline -20
Check current diff (staged + unstaged):
git diff HEAD --stat
git diff HEAD -- '*.tsx' '*.jsx' '*.vue' '*.svelte' '*.html' '*.css' '*.scss' '*.rb' '*.erb'
Check recent branch name (often describes the feature):
git branch --show-current
Synthesize what the feature/update is from this context.
Present findings to user with AskUserQuestion:
$1 was provided as an argument, use that instead of asking.Generate text elements for the image:
Present these to the user with AskUserQuestion:
Use AskUserQuestion:
Store the chosen width and height for the Playwright viewport.
Use AskUserQuestion:
This is the most involved style. The goal is to create a representation of the UI that feels like the app without being a literal screenshot.
Find relevant UI components related to the feature:
Extract visual patterns from components:
Build a simplified HTML mockup that:
Build an HTML page with:
/public, /assets, or /src/assets)This is the most important phase. Spend real time here. The generated image must feel like it was made by the same team that built the product -- not a generic template with brand colors swapped in. The goal is to internalize the brand's visual identity so deeply that the image is indistinguishable from something the design team would produce.
Before looking at config files, study how the brand actually presents itself. These are your primary references:
Landing pages and marketing pages -- search for:
pages/index, app/page, pages/home, components/landing/, components/marketing/, components/herolanding, marketing, home, hero, cta in the nameExisting social/OG images -- search for:
og-image, social, share, twitter, preview in /public or /assetsBlog or changelog pages -- search for:
blog, changelog, updates, announcements in page/route filesEmail templates -- search for:
email, mailer, newsletter templatesREADME and docs -- check for badges, banner images, or styled headers that reveal brand personality
Extract the full color system, not just primary/secondary:
Tailwind config (tailwind.config.js, tailwind.config.ts):
theme.extend.colors blockCSS custom properties (search for :root in global CSS files):
--primary, --brand, --accent, --background, --foreground, --muted, --card or similarDesign token files (search for tokens, theme, design-system in filenames):
Actual usage in marketing components:
@import with font URLs, @font-face, or Google Fonts links)@fontsource/*, next/font)For the image, use the detected font. If it's a Google Font, include the <link> tag in the HTML. If it's a local/custom font, fall back to a similar system font or Google Font alternative.
Search for logo files:
public/logo*, public/images/logo*, src/assets/logo*, assets/logo*
public/*.svg (check for logo-like SVGs)
public/brand*, src/assets/brand*
If a logo is found, embed it in the image (inline SVG or base64-encoded).
Also look for:
Go beyond basic config -- study the visual personality of the brand:
rounded-xl, rounded-2xl) or sharp (rounded-none, rounded-sm)? Use the exact same radii.shadow-lg vs shadow-sm vs no shadow)backdrop-blur usage? Translucent cards?Before building the image, write a short internal summary of the brand's visual identity:
Use this brief as your guide for every design decision in the image. Every element should pass the test: "Would this look at home on their landing page?"
Unique temp files: To avoid race conditions when multiple agents run in parallel, generate a slug-based ID for this run. Format: {project-slug}-{feature-slug}-{short-id} where project slug comes from the directory name or package.json name, feature slug is a 2-3 word kebab-case summary of the feature, and short ID is 4-6 random alphanumeric chars. Example: baremetrics-dark-mode-a3f2. Use this slug in all temp file paths below (shown as [UNIQUE_ID]). Both the HTML file and the capture script must use the same slug.
Create a self-contained HTML file at /tmp/feature-image-[UNIQUE_ID]-page.html that:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="https://fonts.googleapis.com/css2?family=[DETECTED_FONT]&display=swap" rel="stylesheet">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
width: [WIDTH]px;
height: [HEIGHT]px;
overflow: hidden;
font-family: '[DETECTED_FONT]', system-ui, sans-serif;
}
body {
background: [BRAND_GRADIENT_OR_COLOR];
color: [TEXT_COLOR];
display: flex;
/* Layout depends on style choice */
}
/* ... style-specific CSS ... */
</style>
</head>
<body>
<!-- Content depends on style choice -->
</body>
</html>
The image should look like it was designed by a professional. Follow these principles:
These images will be viewed at small sizes in social feeds, timeline cards, and link previews. Every pixel matters. Dead space is wasted space.
Mandatory rules:
Common mistakes to avoid:
Create and run a Node.js script:
import { chromium } from 'playwright';
import { readFileSync } from 'fs';
async function capture() {
const browser = await chromium.launch();
const context = await browser.newContext({
viewport: { width: [WIDTH], height: [HEIGHT] },
deviceScaleFactor: 2, // Retina quality
});
const page = await context.newPage();
// Load the HTML file
const html = readFileSync('/tmp/feature-image-[UNIQUE_ID]-page.html', 'utf-8');
await page.setContent(html, { waitUntil: 'networkidle' });
// Wait for fonts to load
await page.waitForTimeout(1000);
await page.screenshot({
path: './feature-image.png',
type: 'png',
});
await browser.close();
console.log('Saved: ./feature-image.png');
}
capture().catch(console.error);
Save the script to /tmp/feature-image-[UNIQUE_ID]-capture.mjs, run it, then clean up:
node /tmp/feature-image-[UNIQUE_ID]-capture.mjs && rm /tmp/feature-image-[UNIQUE_ID]-capture.mjs /tmp/feature-image-[UNIQUE_ID]-page.html
Check the file exists and has reasonable size:
ls -la ./feature-image.png
sips -g pixelWidth -g pixelHeight ./feature-image.png 2>/dev/null || file ./feature-image.png
Read the image using the Read tool to show it to the user.
Ask if adjustments are needed with AskUserQuestion:
Output summary:
Generated: ./feature-image.png
Size: [W]x[H] @ 2x ([actual_W]x[actual_H] pixels)
Platform: [chosen platform]
Style: [chosen style]
npm install -D playwright && npx playwright install chromiumdevelopment
Deep research before planning. Launches parallel agents to search docs, web, and codebase, then synthesizes findings into actionable context.
development
Review the current session and code changes for anything worth codifying in CLAUDE.md or README.md. Use before committing/opening a PR, or when the user asks "anything learned?", "anything to note?", "should we update CLAUDE.md?", "update the docs with what we learned", or similar.
devops
When the user wants to create or update a README.md file for a project. Also use when the user says "write readme," "create readme," "document this project," "project documentation," or asks for help with README.md. This skill creates absurdly thorough documentation covering local setup, architecture, and deployment.
data-ai
Configure a Rails project to work with Conductor (parallel coding agents)