source-command-icon-validate
БесплатноБез исполняемых скриптовНе проверенMigrated source command `icon-validate`
от databayt★ 19 звёзд на GitHubОб этом скилле
source-command-icon-validate
Use this skill when the user asks to run the migrated source command icon-validate.
Command Template
/icon-validate - Validate Icon Compliance
You are tasked with validating icons in the Hogwarts icon system against Anthropic design guidelines.
Validation Scope
Target: All SVG icons in public/icons/
Design System: Anthropic Design Guidelines
Config: .mcp.json → iconSystem
Design System Requirements
1. ViewBox (CRITICAL)
- ✅ Standard:
0 0 1000 1000 - ✅ Wide format:
0 0 1680 1260or0 0 1681 1261 - ❌ Any other dimensions
2. Color Palette (STRICT)
- ✅ Light:
#FAF9F5(background/fills) - ✅ Dark:
#141413(foreground/details) - ❌ Any other colors, gradients, or patterns
3. SVG Structure
- ✅ Root
<svg>hasfill="none" - ✅ All
<path>elements have explicitfillattribute - ✅ Valid XML structure
- ❌ Inline styles
- ❌ External references (fonts, images)
- ❌ JavaScript or animations
4. Naming Convention
- ✅ Pattern:
{Category}-{Description}.svg - ✅ Categories: Hands, People, Objects, Abstract, Letters, Scenes
- ✅ Semantic, descriptive names
- ❌ Hash-based or cryptic names
5. File Organization
- ✅ All icons in
public/icons/ - ✅ Registered in
src/components/icons/registry.ts - ✅ No duplicates
Validation Workflow
1. Determine Validation Scope
Ask user or default to:
- Single file: Validate specific icon
- Category: Validate all icons in category
- Full system: Validate all 51+ icons
- Recent additions: Validate newly added icons
2. Read Icon Files
Use Glob tool to find icons:
# All icons
public/icons/*.svg
# Specific category (semantic names start with category)
public/icons/Hands-*.svg
Use Read tool to examine each file.
3. Run Validation Checks
For each icon, check:
A. ViewBox Validation
// Extract viewBox attribute
const viewBoxMatch = svgContent.match(/viewBox="([^"]+)"/)
const viewBox = viewBoxMatch?.[1]
// Validate
const validViewBoxes = ["0 0 1000 1000", "0 0 1680 1260", "0 0 1681 1261"]
if (!validViewBoxes.includes(viewBox)) {
errors.push(`Invalid viewBox: ${viewBox}`)
}
B. Color Validation
// Extract all fill colors
const fillMatches = svgContent.matchAll(/fill="(#[A-Fa-f0-9]{6})"/g)
const colors = new Set([...fillMatches].map((m) => m[1].toUpperCase()))
const allowedColors = new Set(["#FAF9F5", "#141413"])
const invalidColors = [...colors].filter((c) => !allowedColors.has(c))
if (invalidColors.length > 0) {
errors.push(`Invalid colors: ${invalidColors.join(", ")}`)
}
C. Structure Validation
// Check root fill="none"
if (!svgContent.includes("<svg") || !svgContent.includes('fill="none"')) {
errors.push('Root svg must have fill="none"')
}
// Check all paths have fill
const pathsWithoutFill = svgContent.match(/<path(?![^>]*fill=)/g)
if (pathsWithoutFill && pathsWithoutFill.length > 0) {
errors.push(`${pathsWithoutFill.length} paths missing fill attribute`)
}
// Check for inline styles
if (svgContent.includes("style=")) {
errors.push("Inline styles not allowed")
}
D. Naming Validation
// Check naming convention
const filename = path.basename(filepath)
const namePattern =
/^(Hands|People|Objects|Abstract|Letters|Scenes)-[\w-]+\.svg$/
if (!namePattern.test(filename)) {
errors.push(`Invalid naming: ${filename}`)
}
4. Generate Report
Output validation results:
## Icon Validation Report
**Scope**: {scope}
**Date**: {date}
**Total Icons**: {count}
### Summary
- ✅ Valid: {validCount}
- ⚠️ Warnings: {warningCount}
- ❌ Errors: {errorCount}
### Issues Found
#### Hands-Gesture-01.svg
- ❌ Invalid viewBox: "0 0 500 500" (expected: "0 0 1000 1000")
- ⚠️ Missing keywords in registry
#### Abstract-Curves-03.svg
- ❌ Invalid color: #FF0000 (only #FAF9F5 and #141413 allowed)
- ❌ 3 paths missing fill attribute
### Recommendations
1. Fix invalid viewBox in 2 files
2. Replace non-compliant colors in 1 file
3. Add fill attributes to paths in 1 file
4. Update registry with missing keywords
5. Offer Auto-Fix
For fixable issues, offer to:
- Adjust viewBox to standard dimensions
- Replace colors with nearest compliant color
- Add fill attributes to paths
- Update naming to follow convention
Prompt user before making changes!
6. Update Registry
After validation, check if registry is in sync:
- All files have registry entries
- Registry entries point to existing files
- Metadata is accurate
Example Validation Sessions
Example 1: Single File
User: /icon-validate Hands-Gesture-01.svg
Assistant: Validating Hands-Gesture-01.svg...
✅ ViewBox: 0 0 1000 1000 (valid)
✅ Colors: #FAF9F5, #141413 (valid)
✅ Structure: Root has fill="none", all paths have fill
✅ Naming: Follows convention
✅ Registry: Entry exists with correct metadata
Result: PASSED - No issues found
Exampl
Установить source-command-icon-validate в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл source-command-icon-validate?
Migrated source command `icon-validate`
Как установить скилл source-command-icon-validate?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл source-command-icon-validate запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic