Skip to content

feat: AI-powered icon finder skill + PNG-to-SVG tracing#191

Open
nomativ wants to merge 3 commits into0xa3k5:mainfrom
nomativ:feat/ai-icon-finder-skill
Open

feat: AI-powered icon finder skill + PNG-to-SVG tracing#191
nomativ wants to merge 3 commits into0xa3k5:mainfrom
nomativ:feat/ai-icon-finder-skill

Conversation

@nomativ
Copy link

@nomativ nomativ commented Mar 4, 2026

Summary

Adds a Claude Code slash command (/add-icon <project>) that automates the full icon addition workflow — from finding a project's logo on the web to creating a ready-to-merge PR with optimized SVGs, metadata, and React components.

Also includes a PNG-to-SVG tracing utility for when only raster logos are available.

What's included

  • .claude/commands/add-icon.md — 13-step AI skill that:

    1. Identifies the project type (token, network, wallet, exchange)
    2. Checks if the icon already exists
    3. Finds the official logo (SVG preferred, falls back to PNG tracing)
    4. Downloads and reformats to 24x24 frame with correct sizing (max 16px mono/branded, max 14px background, centered)
    5. Places SVGs in raw-svgs/ with correct naming conventions
    6. Adds metadata to the appropriate JSON file
    7. Runs validation, builds all packages, and runs post-build
    8. Cleans up SVG path data (trailing zeros, round numbers)
    9. Generates a visual test HTML with grid overlay for sizing verification
    10. Creates commit, pushes, and opens a PR
  • scripts/cli/trace-png-to-svg.ts — CLI tool for bitmap-to-vector conversion

    • Uses sharp for preprocessing + potrace for tracing
    • Supports --mono, --background, --color, --threshold, --turdsize, --turnpolicy
    • Auto-installs dependencies if missing
  • Stella wallet icon — proof-of-concept test of the skill

    • Source: official SVG from lightlink.io/wallet
    • Mono and branded variants, 16.00 x 13.90px centered in 24x24 frame
    • Metadata added to wallets.json

Visual test

The test-preview.html file shows the Stella icon at multiple sizes with the repo's icon grid overlay for sizing verification.

Metadata entry

{
  "id": "stella",
  "filePath": "wallet:stella",
  "name": "Stella",
  "variants": ["branded", "mono"]
}

Checklist

  • SVG dimensions: 24x24 frame, icon max 16px largest side, centered
  • Naming conventions: kebab-case for wallet
  • Mono variant uses fill="white"
  • Branded variant preserves brand color (#6A81FF)
  • Metadata inserted alphabetically
  • Path data cleaned (no trailing zeros, round numbers simplified)
  • Visual test with grid overlay included

🤖 Generated with Claude Code

nomativ and others added 3 commits March 4, 2026 11:30
Add a Claude Code slash command (`/add-icon`) that automates finding,
downloading, and formatting web3 project logos into the repo's 24x24
SVG format. Includes a PNG-to-SVG bitmap tracing utility for when only
raster logos are available.

- .claude/commands/add-icon.md: AI skill that searches for logos, formats
  SVGs, places files, and adds metadata
- scripts/cli/trace-png-to-svg.ts: CLI tool using potrace+sharp to
  convert PNG/JPEG/WebP to 24x24 SVGs
- Adds Stella wallet (LightLink) as a proof-of-concept icon

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove trailing zeros and simplify round numbers in Stella SVGs
- Add Step 10 (Clean Up SVG Path Data) to add-icon skill
- Add test-preview.html for visual verification

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The skill now embeds icons directly in the PR description using
<img> tags pointing to raw GitHub URLs, so reviewers can see the
icons without clicking through to an HTML file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant