Skip to content
Back to search

line-art-animation

SkillWorks with Claude CodeGitHub

Build animated line-art components in SVG and TypeScript — thin ink lines on paper, people and animals that walk, run, cycle and react, scenes with wind, lit windows and a day/night cycle, exported to video if needed. Use this whenever someone asks for a line art (or ink, pen, doodle, hand-drawn) animation, an animated illustration or scene component, little characters doing everyday things, a living street/village/shop/park, a day-night cycle illustration, "make it like this clip" for a drawn animation, or a video of such a component — even if they never say "SVG" or "line art".

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/jdhruv14--line-art-animation/badge.svg)](/listings/jdhruv14--line-art-animation)

HTML

<a href="/listings/jdhruv14--line-art-animation"><img src="/api/listings/jdhruv14--line-art-animation/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

For Claude Code, clone it into your skills folder:

git clone https://github.com/JDhruv14/line-art-animation ~/.claude/skills/line-art-animation

or into `.claude/skills/` inside a single project. Then ask for what you want, for example:

- "Make a line art animation of a bakery at dawn: a baker carrying trays, steam from the oven, a cat in the window." - "Turn this clip into a looping line-art component, matching its walk exactly." (attach or link the clip) - "Add a day-night cycle to the scene and render a 30-second 1080p video."

Claude reads `SKILL.md`, copies `lib/` into your project, shows one figure for approval before building the rest, and checks motion frame by frame before handing it over.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 97 lines
  1. ---
  2. name: line-art-animation
  3. description: Build animated line-art components in SVG and TypeScript — thin ink lines on paper, people and animals that walk, run, cycle and react, scenes with wind, lit windows and a day/night cycle, exported to video if needed. Use this whenever someone asks for a line art (or ink, pen, doodle, hand-drawn) animation, an animated illustration or scene component, little characters doing everyday things, a living street/village/shop/park, a day-night cycle illustration, "make it like this clip" for a drawn animation, or a video of such a component — even if they never say "SVG" or "line art".
  4. ---
  5. # Line-art animation
  6. Animated illustration components: everything is drawn with one thin pen on paper,
  7. built live in SVG from TypeScript, so it stays crisp at any size, responds to the
  8. pointer, and can be stepped frame by frame for checking or video export.
  9. This skill ships a small library (`lib/`), two examples (`examples/walker`, a single
  10. figure in ~150 lines; `examples/village`, a full scene) and tools (`scripts/`).
  11. Read the example that's closest to the request before writing anything.
  12. ## How people judge this work
  13. They look at it like an animator would: frame by frame, at zoom, against life or
  14. against a reference. These were all rejected in practice, and each has a rule below:
  15. - walks that bob on a sine wave, feet that slide, gaits sped up to fit a time-lapse
  16. - limbs drawn as closed tubes; ruler-straight lines; rigid clothes that ignore the legs
  17. - a whole set of components built in one go that all look alike ("AI slop")
  18. - interactions that feel like UI instead of the world reacting
  19. - a page whose background changes with the scene ("looks like a video, not a component")
  20. - reusing characters from a reference clip when asked for something new
  21. - leftover props nobody asked for (they asked to remove hanging laundry)
  22. ## Workflow
  23. 1. **Pin the look** before anything moves. Read `references/style.md`. Decide the pen
  24. weight, paper colour, figure proportions and the one or two flat accent colours.
  25. 2. **Set up the project.** Copy `lib/` into the project (it's four dependency-free
  26. `.ts` files) and use Vite + TypeScript (`package.json`, `tsconfig.json` and
  27. `vite.config.ts` in this repo show the setup). Components are plain DOM/SVG — no framework needed.
  28. 3. **Build one figure or one corner first** and show it (screenshot or a short clip,
  29. next to the reference if there is one). Get a yes before building the rest. A
  30. full set built at once comes back as generic; one good piece shows the bar.
  31. 4. **Make it move** with `references/motion.md`: `gait()` for walking and running,
  32. `spring()` / `pendulum()` for anything attached or hanging, keyed poses with
  33. `curve()` or `sequence()` for gestures. Never animate a figure with free sines.
  34. 5. **Compose the scene** with `references/scenes.md`: a self-contained card on a fixed
  35. page background, layers, a time-of-day palette from `lib/daynight.ts`, lights,
  36. wind, people arriving on schedules, interactions that are reactions.
  37. 6. **Verify** with `references/verify.md` before showing anything: typecheck,
  38. `?debug` stepping, zoomed frame strips of every moving thing, interactions
  39. triggered and stepped through, 60 fps in a real tab.
  40. 7. **If there's a reference clip to match**, follow `references/matching.md` — measure
  41. timing and poses from the clip instead of guessing, and check with an overlay.
  42. 8. **If they want a video**, follow `references/video.md` (deterministic headless
  43. capture with `scripts/capture.ts`, then ffmpeg).
  44. ## Rules that make it work
  45. - **Limbs are two open strokes.** `limb()` draws a paper-filled band between two pen
  46. lines that stop short of each other at the far end. This is the style's signature.
  47. - **Lines curve.** Joints are rounded, edges bow slightly, nothing is ruler-straight.
  48. - **Draw each figure in its own space** — ~95 units tall, feet on y = 120, facing +x,
  49. standing at x = 40 — and place it with `place(g, x, y, dir, scale)`. Proportions,
  50. pen weight and the gait presets all assume this space.
  51. - **Clothes are drawn around the skeleton.** Solve the legs (even if hidden), then
  52. draw the coat or kimono hem from the forward knee and the ankles so the cloth opens
  53. and closes with the stride. Sleeves, scarves and bags swing on springs.
  54. - **Feet are planted.** Move a walker by exactly `gait.speed × scale` per second and
  55. the stance foot stays still on the ground. Don't speed a gait up to match a
  56. compressed clock; compress arrivals instead.
  57. - **Ink is `currentColor`, paper is `.pp`.** Retint the whole drawing with
  58. `applyPalette()` (day: dark ink on warm paper; night: pale ink on indigo, warm
  59. windows). Solid-colour limb fills must use `solid()`, or the paper CSS wins.
  60. - **The component is a card.** The page around it never changes colour.
  61. - **Interactions are the world reacting**: a person bows or tips a hat, a cat wakes and
  62. stretches, a lantern swings, birds scatter, a fish jumps. Pointer movement is wind.
  63. No buttons inside the scene; a single faint hint line is enough.
  64. - **New means new.** If the brief is "like this but new", keep the medium, pen,
  65. proportions and timing feel; invent the characters, activities and props.
  66. ## Library at a glance
  67. | module | what it gives you |
  68. |---|---|
  69. | `lib/ink.ts` | `pen` `shape` `blot` `paint` `limb` `solid` `joint` `hang` `curve` `shoe` `place` `toScene` `inkDefs` `run` |
  70. | `lib/gait.ts` | `gait({ kind: 'walk' \| 'shuffle' \| 'run', …overrides })` → `{ speed, period, pose(phase, go) }` |
  71. | `lib/motion.ts` | `spring` `pendulum` `pointerWind` `sequence` `seeded` `wobble` `ease` `minJerk` … |
  72. | `lib/daynight.ts` | `palette(τ)` → sky, paper, ink, `lamp`, `night`, `sunset`; `applyPalette` `nightTint` |
  73. `run(draw)` drives everything with `draw(t, dt)`. Two URL flags matter for checking:
  74. `?t=1.25` freezes time; `?debug` disables rAF and exposes `window.__step(seconds)`
  75. for exact stepping (background and headless tabs throttle rAF, so always verify in debug mode).
  76. ## Scripts
  77. - `scripts/capture.ts <url?debug> <outDir> <frames> <fps> [w] [h] [setupJs] [frameJs]` — deterministic PNG frames from headless Chrome
  78. - `scripts/clip.ts period|blobs …` — loop length of a region; dark-blob tracking per frame
  79. - `scripts/frames.sh <clip> x y w h outDir` — grid-overlaid frames for reading poses off a clip
  80. All run with Node ≥ 22.18 (TypeScript is stripped natively) plus ffmpeg; `capture.ts`
  81. finds a local Chrome/Chromium or uses `$CHROME`.
README.md · README · 134 lines
  1. # line-art-animation
  2. A Claude skill and a small TypeScript library for animated line-art components:
  3. ink-on-paper figures that walk, ride and react, in scenes that run from day to night.
  4. Everything is drawn live in SVG, so it stays sharp at any size and responds to the
  5. pointer.
  6. ![A Japanese street drawn in line art, going from late afternoon to night](media/village.gif)
  7. | Day | Night |
  8. |---|---|
  9. | ![The village at midday](media/day.png) | ![The village at night with lit windows](media/night.png) |
  10. ## What's in the repo
  11. | | |
  12. |---|---|
  13. | `SKILL.md`, `references/` | The skill: workflow, the rules that make the style work, and guides for style, motion, scenes, verification, matching a reference clip and rendering video. |
  14. | `lib/` | Four dependency-free TypeScript modules: drawing primitives (`ink.ts`), a walk/run solver (`gait.ts`), springs, pendulums and wind (`motion.ts`), and a time-of-day palette (`daynight.ts`). |
  15. | `examples/walker/` | One figure in about 150 lines: a man with a briefcase walks across the card; click him and he tips his hat. |
  16. | `examples/village/` | A full scene: a street of machiya, a tea house and a bath house by a canal, villagers on schedules, a cat, birds, a boatman, lit windows and reflections, about a dozen interactions. |
  17. | `scripts/` | Deterministic frame capture for video, and tools for measuring a reference clip. |
  18. ## Install the skill
  19. For Claude Code, clone it into your skills folder:
  20. ```sh
  21. git clone https://github.com/JDhruv14/line-art-animation ~/.claude/skills/line-art-animation
  22. ```
  23. or into `.claude/skills/` inside a single project. Then ask for what you want, for example:
  24. - "Make a line art animation of a bakery at dawn: a baker carrying trays, steam from the oven, a cat in the window."
  25. - "Turn this clip into a looping line-art component, matching its walk exactly." (attach or link the clip)
  26. - "Add a day-night cycle to the scene and render a 30-second 1080p video."
  27. Claude reads `SKILL.md`, copies `lib/` into your project, shows one figure for approval
  28. before building the rest, and checks motion frame by frame before handing it over.
  29. ## Run the examples
  30. Requires Node 22.18 or newer.
  31. ```sh
  32. npm install
  33. npm run dev # http://localhost:5173
  34. ```
  35. In the village, drag the sun or moon across the sky to change the time, move the pointer
  36. to make wind, and click people, windows, lanterns, the wind chime, the cat, the birds or
  37. the water. URL flags: `?start=0.9` sets the starting time (0 is midnight, 0.5 noon),
  38. `?tau=0.5` pins it, `?day=30` makes a full day last 30 seconds, `?debug` steps time by hand.
  39. ```sh
  40. npm run typecheck # strict for lib/ and the walker
  41. npm run build
  42. ```
  43. ## The library in brief
  44. ![The walker example: a man with a briefcase and a red scarf walking past a lamp post](media/walker.gif)
  45. Figures are drawn in their own space, about 95 units tall with feet on y = 120, and placed
  46. into a scene with a transform. Limbs are two open pen strokes around a curve through the
  47. joints, which is most of what makes the drawing read as hand-inked.
  48. A complete program that draws a pair of legs walking across the page (the walker
  49. example adds the body, arms, clothes and the click reaction):
  50. ```ts
  51. import { el, limb, shoe, place, inkDefs, run } from './lib/ink.ts';
  52. import { gait } from './lib/gait.ts';
  53. const svg = el('svg', { viewBox: '0 0 480 240' });
  54. document.body.append(svg);
  55. const fig = el('g', { filter: inkDefs(svg).filter }, svg);
  56. const legs = [limb(fig, 4.2), limb(fig, 4.2)];
  57. const shoes = [el('path', {}, fig), el('path', {}, fig)];
  58. const walk = gait({ kind: 'walk' });
  59. let phase = 0, x = 60;
  60. run((t, dt) => {
  61. phase += dt / walk.period;
  62. x += walk.speed * 1.25 * dt; // move at the gait's speed and the feet stay planted
  63. place(fig, x % 520 - 20, 196, 1, 1.25);
  64. const p = walk.pose(phase);
  65. p.feet.forEach((foot, i) => {
  66. legs[i].draw([p.hip, foot.knee, foot.ankle]);
  67. shoe(shoes[i], foot.ankle, foot.pitch);
  68. });
  69. });
  70. ```
  71. `gait()` solves the legs rather than animating them: the planted foot slides back at
  72. exactly the travel speed, the swing follows a minimum-jerk path, the heel peels off the
  73. toe before each step, and hip height comes from what the planted legs can reach, so the
  74. body rises over each step and dips when both feet are down. Clothes are then drawn
  75. around the knees and ankles, so a coat or kimono opens and closes with the stride.
  76. `palette(τ)` gives sky, paper and ink colours for any time of day. Ink is `currentColor`
  77. and paper fills carry a `pp` class, so `applyPalette()` can turn the whole drawing into
  78. pale ink on indigo at night while windows and lanterns glow.
  79. ## Render a video
  80. ```sh
  81. npm run dev
  82. node scripts/capture.ts "http://localhost:5173/examples/village/?debug&capture&day=30&start=0.3" \
  83. captures/village 900 30 1920 1080
  84. ffmpeg -framerate 30 -i captures/village/f%04d.png -c:v libx264 -preset slow -crf 15 \
  85. -pix_fmt yuv420p -movflags +faststart -tune animation village.mp4
  86. ```
  87. The capture script drives headless Chrome over the DevTools protocol, with no npm
  88. dependencies, and advances the scene by exactly one frame between screenshots, so the
  89. result doesn't depend on machine speed. It finds a local Chrome or Chromium, or uses
  90. `$CHROME`. Needs ffmpeg.
  91. ## Match a reference clip
  92. ```sh
  93. node scripts/clip.ts period clip.mp4 X Y W H # loop length of a region
  94. node scripts/clip.ts blobs clip.mp4 X Y W H Y0 Y1 # dark blobs per frame, e.g. feet
  95. scripts/frames.sh clip.mp4 X Y W H out/ # frames with a measuring grid
  96. ```
  97. `references/matching.md` covers the rest: why to resample by time (most social clips
  98. are variable-frame-rate), reading poses off the grid, and an overlay mode for checking
  99. your drawing against the clip.
  100. ## License
  101. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.