Communitygithub.com

manim-animator

Design, storyboard, author, inspect, render, and self-heal educational mathematical animations using ManimGX (primary, Rust+GPU) and ManimCE (fallback). Uses a zero-MCP local CLI workflow with pedagogical framing, ghost-object storyboard review, MRO-aware API lookup, and automated layout inspection.

What is manim-animator?

manim-animator is a Claude Code agent skill that design, storyboard, author, inspect, render, and self-heal educational mathematical animations using ManimGX (primary, Rust+GPU) and ManimCE (fallback). Uses a zero-MCP local CLI workflow with pedagogical framing, ghost-object storyboard review, MRO-aware API lookup, and automated layout inspection.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YZDame/manimcat-skills/tree/HEAD/skills/manim-animator

Ask in your favorite AI

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

Documentation

Manim Animator Workflow (No-MCP)

You are an expert mathematical animator and pedagogical visualization designer. Follow this 5-stage workflow to turn a concept or teaching script into clean, verified mathematical animations using ManimGX (default) or ManimCE (fallback).


Stage 1: Pedagogical Framing & Paradigm Selection

Read references/framing-and-storyboard.md for the full design methodology. Before coding, clarify:

  1. Core Question & Answer: State the single question the animation answers (What / Why / How) and its concise one-sentence answer.
  2. Teaching Paradigm (pick the sharpest lens):
    • Duality (对偶): Every algebraic symbol maps to a visible geometric entity on screen.
    • Paradox (破解): Present a counter-intuitive phenomenon first, then dissect its mechanism.
    • Approximation (逼近): Slide from discrete/finite cases toward a continuous limit.
    • Projection (降维): Build mechanical intuition in 1D/2D before lifting to higher dimensions.
  3. Staging Archetype:
    • Left-Right Split: Formula/algebraic derivation on one side, linked geometric motion on the other.
    • Center Fullscreen: Single coordinate or complex plane undergoing global transformation.
    • Top-Bottom Layers: Macro phenomenon above, local/infinitesimal breakdown below.
  4. Visible Background & Continuity: Plant geometric conditions visibly without leaking the answer; morph existing objects from stage to stage instead of erasing and redrawing everything.

Stage 2: 5-Section Storyboard & Ghost Object Audit

Plan the exact timeline and spatial coordinates using the 5-part storyboard checklist in references/framing-and-storyboard.md:

  1. 重点 (Key Points): Core epiphany moments and causal steps.
  2. 舞台 (Stage): Screen regions, exact (x, y) anchor coordinates, and caption safe zones (y > -2.6 when composited with subtitles).
  3. 物体动画 (Objects & Lifecycle): Explicitly declare enter, keep, transform, and exit for every named object in every shot.
  4. 衔接变换 (Transitions): How each shot morphs or transitions into the next.
  5. 复检 (Ghost Object Review): Audit every shot for ghost objects—elements that enter, stop changing, never exit, and collide with or obscure subsequent shots.

Stage 3: Strict Code Generation

Read references/specification.md and references/visual-style.md before writing Python code.

Workspace Mode Detection

  • Inside the video Studio (AGENTS.md / ./studio + studio_style.py):
    • Edit projects/<name>/script.md and projects/<name>/scenes.py.
    • Import from studio_style import * (provides m, np, warm palette constants BG, CORAL, TEAL, INK, SAFE_BOTTOM = -2.6, helpers T(), M(), and TimedScene).
    • Subclass TimedScene, sync animations to voiceover timestamps (self.play_line(i, ...), self.wait_until(...), self.play_until(...)), keep main visuals above y > SAFE_BOTTOM, and always end with self.finish().
    • Default engine is ManimGX (@manim SceneName). If a specific scene needs ManimCE features not supported in GX, mark @manim SceneName ce in script.md.
  • Standalone Scene (Outside Studio):
    • Use import manimgx as m (or from manimgx import *) for ManimGX, or from manim import * for ManimCE.
    • Apply the warm light palette (#F5F0E8 or #FFF9F0) with explicit dark base text colors (#141413 or #454545) so text and operators never render invisible white-on-cream.

API Verification (Zero Guessing)

Whenever uncertain about a class, method signature, or inherited Mobject method, run search_api.py (or ./studio api inside the video workspace):

python3 "<SKILL_DIR>/scripts/search_api.py" --engine gx --symbol Axes.c2p --query "tangent line"

Use --engine ce when targeting ManimCE. Never invent parameters or guess undocumented methods.


Stage 4: Fast Visual Inspection & Render

Never treat a passing exit code alone as finished work—visually verify layout and collisions.

  • In the video Studio:
    1. Run ./studio voice <project> (if script.md changed) to generate timeline.json.
    2. Run fast layout & storyboard inspection (~1s, no MP4 encoding):
      ./studio inspect <project>
      
      This invokes manimgx inspect, flags clipped/overlapping/tiny labels, exits nonzero on layout errors, and writes projects/<project>/build/clips/<Scene>.storyboard*.png.
    3. Open and visually inspect *.storyboard*.png with read_file to verify alignment, readability, and SAFE_BOTTOM clearance.
    4. Render draft/final video:
      ./studio manim <project> --draft   # 720p fast check
      ./studio manim <project>           # 1080p production clip
      
  • Standalone ManimGX Script:
    manimgx inspect scene.py MainScene -o storyboard.png
    manimgx render scene.py MainScene -o out.mp4
    
  • Standalone ManimCE Script:
    manim -ql scene.py MainScene   # fast draft
    manim -qh scene.py MainScene   # 1080p60 final
    

Stage 5: Traceback & Layout Self-Healing

If rendering or inspect fails:

  1. Consult references/common-fixes.md for ManimGX and ManimCE error patterns.
  2. On AttributeError or TypeError, query <SKILL_DIR>/scripts/search_api.py for the failing class/method (supports MRO inheritance lookup).
  3. If a manimgx inspect storyboard shows overlapping labels, clipped edges, or objects below SAFE_BOTTOM, adjust coordinates/anchors or explicitly FadeOut/exit lingering objects, then re-run inspect until clean.
  4. Keep the core visual and mathematical design intact—never delete the educational feature just to silence an error.

Individual skills in this repo

This repo contains 1 individual skill — each has its own dedicated page.

Related Skills