modu-ai/moai-adk/moai-tool-svg
Claude Code and agent skill by modu-ai/moai-adk
- community
- ext:[{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
SVG creation, optimization, and transformation specialist. Use when creating vector graphics, optimizing SVG files with SVGO, implementing icon systems, building data visualizations, or adding SVG animations.
Install
npx vskill@latest install modu-ai/moai-adk/moai-tool-svgSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as modu-ai/moai-adk/moai-tool-svg.
SVG Creation and Optimization Specialist
Comprehensive SVG development covering vector graphics creation, SVGO optimization, icon systems, data visualizations, and animations. This skill provides patterns for all SVG workflows from basic shapes to complex animated graphics.
Quick Reference (30 seconds)
Basic SVG Template
Common Shapes Cheatsheet
Rectangle: <rect x="10" y="10" width="80" height="60" rx="5" />
Circle: <circle cx="50" cy="50" r="40" />
Ellipse: <ellipse cx="50" cy="50" rx="40" ry="25" />
Line: <line x1="10" y1="10" x2="90" y2="90" stroke="black" />
Polyline: <polyline points="10,10 50,50 90,10" fill="none" stroke="black" />
Polygon: <polygon points="50,10 90,90 10,90" />
Path Commands Quick Reference
Movement Commands:
- M x y: Move to absolute position
- m dx dy: Move relative
- L x y: Line to absolute
- l dx dy: Line relative
- H x: Horizontal line absolute
- h dx: Horizontal line relative
- V y: Vertical line absolute
- v dy: Vertical line relative
- Z: Close path
Curve Commands:
- C x1 y1 x2 y2 x y: Cubic bezier (two control points)
- S x2 y2 x y: Smooth cubic (reflects previous control)
- Q x1 y1 x y: Quadratic bezier (one control point)
- T x y: Smooth quadratic (reflects previous control)
- A rx ry rotation large-arc sweep x y: Arc
SVGO CLI Commands
Install globally: npm install -g svgo
Optimize single file: svgo input.svg -o output.svg
Optimize directory: svgo -f ./src/icons -o ./dist/icons
Show optimization stats: svgo input.svg --pretty --indent=2
Use config file: svgo input.svg --config svgo.config.mjs
Fill and Stroke Quick Reference
Fill properties: fill, fill-opacity, fill-rule (nonzero, evenodd)
Stroke properties: stroke, stroke-width, stroke-opacity, stroke-linecap (butt, round, square), stroke-linejoin (miter, round, bevel), stroke-dasharray, stroke-dashoffset
Implementation Guide (5 minutes)
SVG Document Structure
The SVG element requires the xmlns attribute for standalone files. The viewBox defines the coordinate system as "minX minY width height". Width and height set the rendered size.
Creating Reusable Symbols
Symbols define reusable graphics that can be instantiated with use elements. They support their own viewBox for scaling.
Path Creation Patterns
Simple icon path combining moves, lines, and curves:
Rounded rectangle using arcs:
Heart shape using cubic beziers:
Gradient Implementation
Linear gradient from left to right:
Radial gradient with focal point:
SVGO Configuration
Create svgo.config.mjs in project root:
Configuration preserving specific elements:
Embedding SVG in React
Inline SVG component:
SVG sprite with use element:
Text Elements
Basic text positioning:
Text on a path:
Advanced Implementation (10+ minutes)
Complex Filter Effects
Drop shadow with blur:
Glow effect:
Clipping and Masking
Clip path for cropping:
Gradient mask for fade effect:
CSS Animation Integration
Keyframe animation for SVG elements:
Stroke drawing animation:
Accessibility Best Practices
Always include title and desc for meaningful graphics:
For decorative SVGs, hide from screen readers:
Performance Optimization
Reduce precision in path data from 6 decimals to 2:
Before: M10.123456 20.654321 L30.987654 40.123456
After: M10.12 20.65 L30.99 40.12
Convert shapes to paths for smaller file size when appropriate. Use symbols for repeated elements. Apply SVGZ compression for 20-50% size reduction.
For detailed patterns on each topic, see the modules directory.
Module Index
- modules/svg-basics.md: Document structure, coordinate system, shapes, paths, text
- modules/svg-styling.md: Fills, strokes, gradients, patterns, filters, clipping, masking
- modules/svg-optimization.md: SVGO configuration, compression, sprites, performance
- modules/svg-animation.md: CSS animations, SMIL, JavaScript, interaction patterns
Works Well With
- moai-domain-frontend: React/Vue SVG component integration
- moai-docs-generation: SVG diagram generation for documentation
- moai-domain-uiux: Icon systems and design system integration
<!-- moai:evolvable-start id="rationalizations" -->
Common Rationalizations
| Rationalization | Reality | |
|---|---|---|
| "PNG is fine, SVG is overkill for this icon" | PNGs blur at different resolutions and require multiple sizes. SVGs scale perfectly and are smaller for simple graphics. | |
| "I will optimize the SVG later" | Unoptimized SVGs from design tools contain editor metadata, hidden layers, and precision decimals that bloat file size by 50-80%. | |
| "Inline SVG is always better than an img tag" | Inline SVGs increase HTML payload and prevent browser caching. Use img tags for static icons that do not need dynamic styling. | |
| "Accessibility does not apply to decorative icons" | Decorative icons need aria-hidden=true to be properly ignored by screen readers. Without it, they read meaningless content. | |
| "SVGO defaults are fine for all SVGs" | SVGO defaults remove viewBox and title elements. Custom configuration is required to preserve accessibility and responsiveness. |
<!-- moai:evolvable-end -->
<!-- moai:evolvable-start id="red-flags" -->
Red Flags
- SVG file contains editor metadata (Illustrator, Sketch, Figma export cruft)
- SVG missing viewBox attribute (breaks responsive scaling)
- Interactive SVG missing role and aria-label attributes
- Decorative SVG missing aria-hidden="true"
- SVG file larger than the equivalent PNG for the same visual
<!-- moai:evolvable-end -->
<!-- moai:evolvable-start id="verification" -->
Verification
- [ ] SVGs optimized with SVGO or equivalent (show before/after file size)
- [ ] viewBox attribute present on all SVGs (no fixed width/height only)
- [ ] Decorative SVGs have aria-hidden="true"
- [ ] Interactive SVGs have role="img" and aria-label
- [ ] SVG file size smaller than PNG equivalent at target resolution
- [ ] No editor metadata in committed SVG files (check for Illustrator/Sketch/Figma tags)
<!-- moai:evolvable-end -->
Security
- Security scanPassed, 91 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.moai/archive/skills/v3.0/moai-tool-svg/SKILL.md
Popularity
- Repository stars
- 1,218
- Repository forks
- 224
- 7-day trend score
- 36
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
configConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/modu-ai/moai-adk/moai-tool-svg)