svg-craft
Skill8 starsChanged 20 days agoApache-2.0View on GitHub
Create, edit, animate, and optimize SVG icons, illustrations, diagrams, and charts; includes guidance for responsive layout, accessibility, filters, text, and web-component output. Use for SVG-specific authoring and debugging.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- weiweimhy/agent-skillstheir own version, first seen Nov 29, 2026
- MithunWijayasiri/dotclaudetheir own version, first seen Nov 29, 2026
- riquelmechile/Skills-Chiletheir own version, first seen Nov 15, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- MithunWijayasiri/dotclaude★ 4same name
- riquelmechile/Skills-Chile★ 4same name
- weiweimhy/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 11 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Animate: Add motion/transitions to static SVG
- Distinctive: line 32
Follow this structured approach based on the SVG knowledge base:
- Very specific: line 35
Always set viewBox for responsive scaling (ref: essentials ch03)
- Very specific: line 36
Use preserveAspectRatio when aspect ratio control matters
- Distinctive: line 38
Consider the coordinate system: SVG y-axis goes downward
- Very specific: line 66
Consider lengthAdjust and textLength for fitted text
- Very specific: line 108
Use transform-origin in CSS for intuitive rotation centers
- Distinctive: line 160
Read the relevant chapter in animation (SVG Animations) for the requested animation pattern.
- Distinctive: line 187
Prefer simple transform/opacity animation when appropriate.
- Distinctive: line 188
Use SMIL for SVG-specific attributes (path d, gradient stops)
- Very specific: line 189
Add will-change only for a measured need, and avoid keeping unnecessary promoted layers alive
- Distinctive: line 190
Avoid animating filter properties (expensive)
- Very specific: line 191
Use prefers-reduced-motion media query for accessibility
- Distinctive: line 216
Keep every referenced ID unique per component instance, including gradients, masks, clips, titles and descriptions.
- Distinctive: line 221
Remove editor metadata (Illustrator/Inkscape cruft)
- Distinctive: line 223
Use CSS classes instead of inline styles for theming
- Distinctive: line 248
Check reduced-motion behavior for animations.
- Very specific: line 256
Use Read to load specific reference files when you need detailed syntax or examples.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SVG Foundry (svg-craft) — SVG Authoring & Optimization
Local reference collection drawn from SVG books (third-party source and redistribution rights require separate verification): SVG Essentials, SVG Text Layout, SVG Colors Patterns & Gradients, SVG Animations, Using SVG with CSS3 and HTML5, Modern SVG.
Step 1 — Clarify Requirements
Infer the task and output format from the request and project. Ask only when an unresolved choice materially changes the result; do not repeat questions the user already answered.
1. Task type (if not obvious from the request):
- Create: Build SVG from scratch based on a description
- Optimize: Improve existing SVG code (performance, accessibility, responsiveness)
- Animate: Add motion/transitions to static SVG
- Restyle: Change colors, gradients, patterns, filters
2. Output format (use the project framework; otherwise default to standalone SVG):
- Pure SVG: Standalone
.svgmarkup, embeddable anywhere - HTML + SVG: Complete HTML page with inline SVG + CSS animations
- React component: JSX component with props for customization
- Vue component: SFC with template + scoped styles
Step 2 — Design the SVG
Follow this structured approach based on the SVG knowledge base:
2.1 Canvas & Coordinate System
- Always set
viewBoxfor responsive scaling (ref: essentials ch03) - Use
preserveAspectRatiowhen aspect ratio control matters - Set a useful
viewBox; choosewidth/heightor CSS sizing for the actual embedding context. Explicit intrinsic dimensions can coexist with responsive scaling. - Consider the coordinate system: SVG y-axis goes downward
2.2 Shape Selection
Choose the right primitives (ref: essentials ch02, ch03):
<rect>— rectangles, rounded rectangles (rx/ry)<circle>— circles (center + radius)<ellipse>— ellipses (center + rx/ry)<line>— single straight line<polyline>— connected line segments (open)<polygon>— closed shapes from points<path>— complex shapes with M/L/C/S/Q/T/A/Z commands
2.3 Path Commands Mastery (ref: essentials ch04, web ch16)
- M/m — moveto (start point)
- L/l — lineto (straight line)
- H/h, V/v — horizontal/vertical line
- C/c — cubic Bezier (two control points)
- S/s — smooth cubic Bezier (mirrored control)
- Q/q — quadratic Bezier (one control point)
- T/t — smooth quadratic Bezier
- A/a — elliptical arc (rx ry rotation large-arc sweep x y)
- Z — close path
2.4 Text Handling (ref: text; read only the relevant chapter)
<text>withx,y,font-family,font-size<tspan>for inline formatting changes<textPath href="#path-id">for text along a path; use legacyxlink:hrefonly when a stated compatibility target requires itdominant-baselineandtext-anchorfor alignment- Consider
lengthAdjustandtextLengthfor fitted text
2.5 Colors & Fills (ref: colors; read only the relevant chapter)
- Named colors, hex (#RRGGBB / #RGB), rgb(), hsl()
fillandstrokepropertiesfill-opacity,stroke-opacity,opacityfill-rule:nonzero(default) vsevenodd
2.6 Gradients (ref: colors ch09-ch12)
<!-- Linear gradient -->
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" stop-color="#2563eb"/>
<stop offset="100%" stop-color="#7c3aed"/>
</linearGradient>
<!-- Radial gradient -->
<radialGradient id="grad2" cx="50%" cy="50%" r="50%">
<stop offset="0%" stop-color="#fef3c7"/>
<stop offset="100%" stop-color="#f59e0b"/>
</radialGradient>gradientUnits:objectBoundingBox(default, %) vsuserSpaceOnUse(absolute)spreadMethod:pad(default),reflect,repeat- Focal point with
fx/fyon radial gradients
2.7 Patterns (ref: colors ch13-ch14)
<pattern id="pat1" width="20" height="20" patternUnits="userSpaceOnUse">
<!-- pattern content -->
</pattern>patternUnitsvspatternContentUnitspatternTransformfor rotating/scaling patterns
2.8 Transforms (ref: essentials ch06, web ch26-ch27)
translate(tx, ty)— movescale(sx, sy)— resize (negative = flip)rotate(angle, cx, cy)— rotate around pointskewX(angle),skewY(angle)— shearmatrix(a,b,c,d,e,f)— full affine transform- Transforms apply right-to-left when chained
- Use
transform-originin CSS for intuitive rotation centers
2.9 Clipping & Masking (ref: essentials ch09, web ch34-ch35)
<!-- Clip: sharp boundary -->
<clipPath id="clip1"><circle cx="50" cy="50" r="40"/></clipPath>
<image clip-path="url(#clip1)" .../>
<!-- Mask: soft/graduated boundary -->
<mask id="mask1"><rect fill="white" .../><circle fill="black" .../></mask>
<image mask="url(#mask1)" .../>- Clip = binary (in/out), Mask = graduated (luminance-based)
2.10 Filters (ref: essentials ch11, web ch36-ch37)
Common filter primitives:
feGaussianBlur— blur (stdDeviation)feDropShadow— drop shadow shorthandfeColorMatrix— color transformationsfeMorphology— dilate/erode shapesfeDisplacementMap— distortion effectsfeTurbulence+feDisplacementMap— organic texturesfeComposite— combine within,over,atop,xor,arithmeticfeBlend— blend modes (multiply, screen, overlay, etc.)feMerge— layer multiple filter results
<filter id="shadow">
<feDropShadow dx="2" dy="2" stdDeviation="3" flood-color="rgba(0,0,0,0.3)"/>
</filter>2.11 Stroke Properties (ref: web ch30-ch31)
stroke-width,stroke-linecap(butt/round/square)stroke-linejoin(miter/round/bevel),stroke-miterlimitstroke-dasharray— dash patterns (e.g., "5,3,2")stroke-dashoffset— animate for drawing effectsvector-effect="non-scaling-stroke"— constant stroke width when scaled
2.12 Markers (ref: web ch32-ch33)
<marker id="arrow" viewBox="0 0 10 10" refX="5" refY="5"
markerWidth="6" markerHeight="6" orient="auto-start-reverse">
<path d="M 0 0 L 10 5 L 0 10 z" fill="currentColor"/>
</marker>
<line marker-end="url(#arrow)" .../>Step 3 — Add Animation (if needed)
Read the relevant chapter in animation (SVG Animations) for the requested animation pattern.
3.1 CSS Animations (preferred for simple animations)
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spinner { animation: spin 1s linear infinite; transform-box: fill-box; transform-origin: center; }3.2 SVG SMIL Animations (for path morphing, gradient animation)
<animate attributeName="opacity" from="0" to="1" dur="1s" fill="freeze"/>
<animateTransform attributeName="transform" type="rotate" from="0" to="360" dur="2s" repeatCount="indefinite"/>
<animateMotion path="M0,0 C30,0 30,60 60,60" dur="3s" repeatCount="indefinite"/>3.3 Stroke Drawing Animation
.draw-path {
stroke-dasharray: 1000;
stroke-dashoffset: 1000;
animation: draw 2s ease forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }Calculate actual path length with getTotalLength() or estimate.
3.4 Animation Best Practices (ref: animation ch07)
- Prefer simple transform/opacity animation when appropriate; verify actual rendering cost rather than promising GPU acceleration
- Use SMIL for SVG-specific attributes (path d, gradient stops)
- Add
will-changeonly for a measured need, and avoid keeping unnecessary promoted layers alive - Avoid animating filter properties (expensive)
- Use
prefers-reduced-motionmedia query for accessibility
Step 4 — Web Integration & Responsiveness
4.1 Embedding Methods (ref: web ch04-ch08, modern ch04)
- Inline SVG: Best for dynamic/interactive SVG in HTML
<img src="file.svg">: Simple, cached, no scripting- CSS
background-image: Decorative use, no interaction <object>: Interactive, own DOM, fallback content<iframe>: Full isolation, communication via postMessage
4.2 Responsive SVG Pattern
<!-- Fluid width, aspect-ratio preserved -->
<svg viewBox="0 0 800 600" style="width: 100%; height: auto;">
<!-- content -->
</svg>4.3 Accessibility (ref: web ch39-ch40)
- For informative inline SVG, provide an accessible name (for example
<title>witharia-labelledby) androle="img"where appropriate; add a useful description for complex content. - For decorative inline SVG, use
aria-hidden="true"and keep it out of keyboard focus; do not add redundant announced labels. - For an SVG embedded through
<img>, supply the meaning in the image'saltattribute, oralt=""when decorative. - Keep every referenced ID unique per component instance, including gradients, masks, clips, titles and descriptions.
4.4 Performance Best Practices (ref: web ch45-ch47)
- Simplify paths: reduce control points, use relative commands
- Reuse with
<use href="#id"/>and<defs> - Remove editor metadata (Illustrator/Inkscape cruft)
- Minimize
<filter>usage on mobile - Use CSS classes instead of inline styles for theming
Step 5 — Output & Deliver
Output Rules:
- SVG must be valid — proper namespace
xmlns="http://www.w3.org/2000/svg" - Include a suitable viewBox — choose explicit or fluid dimensions to match the target
- Choose accessibility semantics for informative or decorative use; do not force a title onto every decorative asset
- Use
<defs>for reusable elements (gradients, patterns, filters, clips) - Use semantic IDs — meaningful names, not
rect1orpath23 - Indent properly — readable, well-structured markup
- Comment complex paths — explain what
<path d="...">draws
Format-Specific Output:
- Pure SVG: Standalone
<svg>...</svg>block, save as.svg - HTML + SVG: Full
<!DOCTYPE html>page with<style>block for animations - React:
export function SvgComponent({ size, color, ...props })with configurable props - Vue:
<template>+<style scoped>SFC format
Validate the actual deliverable
- Parse standalone SVG as XML; inspect unresolved fragment references and duplicate IDs.
- Preview at the intended dimensions and a smaller size when a renderer/browser is available. Check clipped strokes/filters, legible text and actual font availability.
- For repeated components, check multiple instances on the same page; preserve IDs used by CSS, accessibility or external code during optimization.
- Check reduced-motion behavior for animations. Report which checks actually ran; a valid XML parse alone does not establish visual quality or accessibility.
Current standards: SVG 2 references and legacy XLink, SVG 2 coordinate systems and sizing, WAI decorative image guidance. Consult the relevant current specification when an older book example conflicts with the target runtime.
References Index — When to Load Which Chapter
Use Read to load specific reference files when you need detailed syntax or examples.
Book 1: SVG Essentials (essentials-*)
| File | Topic | Load when... |
| ch01 | Cover + TOC | Understanding book structure |
| ch02 | Ch1: Basic shapes | Drawing rect, circle, ellipse, line, polygon |
| ch03 | Ch2: Coordinates | Viewport, viewBox, units, coordinate systems |
| ch04 | Ch3: Paths | Path commands (M, L, C, Q, A, Z) |
| ch05 | Ch4: Document structure | <g>, <use>, <defs>, <symbol> |
| ch06 | Ch5: Transforms | translate, rotate, scale, skew, matrix |
| ch07 | Ch6: Text | <text>, <tspan>, font properties |
| ch08 | Ch7: Stroke & fill | Colors, gradients basics, patterns basics |
| ch09 | Ch8: Clip & mask | clipPath, mask elements |
| ch10 | Ch9: Images | Embedding raster images in SVG |
| ch11 | Ch11: Filters | All filter primitives (blur, shadow, color, composite) |
| ch14 | Ch14: Advanced | SVG + JavaScript interaction |
Book 2: SVG Text Layout (text-*)
| File | Topic | Load when... |
| ch04 | Ch1: Text basics | <text>, positioning, styling |
| ch08 | Ch5: textPath | Text on a path |
| ch11-ch13 | Ch8-10: Advanced | Multi-line, wrapping, international text |
Book 3: SVG Colors, Patterns & Gradients (colors-*)
| File | Topic | Load when... |
| ch05 | Ch2: Painter's model | fill/stroke rendering order |
| ch06 | Ch3: Color values | Hex, RGB, HSL, named colors |
| ch07 | Ch4: Opacity | fill-opacity, stroke-opacity, group opacity |
| ch09 | Ch6: Linear gradients | linearGradient basics |
| ch10 | Ch7: Gradient sizing | gradientUnits, gradientTransform |
| ch11 | Ch8: Repeating | spreadMethod: pad/reflect/repeat |
| ch12 | Ch9: Radial gradients | radialGradient, focal point |
| ch13 | Ch10: Patterns | pattern basics, tiles, textures |
| ch14 | Ch11: Advanced patterns | patternTransform, nested patterns |
| ch15 | Ch12: Text painting | Textured/gradient text |
| ch16 | Ch13: Strokes | Stroke gradients, stroke patterns |
Book 4: SVG Animations (animation-*)
| File | Topic | Load when... |
| ch03 | Ch1: SVG anatomy | SVG structure for animation |
| ch04 | Ch2: CSS animation | @keyframes, transitions on SVG |
| ch05 | Ch3: Sprites | SVG sprite sheets, hand-drawn animation |
| ch06 | Ch4: Responsive sprites | Responsive animated SVGs |
| ch07 | Ch5: UI/UX animation | Loading, hover, micro-interactions |
| ch08 | Ch6: Data viz animation | Chart animation, data-driven motion |
Book 5: Using SVG with CSS3 and HTML5 (web-*)
| File | Topic | Load when... |
| ch06 | Ch1: SVG overview | SVG on the web, history |
| ch08 | Ch2: SVG + web | Embedding methods, browser support |
| ch10 | Ch3: CSS + SVG | Styling SVG with CSS, cascading rules |
| ch12 | Ch4: Tools | Editor tools, optimization tools |
| ch15 | Ch5: Basic shapes | Detailed shape attributes |
| ch16 | Ch6: Custom paths | Advanced path techniques |
| ch18 | Ch7: Text layout | Graphical text in web context |
| ch21 | Ch8: Coordinate systems | viewBox deep dive, preserveAspectRatio |
| ch23 | Ch9: Cropping | Viewport clipping, overflow |
| ch25 | Ch10: Reuse | <use>, <symbol>, shadow DOM |
| ch27 | Ch11: Transforms | CSS transforms on SVG elements |
| ch29 | Ch12: Fills | Gradients + patterns (comprehensive) |
| ch31 | Ch13: Strokes | All stroke properties |
| ch33 | Ch14: Markers | Arrow markers, custom markers |
| ch35 | Ch15: Clip + mask | Clipping and masking techniques |
| ch37 | Ch16: Filters | Filter effects with CSS blend modes |
| ch40 | Ch17: Accessibility | ARIA, <title>, <desc>, roles |
| ch42 | Ch18: Interactivity | Events, hover, click, scripting |
| ch44 | Ch19: Animation | CSS + SMIL animation techniques |
| ch47 | Ch20: Best practices | Performance, optimization, patterns |
Book 6: Modern SVG (modern-*)
| File | Topic | Load when... |
| ch04 | Ch1: SVG in web pages | Modern embedding best practices |
| ch05 | Ch2: Tools | Modern SVG tool chain |
| ch06 | Ch3: Advanced paths | Advanced curves and shapes |
| ch07 | Ch4: Colors | Modern color techniques |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

