/eisland-dev-add-svg-icon
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
$ npx -y skills add JNTMTMTM/eIsland --skill eisland-dev-add-svg-icon --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/eisland-dev-add-svg-icon
Context preview
The summary Claude sees to decide when to auto-load this skill.
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
SKILL.md
eisland-dev-add-svg-icon.SKILL.mdname: 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/` and wants it registered
Project structure
src/renderer/public/svg/
├── *.svg → SvgIcon (eisland-icon.ts)
├── agent/*.svg → AgentIcon (agent-icon.ts)
├── calculator/*.svg → CalculatorIcon (calculator-icon.ts)
├── countries/*.svg → CountryIcon (country-icon.ts)
├── devicons/*.svg → DevIcon (dev-icon.ts)
├── player/*.svg → PlayerIcon (player-icon.ts)
└── services/*.svg → ServiceIcon (service-icon.ts)
src/renderer/utils/SvgIcon/
├── index.ts → unified exports
├── eisland-icon.ts → SvgIcon enum
├── agent-icon.ts → AgentIcon enum
├── calculator-icon.ts → CalculatorIcon enum
├── country-icon.ts → CountryIcon enum + aliases + resolvers
├── dev-icon.ts → DevIcon enum + aliases + resolvers
├── player-icon.ts → PlayerIcon enum
├── service-icon.ts → ServiceIcon enum
└── test/
├── eisland-icon.test.ts
├── agent-icon.test.ts
├── calculator-icon.test.ts
├── country-icon.test.ts
├── dev-icon.test.ts
├── player-icon.test.ts
└── service-icon.test.tsProcess
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/FOO.svg` | `eisland-icon.ts` | `SvgIcon` | `./svg/` | | `svg/agent/FOO.svg` | `agent-icon.ts` | `AgentIcon` | `./svg/agent/` | | `svg/calculator/FOO.svg` | `calculator-icon.ts` | `CalculatorIcon` | `./svg/calculator/` | | `svg/countries/FOO.svg` | `country-icon.ts` | `CountryIcon` | `./svg/countries/` | | `svg/devicons/FOO.svg` | `dev-icon.ts` | `DevIcon` | `/svg/devicons/` | | `svg/player/FOO.svg` | `player-icon.ts` | `PlayerIcon` | `./svg/player/` | | `svg/services/FOO.svg` | `service-icon.ts` | `ServiceIcon` | `./svg/services/` |
Note the path prefix difference: root/agent/countries/player/services 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, agent-icon, and player-icon. Examples:
- `FILTER.svg` → `FILTER`
- `CLAUDE.svg` → `CLAUDE`
- `PIN_ON_TOP.svg` → `PIN_ON_TOP`
- `applemusic.svg` → `APPLE_MUSIC`
- `qqmusic.svg` → `QQMUSIC`
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 / calculator-icon.ts / player-icon.ts / service-icon.ts pattern:**
NEW_ICON: './svg/NEW_ICON.svg',
// player-icon.ts uses: './svg/player/name.svg'
// service-icon.ts uses: './svg/services/name.svg'
// calculator-icon.ts uses: './svg/calculator/name.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, calculator-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`:
export { NewEnum } from './new-enum';
export type { NewEnumKey } from './new-enum';Step 6: Run tests
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
Read more
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/` and wants it registered
Project structure
src/renderer/public/svg/
├── *.svg → SvgIcon (eisland-icon.ts)
├── agent/*.svg → AgentIcon (agent-icon.ts)
├── calculator/*.svg → CalculatorIcon (calculator-icon.ts)
├── countries/*.svg → CountryIcon (country-icon.ts)
├── devicons/*.svg → DevIcon (dev-icon.ts)
├── player/*.svg → PlayerIcon (player-icon.ts)
└── services/*.svg → ServiceIcon (service-icon.ts)
src/renderer/utils/SvgIcon/
├── index.ts → unified exports
├── eisland-icon.ts → SvgIcon enum
├── agent-icon.ts → AgentIcon enum
├── calculator-icon.ts → CalculatorIcon enum
├── country-icon.ts → CountryIcon enum + aliases + resolvers
├── dev-icon.ts → DevIcon enum + aliases + resolvers
├── player-icon.ts → PlayerIcon enum
├── service-icon.ts → ServiceIcon enum
└── test/
├── eisland-icon.test.ts
├── agent-icon.test.ts
├── calculator-icon.test.ts
├── country-icon.test.ts
├── dev-icon.test.ts
├── player-icon.test.ts
└── service-icon.test.tsProcess
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/FOO.svg` | `eisland-icon.ts` | `SvgIcon` | `./svg/` | | `svg/agent/FOO.svg` | `agent-icon.ts` | `AgentIcon` | `./svg/agent/` | | `svg/calculator/FOO.svg` | `calculator-icon.ts` | `CalculatorIcon` | `./svg/calculator/` | | `svg/countries/FOO.svg` | `country-icon.ts` | `CountryIcon` | `./svg/countries/` | | `svg/devicons/FOO.svg` | `dev-icon.ts` | `DevIcon` | `/svg/devicons/` | | `svg/player/FOO.svg` | `player-icon.ts` | `PlayerIcon` | `./svg/player/` | | `svg/services/FOO.svg` | `service-icon.ts` | `ServiceIcon` | `./svg/services/` |
Note the path prefix difference: root/agent/countries/player/services 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, agent-icon, and player-icon. Examples:
- `FILTER.svg` → `FILTER`
- `CLAUDE.svg` → `CLAUDE`
- `PIN_ON_TOP.svg` → `PIN_ON_TOP`
- `applemusic.svg` → `APPLE_MUSIC`
- `qqmusic.svg` → `QQMUSIC`
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 / calculator-icon.ts / player-icon.ts / service-icon.ts pattern:**
NEW_ICON: './svg/NEW_ICON.svg', // player-icon.ts uses: './svg/player/name.svg' // service-icon.ts uses: './svg/services/name.svg' // calculator-icon.ts uses: './svg/calculator/name.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, calculator-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`:
export { NewEnum } from './new-enum';
export type { NewEnumKey } from './new-enum';Step 6: Run tests
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
eIsland - A sleek, Apple Dynamic Island inspired floating widget for Windows, built with Electron.
Repo: JNTMTMTM/eIsland
Other skills on eisland.
- /eisland-dev-add-empty-setting-subpage
Add a new empty subpage (tab) to an existing eIsland settings section with page navigation support. Use this skill whenever the user wants to add a new tab/page/subpage to any settings section in the eIsland project, including requests like "添加分页", "add a tab", "add subpage",
Open skill - /eisland-dev-add-guide-step
创建 eIsland 引导配置窗口的新步骤页面。当用户要求在引导界面(Guide)中新增配置步骤、引导页面、引导分页时使用此 skill。 触发关键词:guide 步骤、引导页面、引导分页、Guide step、新建引导页、添加引导配置。 适用于 src/renderer/components/components/ 目录下的 Guide 模块。
Open skill - /eisland-dev-generate-release-worklog
Generate a release announcement markdown for eIsland. Use this skill whenever the user asks to "generate release notes", "create announcement", "写更新日志", "生成发布公告", "draft release notes", or mentions preparing a new version release document.
Open skill - /eisland-dev-git-commit
Analyze the current git status, review all staged and unstaged changes, and create a commit with a proper English commit message following conventional commit format. Use this skill whenever the user asks to "commit", "提交", "git commit", "analyze and commit", "check git status
Open skill - /eisland-dev-refactor-module-split
Refactor a monolithic React component file into a standardized module structure with components/, hooks/, utils/, types/, and config/ subdirectories. Use this skill whenever the user asks to "split", "refactor", "拆分", "拆解", or "restructure" a component file into subdirectories,
Open skill - /eisland-dev-update-docs
Update or create documentation in the eIsland VuePress docs site (web/eisland-web-docs). Use this skill whenever the user asks to update docs, add documentation, write a doc article, document a feature, update the tech stack docs, update plugin docs, update command docs, or any
Open skill

