生成风格统一的图标集合,通过宫格生图、切分和去背景交付透明 PNG。用户需要成套自定义图标、栏目图标或匹配品牌风格的图标时使用;不用于单个简单矢量图标或小尺寸密集功能符号。
npx skills add https://github.com/oil-oil/oil-icon --skill oil-icon
Generate a set of icons that share one visual style, output as transparent PNGs.
Image generation runs on a flat grey backdrop as a 4×4 sheet — 16 icons in one generation, 有助于统一风格,但仍需逐个检查 — then each cell is sliced out and background-removed.
Agent owns the design decisions (which style, which palette, which metaphors, whether to match a brand); image generation and slicing are mechanical steps.
需要外部服务凭据时先读API Key 配置与业务读取:复用已有安全入口;本机缺少 Key 时使用随附固定页面,保存后通过业务包装入口读取。内置能力与纯本地流程不要求配置 Key。
styles/ (table below), or match the user's brand by reading their project's design tokens / assets and deriving a custom style-spec — see reference/style-adaptation.md. Freeze the result as a style-spec with the same fields as the built-in JSONs; 后续批次复用同一规范,并检查生成偏差.name — short concrete metaphor (e.g. settlement — a wallet with a coin). One clear idea per icon; keep the detail level consistent across the set. 默认每张 16 格;明确选择 9 格时,提示词使用 3×3,切图命令必须同时传 --grid 3。 If the user asks for an exact count below 16, still use a 4x4 / 16-cell sheet: place the requested icons first in row-major order, then explicitly ask the remaining cells to stay empty grey background.style.preamble + the style's construction fields (as short guidance) + palette-lock line + numbered metaphors + the fixed composition text — see reference/prompt-template.md and reference/construction.md.reference/image-providers.md) — never assume Codex is present:image_gen tool or the imagegen skill, call it directly. Do not delegate to external Codex CLI just to reach imagegen from another process.scripts/gen_image.py --prompt "…" --out raw/<style>.png is ready.Save or copy each generated sheet to raw/<style>.png on flat grey #808080. Built-in imagegen may save under $CODEX_HOME/generated_images/...; after generation, move or copy the selected PNG into the task output raw/ folder. 同一张图更容易保持共同风格,但仍须逐个验收,不能把一次生成视为一致性保证; a provider only has to turn the prompt into a grey-background PNG.
scripts/setup.sh once, then:.venv/bin/python3 scripts/slice_icons.py <raw>.png <outdir> --mode <cutout> [--thresh N] [--grid 4] [--count N]
using the style's cutout mode (floodfill for flat/hard-edge, rembg for soft / 3D / glossy / photo).
construction — uniform stroke, one radius, matched detail level, shared parts, motif present, single perspective, and no accent out-weighting the defining element (in line styles the accent must be lighter and smaller than the stroke). Re-slice or regenerate any that fail — never ship an icon carrying part of the one above it.| style | look | cutout | fits |
|---|---|---|---|
| linear | mono line / outline | floodfill | utility, settings |
| filled | solid single-colour glyphs | floodfill | mobile nav / tab bars |
| colorblock | bold flat multi-colour blocks | floodfill | kids, creative |
| cartoon | sticker-style cartoon | rembg | games, entertainment |
| isometric | isometric 3D miniatures | rembg | SaaS, dashboards |
| render3d | glossy puffy 3D | rembg | rewards, onboarding |
| sticker | die-cut glossy vinyl | rembg | social, reactions |
| realistic | photoreal product renders | rembg | e-commerce, hero |
| animal-badge | animal emblems in badges | rembg | avatars, kids |
Each styles/<name>.json holds the preamble, locked palette, cutout mode, threshold, construction system, and what it fits.
reference/design-rules.md)construction object encodes the grid, stroke, radius, detail budget, shared parts, and motif (see reference/construction.md). A rigorous system ultimately wants vector; raster is for direction and spot icons.Take oil-oil/oil-icon from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.