From cpa
Generate SVG icons and convert them to 48x48 PNG format for Canvas plugins and applications
How this skill is triggered — by the user, by Claude, or both
Slash command
/cpa:icon-generationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill provides the capability to generate SVG icons from descriptions and automatically convert them to 48x48 PNG format, which is the standard size for Canvas Medical plugin icons.
This skill provides the capability to generate SVG icons from descriptions and automatically convert them to 48x48 PNG format, which is the standard size for Canvas Medical plugin icons.
Execution standard: Run Python scripts and Python-based tooling with uv run ... (for scripts, uv run python <script>.py ...). Do not invoke bare python or pip.
This skill should be automatically invoked when:
CANVAS_MANIFEST.json and an icon field needs to be populatedFollow these steps to generate an icon:
Extract or generate a clear description of the icon. If working on a plugin:
Examples:
Create a clean, professional SVG icon based on the description:
SVG Best Practices:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<!-- Simple, clear shapes -->
<!-- Appropriate colors -->
<!-- Professional styling -->
</svg>
Convert the description to kebab-case:
medical-chart-with-checkmark.svgvitals-monitoring-icon.svgUse the Write tool to save the SVG content:
assets/ folder (snake_case folder)assets/ directory if it doesn't exist: mkdir -p {plugin_name_snake}/assets{plugin_name_snake}/assets/medical-chart-icon.svgBefore converting, verify uv is installed:
which uv
If not installed, install it:
curl -LsSf https://astral.sh/uv/install.sh | sh
After installation, you may need to use the full path: ~/.cargo/bin/uv
Use the conversion script to create a 48x48 PNG:
uv run --with cairosvg python ${CLAUDE_PLUGIN_ROOT}/scripts/convert_svg_to_png.py <svg-file> <png-file>
Replace:
<svg-file> with the generated SVG filename<png-file> with the same base name but .png extensionThe script creates a 48x48 pixel PNG suitable for Canvas applications.
If generating an icon for a Canvas plugin, update the manifest:
{
"name": "Plugin Name",
"version": "1.0.0",
"applications": [
{
"class": "plugin_name.applications.my_app:MyApp",
"name": "My Application",
"icon": "assets/icon-filename.png",
...
}
]
}
The icon field should reference the path relative to the manifest location (e.g., assets/icon-filename.png).
On Success:
On Failure:
After successful generation, display:
Icon created successfully:
SVG: /path/to/assets/icon-name.svg
PNG: /path/to/assets/icon-name.png (48x48)
For Canvas plugins, also mention:
CANVAS_MANIFEST.json updated with icon reference: "assets/icon-name.png"
assets/ folder (e.g., {plugin_name_snake}/assets/)assets/ directory if it doesn't exist before saving iconsWhen generating icons for Canvas Medical plugins:
User is creating a "vitals-alert" plugin that monitors patient vital signs.
1. Generate description: "medical vitals monitor with alert icon"
2. Create SVG with heart rate line and alert symbol
3. Create assets directory: mkdir -p vitals_alert/assets
4. Save as: vitals_alert/assets/vitals-alert-icon.svg
5. Convert to: vitals_alert/assets/vitals-alert-icon.png
6. Update CANVAS_MANIFEST.json applications entry: "icon": "assets/vitals-alert-icon.png"
User says: "I need a blue database icon with a checkmark"
1. Use description: "blue database icon with checkmark"
2. Create SVG with database cylinder and green checkmark
3. Save as: blue-database-icon-with-checkmark.svg
4. Convert to: blue-database-icon-with-checkmark.png
5. Report both files created
Assistant is running canvas init for a new plugin called "patient-scheduler"
After scaffold is created, CANVAS_MANIFEST.json needs an icon.
1. Generate description from plugin purpose: "calendar scheduling icon for patient appointments"
2. Create professional SVG with calendar and medical cross
3. Create assets directory: mkdir -p patient_scheduler/assets
4. Save as: patient_scheduler/assets/patient-scheduler-icon.svg
5. Convert to: patient_scheduler/assets/patient-scheduler-icon.png
6. Update manifest applications entry: "icon": "assets/patient-scheduler-icon.png"
7. Commit with other scaffold files
npx claudepluginhub canvas-medical/coding-agents --plugin cpaCreates, edits, reviews, and validates high-quality SVG graphics with W3C compliance, CSS independence, accessibility, and safety.
Generates square PNG icons with transparent backgrounds for app icons, favicons, and UI using Google Gemini. Supports flat/3D/line/glyph/gradient/minimal styles, sizes 128-1024px, batch sets, reference matching.
Generates brand SVG icons from descriptions or base SVGs, producing platform assets: favicon package (ICO, dark/light SVG, apple-touch-icon), PWA manifest icons, and mobile app icons.