Manim explainer animation

From calesthio/generative-media-skills · View interactive version

Manim explainer animation is an AI agent skill from the GitHub repository calesthio/generative-media-skills. Provider-independent production workflow for creating Manim-based explainer animations. Use when an agent must plan, code, render, QA, or hand off precise math, science, data, diagram, algorithm, or concept animations with Manim, including storyboard, scene architecture, formulas, coordinate systems

How to use this skill

Skill file

Manim Explainer Animation

Use this skill to produce explainer animations where the explanation depends on precise symbolic, geometric, graphical, algorithmic, or diagrammatic motion. Treat Manim as a programmable explanation instrument, not as a generic video renderer.

Evidence labels

Choose Manim deliberately

Choose Manim when at least one of these is central to the deliverable:

Prefer another compositor or video tool when:

Hybridize when useful: render Manim scenes as transparent or full-frame segments, then finish in a compositor for music, captions, brand lower-thirds, live footage, or platform-specific packaging.

Start with the explanation, not the code

Before writing Manim code, produce a short production brief:

  1. Audience and prerequisite knowledge.
  2. One-sentence learning objective.
  3. Core misconception or tension.
  4. Exact facts, formulas, datasets, or domain claims that need SME/source approval.
  5. Runtime, aspect ratio, expected narration style, and delivery platform.
  6. Constraints: brand palette, fonts, captions, localization, accessibility, source attribution, or no-audio viewing.

Then create a concept breakdown:

Escalate before production if the script makes medical, legal, financial, safety, engineering, scientific, or educational claims whose correctness matters beyond style.

Storyboard as teachable beats

Write the storyboard as a table or structured list with these fields:

Production heuristics:

Scene architecture

Documented fact: Manim scripts generally define classes derived from Scene, put animation code in construct(), manage visual objects as mobjects, and play animations with Scene.play().

Build scenes as production code:

Example project skeleton:

project/
  pyproject.toml or requirements.txt
  scenes/
    main.py
    theme.py
    data/
      measurements.csv
    assets/
      logo.svg
  renders/
  captions/
  README-production-notes.md  # outside this skill; for the user's project handoff

Example theme.py pattern:

from manim import *

BG = "#0B1020"
FG = "#F6F7FB"
MUTED = "#8A93A6"
ACCENT = "#FFD166"
BLUE = "#4CC9F0"
GREEN = "#80ED99"
RED = "#FF5C8A"

TITLE_SIZE = 46
BODY_SIZE = 30
FORMULA_SIZE = 42

def title(text: str) -> Text:
    return Text(text, font="Inter", color=FG, font_size=TITLE_SIZE)

def caption(text: str) -> Text:
    return Text(text, font="Inter", color=MUTED, font_size=24)

Coordinate systems and layout

Documented fact: Manim provides mobjects for coordinate systems such as Axes and NumberPlane, and Axes exposes methods including coordinate-to-point conversion, graph labels, and line graph plotting.

Production rules:

Typography, formulas, and symbol continuity

Documented fact: Manim supports normal text mobjects and LaTeX-based Tex/MathTex; extra LaTeX packages can be added through a TexTemplate; MathTex can isolate substrings so parts can be colored or transformed reliably.

Production rules:

Formula transformation pattern:

start = MathTex(r"A", r"=", r"\pi", r"r^2", font_size=56)
expanded = MathTex(r"A", r"=", r"\pi", r"\cdot", r"3^2", font_size=56)
for mob in (start, expanded):
    mob.set_color_by_tex("A", YELLOW)
    mob.set_color_by_tex("r", BLUE)
self.play(Write(start))
self.play(TransformMatchingTex(start, expanded))

Graph, data, diagram, and algorithm animation

For graphs:

For diagrams:

For algorithms:

Voiceover and timing alignment

Documented fact: Manim Voiceover is an official Manim Community plugin pathway that allows voiceover text to be attached to scene code and exposes duration tracking for aligning animations.

Use one of three timing modes:

  1. Silent/visual-first: no narration; all meaning must be readable from visuals, titles, labels, and captions.
  2. Narration-led: record or synthesize voice first, then time animations to the audio.
  3. Code-led with voiceover plugin: use Manim Voiceover or a similar workflow to bind narration text to scene blocks and use tracker durations.

Production heuristics:

Voiceover timing pattern:

from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.recorder import RecorderService

class SlopeIntro(VoiceoverScene):
    def construct(self):
        self.set_speech_service(RecorderService())
        axes = Axes(x_range=[0, 4], y_range=[0, 4]).add_coordinates()
        line = axes.plot(lambda x: x, x_range=[0, 3], color=YELLOW)

        with self.voiceover(text="A line's slope tells us how fast y rises as x moves right.") as tracker:
            self.play(Create(axes), run_time=tracker.duration * 0.35)
            self.play(Create(line), run_time=tracker.duration * 0.65)

Accessibility and safety

Documented fact: WCAG 2.2 requires captions for prerecorded audio in synchronized media at Level A, except when the media is clearly labeled as a media alternative for text. WCAG 2.2 also includes a Level A flashing criterion: content should not flash more than three times in any one-second period unless below defined thresholds.

Production requirements:

Escalate if the client requires formal accessibility conformance, regulated education compliance, medical/safety instruction, or public-sector delivery. Provide production evidence, but do not give legal advice.

Asset custody and provenance

Maintain an asset ledger for every external input:

Documented fact: C2PA Content Credentials store provenance data in C2PA manifests; the specification explicitly warns that provenance data should not be treated as a value judgment about whether content is good or bad.

Production rules:

Escalate for copyrighted textbook figures, proprietary datasets, brand assets without permission, student/medical/personal data, or any requirement that provenance metadata be legally binding.

Render settings and delivery

Documented fact: Manim renders scene classes from files and writes output under a media directory by default, with quality-dependent output folders. Manim v0.19.0 documentation states that external FFmpeg was replaced with PyAV for core Manim installation, but FFmpeg remains useful for post-processing and delivery transcodes.

Development workflow:

Typical Manim commands to adapt after checking current docs:

manim -pql scenes/main.py SceneName      # quick local preview
manim -pqm scenes/main.py SceneName      # medium review
manim -pqh scenes/main.py SceneName      # high-quality review
manim -p --format=png scenes/main.py SceneName  # spot-check stills if supported in current version

Typical FFmpeg finishing tasks:

Re-check platform delivery specs at production time. Social, LMS, broadcast, conference, and ad platforms change accepted codecs, aspect ratios, caption formats, file size limits, and safe-area overlays.

Reproducibility package

For every serious Manim explainer, hand off:

If the project uses generated voice, generated music, or external APIs, include enough metadata to reproduce or replace the asset. Do not assume API outputs are exactly reproducible unless the provider guarantees it and seeds/settings were recorded.

QA workflow

Run QA in layers:

  1. Code QA: imports cleanly, scene class names correct, no missing files, no hardcoded absolute paths unless intentional, dependencies recorded.
  2. Render QA: preview render completes; final render completes; no cropped labels, overlapping captions, invisible text, missing glyphs, broken SVGs, or stuttering.
  3. Pedagogy QA: each beat answers "what should the viewer learn now?"; no unexplained symbols; no visual contradiction with narration.
  4. Technical correctness QA: formulas, units, graph scales, algorithms, and data transformations are reviewed by sources/SME when needed.
  5. Accessibility QA: captions/transcript, contrast, color independence, mobile readability, flashing risk, motion comfort.
  6. Delivery QA: final file opens, audio sync is correct, duration/aspect/codec meet target specs, captions are in the requested format.
  7. Provenance QA: sources and generated assets are logged; required permissions and Content Credentials workflow are handled or escalated.

Use render-in-the-loop repair. When a render fails, inspect the first traceback, isolate the smallest scene, patch the cause, and rerender that scene before attempting the full video.

Common failure modes and repairs:

Example: calculus micro-explainer

Example intent: create a 45-second narrated animation explaining "derivative as instantaneous rate of change" for high-school students.

Storyboard excerpt:

| Time | Narration | Visual | Animation | QA |

|---|---|---|---|---|

| 0-5s | "Average speed is distance over time." | Two points on a curve | Draw secant line between points | Labels readable |

| 5-15s | "Shrink the time window." | Same curve and secant | Move second point toward first | Dot follows curve; no axis mismatch |

| 15-28s | "The secant becomes a tangent." | Tangent at point | Transform secant to tangent | Formula matches visual |

| 28-40s | "That limiting slope is the derivative." | f'(x) formula | Highlight \Delta x \to 0 then f'(x) | Formula color ledger |

| 40-45s | Recap | Curve, tangent, concise caption | Fade nonessential labels | Caption safe area |

Example Manim scene:

from manim import *

class DerivativeAsLimit(Scene):
    def construct(self):
        self.camera.background_color = "#0B1020"
        axes = Axes(
            x_range=[0, 4, 1],
            y_range=[0, 5, 1],
            x_length=7,
            y_length=4.5,
            axis_config={"color": "#8A93A6", "include_numbers": True},
        ).to_edge(DOWN)
        labels = axes.get_axis_labels(MathTex("t"), MathTex("s(t)"))

        curve = axes.plot(lambda x: 0.45 * (x - 1) ** 2 + 1, x_range=[0.2, 3.8], color="#4CC9F0")

        x0 = 1.35
        dx_tracker = ValueTracker(1.8)

        p0 = always_redraw(lambda: Dot(axes.c2p(x0, 0.45 * (x0 - 1) ** 2 + 1), color="#FFD166"))
        p1 = always_redraw(lambda: Dot(
            axes.c2p(x0 + dx_tracker.get_value(), 0.45 * (x0 + dx_tracker.get_value() - 1) ** 2 + 1),
            color="#80ED99",
        ))

        secant = always_redraw(lambda: Line(
            p0.get_center(),
            p1.get_center(),
            color="#FFD166",
        ).set_stroke(width=5))

        formula = MathTex(
            r"\text{slope}", r"=", r"\frac{\Delta s}{\Delta t}",
            font_size=48,
        ).to_edge(UP)
        formula.set_color_by_tex(r"\Delta", "#FFD166")

        limit_formula = MathTex(
            r"f'(t)", r"=", r"\lim_{\Delta t \to 0}", r"\frac{\Delta s}{\Delta t}",
            font_size=48,
        ).to_edge(UP)
        limit_formula.set_color_by_tex(r"\Delta", "#FFD166")
        limit_formula.set_color_by_tex(r"f'", "#80ED99")

        self.play(Create(axes), Write(labels))
        self.play(Create(curve))
        self.play(FadeIn(p0), FadeIn(p1), Create(secant), Write(formula))
        self.wait(0.5)
        self.play(dx_tracker.animate.set_value(0.18), run_time=4, rate_func=smooth)
        self.play(TransformMatchingTex(formula, limit_formula))
        self.play(Circumscribe(limit_formula[0], color="#80ED99"))
        self.wait(1)

Why this structure works:

Likely revisions:

Example: algorithm explainer

Example intent: 60-second animation explaining binary search to a beginner.

Production plan:

Example visual state structure:

values = [2, 5, 8, 12, 16, 23, 38]
boxes = VGroup(*[
    VGroup(Square(side_length=0.7), Text(str(v), font_size=24)).arrange(ORIGIN)
    for v in values
]).arrange(RIGHT, buff=0.12)

low_arrow = Arrow(DOWN, UP, color=BLUE).scale(0.45)
mid_arrow = Arrow(DOWN, UP, color=YELLOW).scale(0.45)
high_arrow = Arrow(DOWN, UP, color=GREEN).scale(0.45)

QA checks:

Example: data explainer

Example intent: animate a small dataset showing how a moving average smooths noise.

Production plan:

QA checks:

Sources and verification dates

Sources accessed July 11, 2026:

Volatile facts to re-check at production time:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.