Skip to main content
rule CX Codex

svg-path-draw — Claude Code rule: what it does, how to install

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.

AGPL-3.0 ★ 78,316 updated 2026-10-24

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/svg-path-draw.md
Open on GitHub

What svg-path-draw 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.

What it helps with

  • 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 for the agent

  • 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.

How to install svg-path-draw

Manually: put the files in place

.claude/rules/svg-path-draw.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about svg-path-draw

How do I install svg-path-draw in Claude Code?

Place .claude/rules/svg-path-draw.md in your project; the rule is picked up from that folder.

What does svg-path-draw do?

It spells out how to reveal an SVG stroke gradually with stroke-dasharray and stroke-dashoffset, plus a GSAP timeline with timing ranges for each segment.

Why is back.out off limits for the stroke?

Strokes use power2.out so the line slows at the end like a lifted pen instead of springing. For a constant-speed trace the rule suggests none.

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set101

The whole set →
styling Rule for styling mobjects in ManimGL: fill, stroke, opacity, and visual effects. Use it when building animations and want consistent, reusable styling across objects. CX Codex +1 ★ 78,316repo stars kling-official kling-official teaches the agent to drive Kling's own API inside OpenMontage: video, images, speech, avatars and lip sync. CX Codex +1 ★ 78,316repo stars hyperframes-cli hyperframes-cli guides the HyperFrames video build loop, from composition validation and timeline inspection to AWS Lambda rendering. CX Codex +1 ★ 78,316repo stars synthetic-screen-recording The synthetic-screen-recording skill guides synthetic terminal demos in Remotion with TerminalScene. Use it when the command sequence and output can be authored ahead of time. CX Codex +1 ★ 78,316repo stars hacker-flip-3d hacker-flip-3d supplies guidelines for creating a 3D character flip animation with randomized glyph decoding. Helps build terminal and airport-style text reveals. CX Codex +1 ★ 78,316repo stars gemini-omni Generates short clips via gemini-omni-1.1-flash and edits them through follow-up prompts without re-generating. Each generation returns an interaction_id so the next call changes only what you specify. CX Codex +1 ★ 78,316repo stars discrete-text-sequence discrete-text-sequence — a rule for GSAP scenes where the terminal line swaps whole states instead of typing evenly: typos, backspaces, pasted chunks and holds. CX Codex +1 ★ 78,316repo stars animation-groups The animation-groups rule organizes ManimGL animations for parallel, sequential, or staggered playback. Use it when several scene elements need coordinated timing. CX Codex +1 ★ 78,316repo stars

Project sponsors

Companies that keep this analytics open