Communitygithub.com

animaku

Code-driven HTML5 Canvas animation studio for creating short-form videos (9:16 portrait, 16:9 landscape, or 1:1 square) with procedural 2D characters, After Effects-style VFX, kinetic highlighted subtitles, and AI narrator voiceover. Use this skill when the user asks to create an animated short video, storytelling animation, motion-graphics clip, or canvas-coded video.

What is animaku?

animaku is a Claude Code agent skill that code-driven HTML5 Canvas animation studio for creating short-form videos (9:16 portrait, 16:9 landscape, or 1:1 square) with procedural 2D characters, After Effects-style VFX, kinetic highlighted subtitles, and AI narrator voiceover. Use this skill when the user asks to create an animated short video, storytelling animation, motion-graphics clip, or canvas-coded video.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/QUHu-FER/animaku/tree/HEAD/.agents/skills/animaku

Ask in your favorite AI

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

Documentation

Animaku — Code-Driven Canvas Animation Studio

Create polished short-form animated videos from code using the Animaku HTML5 Canvas 2D engine, edge-tts neural narration, and headless Playwright + FFmpeg rendering.

Workflow

1. Plan Storyboard & Narration (script.json)

Create a project folder under projects/<slug>/ (or examples/<slug>/) with script.json:

  • Choose a voice from presets.md (e.g., id-ID-ArdiNeural, id-ID-GadisNeural, en-US-GuyNeural).
  • Wrap emphasis keywords in *asterisks* so kinetic subtitles automatically highlight them in yellow (e.g., "Nahan *fantasi* liar").
  • Add pauseAfter (seconds) for dramatic beats between lines.
{
  "voice": "id-ID-ArdiNeural",
  "rate": "+6%",
  "cues": [
    { "id": "c1", "text": "Nahan *fantasi* liar", "pauseAfter": 0.25 },
    { "id": "c2", "text": "Padahal masih *ngecat* tembok!", "pauseAfter": 0.3 }
  ]
}

2. Generate Narrator Audio & Exact Timestamps

Run narrator.py to synthesize narrator.mp3 and timing.json:

python .agents/skills/animaku/scripts/narrator.py --script projects/<slug>/script.json --out-dir projects/<slug>

3. Code the Animated Canvas Scene (scene.js)

Write projects/<slug>/scene.js importing helpers from ../../engine/animaku.js (see canvas-api.md):

  • Export meta (width, height, fps) matching the requested aspect ratio (1080x1920 portrait by default).
  • Export init({ width, height, timing, duration }) to pre-build deterministic particle systems or background props.
  • Export render(ctx, { width, height, t, duration, timing, state }):
    1. Background: Use VFX.drawBlurredLayer(...) for depth-of-field rooms, doorways, or gradients.
    2. Camera: Wrap world-space elements in cam.begin(ctx, width, height, t) ... cam.end(ctx) with smooth pan/zoom and impact trauma shake.
    3. Characters & Props: Use drawCharacter(ctx, cfg, state, t) with 'flat-glow' or 'stickman-toon' style, rim-light glow, and VFX.drawMotionLines(...) / VFX.drawSweatDrop(...).
    4. VFX & Post-Processing: Add VFX.drawParticles(...) and VFX.drawPostProcess(ctx, width, height, { vignette, lightLeak, grain, t }).
    5. Kinetic Subtitles: Call drawKineticSubtitles(ctx, width, height, timing.cues, t) outside the camera transform so captions stay crisp and centered.

4. Render to MP4

Run render.mjs to capture deterministic frames via headless Edge/Chrome and encode with FFmpeg:

node .agents/skills/animaku/scripts/render.mjs --scene projects/<slug>/scene.js --timing projects/<slug>/timing.json --audio projects/<slug>/narrator.mp3 --out projects/<slug>/output.mp4 --w 1080 --h 1920 --fps 30

Optional: pass --bgm path/to/music.mp3 to mix background music at 18% volume under the narrator.

5. Verify Output

Confirm the rendered video has valid video and audio streams and non-zero duration:

ffprobe -v error -show_entries format=duration -show_entries stream=codec_type,width,height -of default=noprint_wrappers=1 projects/<slug>/output.mp4

Related Skills