custom-icons-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese🎨 Custom Icons Skill
🎨 自定义图标Skill
A master workflow for crafting professional-grade iconography. This skill handles the entire pipeline: from conceptual "desire" and visual "design" to technical "path" refinement, transparent 3D PNG cleanup, and production-ready SVG optimization.
一套用于制作专业级图标的核心工作流。该Skill覆盖完整流程:从概念层面的“desire”、视觉层面的“design”到技术层面的“path”优化,再到透明3D PNG清理和可用于生产环境的SVG优化。
🤖 Agent Instructions (Strict Workflow)
🤖 Agent操作说明(严格工作流)
When this skill is activated, you MUST follow this step-by-step interaction protocol:
激活该Skill后,必须遵循以下分步交互协议:
Phase 0: User Intent Comes First
阶段0:用户意图优先
Follow the user's explicit request over defaults in this skill.
- If the user provides specific subjects, style, output type, destination, colors, or framework, use those exact details as provided. If any detail is missing, request clarification.
- If the user's input contains conflicting or invalid details, clarify the conflict and request correction before proceeding. This takes priority over following the input strictly.
- If the user requests an unsupported format or style, inform them of the limitation and suggest alternatives.
- Do not substitute a different pipeline, format, style, subject, palette, or destination because it seems easier than the user's valid request.
- Do not hand-author final Strategy A SVGs unless the user explicitly asks for manual/deterministic SVG code.
- Do not convert a Strategy B/3D request into SVG unless the user explicitly asks for SVG.
- Do not ask setup questions when the user has already provided enough information to proceed.
- Ask a concise clarifying question only when a missing detail prevents accurate determination of the output format, subject list, destination, or strategy selection.
- If the user asks to update this skill or its gallery, preserve existing conventions unless the user asks to change them.
- Use a visible project-local temporary workspace for generated sources, masks, traces, and intermediate outputs: .
tmp/custom-icons/<request-or-icon-name>/ - Do not delete the temporary workspace or intermediate files unless the user explicitly asks for cleanup. Final assets should be copied to the target destination; intermediate files should remain in the workspace as a reference until an explicit cleanup request is received.
tmp/
优先遵循用户的明确请求,而非Skill中的默认设置。
- 如果用户提供了特定的主题、风格、输出类型、目标路径、颜色或框架,请严格按照提供的细节执行。若有任何细节缺失,请求用户澄清。
- 如果用户输入存在冲突或无效细节,请先澄清冲突并请求修正,再继续执行。这比严格遵循输入内容优先级更高。
- 如果用户请求不支持的格式或风格,请告知其限制并提供替代方案。
- 不要因为看似更简单就替换用户有效请求中的流程、格式、风格、主题、调色板或目标路径。
- 除非用户明确要求手动/确定性SVG代码,否则不要手动编写最终的Strategy A SVG。
- 除非用户明确要求转换为SVG,否则不要将Strategy B/3D请求转换为SVG格式。
- 如果用户已提供足够信息,不要询问设置类问题。
- 仅当缺失的细节会影响输出格式、主题列表、目标路径或策略选择的准确判断时,才提出简洁的澄清问题。
- 如果用户要求更新该Skill或其图库,请保留现有惯例,除非用户明确要求更改。
- 使用可见的项目本地临时工作区存储生成的源文件、遮罩、轨迹和中间输出:。
tmp/custom-icons/<request-or-icon-name>/ - 除非用户明确要求清理,否则不要删除临时工作区或中间文件。最终资产应复制到目标路径;中间文件应保留在工作区作为参考,直到收到明确的清理请求。
tmp/
Phase 1: Discovery & Style Definition
阶段1:需求探索与风格定义
Use discovery only when the request has missing required information. If the user input is incomplete, ask for the minimum missing information:
- Style: What style of icon? (e.g., 3D-effect, Flat, Monoline, Luxury Engraved, Minimalist).
- Subjects: What icons or desire should be represented?
- Target environment: Where will the icons be used? (e.g., Astro, React, Mobile App).
仅当请求缺少必要信息时才进行需求探索。如果用户输入不完整,询问最少的缺失信息:
- 风格:需要什么风格的图标?(例如:3D效果、扁平化、单线、奢华雕刻风、极简风)
- 主题:需要呈现什么图标或概念?
- 目标环境:图标将用于何处?(例如:Astro、React、移动应用)
Phase 2: Generation & Strategy Selection
阶段2:生成与策略选择
For each icon, select a strategy based on the visual complexity:
针对每个图标,根据视觉复杂度选择策略:
Strategy Selection Flowchart
策略选择流程图
- Analyze Request: Check subject complexity and color requirements.
- If the request mixes Strategy A and Strategy B features, clarify which to prioritize or suggest splitting the task.
- Select Strategy:
- Strategy A (Vector): Use for monochrome logos, UI icons, or simple line art.
- Strategy B (Raster): Use for 3D icons, multi-color assets, or detailed illustrations.
- Confirm Pipeline:
- Strategy A -> Binarization -> Potrace -> SVGO.
- Strategy B -> Chroma-Key -> Transparent PNG/WebP.
| Strategy | Recommended Use Cases | Technical Pipeline |
|---|---|---|
| Strategy A (Vector) | Logos, UI icons, line art, monochrome | Image -> Binarization -> Potrace -> SVGO |
| Strategy B (Raster) | 3D icons, multi-color, detailed illustration | Image -> Chroma-Key -> Transparent PNG/WebP |
- 分析请求:检查主题复杂度和颜色要求。
- 如果请求混合了Strategy A和Strategy B的特性,请澄清优先选择哪一种,或建议拆分任务。
- 选择策略:
- Strategy A(矢量):用于单色标志、UI图标或简单线条艺术。
- Strategy B(栅格):用于3D图标、多色资产或精细插画。
- 确认流程:
- Strategy A -> 二值化 -> Potrace -> SVGO。
- Strategy B -> 色度抠图 -> 透明PNG/WebP。
| 策略 | 推荐使用场景 | 技术流程 |
|---|---|---|
| Strategy A (Vector) | 标志、UI图标、线条艺术、单色 | 图片 -> 二值化 -> Potrace -> SVGO |
| Strategy B (Raster) | 3D图标、多色、精细插画 | 图片 -> 色度抠图 -> 透明PNG/WebP |
Prompt Construction Rules
提示构建规则
Use a concise, labeled prompt spec for generation.
使用简洁、带标签的提示规范进行生成。
Content Constraints
内容约束
- Asset type: icon asset for the user's target environment.
- Primary request: exact subject or concept.
- Style/medium: requested style plus the selected strategy.
- Composition/framing: centered, clear silhouette, generous padding.
- Color palette: user-specified colors or category color.
- 资产类型:适用于用户目标环境的图标资产。
- 核心请求:明确的主题或概念。
- 风格/媒介:请求的风格加上所选策略。
- 构图/取景:居中、轮廓清晰、留有充足内边距。
- 调色板:用户指定的颜色或分类颜色。
Visual Constraints
视觉约束
- No text: unless explicitly requested.
- Cleanliness: No logos, trademarks, or watermarks.
- Isolation: No extra elements or complex backgrounds.
- 无文字:除非明确要求。
- 无标识:无标志、商标或水印。
- 独立呈现:无额外元素或复杂背景。
Examples
示例
- Vector: "A monoline coffee cup icon, black on white, minimal."
- Raster: "3D isometric computer icon, vibrant colors, #00ff00 background."
For existing image/reference workflows, label each image by role: , , etc.
Image 1: edit targetImage 2: style reference- 矢量:"单色线条风格咖啡杯图标,黑底白图,极简风。"
- 栅格:"3D等距电脑图标,色彩鲜艳,背景色#00ff00。"
对于现有图片/参考工作流,按角色标记每张图片:, 等。
Image 1: 编辑目标Image 2: 风格参考Strategy A: Vector (Monochrome/Simple)
Strategy A:矢量(单色/简单)
Use for: Logos, UI icons, line art.
- Generate:
text
Asset type: scalable UI icon Primary request: [SUBJECT] Style/medium: [STYLE], high-contrast black vector-like line art Composition/framing: centered icon, clear silhouette, generous padding Color palette: black on pure white background Constraints: no fills unless requested; no gradients; no text; no logos or trademarks; no watermark; no extra elements - Process: Binarize the generated image, trace it with , and optimize it with
potrace.svgo - Rule: Do not hand-author final SVG path data for new Strategy A icons unless the user explicitly asks for a deterministic/manual SVG. The default output must come from the generated image -> ->
scripts/crop_and_trace.py->potracepipeline.svgo - Color: If the user specifies a color, apply that color after tracing. If updating the reference gallery and no color is specified, use the category color.
适用场景:标志、UI图标、线条艺术。
- 生成:
text
Asset type: scalable UI icon Primary request: [SUBJECT] Style/medium: [STYLE], high-contrast black vector-like line art Composition/framing: centered icon, clear silhouette, generous padding Color palette: black on pure white background Constraints: no fills unless requested; no gradients; no text; no logos or trademarks; no watermark; no extra elements - 处理:对生成的图片进行二值化,使用跟踪路径,再用
potrace优化。svgo - 规则:除非用户明确要求确定性/手动SVG,否则不要为新的Strategy A图标手动编写最终SVG路径数据。默认输出必须来自“生成图片 -> ->
scripts/crop_and_trace.py->potrace”流程。svgo - 颜色:如果用户指定颜色,在路径跟踪后应用该颜色。如果更新参考图库且未指定颜色,使用分类颜色。
Strategy B: Raster (Complex/Multi-color)
Strategy B:栅格(复杂/多色)
Use for: Detailed illustrations, 3D icons, colorful assets.
- Generate:
Usetext
Asset type: transparent raster icon Primary request: [SUBJECT] Style/medium: [STYLE], vibrant detailed icon Composition/framing: centered isolated subject, clear silhouette, generous padding Scene/backdrop: perfectly flat solid chroma-key background, usually #00ff00 Constraints: background must be one uniform color with no shadows, gradients, texture, reflections, floor plane, or lighting variation; crisp edges; no halos; no text unless requested; no logos or trademarks; no watermark; no extra elements; do not use the chroma-key color anywhere in the subjectinstead of#ff00ffwhen the subject contains significant green elements or a predominantly green color scheme.#00ff00 - Logic: Background removed via chroma-keying to create a transparent PNG.
- Rule: Keep Strategy B outputs as transparent PNG/WebP unless the user explicitly asks for another format.
适用场景:精细插画、3D图标、彩色资产。
- 生成:
当主题包含大量绿色元素或主要为绿色配色方案时,使用text
Asset type: transparent raster icon Primary request: [SUBJECT] Style/medium: [STYLE], vibrant detailed icon Composition/framing: centered isolated subject, clear silhouette, generous padding Scene/backdrop: perfectly flat solid chroma-key background, usually #00ff00 Constraints: background must be one uniform color with no shadows, gradients, texture, reflections, floor plane, or lighting variation; crisp edges; no halos; no text unless requested; no logos or trademarks; no watermark; no extra elements; do not use the chroma-key color anywhere in the subject替代#ff00ff。#00ff00 - 逻辑:通过色度抠图移除背景,创建透明PNG。
- 规则:除非用户明确要求其他格式,否则Strategy B输出保持为透明PNG/WebP格式。
Phase 3: Processing & Tracing
阶段3:处理与路径跟踪
Temporary Workspace
临时工作区
Before processing, create a project-local workspace for the request:
bash
mkdir -p tmp/custom-icons/<request-or-icon-name>Save generated source images, cropped PNGs, PBM files, traced SVG drafts, validation snapshots, and alternate attempts in that folder. Use the user's requested destination only for final delivered assets; if no final destination is provided, leave the final assets in the same workspace.
tmp/custom-icons/<request-or-icon-name>/- Input Validation: If the provided final destination path is invalid, or if the user provides an unsupported file format for input, notify the user and request a valid path/format before proceeding.
处理前,为请求创建项目本地工作区:
bash
mkdir -p tmp/custom-icons/<request-or-icon-name>将生成的源图片、裁剪后的PNG、PBM文件、跟踪后的SVG草稿、验证快照和备选尝试保存到该文件夹。仅将最终交付的资产保存到用户请求的目标路径;如果未提供最终目标路径,将最终资产留在工作区中。
tmp/custom-icons/<request-or-icon-name>/- 输入验证:如果提供的最终目标路径无效,或用户提供的输入文件格式不支持,请通知用户并请求有效的路径/格式后再继续。
Error Handling
错误处理
If any processing step fails (binarization, tracing, chroma-keying), report the specific error to the user and suggest corrective actions (e.g., retrying with adjusted parameters, checking file formats).
如果任何处理步骤失败(二值化、路径跟踪、色度抠图),向用户报告具体错误并建议纠正措施(例如:调整参数重试、检查文件格式)。
For Strategy A (Vector):
针对Strategy A(矢量):
- Binarize:
python3 scripts/crop_and_trace.py <source> tmp/custom-icons/<request-or-icon-name> <name> - Trace:
potrace "tmp/custom-icons/<request-or-icon-name>/<name>.pbm" --svg --flat -o "tmp/custom-icons/<request-or-icon-name>/<name>.svg" - Optimize:
bunx svgo "tmp/custom-icons/<request-or-icon-name>/<name>.svg" - Color: After tracing, apply the target category fill/stroke color to the optimized SVG only as a mechanical tinting step.
- Deliver: Copy the optimized SVG from to the user's requested destination when provided.
tmp/custom-icons/<request-or-icon-name>/ - Validate: Confirm the SVG parses, contains traced path data, and visually matches the requested subject/style.
- 二值化:
python3 scripts/crop_and_trace.py <source> tmp/custom-icons/<request-or-icon-name> <name> - 路径跟踪:
potrace "tmp/custom-icons/<request-or-icon-name>/<name>.pbm" --svg --flat -o "tmp/custom-icons/<request-or-icon-name>/<name>.svg" - 优化:
bunx svgo "tmp/custom-icons/<request-or-icon-name>/<name>.svg" - 颜色:路径跟踪后,仅通过机械着色步骤将目标分类填充/描边颜色应用到优化后的SVG。
- 交付:如果提供了用户请求的目标路径,将优化后的SVG从复制到该路径。
tmp/custom-icons/<request-or-icon-name>/ - 验证:确认SVG可解析、包含跟踪路径数据,且视觉上符合请求的主题/风格。
For Strategy B (Complex):
针对Strategy B(复杂):
-
Remove Green Screen with the advanced chroma-key utility:bash
python3 scripts/remove_chroma_key.py \ --input <source> \ --out tmp/custom-icons/<request-or-icon-name>/<name>.png \ --auto-key border \ --soft-matte \ --spill-cleanup \ --edge-feather 1.0 \ --forceResult: Creates a transparent PNG with spill cleanup and antialiased edges. -
Alternative Trim Workflow:bash
python3 scripts/crop_and_trace.py <source> tmp/custom-icons/<request-or-icon-name> <name> \ --chroma \ --padding 12Result: Creates a transparent, trimmed PNG at. Use this when trimming is more important than soft matte cleanup.tmp/custom-icons/<request-or-icon-name>/<name>.png -
Deliver: Copy the transparent PNG/WebP fromto the user's requested destination when provided.
tmp/custom-icons/<request-or-icon-name>/ -
Validate Alpha: Check that the output has transparent corners, no green fringe, and a clear subject silhouette. If a fringe remains after the advanced utility, retry once with; if edges look too hard, use a smaller feather such as
--edge-contract 1.--edge-feather 0.25
-
使用高级色度抠图工具移除绿幕:bash
python3 scripts/remove_chroma_key.py \ --input <source> \ --out tmp/custom-icons/<request-or-icon-name>/<name>.png \ --auto-key border \ --soft-matte \ --spill-cleanup \ --edge-feather 1.0 \ --force结果:创建一个带有溢色清理和抗锯齿边缘的透明PNG。 -
备选裁剪工作流:bash
python3 scripts/crop_and_trace.py <source> tmp/custom-icons/<request-or-icon-name> <name> \ --chroma \ --padding 12结果:在创建一个透明、已裁剪的PNG。当裁剪比柔化遮罩清理更重要时使用此方法。tmp/custom-icons/<request-or-icon-name>/<name>.png -
交付:如果提供了用户请求的目标路径,将透明PNG/WebP从复制到该路径。
tmp/custom-icons/<request-or-icon-name>/ -
Alpha通道验证:检查输出是否有透明角落、无绿色边缘,且主题轮廓清晰。如果使用高级工具后仍有边缘残留,添加重试一次;如果边缘过于生硬,使用更小的羽化值,例如
--edge-contract 1。--edge-feather 0.25
Phase 4: Optimization & Delivery
阶段4:优化与交付
- Optimize: For SVGs, use . For PNGs, ensure they are trimmed and compressed.
svgo - Implement: Show the user how to use the asset.
- Gallery Consistency: Keep each reference category at five icons when updating the gallery. Strategy A categories should use their thematic fill/stroke color: Tech , Lifestyle
#00C8FF, Detailed#00E676.#FF3D00 - Report Honestly: Say which pipeline was used, where final files were saved, where the workspace is, and whether validation passed. If a requested step could not be completed, say exactly what failed.
tmp/custom-icons/...
- 优化:对于SVG,使用;对于PNG,确保已裁剪并压缩。
svgo - 使用指导:向用户展示如何使用该资产。
- 图库一致性:更新图库时,每个参考分类保持5个图标。Strategy A分类应使用其主题填充/描边颜色:科技类、生活方式类
#00C8FF、精细类#00E676。#FF3D00 - 如实报告:说明使用了哪个流程、最终文件保存位置、工作区位置,以及验证是否通过。如果无法完成请求的步骤,明确说明失败原因。
tmp/custom-icons/...
🎯 When to Use This Skill
🎯 何时使用该Skill
- Brand Identity: Creating a cohesive set of unique icons for a new brand.
- AI-to-Vector: Converting illustrations into clean, colorable SVGs.
- High-Fidelity Assets: Creating transparent PNGs for complex 3D or multi-color icons.
- 品牌标识:为新品牌创建一套风格统一的独特图标。
- AI转矢量:将插画转换为干净、可着色的SVG。
- 高保真资产:为复杂3D或多色图标创建透明PNG。
🛠 Icon Creation Modes
🛠 图标创建模式
1. 🏗 Design Mode (Visual Structure)
1. 🏗 Design模式(视觉结构)
Minimalist [SUBJECT] icon, black on white, monoline style.
极简风格[SUBJECT]图标,黑底白图,单线样式。
2. 🛣 Path Mode (Vector-Driven)
2. 🛣 Path模式(矢量驱动)
Refine existing image into a clean SVG.
将现有图片优化为干净的SVG。
3. ✨ Desire Mode (Conceptual)
3. ✨ Desire模式(概念表达)
Abstract representation of "[DESIRE]".
“[DESIRE]”的抽象表现。
🎨 Style Library
🎨 风格库
| Style Modifier | Category | Visual Characteristics |
|---|---|---|
| Luxury monoline | Premium | Elegant, thin strokes |
| Geometric bold | Tech | 2px strokes, rounded caps |
| Organic Ink | Lifestyle | Textured edges, fluid |
| 3D Rendered | Complex | Depth, lighting, multi-color, transparent PNG/WebP (Use Strategy B) |
| 风格修饰词 | 分类 | 视觉特征 |
|---|---|---|
| Luxury monoline | 高端 | 优雅、细线条 |
| Geometric bold | 科技 | 2px线条、圆角端点 |
| Organic Ink | 生活方式 | 纹理边缘、流畅自然 |
| 3D Rendered | 复杂 | 有深度、带光影、多色、透明PNG/WebP(使用Strategy B) |
Scripts
脚本
- Vector/Trim Script: scripts/crop_and_trace.py
- Advanced Chroma-Key Script: scripts/remove_chroma_key.py
- 矢量/裁剪脚本:scripts/crop_and_trace.py
- 高级色度抠图脚本:scripts/remove_chroma_key.py