agentsclimarketplace

With svg animation

Skill robcsaszar/frontend-kit/skills/with-svg-animation

Surfaces the SVG animation traps that go unmentioned when a request sounds simple — dash patterns restarting at every subpath, pathLength normalization, transform-box on inner elements. Use whenever animating an SVG (draw-on, hover spin or scale, path morph, clip reveal, scroll-linked draw), including when the request names none of these and sounds like a one-liner, and when choosing between CSS, SMIL, WAAPI, GSAP, or a morph library. Don't use for raster or canvas animation (see with-canvas) or for non-SVG DOM transitions.From its SKILL.md

Install
npx -y skills add robcsaszar/frontend-kit --skill with-svg-animation

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

6.2 KB, as published. Nobody here has run it

with-svg-animation

You already know how to animate SVG. What you reliably fail to do is raise these conditions when the user hasn't named them — a vague request produces a plausible answer that breaks on the user's actual artwork. This body is a pre-flight, not a tutorial.

Pre-flight — answer before writing any code

Read the actual path data; if you can't see it, ask for it. Never answer from the request alone — every trap below is invisible in the request and obvious in the markup.

  1. Is the thing being animated the root <svg>, or an element inside it? Inner elements need transform-box.
  2. Does the target d contain more than one M command? One <path> can hold several disconnected subpaths.
  3. Is the artwork stroked or filled? A draw-on animation only animates a stroke; a filled logo needs stroke-then-crossfade, or a mask wipe instead.
  4. How many elements animate at once, and is it scroll-linked? Dash and d are paint-level, not compositable — dozens of them on a mid-range phone is a different problem than one logo, and answering "many" or "scroll-linked" puts you under the paint budget in the last NEVER before you write anything.

Already broken? Match the symptom

SymptomCause
Shape swings across the canvas instead of pivotingtransform-box missing on an inner element
Strokes start together but finish at different timesOne <path>, several subpaths — dash pattern restarts per subpath
Morph hard-cuts halfway instead of tweeningCommand sequences don't match, so interpolation fell back to discrete
Reveal edge drifts or scales with the artworkclip-path and transform on the same node

Traps

Dash patterns restart at every subpath. A single <path> whose d has three M commands is not one continuous dash run — each subpath gets its own copy of the pattern, so all three start together and finish at different times. It reads as a glitch. Split the d into one <path> per subpath (a mechanical edit at each M) to get per-stroke control and staggering. pathLength does not rescue the single-path version.

Use pathLength="1" instead of measuring. It rescales the coordinate system that stroke-dasharray and stroke-dashoffset operate in, so dasharray: 1; dashoffset: 1 hides any path regardless of length. No getTotalLength(), no hardcoded numbers that break when a designer nudges the artwork. Reach for measurement only when you need true constant pen-speed across paths of differing length.

transform-origin needs transform-box: fill-box on inner elements. On the root <svg> it behaves like a CSS box and transform-origin: center works. On a <path> or <g>, transform-box defaults to view-box, so center means the centre of the viewBox and the shape swings across the canvas instead of pivoting. Set both properties explicitly on every animated inner element.

Do not reach for vector-effect="non-scaling-stroke" by reflex. It keeps on-screen stroke width constant regardless of scale, which is wrong for a logo — a mark should thicken as it grows. It also forces stroke geometry to recompute against the current CTM on every paint, which compounds badly with dash animation. Use it only when constant stroke weight is the stated intent.

A clip and a transform on the same node are one rigid unit. Per spec the element's own transform also transforms its clip, so the reveal edge welds to the artwork and scales with it. When you want them decoupled, put clip-path on an outer group and the transform on an inner one. When you want them welded, put both on the same node deliberately.

Escalation — CSS first

Start in CSS and escalate only when CSS structurally cannot do it, not when it merely gets awkward:

Reach forWhen
CSSAnything expressible as transform, opacity, dash offset, or interpolating between same-type same-vertex-count shapes
SMIL <animate>Cross-browser d animation with no JS — Firefox does not support CSS d interpolation
WAAPIYou need JS control, scroll/pointer input, or reduced-motion branching, and d support is adequate for your targets
LibraryOnly for geometry no native technique can produce — resampling mismatched point counts (Flubber) or subpath-count changes

GSAP's DrawSVG and MorphSVG are paid Club GreenSock plugins. Never emit code depending on them without confirmed licensing — check the project's dependencies or ask. Unconfirmed means use the native route or Flubber, and say why you did.

MANDATORY READ references/techniques.md before writing stroke-draw, clip-path, morph, squash-stretch, stagger, or scroll-linked code — 15 worked examples, each independently readable via the contents table. Do NOT load it for approach-selection or diagnosis questions; this body answers those.

NEVER

  • NEVER morph between paths with different command sequences Instead: author both states with identical commands in identical order — including a degenerate zero-radius subpath when a hole must appear — or hand resampling to a library. Why: interpolation is a per-coordinate lerp over two command lists; a structural mismatch silently falls back to a discrete swap and hard-cuts at 50%.

  • NEVER scroll-link dash animation across many paths without a paint budget Instead: round offset writes to whole units, skip paths outside their active range, cache lengths once, and move any continuous background transform out to a promoted HTML wrapper. Why: dash offset regenerates stroke geometry every frame on the main thread; it is fine for one logo and janks a mid-range phone across dozens.

What ships with it: 1 file

7.5 KB alongside SKILL.md

references/

Gives 0 of the 12 instructions most css styling skills give

Counted across 512 of the 512 authors here whose files we hold, read 2026-09-06

  • Animate only transform and opacityin 32 of 512, across 30 files
  • Respect prefers-reduced-motionin 21 of 512
  • Support reduced motion preferencesin 16 of 512, across 6 files
  • Use Tailwind CSS for stylingin 14 of 512, across 13 files
  • Specify AnimatePresence mode explicitlyin 12 of 512, across 2 files
  • Set initial states explicitlyin 12 of 512, across 2 files
  • Use semantic HTML elementsin 11 of 512, across 10 files
  • Use oklch for color valuesin 11 of 512, across 10 files
  • Honor prefers-reduced-motion in animationsin 10 of 512
  • Provide a reduced-motion fallback for animationsin 10 of 512, across 9 files
  • Use property names in camelCasein 9 of 512, across 4 files
  • Ensure UI animations stay under 300msin 9 of 512, across 6 files

Said here and by no other author read

  • read the actual path data before writing code
  • split the d attribute into one path per subpath
  • use pathLength equals one instead of measuring
  • set transform-box fill-box on inner elements
  • put clip-path on an outer group
  • start in CSS and escalate only when necessary

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once.

Keep looking

Skills are one crate of 626,045. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.