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
    tmp/
    workspace as a reference until an explicit cleanup request is received.
优先遵循用户的明确请求,而非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:
  1. Style: What style of icon? (e.g., 3D-effect, Flat, Monoline, Luxury Engraved, Minimalist).
  2. Subjects: What icons or desire should be represented?
  3. Target environment: Where will the icons be used? (e.g., Astro, React, Mobile App).
仅当请求缺少必要信息时才进行需求探索。如果用户输入不完整,询问最少的缺失信息:
  1. 风格:需要什么风格的图标?(例如:3D效果、扁平化、单线、奢华雕刻风、极简风)
  2. 主题:需要呈现什么图标或概念?
  3. 目标环境:图标将用于何处?(例如:Astro、React、移动应用)

Phase 2: Generation & Strategy Selection

阶段2:生成与策略选择

For each icon, select a strategy based on the visual complexity:
针对每个图标,根据视觉复杂度选择策略:

Strategy Selection Flowchart

策略选择流程图

  1. 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.
  2. 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.
  3. Confirm Pipeline:
    • Strategy A -> Binarization -> Potrace -> SVGO.
    • Strategy B -> Chroma-Key -> Transparent PNG/WebP.
StrategyRecommended Use CasesTechnical Pipeline
Strategy A (Vector)Logos, UI icons, line art, monochromeImage -> Binarization -> Potrace -> SVGO
Strategy B (Raster)3D icons, multi-color, detailed illustrationImage -> Chroma-Key -> Transparent PNG/WebP
  1. 分析请求:检查主题复杂度和颜色要求。
    • 如果请求混合了Strategy A和Strategy B的特性,请澄清优先选择哪一种,或建议拆分任务。
  2. 选择策略
    • Strategy A(矢量):用于单色标志、UI图标或简单线条艺术。
    • Strategy B(栅格):用于3D图标、多色资产或精细插画。
  3. 确认流程
    • 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
内容约束
  1. Asset type: icon asset for the user's target environment.
  2. Primary request: exact subject or concept.
  3. Style/medium: requested style plus the selected strategy.
  4. Composition/framing: centered, clear silhouette, generous padding.
  5. Color palette: user-specified colors or category color.
  1. 资产类型:适用于用户目标环境的图标资产。
  2. 核心请求:明确的主题或概念。
  3. 风格/媒介:请求的风格加上所选策略。
  4. 构图/取景:居中、轮廓清晰、留有充足内边距。
  5. 调色板:用户指定的颜色或分类颜色。
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:
Image 1: edit target
,
Image 2: style reference
, etc.
  • 矢量:"单色线条风格咖啡杯图标,黑底白图,极简风。"
  • 栅格:"3D等距电脑图标,色彩鲜艳,背景色#00ff00。"
对于现有图片/参考工作流,按角色标记每张图片:
Image 1: 编辑目标
,
Image 2: 风格参考
等。

Strategy A: Vector (Monochrome/Simple)

Strategy A:矢量(单色/简单)

Use for: Logos, UI icons, line art.
  1. 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
  2. Process: Binarize the generated image, trace it with
    potrace
    , and optimize it with
    svgo
    .
  3. 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
    ->
    potrace
    ->
    svgo
    pipeline.
  4. 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图标、线条艺术。
  1. 生成
    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
  2. 处理:对生成的图片进行二值化,使用
    potrace
    跟踪路径,再用
    svgo
    优化。
  3. 规则:除非用户明确要求确定性/手动SVG,否则不要为新的Strategy A图标手动编写最终SVG路径数据。默认输出必须来自“生成图片 ->
    scripts/crop_and_trace.py
    ->
    potrace
    ->
    svgo
    ”流程。
  4. 颜色:如果用户指定颜色,在路径跟踪后应用该颜色。如果更新参考图库且未指定颜色,使用分类颜色。

Strategy B: Raster (Complex/Multi-color)

Strategy B:栅格(复杂/多色)

Use for: Detailed illustrations, 3D icons, colorful assets.
  1. Generate:
    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
    Use
    #ff00ff
    instead of
    #00ff00
    when the subject contains significant green elements or a predominantly green color scheme.
  2. Logic: Background removed via chroma-keying to create a transparent PNG.
  3. Rule: Keep Strategy B outputs as transparent PNG/WebP unless the user explicitly asks for another format.

适用场景:精细插画、3D图标、彩色资产。
  1. 生成
    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
  2. 逻辑:通过色度抠图移除背景,创建透明PNG。
  3. 规则:除非用户明确要求其他格式,否则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
tmp/custom-icons/<request-or-icon-name>/
workspace.
  • 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(矢量):

  1. Binarize:
    python3 scripts/crop_and_trace.py <source> tmp/custom-icons/<request-or-icon-name> <name>
  2. Trace:
    potrace "tmp/custom-icons/<request-or-icon-name>/<name>.pbm" --svg --flat -o "tmp/custom-icons/<request-or-icon-name>/<name>.svg"
  3. Optimize:
    bunx svgo "tmp/custom-icons/<request-or-icon-name>/<name>.svg"
  4. Color: After tracing, apply the target category fill/stroke color to the optimized SVG only as a mechanical tinting step.
  5. Deliver: Copy the optimized SVG from
    tmp/custom-icons/<request-or-icon-name>/
    to the user's requested destination when provided.
  6. Validate: Confirm the SVG parses, contains traced path data, and visually matches the requested subject/style.
  1. 二值化
    python3 scripts/crop_and_trace.py <source> tmp/custom-icons/<request-or-icon-name> <name>
  2. 路径跟踪
    potrace "tmp/custom-icons/<request-or-icon-name>/<name>.pbm" --svg --flat -o "tmp/custom-icons/<request-or-icon-name>/<name>.svg"
  3. 优化
    bunx svgo "tmp/custom-icons/<request-or-icon-name>/<name>.svg"
  4. 颜色:路径跟踪后,仅通过机械着色步骤将目标分类填充/描边颜色应用到优化后的SVG。
  5. 交付:如果提供了用户请求的目标路径,将优化后的SVG从
    tmp/custom-icons/<request-or-icon-name>/
    复制到该路径。
  6. 验证:确认SVG可解析、包含跟踪路径数据,且视觉上符合请求的主题/风格。

For Strategy B (Complex):

针对Strategy B(复杂):

  1. 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 \
      --force
    Result: Creates a transparent PNG with spill cleanup and antialiased edges.
  2. Alternative Trim Workflow:
    bash
    python3 scripts/crop_and_trace.py <source> tmp/custom-icons/<request-or-icon-name> <name> \
      --chroma \
      --padding 12
    Result: Creates a transparent, trimmed PNG at
    tmp/custom-icons/<request-or-icon-name>/<name>.png
    . Use this when trimming is more important than soft matte cleanup.
  3. Deliver: Copy the transparent PNG/WebP from
    tmp/custom-icons/<request-or-icon-name>/
    to the user's requested destination when provided.
  4. 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
    --edge-contract 1
    ; if edges look too hard, use a smaller feather such as
    --edge-feather 0.25
    .

  1. 使用高级色度抠图工具移除绿幕
    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。
  2. 备选裁剪工作流
    bash
    python3 scripts/crop_and_trace.py <source> tmp/custom-icons/<request-or-icon-name> <name> \
      --chroma \
      --padding 12
    结果:在
    tmp/custom-icons/<request-or-icon-name>/<name>.png
    创建一个透明、已裁剪的PNG。当裁剪比柔化遮罩清理更重要时使用此方法。
  3. 交付:如果提供了用户请求的目标路径,将透明PNG/WebP从
    tmp/custom-icons/<request-or-icon-name>/
    复制到该路径。
  4. Alpha通道验证:检查输出是否有透明角落、无绿色边缘,且主题轮廓清晰。如果使用高级工具后仍有边缘残留,添加
    --edge-contract 1
    重试一次;如果边缘过于生硬,使用更小的羽化值,例如
    --edge-feather 0.25

Phase 4: Optimization & Delivery

阶段4:优化与交付

  1. Optimize: For SVGs, use
    svgo
    . For PNGs, ensure they are trimmed and compressed.
  2. Implement: Show the user how to use the asset.
  3. Gallery Consistency: Keep each reference category at five icons when updating the gallery. Strategy A categories should use their thematic fill/stroke color: Tech
    #00C8FF
    , Lifestyle
    #00E676
    , Detailed
    #FF3D00
    .
  4. Report Honestly: Say which pipeline was used, where final files were saved, where the
    tmp/custom-icons/...
    workspace is, and whether validation passed. If a requested step could not be completed, say exactly what failed.

  1. 优化:对于SVG,使用
    svgo
    ;对于PNG,确保已裁剪并压缩。
  2. 使用指导:向用户展示如何使用该资产。
  3. 图库一致性:更新图库时,每个参考分类保持5个图标。Strategy A分类应使用其主题填充/描边颜色:科技类
    #00C8FF
    、生活方式类
    #00E676
    、精细类
    #FF3D00
  4. 如实报告:说明使用了哪个流程、最终文件保存位置、
    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 ModifierCategoryVisual Characteristics
Luxury monolinePremiumElegant, thin strokes
Geometric boldTech2px strokes, rounded caps
Organic InkLifestyleTextured edges, fluid
3D RenderedComplexDepth, 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