# svg-path-draw

svg-path-draw — a rule that gets the agent to trace an SVG outline stroke by stroke, then fade in a wordmark once the drawing settles.

- rule · `type=rule` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline · ★ 78316 repo stars
- Author: calesthio
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/calesthio/OpenMontage/tree/HEAD/.agents/skills/hyperframes-animation/rules/svg-path-draw.md
- Updated: 2026-10-24
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/rules/svg-path-draw

## What it does

The rule hands the agent a working recipe for a shape that draws itself. Two stroke properties carry it: the dash pattern spans the path's whole length, and the dash offset runs from that length down to zero. The length comes from `path.getTotalLength()`, so it is measured geometry rather than a hardcoded number.

You get an HTML scene with several `<path>` elements, CSS that leaves strokes unfilled with round caps, and a GSAP timeline built paused. Each segment begins before the previous one finishes, which is why the result reads as one motion and not three separate tweens. A table of ranges covers the timings: 0.3-0.8s for a segment draw, 0.25-0.6s for the shorter closing segment, 0.3-0.8s for the fade. Easing is a discrete pick, `power2.out` on strokes and `power1.out` on the fade, with bouncy curves such as `back.out` ruled out.

GSAP arrives through a script tag from `cdn.jsdelivr.net`. Miss it and there is no `gsap.timeline` to call, so the scene stays empty. The wordmark fade has a hard floor too: it must start at or after the end of the last stroke, otherwise the text competes with a line still being drawn.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/rules/svg-path-draw.md` — The paths frontmatter field limits the files

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### Cursor

**Manually: put the files in place**
- File: `.cursor/rules/svg-path-draw.mdc` — Frontmatter: description, globs, alwaysApply

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/instructions/svg-path-draw.instructions.md` — The applyTo field sets which files it applies to

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/svg-path-draw.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/svg-path-draw.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/calesthio/OpenMontage/tree/HEAD/.agents/skills/hyperframes-animation/rules/svg-path-draw.md

## When to use it
- trace a logo outline on page load
- chain several strokes so they read as one motion
- size a segment's duration to its actual length
- hold the wordmark back until the drawing settles

## Example prompts
- Build a scene where the logo draws itself and the caption fades in after the last stroke.
- Check that `BRAND_FADE_START` comes after `SEG_3_START` plus `FINAL_SEGMENT_DUR`.
- Set `strokeDasharray` from `getTotalLength()` on every `path`.

## Similar
- [svg-animation](https://affpapa.org/en/nevibecode/skills/svg-animation.md) — skill · 4400 installs
- [rendering-svg-precision](https://affpapa.org/en/nevibecode/rules/rendering-svg-precision.md) — rule · ★ 1064 repo stars
- [svg-tracer](https://affpapa.org/en/nevibecode/mcp/svg-tracer.md) — MCP server · ★ 81 repo stars
- [Image to SVG](https://affpapa.org/en/nevibecode/mcp/image-to-svg.md) — MCP server · ★ 11 repo stars
- [create-svg-illustrations](https://affpapa.org/en/nevibecode/skills/create-svg-illustrations.md) — skill · 211 installs
- [makepad-2.0-vector](https://affpapa.org/en/nevibecode/skills/makepad-20-vector.md) — skill · ★ 754 repo stars

From the same set: [calesthio/openmontage](https://affpapa.org/en/nevibecode/by/calesthio/openmontage.md) — 101 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
