Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Eisland Dev Add Svg Icon

ASecurity

Add a new SVG icon to the project's icon enum system with matching test assertions. Use this skill whenever the user asks to "add SVG icon", "添加图标", "add icon enum", "注册图标", "补齐图标枚举", "add SVG enum", or wants to register a new .svg file in the SvgIcon utility. Also trigger when the user provides a path to an .svg file and asks to create enum/test for it.

320 stars
0 votes
0 copies
0 views
Added 10/6/2026
developmentjavascriptgojavabash

Security Analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned 10/6/2026

$npx -y skills add JNTMTMTM/eIsland --skill eisland-dev-add-svg-icon --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Eisland Dev Add Svg Icon?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Eisland Dev Add Svg Icon
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jntmtmtm-eisland-dev-add-svg-icon/badge)](https://www.skillsdirectory.com/skills/jntmtmtm-eisland-dev-add-svg-icon)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: eisland-dev-add-svg-icon
author: 鸡哥
description: >
  Add a new SVG icon to the project's icon enum system with matching test assertions.
  Use this skill whenever the user asks to "add SVG icon", "添加图标", "add icon enum",
  "注册图标", "补齐图标枚举", "add SVG enum", or wants to register a new .svg file
  in the SvgIcon utility. Also trigger when the user provides a path to an .svg file
  and asks to create enum/test for it.
---

# Add SVG Icon Enum and Test

Register a new SVG file in the project's icon enum system and ensure test coverage.

## When to use

- User provides an SVG file path and asks to add it to the enum
- User says "添加图标", "add icon", "补齐枚举", "注册 SVG"
- User adds a new `.svg` file to `src/renderer/public/svg/app/` and wants it registered

## Project structure

```
src/renderer/public/svg/
├── app/*.svg              → SvgIcon (eisland-icon.ts)
├── agent/*.svg            → AgentIcon (agent-icon.ts)
├── countries/*.svg        → CountryIcon (country-icon.ts)
└── devicons/*.svg         → DevIcon (dev-icon.ts)

src/renderer/utils/SvgIcon/
├── index.ts               → unified exports
├── eisland-icon.ts        → SvgIcon enum
├── agent-icon.ts          → AgentIcon enum
├── country-icon.ts        → CountryIcon enum + aliases + resolvers
├── dev-icon.ts            → DevIcon enum + aliases + resolvers
└── test/
    ├── eisland-icon.test.ts
    ├── agent-icon.test.ts
    ├── country-icon.test.ts
    └── dev-icon.test.ts
```

## Process

### Step 1: Identify the icon category

Determine which enum the SVG belongs to based on its filesystem path:

| SVG path | Enum file | Enum name | Path prefix |
|----------|-----------|-----------|-------------|
| `svg/app/FOO.svg` | `eisland-icon.ts` | `SvgIcon` | `./svg/app/` |
| `svg/agent/FOO.svg` | `agent-icon.ts` | `AgentIcon` | `./svg/agent/` |
| `svg/countries/FOO.svg` | `country-icon.ts` | `CountryIcon` | `./svg/countries/` |
| `svg/devicons/FOO.svg` | `dev-icon.ts` | `DevIcon` | `/svg/devicons/` |

Note the path prefix difference: root/agent/countries use `./svg/...`, devicons use `/svg/...`.

### Step 2: Derive the enum key

Use the SVG filename (without extension), converted to UPPER_SNAKE_CASE for eisland-icon and agent-icon. Examples:
- `FILTER.svg` → `FILTER`
- `Codex.svg` → `Codex`
- `PIN_ON_TOP.svg` → `PIN_ON_TOP`

For country-icon and dev-icon, keys follow their existing conventions (e.g., `CHN`, `javascript`).

### Step 3: Add to the enum

Read the enum file, then add the new entry before the closing `} as const;`. Keep entries sorted logically or grouped with related icons — match the existing ordering style.

**eisland-icon.ts / agent-icon.ts pattern:**
```ts
  NEW_ICON: './svg/app/NEW_ICON.svg',
```

**country-icon.ts / dev-icon.ts:** These have aliases and resolver functions. Only add if the user explicitly asks, and follow the existing alias/resolver patterns.

### Step 4: Update the test file

Read the test file for the enum, then make three changes:

1. **Add property assertion** — add `expect(EnumName).toHaveProperty('NEW_KEY');` in the "should contain expected keys" test block.

2. **Update key count** — the test has an assertion like `expect(Object.keys(EnumName)).toHaveLength(N)`. Increment N by 1.

3. **Path format check** — verify the existing path regex test covers the new entry's path format. No change needed unless the path format differs from existing entries.

### Step 5: Export from index.ts (new category only)

If adding to an existing enum file (eisland-icon, agent-icon, etc.), no change to `index.ts` is needed — it's already exported.

If creating a **new** category (a new enum file), add the export to `src/renderer/utils/SvgIcon/index.ts`:
```ts
export { NewEnum } from './new-enum';
export type { NewEnumKey } from './new-enum';
```

### Step 6: Run tests

```bash
npx vitest run src/renderer/utils/SvgIcon/test/<enum-name>.test.ts
```

All tests must pass. If the key count assertion fails, double-check the count update in Step 4.

## Important rules

- **Never modify existing entries** — only add new ones
- **Match existing code style** — look at surrounding entries for trailing commas, spacing, comments
- **Update key count in tests** — forgetting this is the most common mistake
- **Run tests before reporting done** — verify the change actually works
- **Path prefix must match the category** — `./svg/` vs `/svg/` matters

Attribution

JNTMTMTMJNTMTMTM
View sourceSee grades on GitHubMore from JNTMTMTM →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Clean Code

Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments

304955 votes

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

286712 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2222 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Writing Plans

Use when you have a spec or requirements for a multi-step task, before touching code

2927051 votes
View all in development →