Use when generating SVG graphics from written descriptions including icons, data visualizations, illustrations, technical diagrams, or any visual content. Emphasizes visual accuracy through planning-first workflows, proper coordinate systems, and expert-level engineering reasoning including alternative exploration, context constraint extraction, and trade-off articulation.
This skill provides systematic workflows for generating accurate SVG graphics from text descriptions. It triggers whenever you create SVGs for icons, data visualizations, illustrations, or technical diagrams, requiring you to plan first by exploring alternatives, extracting context constraints, and articulating trade-offs before any code generation.
/plugin marketplace add mthalman/superpowers/plugin install superpowers@cc-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/svg-reference.mdThis skill provides systematic workflows for generating accurate SVG graphics from textual descriptions. The primary focus is ensuring visual accuracy through expert-level engineering reasoning - that generated SVGs actually look like what was described, with decisions grounded in explicit trade-off analysis, context constraints, and alternative exploration rather than mechanical template application.
Supporting skills (load when needed):
Use this skill when:
CRITICAL: Never generate SVG code directly from a description. Always plan first.
The planning phase ensures:
This prevents misaligned, disproportionate, or inaccurate graphics.
Before executing any workflow, complete these three critical steps:
Classify the task complexity to determine appropriate workflow depth:
| Complexity | Criteria | Workflow Approach |
|---|---|---|
| SIMPLE | • <5 elements<br>• Established metaphor (search icon, checkmark, arrow)<br>• Well-defined parameters | • Streamlined: 1-2 paragraphs per decision<br>• Focus: correct proportions, clean code<br>• Skip: exhaustive checklists, lengthy verification |
| MODERATE | • 5-15 elements<br>• Standard requirements with some customization<br>• Typical use cases | • Standard workflow depth<br>• Balance detail with efficiency<br>• Focus on key decisions |
| COMPLEX | • >15 elements<br>• Custom illustrations or novel compositions<br>• Conflicting requirements<br>• Special constraints (accessibility, text overlay) | • Full workflow with deep exploration<br>• Detailed alternative analysis<br>• Comprehensive verification<br>• Multiple iterations expected |
Current task classification: [Determine from request and state explicitly]
If unsure, ask the user: "Should I provide streamlined analysis for a simple task, or comprehensive exploration for a complex requirement?"
From the stated use case, extract functional requirements BEFORE making technical decisions.
Use this template:
Platform constraints → Technical requirements
Visual environment → Design requirements
User interaction → Functional requirements
FORMAT REQUIREMENT: "Because [context], we must [constraint]"
✓ Good: "Because mobile toolbar, must work in monochrome with currentColor" ✗ Bad: "This is for a mobile toolbar" (no extracted constraint)
Reference these constraints throughout your technical decisions.
Before technical planning, articulate 2-4 design principles as "X over Y" trade-offs:
These principles guide ALL subsequent decisions and help resolve ambiguous choices.
Examples by context:
Your principles for this task: [State 2-4 principles based on context]
How to use: When making decisions, reference your principles. Example: "I'm choosing simple primitives over complex paths because 'clarity over cleverness' dictates favoring obvious, maintainable solutions."
User requests SVG generation?
│
├─ Simple icon or symbol (< 10 elements)
│ └─ Use "Quick Icon Generation" workflow
│
├─ Data visualization (chart, graph)
│ └─ Use "Data Visualization" workflow
│
├─ Technical diagram (flowchart, architecture)
│ └─ Use "Technical Diagram" workflow
│
├─ Complex illustration or scene
│ └─ Use "Complex Illustration" workflow
│
└─ Unknown or complex requirements
└─ Start with "Complex Illustration" workflow
For simple icons and symbols (< 10 basic shapes).
Read references/svg-reference.md (Common ViewBox Patterns)
REQUIRED: Explore 2-3 viewBox alternatives with specific trade-offs
For each option, state the specific technical downside, not just "less optimal."
Example analysis:
| ViewBox | Technical Trade-off | Use When |
|---|---|---|
| 16×16 | Forces fractional coordinates, harder stroke math | Very small UI elements, space-constrained |
| 24×24 | Industry standard, clean integer math | Standard mobile/web icons (RECOMMENDED) |
| 32×32 | More precision but larger file size | Icons that need fine detail |
| 48×48 | Excessive precision for simple icons | Complex icons with many elements |
Decision format: "Choosing [X] over [Y] because [specific reason]. Accepting [downside] because [context makes it acceptable]."
✓ Good: "Choosing 24×24 over 16×16 because 16×16 forces fractional coordinates (harder to pixel-align). Accepting slightly less precision than 48×48 because simple icons don't need that detail."
✗ Bad: "Using 24×24 because it's standard." (No alternatives explored, no downsides stated)
List the visual elements needed:
Example: "Blue checkmark icon"
For icons at small sizes (<48px viewBox), coordinate precision affects rendering quality.
Default to integer coordinates for crisp rendering. Use fractional coordinates ONLY when you can justify the benefit.
Stroke-aware positioning:
strokeWidth / 2 when planning marginsDecision template for coordinates:
"Using [integer/fractional] coordinates because [specific reason]."
✓ Good examples:
✗ Bad examples:
When explaining technical parameters, avoid meaningless calculations:
DON'T:
DO:
Test: If stating a ratio or percentage, ask "Is this threshold documented anywhere, or am I just doing math?"
Create SVG with planned elements:
<svg> tag including viewBox and dimensionsFor SIMPLE icons: Skip formal checklists. Instead:
Red flag: Verification checklist with more items than SVG elements = verification theater
Real failure modes to check:
✓ Good: "Verified: Icon looks correct at 24×24px, works in both light/dark themes with currentColor" ✗ Bad: 15-point checklist for a 2-element SVG
If inaccurate, identify the specific issue and regenerate with corrections.
For charts, graphs, and data-driven graphics.
Parse the data or data description:
CRITICAL: Identify outliers immediately
An outlier is a value significantly different from others (typically >2x or <0.5x the median).
If outliers exist, you MUST address them explicitly:
| Outlier Strategy | When to Use | Trade-off |
|---|---|---|
| Broken axis with visual indicator | One outlier, need to show all data | Shows full range but requires explanation |
| Logarithmic scale | Multiple outliers, wide range | Harder for non-technical audiences to read |
| Separate annotation | Extreme outlier | Maintains readable scale, outlier shown separately |
| Truncation with marker | Outlier less important than comparison | Hides actual value, emphasizes relative differences |
Decision format: "Data contains outlier at [value] which is [X]x the median. Using [strategy] because [reason], accepting [downside]."
Read references/svg-reference.md (Data Visualizations)
Select appropriate visualization:
Choose viewBox dimensions (e.g., 400×300 for charts with axes).
For bar charts:
chartWidth / numberOfBars(value / maxValue) * chartHeightFor pie charts:
(percentage / 100) * 360For line/scatter plots:
x = (index / maxIndex) * chartWidth, y = chartHeight - (value / maxValue) * chartHeightCreate SVG in layers:
Check that:
For flowcharts, architecture diagrams, process flows.
Identify diagram components:
Read references/svg-reference.md (Technical Diagrams)
Calculate positions:
Example: 3-step vertical flowchart
Create SVG structure:
<defs>
<marker id="arrowhead" ...>
</defs>
<g> for logical groupingCheck that:
For scenes, landscapes, artistic compositions, or multi-element graphics.
Break down the description into:
Example: "Mountain landscape with sun and trees"
Read references/svg-reference.md (Coordinate System and ViewBox)
Select viewBox based on aspect ratio:
Consider using centered origin for symmetrical compositions.
Establish spatial layout:
Plan colors:
For color palette selection, use superpowers:designing-ui-color skill.
The superpowers:designing-ui-color skill provides:
SVG-specific color considerations:
If image will have text overlay (hero images, backgrounds):
You MUST consider luminance values and contrast ratios, not just "subtle colors."
Text overlay requirements:
| Text Color | Background Luminance | WCAG Contrast Ratio | Color Strategy |
|---|---|---|---|
| White text | L* < 60 (dark backgrounds) | 4.5:1 for body, 3:1 for large text | Use muted, low-luminance colors |
| Dark text | L* > 70 (light backgrounds) | 4.5:1 for body, 3:1 for large text | Use pastel, high-luminance colors |
Example analysis:
✓ Good: "For white text overlay, using sage green (#8B9A7F, L* ≈ 52), taupe (#B8A898, L* ≈ 58), soft blue (#6B8CAA, L* ≈ 48). All L* < 60 ensures WCAG AA compliance (≥4.5:1 contrast) for body text."
✗ Bad: "Using subtle green and blue colors" (No luminance analysis, no contrast verification)
How to verify: Use an online contrast checker or calculate: If RGB values average <128, likely dark enough for white text.
Calculate key coordinates:
Create SVG structure from back to front:
<svg viewBox="..." width="..." height="...">
<!-- 1. Background layer -->
<g id="background">
<!-- Sky, backdrop, gradients -->
</g>
<!-- 2. Midground layer -->
<g id="midground">
<!-- Main subjects, focal elements -->
</g>
<!-- 3. Foreground layer -->
<g id="foreground">
<!-- Details, overlaying objects -->
</g>
</svg>
For each layer:
Read references/svg-reference.md (Content-Specific Patterns)
Use grouping and reuse:
<g><defs> and use <use>Enhance visual richness:
Read references/svg-reference.md (Depth and Dimension)
Verify the illustration matches the description:
Compositional accuracy:
Visual accuracy:
Technical quality:
If any verification fails, identify the specific issue and regenerate the affected elements or sections.
The SVG reference document contains comprehensive technical information:
Read references/svg-reference.md
When to consult specific sections:
Search the reference for:
1. Recognize as icon generation task
2. Plan: Circle with arc path, blue stroke, centered in 24×24 viewBox
3. Consult references/svg-reference.md (Paths - Arc Examples)
4. Generate SVG with animated arc or segmented circle
5. Verify: circular shape, blue color, appropriate for loading indication
1. Recognize as data visualization task
2. Parse data values and labels
3. Consult references/svg-reference.md (Bar Chart Pattern)
4. Calculate bar widths and heights based on data
5. Generate SVG with axes, bars, and labels
6. Verify: bars accurately represent data values, labels are correct
1. Recognize as technical diagram task
2. Map structure: identify 5 process boxes, 2 diamond decisions
3. Consult references/svg-reference.md (Flowchart Box, Diamond)
4. Calculate layout: vertical flow with appropriate spacing
5. Generate SVG with arrow markers, nodes, connectors
6. Verify: 7 total nodes, clear flow direction, decisions properly marked
1. Recognize as complex illustration task
2. Decompose: Background (sky gradient, sun), Midground (palm tree), Foreground (beach, ocean)
3. Choose viewBox="0 0 1600 900" for landscape aspect ratio
4. Consult references/svg-reference.md (Sun, Water, Sky Gradient, Tree pattern)
5. Plan composition: sky top 50%, ocean middle 30%, beach bottom 20%
6. Generate in layers: sky → sun → ocean → beach → palm tree
7. Verify: all elements present, sunset colors appropriate, composition balanced
1. Identify the problem: which elements are misaligned
2. Check coordinate calculations in planning
3. Consult references/svg-reference.md (Coordinate System)
4. Recalculate positions ensuring proper spacing and alignment
5. Regenerate affected elements with corrected coordinates
6. Verify alignment is now correct
<defs> and <use> for repeated elementsInclude accessibility features:
<svg role="img" aria-labelledby="title desc">
<title id="title">Descriptive Title</title>
<desc id="desc">Detailed description of the visual content</desc>
<!-- SVG content -->
</svg>
When requirements are vague or contradictory, you must make them explicit before proceeding.
Step 1: Identify all contradictions
List conflicting requirements explicitly:
Step 2: Extract the underlying intent
For each contradiction, determine what the user likely means:
Step 3: Document assumptions with justification
Use this format:
ASSUMPTION: [What you're assuming] RATIONALE: [Why you're making this assumption based on context] RISK: [What happens if assumption is wrong] MITIGATION: [How to easily adjust if user corrects you]
Example:
ASSUMPTION: Target age is 7-11 (elementary school) RATIONALE: "Not too childish" rules out early childhood; educational context suggests K-12 RISK: If target is ages 13-18, style may be too playful MITIGATION: Color saturation and detail level are easily adjustable
If you could ask questions, what would you ask?
Document these (even if you can't ask them) to show your thinking:
Critical questions (would change fundamental approach):
High-priority questions (major design implications):
Nice-to-know questions (optimization/refinement):
Decision protocol when you can't ask:
Issue: Coordinates exceed viewBox bounds
Solution:
Issue: Color selection doesn't align with described appearance
Solution:
Issue: Elements are disproportionate to each other
Solution:
Issue: Visual weight is unevenly distributed
Solution:
Issue: Flow or relationships are unclear
Solution:
These are common failure modes identified through quality validation. Avoid them:
Bad: "Using 24×24 viewBox because it's standard." Good: "Choosing 24×24 over 16×16 (forces fractional coordinates) and 48×48 (excessive precision). Accepting slightly less precision than 48×48 because simple icons don't need that detail."
Why it matters: Without alternative exploration, you can't adapt when requirements change.
Bad: "This is for a mobile toolbar." (stated but not analyzed) Good: "Because mobile toolbar → must work in monochrome (currentColor), touch target ≥44×44px (iOS), consistent optical weight with other icons."
Why it matters: Missing context constraints = accessibility failures and integration problems.
Bad: 15-point verification checklist for a 2-element SVG Good: "Simple icon → streamlined verification: looks right at 24px, works in light/dark themes."
Why it matters: Wastes time on trivial confirmations instead of focusing on real issues.
Bad: "Stroke is 8.3% of viewBox width" Good: "Using 2px stroke (Material Design standard), proven readable at this scale"
Why it matters: Meaningless calculations substitute for genuine engineering reasoning.
Bad: "Handle at (15.5, 15.5)" with no explanation Good: "Handle at (15, 15) with integer coordinates for crisp rendering, OR (15.5, 15.5) for 1px stroke pixel-grid alignment"
Why it matters: Fractional coordinates cause anti-aliasing blur unless specifically needed.
Bad: Using linear scale when one value is 3x others, making most bars unreadable Good: "Outlier at $155k (3x median). Using broken axis with visual indicator to maintain readability while showing full range. Trade-off: requires explanation, but preserves data integrity."
Why it matters: Outliers on linear scales make data unreadable or require dishonest omission.
Bad: "Using subtle colors for text overlay" Good: "For white text overlay: sage green (L* ≈ 52), taupe (L* ≈ 58). All L* < 60 ensures WCAG AA (≥4.5:1 contrast)."
Why it matters: Without luminance analysis, text may be unreadable or fail accessibility standards.
Bad: Proceeding with vague requirements without documenting assumptions Good: "ASSUMPTION: Ages 7-11. RATIONALE: 'Not childish' rules out preschool. RISK: If 13-18, may be too playful. MITIGATION: Color saturation easily adjustable."
Why it matters: Implicit assumptions lead to rework when user expectations don't match.
Your SVG generation demonstrates expert-level quality when:
✓ Trade-offs articulated: Every non-trivial decision includes 2+ alternatives with specific downsides ✓ Context incorporated: Constraints extracted from use case and referenced in decisions ✓ Alternatives explored: No foregone conclusions; solution space examined ✓ Reasoning grounded: Evidence-based (industry standards, perceptual thresholds) not spurious math ✓ Depth calibrated: Simple tasks streamlined, complex tasks thorough ✓ Ambiguity explicit: Assumptions documented with rationale and risk assessment ✓ Verification purposeful: Focus on real failure modes, not process theater
If you find yourself:
This is engineering reasoning, not template filling.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.