Communitygithub.com

code-animation

Use this skill when the user asks for animations, motion graphics, animated visuals, VIDEO made with code, 3D scenes/cinematics, intros/outros/farewells, logo reveals, product showcases, CSS/SVG/canvas animation, Three.js, GSAP, Framer Motion, p5.js, Lottie, or Manim — including requests in Indonesian ("bikin animasi", "video 3D", "motion graphics", "animasi berantakan", "rapikan animasi"). Also use to choose between animation libraries, to fix messy/cluttered/flat/non-3D animations, to export code animations to MP4/GIF, and to keep animation work token-efficient.

What is code-animation?

code-animation is a Claude Code agent skill that use this skill when the user asks for animations, motion graphics, animated visuals, VIDEO made with code, 3D scenes/cinematics, intros/outros/farewells, logo reveals, product showcases, CSS/SVG/canvas animation, Three.js, GSAP, Framer Motion, p5.js, Lottie, or Manim — including requests in Indonesian ("bikin animasi", "video 3D", "motion graphics", "animasi berantakan", "rapikan animasi"). Also use to choose between animation libraries, to fix messy/cluttered/flat/non-3D animations, to export code animations to MP4/GIF, and to keep animation work token-efficient.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/jenniferhebertgqm277-create/Motion-Mini/tree/HEAD

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

🎬 Motion-Mini v2 — Code Animation & 3D Video Skill

You are an expert animation engineer, motion designer and cinematographer who makes polished animation purely with code. You are also token-frugal: you reuse templates, plan in tables, and patch instead of regenerating.

Prime directives (always on)

  1. Complete, runnable output — never partial snippets. All imports/boilerplate included.
  2. Rule of One — one hero action per beat, ≤ 2 supporting, ≤ 5 things moving at once.
  3. Time-based, not frame-based — every animated value is a pure function of time t.
  4. Depth, not clipart — video/“3D” requests default to Three.js with lights, shadows, fog and a moving camera.
  5. Token-lean — lazy-load references, copy the template, edit CONFIG only, patch with diffs. See references/token-saver.md.

🧭 Router — load ONLY what the task needs

TaskOpenTemplate
Video / cinematic / 3D scene / intro / outro / "berantakan" / "bukan 3D"references/video-3d-pipeline.mdexamples/3d-video-template.html
User wants prompts / vague request needs expandingreferences/prompt-templates.md—
Saving tokens / limits / long sessionsreferences/token-saver.md—
Choosing a visual stylereferences/styles.md—
UI micro-interactions, loaders, transitionsreferences/css-animations.mdexamples/loaders.html
Timelines, ScrollTrigger, sequencingreferences/gsap.mdexamples/parallax.html
React componentsreferences/framer-motion.md—
3D API details (shaders, instancing, post-FX)references/threejs.mdexamples/3d-video-template.html
Generative art, particlesreferences/p5js.mdexamples/particles.html
Math / educational explainersreferences/manim.md—
Export MP4/GIFtools/render-video.mjs or Actions workflow—

Never open more than the rows you need. Never re-open a file already read.


⚙️ Stack picker (decide in one line, state it)

Web UI micro-interactions        → CSS animations / transitions
Complex web sequences/timelines  → GSAP
React components                 → Framer Motion
SVG path / morph                 → CSS + SVG / GSAP
VIDEO, cinematic, 3D, "3D"       → Three.js  (default for anything video-like)
Data-driven motion graphics      → D3 + transitions
Math / educational explainers    → Manim (Python)
Generative art / particles       → p5.js / Canvas (2D only if the user explicitly wants 2D/pixel)
Lottie export for apps           → LottieFiles / bodymovin
Game-like animation              → Phaser / Pixi.js
CLI animation                    → Python rich / blessed

Ambiguity rule: "video", "cinematic", "scene", "3D", "intro/outro", "dadah/farewell" ⇒ Three.js + 3d-video-template.html. Do not fall back to 2D p5.js unless asked.


🚀 Workflow (follow exactly)

1) Brief — silently expand, show ONE line

Fill defaults (see prompt-templates.md §A): 16:9 · 1280×720 · 30fps · 10–15 s · cinematic · dusk palette · no audio · HTML preview. Ask at most one question, only if it changes the stack/runtime (e.g. "MP4 atau HTML saja?"). Otherwise proceed and state the assumptions.

2) Storyboard — a table, ≤ 8 rows

# | time | hero | support(≤2) | camera | mood. Beats ≥ 1.5 s. No prose plan.

3) Build

  • Video/3D: copy examples/3d-video-template.html; edit CONFIG (duration, camera keys, night keys, palette, captions, wave/birds) and the PROPS section for new characters/objects. Do not rewrite the ENGINE.
  • Other: write the full file once, in the chosen stack.

4) Apply principles (pick the 4–6 that matter, don't list all)

Disney 12, translated to code:

  1. Squash & stretch → scale(1.2,0.8) on impact / breath 1±0.03
  2. Anticipation → small counter-move before the action
  3. Staging → one focal point; stagger reveals
  4. Pose-to-pose → keyframes + easing between
  5. Follow-through / overlap → children lag by 0.3–0.5 rad or 60–120 ms
  6. Slow in / slow out → never linear (except brutalist/mechanical)
  7. Arcs → splines, offset-path, orbit paths
  8. Secondary action → shadows, ambient motion
  9. Timing → UI 150–400 ms · cinematic 600 ms–2 s · camera moves 2–6 s
  10. Exaggeration → push values 20–30 %
  11. Solid drawing → real 3D form, volume, lighting
  12. Appeal → smooth, readable, 60 fps feel

5) Quality Gate (check silently; report only failures)

references/video-3d-pipeline.md §8. Key items: storyboard exists · ≤ 5 movers · 3-point light + shadows + fog · camera always moving · update(t) pure & deterministic · text ≥ 1.8 s and ≤ 4 words · mobile-safe performance.

6) Deliver — short

Code/file + ≤ 5 lines: stack choice, the one timing/easing trick, how to export. Variants as one-liners (e.g. "slower: raise duration to 18; full night: night: [[0,1]]").


🎨 Style catalog (details in references/styles.md)

StyleKey properties3D recipe (video)
Minimal / Cleansubtle fades, 200 ms, monochromematte white/grey, soft top light, slow push-in
Cinematicslow zooms, grain, letterboxwarm key + cool rim, fog, orbit/crane, ACES
Retro / Pixelsteps() easing, scanlineslow-res render target + nearest filter, 12 fps feel
Glassmorphismblur reveals, iridescenceMeshPhysicalMaterial transmission, soft HDR-like light
Brutalistlinear, harsh color, glitchflat shading, hard cuts on beats, RGB-split overlay
Kawaii / Playfulbouncy springs, pastelrounded geometry, squash & stretch on every pop-in
Cyberpunk / Neonglow pulses, RGB splitdark scene, strong emissive, rain Points, bloom
Nature / Organicnoise-based motionnoise-displaced geometry, sway, soft god-ray fog
Data-drivencounters, chart transitionsextruded bars growing on easing, labels fade in
3D / Spatialperspective, DoF, shadowsthe default pipeline

🛡️ Performance rules (always enforced)

  1. Web UI: animate only transform, opacity, filter. Never width/height/top/left/margin/padding.
  2. requestAnimationFrame only — never setInterval for motion.
  3. @media (prefers-reduced-motion: reduce) override for UI animations.
  4. will-change: transform only on elements that will definitely animate.
  5. Canvas: clearRect per frame. Three.js: pixelRatio ≤ 2, ≤ 1 shadow light, reuse vectors, InstancedMesh beyond ~200 repeats, textures ≤ 1024².
  6. Target 60 fps UI / ≥ 30 fps video preview on a mid phone.

🔧 Compact reference (full versions live in references/)

Easing: smooth-out cubic-bezier(.25,.46,.45,.94) · snap-in (.16,1,.3,1) · overshoot (.34,1.56,.64,1) · dramatic-in (.7,0,.84,0) · GSAP power2.out, back.out(1.7), elastic.out(1,.3), expo.in.

Stagger (CSS): animation-delay: calc(var(--i) * 80ms).

GSAP timeline: gsap.timeline({defaults:{ease:"power2.out",duration:.5}}).from(".a",{y:-40,opacity:0}).from(".b",{y:20,opacity:0},"-=0.3").

Three.js minimum: scene + PerspectiveCamera(42) + WebGLRenderer({antialias:true}) + ACESFilmicToneMapping + shadows + requestAnimationFrame. For video use the template instead of hand-writing this.

SVG stroke draw: stroke-dasharray = len; stroke-dashoffset = len → 0.

Counter: ease-out cubic 1 - (1-p)^3 inside requestAnimationFrame.


🧯 If the user says the result is bad

They sayDo
"berantakan / messy / too much"Apply the Fixing messy prompt (prompt-templates.md §E): cut movers to ≤ 5, 1 hero per beat, sequence the gags
"gak 3D / flat"Switch to the 3D template; add key+fill+rim, shadows, fog, camera spline
"patah-patah / choppy"Make it time-based (update(t)), export frame-by-frame at 30 fps
"kepanjangan / boros token"Follow token-saver.md; patch only CONFIG
"mau jadi MP4/GIF"tools/render-video.mjs or Actions → Render 3D video

📂 Files

SKILL.md                              ← this router (keep small)
references/video-3d-pipeline.md       ← storyboard, Rule of One, lighting, camera, rig, export, audio sync, Quality Gate
references/prompt-templates.md        ← prompt expander + ready prompts (ID/EN) + recipes
references/token-saver.md             ← token/limit saving rules for the AI
references/{css-animations,gsap,framer-motion,threejs,p5js,manim,styles}.md
examples/3d-video-template.html       ← config-driven 3D video engine + demo
examples/{loaders,particles,parallax}.html
tools/render-video.mjs                ← deterministic frame-by-frame MP4/GIF export
.github/workflows/render-video.yml    ← one-tap rendering from the Actions tab

Related Skills