image-gen
БесплатноБез исполняемых скриптовНе проверенGenerate illustration images (heroes, decorations, section art) for ethereum.org via the OpenRouter image API, then key/trim/check and place them in the repo…
от ethereum★ 6 005 звёзд на GitHubОб этом скилле
Image generation
The user asks in chat ("make a hero for /privacy"); Claude drives the flow below. The script is Claude's tool for the parts that need the key or pixel math: it wraps OpenRouter's POST /api/v1/images and the post-processing. Three subcommands:
pnpm tsx src/scripts/image-gen/main.ts models [--filter gemini] # live params per model (aspect, resolution, background, n, ref limit)
pnpm tsx src/scripts/image-gen/main.ts generate --type cutout|full-bleed --prompt-file <f> [--ref <img>]... [--model <id>] [--aspect 16:9] [--quality <q>] [--eth-glyph auto|on|off] [--n 1] [--name <slug>] [--out-dir <dir>] [--dry-run]
pnpm tsx src/scripts/image-gen/main.ts process <img> --type cutout|full-bleed --out <file> [--key-color green|magenta] [--pad 0] [--max-size <px>]
The key
OPENROUTER_API_KEY lives in .env.local, loaded by the script itself. Never read .env.local (.claude/settings.json denies it; .env.example is fine to read). Never echo, log, or pass the key on a command line. Each person uses their own OpenRouter key with a spend limit set.
If a key ever appears in your context (tool output, an error body, a file you read), tell the user right away that it was exposed and should be revoked and replaced at openrouter.ai/settings/keys, without repeating the key. Then carry on with the task; rotation happens separately.
Workflow
- Context. Read the target page and component, then decide the type. If the page doesn't settle it, ask with AskUserQuestion; never guess.
- cutout -- subject on transparency, nothing touching any edge (
PageHeroheroImg, section decorations). - full-bleed -- scene fills the frame edge to edge (
HubHerobackgrounds, banners).
- cutout -- subject on transparency, nothing touching any edge (
- References. Pick 2-6 existing images that match the target style (look at them first); see House style below. More refs pull harder toward house style; mismatched refs muddy it.
- Prompt. Write the subject/scene and style only. The script appends the cutout or full-bleed constraints (key color, margins, no borders) and, when the prompt mentions Ethereum, the ETH glyph spec and reference (see The ETH glyph), so don't restate them.
- Confirm before spending. Show the prompt, refs, model, aspect, and
--dry-runoutput. Generate only after the user agrees, and get a fresh go-ahead for every further call; agreement to one generation isn't agreement to the next. A call costs about $0.11-0.26 and the price follows output pixels (21:9 is the cheapest, 1:1 and 3:2 the most). - Generate one image per call:
--n 1, never higher unless the user asks for a batch. Use a stable kebab--namedescribing the subject (see Naming below); reuse it for every iteration on that target, even if the subject drifts. Don't pass--out-dir: the default archive,/tmp/image-gen/<name>/, sits outside the repo and the session scratchpad, so candidates survive across iterations and sessions. Numbering continues (-1,-2, ...) and nothing is ever overwritten. Each candidate gets<name>-<i>-raw.*, a processed<name>-<i>.png, and<name>-<i>.json(prompt, refs, params, cost, check results). - Review. Look at every output.
CHECKlines are automatic failures (subject touching an edge, flat border strip, background not a key color); regenerate those rather than placing them. Then zoom in (crop at 3-4x) on every ETH glyph and every structure the user has flagged before, and check them against The ETH glyph and Compositions that fail. Report defects you find rather than letting the user discover them. - Place in situ, automatically. Don't wait for a pick: put the best passing candidate at its target location right away so the user can judge it on the real page in their running dev server.
processthe archived raw (orcpthe archived.png) to its final path,public/images/<area>/<descriptive-name>.png, sized to roughly 2x its largest rendered width with--max-size. Cutouts are trimmed to zero margin (--pad 0, the default); the page sets the spacing. Run a lossless PNG optimizer (oxipng) on the result.- If the target also uses a portrait version on small viewports (a
*-portrait.pngbeside it, e.g. someHubHerobackgrounds), crop it from the landscape image rather than generating it separately, so both stay identical. - Wire it into the target component (camelCase raster import, see the design-system skill's
page-hero-walkthrough.md). If it replaces an existing image, repoint the import and leave the old file alone, so reverting is justgit checkouton the component. - Tell the user the URL to check (e.g.
/organizations/) and list the other candidates by path. - Never commit, and never start a dev server; the user runs their own.
- Iterate in place. Each new trial is copied from the archive over the same in-repo file, so the page updates without touching the import again. Static imports pick up the change through the
Установить image-gen в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл image-gen?
Generate illustration images (heroes, decorations, section art) for ethereum.org via the OpenRouter image API, then key/trim/check and place them in the repo. Trigger on "make an image for", "generate a hero", "new illustration for <page>", "fix the glyph", "redraw this image", "chroma key this", or edits to `src/scripts/image-gen/`. Not for screenshots, logos, or brand assets.
Как установить скилл image-gen?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл image-gen запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic