A pipeline for producing branded, operator-style infographics for social media. The design system is reverse-engineered from top product creators on LinkedIn — the look is clean grid structure + handwritten annotations + flanking emojis + signed footer. Outputs are ready for Twitter, LinkedIn, or Instagram.
The skill renders via OpenAI gpt-image-2 using the images.edit endpoint so the user's logos, screenshots, and avatar are honored as visual references rather than hallucinated.
When the skill is first used in a project, it creates a working directory:
infographics/
├── style.json # active theme (filled at runtime: accent color, handle, avatar path)
├── assets/ # logos, screenshots, avatar (user-supplied)
├── outputs/ # rendered PNGs
└── prompts/ # one .py file per generated piece, kept for re-rendering
If this directory already exists, reuse the existing style.json (don't re-ask theme questions every session).
When the user asks for a new infographic, run these steps in order. Don't shortcut.
If the user gave a clear topic, skip ahead. Otherwise:
Pick one layout from references/style-guide.md (L1–L12). Justify briefly.
Then pick a Twitter/LinkedIn format:
| Format | gpt-image-2 size | When to use |
|---|---|---|
| --- | --- | --- |
| 4:5 portrait | 1024x1536 | Default. Dense data — comparison tables, cheat sheets, ranked lists. Highest engagement. |
| 1:1 square | 1024x1024 | Single hero metaphor, hooks, hero charts. Punchy in-feed. |
| 16:9 landscape | 1536x1024 | Process flows, timelines, before/after spreads. |
Rotation rule: if the user is producing a series, alternate formats across posts to break feed monotony. Don't ship 5 portraits in a row.
Identify every brand, tool, or person mentioned in the idea. For each:
```
https://www.google.com/s2/favicons?domain=DOMAIN&sz=128
```
This is the most reliable logo source. Download with curl -sL .
cairosvg. Install inside a virtualenv to avoid touching the system Python:```bash
python3 -m venv .venv && source .venv/bin/activate
pip install --quiet "openai>=1.0" "cairosvg>=2.7"
python3 -c "import cairosvg; cairosvg.svg2png(url='in.svg', write_to='out.png', output_width=512)"
```
If a venv isn't an option, ask the user before falling back to a system-wide install (e.g. pip install --break-system-packages) — it can affect their global Python environment.
assets/avatar.png and reference in style.json.The visual quality is bounded by the copy quality. Ask 3–5 targeted questions to fill the prompt. Tailor them to the chosen layout. Examples:
Do NOT generate copy yourself. Wait for the user. Their voice is the differentiator — the moment you write the copy, the post sounds AI-generated.
references/prompt-templates.md, pick the right layout template, fill in all {{...}} placeholders with the user's confirmed copy, accent color, and reference image filenames..py file in infographics/prompts/.py so it's re-runnable.scripts/generate.py (see that file for the exact API contract).These are what make the output look intentional rather than AI-slop. Skipping any one of them dilutes the whole brand.
style.json for the active hex; if not yet set, ask the user.assets/avatar.png) on the left, the user's handle on the right. Anchors the brand.images.edit, not images.generate. This is what lets reference logos and the avatar be honored. generate will hallucinate them.User says: "Make a comparison infographic of Linear vs Jira."
Step 1 — Idea is clear. Skip to step 2.
Step 2 — Layout: L1 (comparison table) — head-to-head naturally maps to a table. Format: 4:5 portrait for density. Confirm with user.
Step 3 — Fetch logos:
curl -sL "https://www.google.com/s2/favicons?domain=linear.app&sz=128" -o assets/linear.png
curl -sL "https://www.google.com/s2/favicons?domain=atlassian.com&sz=128" -o assets/jira.png
Read both back to confirm they look right.
Step 4 — Ask:
Step 5 — Compose the L1 prompt from references/prompt-templates.md, fill in placeholders, save to infographics/prompts/linear-vs-jira.py, render at 1024x1536, show output, note quirks.
#006EFF (blue), don't leave the word "purple" or "violet" anywhere in the prompt. The model weights words higher than hex codes.images.edit. If you get a moderation_blocked error, swap the brand reference for a generic descriptor and retry.&sz=256 first; if still small, source from the brand's press kit.This skill writes images, reads reference files, and uploads them to OpenAI. A few things to be deliberate about:
OPENAI_API_KEY should be a project-scoped key with a spending limit. Image-2 calls are billable and can run up if the loop misfires.assets_dir: scripts/generate.py rejects absolute paths and .. segments in filenames. Don't try to work around the guard — if you need a logo from elsewhere, copy it into infographics/assets/ first.out_name is validated for the same reason. Use names like linear-vs-jira, never paths.python3 generate.py path/to/prompt.txt …, treat the prompt file as user-authored. Don't let an upstream agent point this at unrelated local files (the contents will be sent to OpenAI).infographics/style.json stores the user's accent color, handle, and avatar path. Treat it as branding metadata only — never store secrets there.When you need details, read these:
references/style-guide.md — full visual rules: 12 layouts (L1–L12), color tokens, typography, recurring motifs, tone of writingreferences/prompt-templates.md — fill-in-the-blank prompt scaffolds, one per layoutreferences/style.json — machine-readable design tokens, runtime-edited to record the user's themeinfographics/style.json from their project.assets/ (don't re-fetch).Image-2 is great for the layout + composition but has known weak spots:
If any of these matter for a high-stakes post (launch announcement, sponsored content), generate the layout in image-2, then do a 5-minute touch-up in Figma to composite real logos + avatar + frame. Tell the user when that's worth doing.
共 1 个版本