plugins/social-media-generator/skills/social-media-generator/SKILL.md
Generate social media images and videos using HTML/CSS templates combined with AI-generated imagery. Use when the user asks to create social media posts, graphics, videos, stories, reels, quote graphics, promotional content, or any visual content for Facebook, Instagram, or Twitter/X. Triggers include "create a social media post", "make an Instagram graphic", "design a Facebook post", "generate a Twitter image", "create a promotional video", "make a quote graphic", "design content for [platform]", "create an ad for", "make promotional material".
npx skillsauth add ao-cyber-systems/devflow-claude social-media-generatorInstall 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 professional social media content by combining HTML/CSS layouts with AI-generated images/videos.
Before starting, check which image generation tools are available. Try calling each to detect availability:
mcp__aosentry-media__generate_image toolreplicate:create_models_predictions toolSet the backend based on what is found:
"AI image generation is not available. To enable it, install one of:
- AOSentry MCP plugin (from the devflow marketplace) — provides image generation, editing, and analysis
- Replicate MCP — run
npx replicate-mcp@latestwith aREPLICATE_API_TOKENWithout image generation, I can still create HTML/CSS templates with placeholder backgrounds. Want to proceed with CSS-only designs?"
If platform not specified, confirm: "I'll create this for Facebook. Want me to also generate versions for Instagram and Twitter/X?"
Gather:
Recommend a theme based on context, or let user choose. See references/themes.md for full specifications.
| Theme | Best For | |-------|----------| | Cybernetic Luxury | Tech, AI, SaaS, innovation, premium digital products | | Republican Campaign | Political campaigns, conservative causes, patriotic content | | Ministry/Church | Religious organizations, faith-based content, spiritual messages | | Auto-detect | Analyze content and recommend appropriate theme |
Use whichever backend was detected in Step 0.
Prompt structure for backgrounds: "[style keywords from theme], abstract background, [mood/atmosphere], no text, no words, suitable for text overlay, [additional context]"
mcp__aosentry-media__generate_image
prompt: "[detailed prompt with theme keywords from references/themes.md]"
aspect_ratio: "16:9" # Match platform: 1:1, 4:5, 9:16, 16:9
AOSentry also provides edit_image (inpainting/outpainting) and analyze_image (vision analysis) which can be useful for refining outputs.
Model selection by use case:
| Use Case | Model | Notes |
|----------|-------|-------|
| Photorealistic/general | black-forest-labs/flux-1.1-pro | High quality, reliable |
| Images with embedded text | ideogram-ai/ideogram-v2 | Best text rendering |
| Video backgrounds | minimax/video-01 | High quality video |
replicate:create_models_predictions
model_owner: "black-forest-labs"
model_name: "flux-1.1-pro"
Prefer: "wait"
input:
prompt: "[detailed prompt with theme keywords from references/themes.md]"
aspect_ratio: "16:9" # Match platform: 1:1, 4:5, 9:16, 16:9
If no image generation is available, create designs using CSS gradients, patterns, and solid backgrounds that match the selected theme's color palette. The output will still be professional but without AI-generated imagery.
⚠️ CRITICAL: Always download generated image outputs before rendering.
Puppeteer with file:// protocol cannot reliably fetch remote URLs due to CORS restrictions. Output URLs (from Replicate or AOSentry) will fail silently during render, resulting in missing backgrounds.
Always download AI-generated assets locally:
# Download the generated output
curl -L -o background.webp "[OUTPUT_URL]"
Or use the render-util.js helper:
const { downloadAsset } = require('./render-util.js');
const localFile = downloadAsset('[OUTPUT_URL]', 'background.webp');
Why this matters:
file:// protocol has CORS restrictions that block remote fetchesSkip this step if using CSS-only fallback (Option C).
Create HTML that composites the local AI image with text overlays:
<!DOCTYPE html>
<html>
<head>
<link href="https://fonts.googleapis.com/css2?family=[Theme+Font]&display=swap" rel="stylesheet">
<style>
.post {
width: [PLATFORM_WIDTH]px;
height: [PLATFORM_HEIGHT]px;
position: relative;
overflow: hidden;
}
.background {
position: absolute;
width: 100%;
height: 100%;
object-fit: cover;
}
.overlay {
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
justify-content: center;
padding: 40px;
/* Theme-specific gradient overlay */
}
.headline {
font-family: '[Theme Font]', sans-serif;
/* Theme colors and sizing */
}
</style>
</head>
<body>
<div class="post">
<!-- IMPORTANT: Use local file path, NOT remote URL -->
<img src="background.webp" class="background" />
<div class="overlay">
<h1 class="headline">[Main Message]</h1>
<p class="subtext">[Supporting text]</p>
</div>
</div>
</body>
</html>
IMPORTANT: Use puppeteer-core instead of Playwright.
Playwright bundles specific browser versions that may not match the environment. puppeteer-core allows pointing to any available Chrome executable, making it robust across environments.
Setup:
npm install puppeteer-core
Using render-util.js (recommended):
const { renderForPlatform } = require('./render-util.js');
// Render for specific platform
await renderForPlatform('template.html', 'output.png', 'facebook');
await renderForPlatform('template.html', 'output-ig.png', 'instagram_square');
Manual render script:
const puppeteer = require('puppeteer-core');
const path = require('path');
const fs = require('fs');
// Find available Chrome - check multiple locations
async function findChrome() {
const paths = [
'/usr/bin/google-chrome',
'/usr/bin/chromium-browser',
'/usr/bin/chromium',
];
// Also check Playwright browser directory
const pwBrowsers = '/opt/pw-browsers';
if (fs.existsSync(pwBrowsers)) {
const dirs = fs.readdirSync(pwBrowsers)
.filter(d => d.startsWith('chromium-') && !d.includes('headless_shell'))
.sort().reverse();
for (const dir of dirs) {
const chromePath = path.join(pwBrowsers, dir, 'chrome-linux', 'chrome');
if (fs.existsSync(chromePath)) return chromePath;
}
}
for (const p of paths) {
if (fs.existsSync(p)) return p;
}
throw new Error('No Chrome found');
}
(async () => {
const browser = await puppeteer.launch({
executablePath: await findChrome(),
headless: true,
args: ['--no-sandbox', '--disable-setuid-sandbox']
});
const page = await browser.newPage();
await page.setViewport({ width: 1200, height: 630 });
await page.goto(`file://${path.resolve('template.html')}`, { waitUntil: 'networkidle0' });
await new Promise(r => setTimeout(r, 1500)); // Wait for fonts
await page.screenshot({ path: 'output.png', clip: { x: 0, y: 0, width: 1200, height: 630 } });
await browser.close();
})();
Video content: Generate video via Replicate (if available), then overlay text using ffmpeg or create animated HTML.
When multiple platforms requested, create optimized versions:
| Platform | Format | Dimensions | Notes | |----------|--------|------------|-------| | Facebook | Post | 1200×630 | Primary default | | Instagram | Square | 1080×1080 | Feed posts | | Instagram | Portrait | 1080×1350 | Better engagement | | Instagram | Story/Reel | 1080×1920 | Vertical video | | Twitter/X | Post | 1200×675 | Timeline optimized |
Adjust per platform:
Before rendering, verify:
src="background.webp"Quote graphic:
Tech product announcement:
Political campaign:
Cause: Using remote URL in <img src="..."> with file:// protocol.
Fix: Download the image locally first and reference the local file.
Cause: Insufficient wait time after page load.
Fix: Increase waitMs parameter in render call (default 1500ms).
Cause: No Chrome/Chromium installed in expected locations. Fix: The render-util.js searches multiple paths including Playwright browsers.
references/themes.md - Complete theme specs: colors, fonts, Replicate prompt keywordsreferences/platforms.md - Platform dimensions, safe zones, best practicesrender-util.js - Reusable rendering utility with browser detection and asset downloaddevelopment
Orchestrate a multi-step DevFlow workflow by chaining skills. Use when the user wants to invoke a sequence of skills as one ask (e.g., "build and sync to github", "research, plan, then build", "ship and announce"). Triggers on: "ship X to Y", "build and X", "plan and X", "X then Y", "in one go", "as a chain", "all in sequence", "chain", "ship-and-sync", "research-plan-build"
testing
Stamp a new polyglot monorepo using the AO Cyber Systems scaffold — root CLAUDE.md with Layout table, per-area CLAUDE.md, path-filtered CI workflows, comprehensive .gitignore, and the no-binaries pre-commit hook config. Use this for new product monorepos (the 5-monorepo architecture: aodex, aosentry, eden-biz, politihub, aohealth, plus future ones). Triggers on: "new monorepo", "scaffold a monorepo", "set up a monorepo", "create a new product monorepo".
development
Validate that a monorepo follows the AO Cyber Systems layout convention — root CLAUDE.md declares every area, every area has its own CLAUDE.md, no compiled binaries are tracked in git. Reads the root `CLAUDE.md` Layout table, walks the working tree, and reports drift in a single Markdown summary. Standalone — works on any repo. Triggers on: "audit monorepo layout", "monorepo doctor", "is this monorepo healthy?", "check the layout", "find binaries in the repo".
development
Build, review, or visually inspect web pages using Hugo templates, Tailwind CSS, and the project's brand design system. Use when the user wants to create new pages, design components, audit existing UI, review frontend code, or visually test rendered pages. Triggers on: "build the UI", "design this page", "create a page", "review the frontend", "audit the UI", "check UI consistency", "make it look good", "frontend review", "visual review", "check how it looks", "inspect the page"