generating-icons

Installation
SKILL.md

Generating Medusa Icons

Draws an SVG that matches the existing icon set, validates it, and converts it with the same SVGR pipeline as yarn generate.

Constraints

CRITICAL: Icons from this skill go in src/custom/, never src/components/. yarn generate deletes src/components/ and rebuilds it from Figma; src/custom/ is untouched by it.

  • Never hand-write the .tsx: write an SVG, then run icon.mjs emit. The script writes the component, the spec, and index.ts in src/custom/.
  • Names are unique across both directories: emit refuses a name Figma already exports. If Figma later adds an icon with the same name, the build fails on the duplicate export: delete the src/custom/ copy, its spec, and its line in src/custom/index.ts.
  • #18181B is the only themeable color: uppercase, exactly. It becomes {color}. currentColor and any other hex stay hardcoded.
  • Outline is the default style: live strokes, stroke-width="1.5", stroke-linecap="round", stroke-linejoin="round", no fill.
  • Solid is fill-only: -solid icons use fill="#18181B" shapes, no strokes.
  • Canvas is 15x15: width="15" height="15" viewBox="0 0 15 15" fill="none" on the root.
  • Style is decided by the markup, not by how a usage site renders it: an icon whose paths are stroke only is an outline. If it looks filled in the app, the call site is forcing a fill (see step 9). Never describe an icon as outline or solid without checking both the SVG and the rendered usage.
  • Study siblings first: export 2-3 related existing icons and reuse their metrics instead of inventing proportions.

CRITICAL: Load the Reference First

Installs
2
Repository
medusajs/medusa
GitHub Stars
37.3K
First Seen
Nov 13, 2026