An open-source AI-agent Skill for creating 3Blue1Brown-style animated math, calculus, physics, and STEM explainer videos — straight from a prompt.
Give your AI agent the ability to turn "make me a video explaining why the derivative of x² is 2x" into an actual rendered, narrated-quality animation — the kind you'd see on 3Blue1Brown.
Copy this into Claude Code (or any coding agent). It installs the skill if needed, then builds your video — just swap in your own topic on the last line:
Use the "chalktalk" skill to make a 3Blue1Brown-style animated math explainer video.
Skill repo: https://github.com/ahkamboh/chalktalk
If it isn't installed yet, clone it into your skills folder first:
git clone https://github.com/ahkamboh/chalktalk.git ~/.claude/skills/chalktalk
Then read its SKILL.md and follow it end-to-end to create a video explaining:
why the derivative of x² is 2x ← replace with any topic you want
(Above: a frame sequence from the bundled example — the growing-square proof
that d/dx[x²] = 2x.)
This repo is a Skill:
a small, self-contained package of instructions + scripts + references that
teaches an AI coding agent (Claude Code, and any agent that supports the
SKILL.md format) how to do one specialized task really well — here, producing
animated math explainer videos end to end:
- 🧰 Bootstraps the environment — a Python virtualenv, the animation engine,
and the system libraries it needs (cairo / pango / ffmpeg), across macOS &
Linux (
scripts/setup_env.sh). - ✍️ Teaches good scene design — 3b1b narrative principles plus a tested animation cheatsheet.
- 🚫 Works without LaTeX — most machines don't have a multi-GB TeX install,
so it renders math with Pango
Text+ Unicode and documents every hidden-LaTeX trap (DecimalNumber, axis labels) that crashes naïve renders. - 🔍 Verifies before delivering — extracts frames so the agent looks at the layout and catches off-screen / overlapping bugs before the final render.
- 📚 Ships ready-made recipes — derivatives, Riemann sums & integrals, the Fundamental Theorem, limits/ε–δ, the chain rule, Taylor series, vectors.
It is MIT-licensed and free for any AI agent or human to use.
The bundled example, examples/derivative_x2.py,
answers "why is d/dx[x²] = 2x?" two ways — as the slope of the parabola (a
sliding tangent line with a live slope read-out) and as a geometric proof (a
growing square). Render it:
bash scripts/setup_env.sh demo # one-time: venv + engine + system libs
cd demo && source .venv/bin/activate
cp ../examples/derivative_x2.py .
bash ../scripts/render.sh derivative_x2.py DerivativeOfXSquared h # 1080p60
# -> media/videos/derivative_x2/1080p60/DerivativeOfXSquared.mp4Install the skill where Claude Code discovers skills, then just ask:
# personal (all projects):
git clone https://github.com/ahkamboh/chalktalk.git \
~/.claude/skills/chalktalk
# or per-project:
git clone https://github.com/ahkamboh/chalktalk.git \
.claude/skills/chalktalkThen in a session:
"Make a video explaining Riemann sums." "Animate why the chain rule works." "Turn the Fundamental Theorem of Calculus into a 60-second explainer."
The skill triggers automatically — the agent reads SKILL.md, sets up the
environment if needed, writes the scene from the closest recipe, draft-renders,
checks frames, and delivers the final mp4.
The skill is just Markdown + shell + Python. Point your agent at
SKILL.md as the entry point; it links out to the references and
scripts as needed (progressive disclosure).
chalktalk/
├── SKILL.md # entry point: the end-to-end workflow
├── scripts/
│ ├── setup_env.sh # bootstrap venv + engine + cairo/pango/ffmpeg
│ ├── render.sh # render with the right library paths set
│ └── verify_frames.sh # extract frames for visual QA
├── references/
│ ├── animation-cheatsheet.md # core animation API patterns
│ ├── no-latex-mode.md # render math without LaTeX (and the gotchas)
│ └── topic-recipes.md # blueprints: derivatives, integrals, FTC, …
├── examples/
│ └── derivative_x2.py # full working no-LaTeX scene
└── assets/
└── preview.gif
- Python 3.11 or 3.12 (some native dependencies may lack wheels on the very newest Python).
- ffmpeg, plus cairo, pango, pkg-config — installed automatically
by
scripts/setup_env.sh(Homebrew on macOS, apt on Debian/Ubuntu). - LaTeX is NOT required. Install it only if you want publication-grade
typesetting — see
references/no-latex-mode.md.
A full TeX distribution is several gigabytes and a frequent source of
latex not found render failures. For the vast majority of explainers, Pango
Text with Unicode math (x², ∫, Δ, →, …) looks great and just works
everywhere. The skill documents the exact spots where the renderer secretly
calls LaTeX (DecimalNumber, Integer, axis labels) and how to route around
them — and how to opt back into real LaTeX if you want it.
- Inspired by 3Blue1Brown (Grant Sanderson), whose videos defined this visual style of mathematical storytelling.
- This repo is an independent, community skill — not affiliated with or endorsed by 3Blue1Brown.
MIT © 2026 Ali Hamza Kamboh. Use it freely, for agents and humans alike. PRs adding new topic recipes are very welcome.
![Animated proof that d/dx[x²] = 2x](/ahkamboh/chalktalk/raw/main/assets/preview.gif)