svg-icon-enrichment — Claude Code rule for animating SVG icon internals
svg-icon-enrichment — a rule that teaches Claude Code and Codex to animate the inner parts of SVG icons: clock hands, scissor blades, pulsing dots, flowing dashes. For micro-animation without swapping the icons themselves.
AGPL-3.0 ★ 78,316 updated 2026-10-24
.claude/rules/svg-icon-enrichment.mdWhat svg-icon-enrichment does
The rule pushes the agent to see an SVG icon as a set of moving parts, not a flat image. Each meaningful child element gets its own GSAP-driven motion.
Four motion patterns are defined: rotation for clock hands and gears, oscillation for scissor blades and toggles, pulse for recording dots and hearts, and dash flow along strokes for data streams. Everything runs inside a paused GSAP timeline so frame seeking stays deterministic.
It is a sibling to svg-path-draw, which handles outline drawing. This rule covers internal parts, ideally once the outline is already drawn. GSAP loaded from a CDN and constants like MIN_REVOLUTIONS, SEC_REVOLUTIONS, PULSE_CYCLES are required for the timeline to build.
What it helps with
- Spin clock hands and gears with rotation
- Make scissor blades and wings oscillate
- Add a pulse to a recording dot or heart
- Move dashes along a stroke like a data stream
Example prompts for the agent
- Add a clock icon to the scene: minute hand does 2 revolutions, second hand 8 over 4 seconds
- Create a pulsing recording dot: 3 cycles over the scene, ring fades in counter-phase
- Animate a data stream: dashes flow left to right via strokeDashoffset
How to install svg-icon-enrichment
Manually: put the files in place
.claude/rules/svg-icon-enrichment.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/svg-icon-enrichment.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/svg-icon-enrichment.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/svg-icon-enrichment.mdManually: put the files in place
.clinerules/svg-icon-enrichment.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about svg-icon-enrichment
How do I install svg-icon-enrichment in Claude Code?
Add the file .claude/rules/svg-icon-enrichment.md to the project root. Claude Code picks the rule up on the next run.
What does svg-icon-enrichment do?
It teaches the agent to animate internal SVG icon parts with rotation, oscillation, pulse and dash flow. All motion is built on a GSAP timeline.
How is it different from svg-path-draw?
svg-path-draw animates the outline of an icon, while this rule handles its internal elements. Ideally enrichment runs after the outline has finished drawing.