Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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

  1. 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 (PageHero heroImg, section decorations).
    • full-bleed -- scene fills the frame edge to edge (HubHero backgrounds, banners).
  2. 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.
  3. 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.
  4. Confirm before spending. Show the prompt, refs, model, aspect, and --dry-run output. 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).
  5. Generate one image per call: --n 1, never higher unless the user asks for a batch. Use a stable kebab --name describing 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).
  6. Review. Look at every output. CHECK lines 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.
  7. 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.
    • process the archived raw (or cp the 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.png beside it, e.g. some HubHero backgrounds), 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 just git checkout on 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.
  8. 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
Полный SKILL.md на GitHub

Установить 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), без исполняемых скриптов.

Похожие скиллы

Сравнить image-gen с