agentleFS
daizhouchendaizhouchen/openclaw-skills/skills/svg-icon-forge/SKILL.md

svg-icon-forge

Skill0 starsChanged 48 days agoMITView on GitHub

根据需求生成、优化或校验 SVG 图标,支持线框、填充、双色、手绘和像素风格。用于矢量图标任务。

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 6 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Determine the style: If not specified, default to outline.

    line 16
  2. Distinctive:

    Use negative space (cutouts) to convey detail

    line 30
  3. Distinctive:

    Use cubic bezier curves with subtle control-point offsets

    line 41
  4. Distinctive:

    Avoid perfect circles or straight lines.

    line 43
  5. Very specific:

    Use <rect> elements sized 1x1 or 2x2 on integer coordinates

    line 47
  6. Distinctive:

    No anti-aliasing effects; all edges are axis-aligned

    line 48
  7. Distinctive:

    Every generated SVG MUST meet these criteria:

    line 53
  8. Very specific:

    ViewBox: Always viewBox="0 0 24 24" with width="24" height="24"

    line 55
  9. Very specific:

    Color: Use currentColor exclusively so icons adapt to any theme

    line 56
  10. Distinctive:

    Coordinates: Prefer integer (pixel-aligned) coordinates.

    line 57
  11. Very specific:

    Relative paths: Use relative commands (m, l, c, a) in <path> d attributes where practical

    line 58
  12. Very specific:

    Run scripts/optimize_svg.py on the result to validate and optimize

    line 109

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

SVG Icon Forge

Resolve <skill_dir> to the directory containing this SKILL.md. Use absolute helper paths, keep project/output paths separate, and generate only the outputs needed for the user's request.

You are a precision SVG icon generator. When the user requests icons, follow these instructions carefully.

Understanding Icon Requests

  1. Identify the subject: What object, concept, or action should the icon depict?
  2. Determine the style: If not specified, default to outline. Ask if ambiguous.
  3. Check quantity: Single icon or a set? For sets, ensure visual consistency.
  4. Note constraints: Target size, color requirements, accessibility needs.

Style Definitions

outline (default)

  • 24x24 line icons inspired by Lucide/Feather conventions
  • stroke-width="2", stroke="currentColor", fill="none"
  • stroke-linecap="round", stroke-linejoin="round"
  • Clean, minimal geometry; avoid overly complex paths

filled

  • Solid fill shapes: fill="currentColor", no stroke
  • Use negative space (cutouts) to convey detail
  • Shapes should be bold and recognizable at small sizes

duotone

  • Two-tone icons with a primary and secondary layer
  • Primary layer: fill="currentColor" at full opacity
  • Secondary layer: fill="currentColor" at opacity="0.3"
  • Group layers with <g> elements for easy theming

hand-drawn

  • Irregular, slightly wobbly paths that mimic pen sketches
  • Use cubic bezier curves with subtle control-point offsets
  • stroke-width="1.5" to 2, fill="none"
  • Avoid perfect circles or straight lines; add human imperfection

pixel

  • Pixel-art style aligned strictly to a grid
  • Use <rect> elements sized 1x1 or 2x2 on integer coordinates
  • No anti-aliasing effects; all edges are axis-aligned
  • Limit palette: currentColor for on-pixels, transparent for off

SVG Quality Standards

Every generated SVG MUST meet these criteria:

  1. ViewBox: Always viewBox="0 0 24 24" with width="24" height="24"
  2. Color: Use currentColor exclusively so icons adapt to any theme
  3. Coordinates: Prefer integer (pixel-aligned) coordinates; use half-pixels only when necessary for centering
  4. Relative paths: Use relative commands (m, l, c, a) in <path> d attributes where practical
  5. File size: Each icon SVG must be under 1 KB
  6. No unnecessary attributes: Strip xmlns when inline, remove editor metadata, IDs unless needed
  7. Accessibility: Include a <title> element inside the SVG describing the icon
  8. Structure: Wrap in <svg xmlns="http://www.w3.org/2000/svg" ...> for standalone files

Output Formats

Single SVG

Return the raw SVG markup in a fenced code block with svg language tag.

SVG Sprite (for icon sets)

Combine multiple icons into one <svg> with <symbol> elements:

<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
  <symbol id="icon-name" viewBox="0 0 24 24">
    <!-- paths -->
  </symbol>
</svg>

Usage: <svg><use href="#icon-name"/></svg>

React Component Wrapper

export const IconName = ({ size = 24, ...props }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none"
       stroke="currentColor" strokeWidth="2" strokeLinecap="round"
       strokeLinejoin="round" {...props}>
    {/* paths */}
  </svg>
);

Vue Component Wrapper

<template>
  <svg :width="size" :height="size" viewBox="0 0 24 24" fill="none"
       stroke="currentColor" stroke-width="2" stroke-linecap="round"
       stroke-linejoin="round" v-bind="$attrs">
    <!-- paths -->
  </svg>
</template>
<script setup>
defineProps({ size: { type: Number, default: 24 } });
</script>

Workflow

  1. Parse the user's request to identify icon subject(s) and style
  2. Generate SVG code following the style definition above
  3. Run scripts/optimize_svg.py on the result to validate and optimize
  4. Present the final SVG with a visual preview description
  5. For sets, offer a sprite sheet and component wrappers if appropriate

Available Resources

  • scripts/optimize_svg.py -- Validates, optimizes, and reports size of SVG files
  • assets/icon_templates.py -- Parameterized templates for common icon categories
  • references/examples.md -- Gallery of example icons in all 5 styles

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.