
Manim
- 407 installs
- 30.1k repo stars
- Updated August 4, 2026
- davila7/claude-code-templates
manim is a Claude Code skill that programs explanatory math and concept animations with the Manim library for developers who need tutorial videos, course modules, launch explainers, and technical storytelling assets.
About
manim from davila7/claude-code-templates is a Claude Code skill that guides agents to author Manim Python scenes for explanatory math and concept animations. Manim renders vector motion graphics suited to step-by-step derivations, algorithm visualizations, and narrated technical explainers commonly used in course modules, launch videos, and internal training. The skill helps developers translate mathematical or systems concepts into scripted scenes, camera moves, and timed transitions instead of hand-editing timeline tools. Reach for manim when a project needs reproducible animation source code checked into a repo, batch-rendered clips for documentation sites, or consistent visual language across a tutorial series. It complements static docs and slide decks by turning equations, data flows, and geometric intuition into programmatic video assets developers can re-render after code changes.
- Scene and timeline structuring
- LaTeX and label placement patterns
- Camera moves and transitions
- Reusable animation primitives
- Render settings for crisp exports
Manim by the numbers
- 407 all-time installs (skills.sh)
- Ranked #40 of 290 Python skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/davila7/claude-code-templates --skill manimAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 407 |
|---|---|
| repo stars | ★ 30.1k |
| Last updated | August 4, 2026 |
| Repository | davila7/claude-code-templates ↗ |
How do you code math explainer animations with Manim?
Program explanatory math and concept animations with Manim for tutorials, course modules, launch explainers, and technical storytelling assets.
Who is it for?
Developers producing programmatic math or CS explainer videos who want Manim scene code generated and iterated inside an agent session.
Skip if: Teams needing motion-design in After Effects, real-time game cinematics, or photo/video editing workflows without code-driven animation.
When should I use this skill?
User asks for Manim animations, math visualization videos, algorithm explainers, or programmatic tutorial motion graphics.
What you get
Manim Python scene scripts and rendered animation clips for tutorials, courses, and technical explainers.
- Manim scene Python scripts
- Rendered animation video clips
Files
Manim Community - Mathematical Animation Engine
Comprehensive skill set for creating mathematical animations using Manim Community, a Python framework for creating explanatory math videos programmatically, popularized by 3Blue1Brown.
When to use
Use this skill whenever you are dealing with Manim code to obtain domain-specific knowledge about:
- Creating mathematical animations and visualizations
- Building educational video content programmatically
- Working with geometric shapes and transformations
- Animating LaTeX equations and mathematical formulas
- Creating graphs, charts, and coordinate systems
- Implementing scene-based animation sequences
- Rendering high-quality mathematical diagrams
- Building explanatory visual content for teaching
Core Concepts
Manim allows you to create animations using:
- Scenes: Canvas for your animations where you orchestrate mobjects
- Mobjects: Mathematical objects that can be displayed (shapes, text, equations)
- Animations: Transformations applied to mobjects (Write, Create, Transform, FadeIn)
- Transforms: Morphing between different states of mobjects
- LaTeX Integration: Native support for rendering mathematical notation
- Python Simplicity: Use Python to programmatically specify animation behavior
Key Features
- Precise mathematical object positioning and transformations
- Native LaTeX rendering for equations and formulas
- Extensive shape library (circles, rectangles, arrows, polygons)
- Coordinate systems and function graphing
- Boolean operations on geometric shapes
- Camera controls and scene management
- High-quality video rendering
- IPython/Jupyter notebook integration
- VS Code extension with live preview
How to use
Read individual rule files for detailed explanations and code examples:
Core Concepts
- [references/scenes.md](references/scenes.md) - Creating scenes and organizing animations
- [references/mobjects.md](references/mobjects.md) - Understanding mathematical objects and shapes
- [references/animations.md](references/animations.md) - Core animation types and techniques
- [references/latex.md](references/latex.md) - Rendering LaTeX equations and formulas
For additional topics including transforms, timing, shapes, coordinate systems, 3D animations, camera movement, and advanced features, refer to the comprehensive Manim Community documentation.
Quick Start Example
from manim import *
class SquareToCircle(Scene):
def construct(self):
# Create a square
square = Square()
square.set_fill(BLUE, opacity=0.5)
# Create a circle
circle = Circle()
circle.set_fill(RED, opacity=0.5)
# Animate square creation
self.play(Create(square))
self.wait(1)
# Transform square into circle
self.play(Transform(square, circle))
self.wait(1)
# Fade out
self.play(FadeOut(square))Render with: manim -pql script.py SquareToCircle
Best Practices
1. Inherit from Scene - All animations should be in a class inheriting from Scene 2. Use construct() method - Place all animation code inside the construct() method 3. Think in layers - Add mobjects to the scene before animating them 4. Use self.play() - Animate mobjects using self.play(Animation(...)) 5. Test with low quality - Use -ql flag for faster preview renders 6. Leverage LaTeX - Use Tex() and MathTex() for mathematical notation 7. Group related objects - Use VGroup to manage multiple mobjects together 8. Preview frequently - Use -p flag to automatically open rendered videos
Command Line Usage
# Preview at low quality (fast)
manim -pql script.py SceneName
# Render at high quality
manim -pqh script.py SceneName
# Save last frame as image
manim -s script.py SceneName
# Render multiple scenes
manim script.py Scene1 Scene2Resources
- Documentation: https://docs.manim.community/
- Repository: https://github.com/ManimCommunity/manim
- Examples Gallery: https://docs.manim.community/en/stable/examples.html
- Discord Community: https://www.manim.community/discord/
- 3Blue1Brown Channel: https://www.youtube.com/c/3blue1brown
- License: MIT
Animations in Manim
Animations are transformations applied to mobjects over time. Manim provides a rich set of built-in animations for creating smooth, professional-looking transitions.
Basic Animation Pattern
from manim import *
class BasicAnimation(Scene):
def construct(self):
circle = Circle()
# Play an animation
self.play(Create(circle))
self.wait(1)Creation Animations
Animations for introducing mobjects:
class CreationAnimations(Scene):
def construct(self):
square = Square()
circle = Circle()
text = Text("Hello")
# Create (draw stroke)
self.play(Create(square))
self.wait(0.5)
# Fade in
self.play(FadeIn(circle))
self.wait(0.5)
# Write (for text)
self.play(Write(text))
self.wait(0.5)
# Grow from center
triangle = Triangle()
self.play(GrowFromCenter(triangle))Removal Animations
Animations for removing mobjects:
class RemovalAnimations(Scene):
def construct(self):
shapes = VGroup(*[Circle() for _ in range(4)])
shapes.arrange(RIGHT, buff=0.5)
self.add(shapes)
# Fade out
self.play(FadeOut(shapes[0]))
# Shrink to center
self.play(ShrinkToCenter(shapes[1]))
# Uncreate (reverse of Create)
self.play(Uncreate(shapes[2]))
# Unwrite (reverse of Write)
text = Text("Bye")
self.add(text)
self.play(Unwrite(text))Transform Animations
Morph one mobject into another:
class TransformAnimations(Scene):
def construct(self):
square = Square()
circle = Circle()
self.play(Create(square))
self.wait(0.5)
# Transform (original mobject becomes target)
self.play(Transform(square, circle))
self.wait(0.5)
# ReplacementTransform (replace with new mobject)
triangle = Triangle()
self.play(ReplacementTransform(square, triangle))Movement Animations
class MovementAnimations(Scene):
def construct(self):
circle = Circle()
self.add(circle)
# Shift (relative movement)
self.play(circle.animate.shift(RIGHT * 2))
# Move to (absolute position)
self.play(circle.animate.move_to(UP * 2))
# Rotate
self.play(circle.animate.rotate(PI / 2))
# Scale
self.play(circle.animate.scale(2))The .animate Syntax
Use .animate to smoothly interpolate property changes:
class AnimateSyntax(Scene):
def construct(self):
square = Square()
self.add(square)
# Animate multiple properties at once
self.play(
square.animate
.shift(RIGHT * 2)
.rotate(PI / 4)
.scale(1.5)
.set_fill(BLUE, opacity=0.7)
)Animation Timing
class AnimationTiming(Scene):
def construct(self):
circle = Circle()
self.add(circle)
# Set animation duration (default is 1 second)
self.play(circle.animate.shift(RIGHT * 3), run_time=2)
# Add delay before next animation
self.wait(1.5)
# Fast animation
self.play(circle.animate.shift(LEFT * 3), run_time=0.5)Rate Functions (Easing)
Control animation speed curves:
class RateFunctions(Scene):
def construct(self):
circles = VGroup(*[Circle() for _ in range(3)])
circles.arrange(DOWN, buff=1)
self.add(circles)
# Linear (constant speed)
self.play(
circles[0].animate.shift(RIGHT * 3),
rate_func=linear
)
# Smooth (ease in and out)
self.play(
circles[1].animate.shift(RIGHT * 3),
rate_func=smooth
)
# Bounce
self.play(
circles[2].animate.shift(RIGHT * 3),
rate_func=there_and_back
)Simultaneous Animations
Animate multiple mobjects at once:
class SimultaneousAnimations(Scene):
def construct(self):
circle = Circle()
square = Square()
circle.shift(LEFT * 2)
square.shift(RIGHT * 2)
# Both animations play simultaneously
self.play(
Create(circle),
Create(square)
)
self.play(
circle.animate.shift(UP),
square.animate.shift(DOWN)
)Sequential vs Simultaneous
class SequentialVsSimultaneous(Scene):
def construct(self):
# Sequential (one after another)
c1 = Circle().shift(LEFT * 3)
c2 = Circle()
c3 = Circle().shift(RIGHT * 3)
self.play(Create(c1)) # First
self.play(Create(c2)) # Second
self.play(Create(c3)) # Third
# Simultaneous (all at once)
s1 = Square().shift(LEFT * 3 + DOWN * 2)
s2 = Square().shift(DOWN * 2)
s3 = Square().shift(RIGHT * 3 + DOWN * 2)
self.play(Create(s1), Create(s2), Create(s3)) # All togetherResources
LaTeX in Manim
Manim has native support for rendering LaTeX, making it perfect for mathematical animations and educational content.
MathTex - Mathematical Formulas
from manim import *
class BasicMath(Scene):
def construct(self):
# Simple equation
equation = MathTex(r"E = mc^2")
self.play(Write(equation))
self.wait(2)Tex - Mixed Text and Math
class TexExample(Scene):
def construct(self):
# Mix text and math
formula = Tex(r"The famous equation: $E = mc^2$")
self.play(Write(formula))
self.wait(2)Complex Equations
class ComplexEquations(Scene):
def construct(self):
# Quadratic formula
quadratic = MathTex(
r"x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}"
)
# Integral
integral = MathTex(
r"\int_0^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}"
)
# Matrix
matrix = MathTex(
r"\begin{bmatrix} a & b \\ c & d \end{bmatrix}"
)
formulas = VGroup(quadratic, integral, matrix)
formulas.arrange(DOWN, buff=1)
self.play(Write(formulas))
self.wait(2)Colored Parts
Color specific parts of equations:
class ColoredMath(Scene):
def construct(self):
# Split equation into parts
equation = MathTex(
r"a^2", "+", "b^2", "=", "c^2"
)
# Color individual parts
equation[0].set_color(RED) # a^2
equation[2].set_color(BLUE) # b^2
equation[4].set_color(GREEN) # c^2
self.play(Write(equation))
self.wait(2)Transform Between Equations
class EquationTransform(Scene):
def construct(self):
# Start with one equation
eq1 = MathTex(r"x^2 + y^2 = r^2")
# Transform to another
eq2 = MathTex(r"(x-h)^2 + (y-k)^2 = r^2")
self.play(Write(eq1))
self.wait(1)
self.play(TransformMatchingShapes(eq1, eq2))
self.wait(2)Step-by-Step Derivation
class Derivation(Scene):
def construct(self):
# Create a series of equations
line1 = MathTex(r"x + 5 = 10")
line2 = MathTex(r"x + 5 - 5 = 10 - 5")
line3 = MathTex(r"x = 5")
# Position them
equations = VGroup(line1, line2, line3)
equations.arrange(DOWN, buff=0.8)
# Show derivation step by step
self.play(Write(line1))
self.wait(1)
self.play(TransformMatchingShapes(line1.copy(), line2))
self.wait(1)
self.play(TransformMatchingShapes(line2.copy(), line3))
self.wait(2)Aligned Equations
class AlignedEquations(Scene):
def construct(self):
# Use aligned environment
aligned = MathTex(
r"\begin{aligned}"
r"x + 5 &= 10 \\"
r"x &= 10 - 5 \\"
r"x &= 5"
r"\end{aligned}"
)
self.play(Write(aligned))
self.wait(2)Greek Letters and Symbols
class GreekSymbols(Scene):
def construct(self):
# Common Greek letters
greeks = MathTex(
r"\alpha, \beta, \gamma, \delta, \theta, \pi, \sigma, \omega"
)
# Common symbols
symbols = MathTex(
r"\sum_{i=1}^{n} i = \frac{n(n+1)}{2}"
)
# Limits
limit = MathTex(
r"\lim_{x \to \infty} \frac{1}{x} = 0"
)
group = VGroup(greeks, symbols, limit)
group.arrange(DOWN, buff=1)
self.play(Write(group))
self.wait(2)Font Sizes
class FontSizes(Scene):
def construct(self):
# Different font sizes
small = MathTex(r"E = mc^2").scale(0.5)
normal = MathTex(r"E = mc^2")
large = MathTex(r"E = mc^2").scale(2)
sizes = VGroup(small, normal, large)
sizes.arrange(DOWN, buff=1)
self.play(Write(sizes))
self.wait(2)Highlighting Parts
class HighlightParts(Scene):
def construct(self):
equation = MathTex(
r"f(x) = ax^2 + bx + c"
)
# Create a box around the quadratic term
box = SurroundingRectangle(equation[0][4:7], color=YELLOW)
self.play(Write(equation))
self.wait(1)
self.play(Create(box))
self.wait(2)Resources
Mobjects in Manim
Mobjects (Mathematical Objects) are the building blocks of Manim animations. They represent anything that can be displayed on screen.
Basic Shapes
from manim import *
class BasicShapes(Scene):
def construct(self):
# Circle
circle = Circle(radius=1, color=BLUE)
circle.set_fill(BLUE, opacity=0.5)
# Square
square = Square(side_length=2, color=RED)
# Rectangle
rectangle = Rectangle(width=3, height=1.5, color=GREEN)
# Display them
self.play(Create(circle))
self.play(Create(square))
self.play(Create(rectangle))Common Mobjects
Geometric Shapes
class GeometricShapes(Scene):
def construct(self):
# Basic shapes
circle = Circle()
square = Square()
triangle = Triangle()
pentagon = RegularPolygon(n=5)
# Arrange in a row
shapes = VGroup(circle, square, triangle, pentagon)
shapes.arrange(RIGHT, buff=0.5)
self.play(Create(shapes))Lines and Arrows
class LinesAndArrows(Scene):
def construct(self):
# Line
line = Line(start=LEFT, end=RIGHT, color=BLUE)
# Arrow
arrow = Arrow(start=LEFT, end=RIGHT, color=RED)
# Double arrow
double_arrow = DoubleArrow(start=LEFT * 2, end=RIGHT * 2)
# Vector
vector = Vector(direction=UP + RIGHT)
arrows = VGroup(line, arrow, double_arrow, vector)
arrows.arrange(DOWN, buff=0.5)
self.play(Create(arrows))Mobject Properties
Color and Opacity
class ColorOpacity(Scene):
def construct(self):
circle = Circle()
# Set stroke color
circle.set_stroke(color=BLUE, width=5)
# Set fill
circle.set_fill(RED, opacity=0.7)
self.play(Create(circle))Size and Position
class SizePosition(Scene):
def construct(self):
square = Square()
# Scale
square.scale(2)
# Move
square.shift(UP * 2 + RIGHT * 3)
# Rotate
square.rotate(PI / 4)
self.play(Create(square))Text and LaTeX
class TextExample(Scene):
def construct(self):
# Regular text
text = Text("Hello, Manim!")
# LaTeX text
formula = MathTex(r"e^{i\pi} + 1 = 0")
# Equation
equation = Tex(r"The famous equation: $E = mc^2$")
group = VGroup(text, formula, equation)
group.arrange(DOWN, buff=1)
self.play(Write(text))
self.play(Write(formula))
self.play(Write(equation))Grouping Mobjects
class GroupingExample(Scene):
def construct(self):
# Create multiple circles
circles = VGroup(*[Circle(radius=0.5) for _ in range(5)])
# Arrange them
circles.arrange(RIGHT, buff=0.3)
# Apply color gradient
circles.set_color_by_gradient(BLUE, RED)
# Animate all at once
self.play(Create(circles))
# Animate each individually
self.play(*[circle.animate.shift(UP) for circle in circles])Custom Mobjects
class CustomMobject(VMobject):
def __init__(self, **kwargs):
super().__init__(**kwargs)
# Add custom shape construction
self.set_points_as_corners([
LEFT, UP, RIGHT, DOWN, LEFT
])
self.set_fill(BLUE, opacity=0.5)
class CustomExample(Scene):
def construct(self):
custom = CustomMobject()
self.play(Create(custom))Resources
Scenes in Manim
Scenes are the canvas for your animations. All Manim code is organized within Scene classes, and each scene represents a complete animation sequence.
Basic Scene Structure
from manim import *
class MyScene(Scene):
def construct(self):
# All animation code goes here
circle = Circle()
self.play(Create(circle))
self.wait(1)Scene Types
Manim provides different scene types for different purposes:
Standard Scene
class BasicScene(Scene):
def construct(self):
text = Text("Hello, Manim!")
self.play(Write(text))
self.wait(2)Moving Camera Scene
For scenes with camera movement:
class CameraScene(MovingCameraScene):
def construct(self):
circle = Circle()
self.play(Create(circle))
# Zoom in on the circle
self.play(self.camera.frame.animate.scale(0.5))
self.wait(1)3D Scene
For three-dimensional animations:
class ThreeDExample(ThreeDScene):
def construct(self):
axes = ThreeDAxes()
sphere = Sphere()
self.set_camera_orientation(phi=75 * DEGREES, theta=30 * DEGREES)
self.play(Create(axes), Create(sphere))
self.begin_ambient_camera_rotation(rate=0.1)
self.wait(5)Adding and Removing Mobjects
class AddRemoveScene(Scene):
def construct(self):
circle = Circle()
square = Square()
# Add without animation
self.add(circle)
self.wait(1)
# Add with animation
self.play(Create(square))
self.wait(1)
# Remove without animation
self.remove(circle)
self.wait(1)
# Remove with animation
self.play(FadeOut(square))Scene Methods
Common scene methods:
class SceneMethods(Scene):
def construct(self):
circle = Circle()
# Add mobject to scene
self.add(circle)
# Play animation
self.play(circle.animate.shift(RIGHT * 2))
# Wait (pause)
self.wait(2)
# Remove mobject
self.remove(circle)
# Clear all mobjects
self.clear()Multiple Scenes in One File
from manim import *
class Scene1(Scene):
def construct(self):
circle = Circle()
self.play(Create(circle))
class Scene2(Scene):
def construct(self):
square = Square()
self.play(Create(square))
# Render specific scene:
# manim script.py Scene1
# manim script.py Scene2Resources
Related skills
How it compares
Choose manim when animation must be code-driven and re-renderable; use image or slide skills for static diagrams only.
FAQ
What does the manim skill generate?
The manim skill generates Manim Python scene code and guidance for rendering explanatory math and concept animations used in tutorials, course modules, launch explainers, and technical storytelling assets.
When should developers use manim over static docs?
manim fits when concepts need timed motion—equation steps, geometric transforms, or algorithm flows—where reproducible Python scene code beats one-off slide or screenshot updates.