| name | manim-video |
| description | Plan, script, render, and stitch Manim Community Edition videos in Python. Use when the user asks for animated math explanations, algorithm walkthroughs, equation derivations, technical concept videos, 3Blue1Brown-style explainers, or programmatic educational motion graphics. |
| user-invocable | true |
| disable-model-invocation | false |
| requires | {"bins":["python3"]} |
| metadata | {"hybridclaw":{"category":"publishing","short_description":"Python-first Manim video pipeline.","tags":["video","animation","manim","python","math"],"install":["[Truncated]","[Truncated]"]}} |
Manim Video
Use this skill for Python-based Manim projects that need a clean planning phase, strong visual direction, reusable scene structure, and a deterministic render pipeline.
The output contract is usually a workspace project directory containing plan.md, script.py, concat.txt, draft renders, and optionally a stitched final.mp4.
Creative Standard
This is educational cinema, not animated slides.
- Make it beautiful and professional. The draft should feel intentional, polished, and presentation-ready, not like a rough internal diagram dump.
- Before writing code, define the narrative arc: confusion -> visual hook -> mechanism -> payoff -> recap.
- Geometry before algebra. Show the shape, motion, system flow, or data change before the formal equation.
- Every scene teaches one dominant idea. If a scene has two unrelated claims, split it.
- Direct attention with opacity layering: primary elements at 1.0, contextual elements around 0.35-0.45, and structural elements like axes or grids around 0.12-0.2.
- Give reveals breathing room. Add
self.wait() after every important animation and make the main aha moment the longest pause.
- Keep one cohesive visual language across the whole project: shared palette, shared timing constants, shared font rules, and stable concept-color meaning.
- Avoid repetitive scenes. Vary dominant color, layout, and entry animation across scenes while keeping the overall palette consistent.
- First-render quality matters. If the layout is cluttered, the typography is inconsistent, or the pacing feels rushed, the scene is not done.
Modes
| Mode | Input | Output | Primary references |
|---|
| Concept explainer | topic or feature | intuitive multi-scene explainer | scene-planning.md, visual-design.md |
| Equation derivation | symbolic expression or proof goal | stepwise animated derivation | equations.md, python-patterns.md |
| Algorithm visualization | algorithm or invariant | stepwise state evolution | graphs-and-data.md, python-patterns.md |
| Data story | metrics, counters, or comparisons | animated charts and deltas | graphs-and-data.md, visual-design.md |
| Architecture diagram | system or service flow | progressive build with data flow | scene-planning.md, python-patterns.md |
| Paper explainer | paper, abstract, or finding | hook -> method -> evidence explainer | scene-planning.md, visual-design.md |
| Camera or 3D explainer | spatial or geometric topic | moving-camera or 3D scene set | camera-and-3d.md, visual-design.md |
Stack
Single Python script per project. No browser, no Node.js, no GPU requirement.
| Layer | Tool | Purpose |
|---|
| Core | Manim Community Edition | scene rendering and animation engine |
| Math | LaTeX via MathTex / Tex | equation rendering |
| Video I/O | ffmpeg | stitching, muxing, and format conversion |
| Narration | subtitles by default, voiceover optional | accessibility and pacing |
| Setup check | check_setup.py | host capability validation and install hints |
Pipeline
PLAN --> CODE --> RENDER --> STITCH --> AUDIO --> REVIEW
PLAN: write plan.md with the narrative arc, misconception, aha moment, palette, typography, and scene beats.
CODE: write script.py with one independently renderable Scene subclass per clip.
RENDER: draft render all scenes at -ql unless a real render blocker prevents it.
STITCH: update concat.txt and stitch a draft video when ffmpeg is available.
AUDIO: add narration or music only when the user asks for it or the project explicitly includes it.
REVIEW: verify timing, readability, clean exits, and overall visual coherence before claiming the output is done.
Creative Direction
Color Palettes
| Palette | Background | Primary | Secondary | Accent | Use case |
|---|
| HybridClaw Dark | #0B1220 | #7DA2FF | #9AB6FF | #7EE3A5 | default for systems, tools, and architecture |
| HybridClaw Light | #F8FAFC | #4A6CF7 | #3657E9 | #15803D | brighter docs-style explainer look |
| HybridClaw Neutral | #111827 | #E5EDF7 | #93A4B8 | #7DA2FF | minimal or formal topics |
Start with a HybridClaw palette unless the user explicitly asks for a different visual language.
Animation Speed
| Context | Typical run_time | Typical self.wait() after |
|---|
| Title or intro hook | 1.2-1.8s | 0.8-1.2s |
| Key equation or mechanism reveal | 1.8-2.2s | 1.5-2.5s |
| Transform or morph | 1.2-1.8s | 1.0-1.5s |
| Supporting annotation | 0.6-1.0s | 0.3-0.6s |
| Fade-out cleanup | 0.4-0.7s | 0.2-0.4s |
| Aha moment | 2.0-2.8s | 2.0-3.0s |
Typography Scale
| Role | Font size | Usage |
|---|
| Title | 34-38 | scene titles and opening claims |
| Heading | 28-32 | section headers within a scene |
| Body | 20-24 | explanatory text |
| Label | 18-20 | annotations, axis labels, component names |
| Caption | 18 | subtitles and supporting notes |
Font Rules
| Text type | Default choice | Notes |
|---|
| Titles and sentence copy | Text(..., font=SANS) | prefer a clean sans like SANS = "Avenir Next" or another installed equivalent |
| Styled inline emphasis | MarkupText(..., font=SANS) | best for colored spans or bold fragments |
| Code-like labels | Text(..., font=MONO) | use MONO = "Menlo" only for identifiers, commands, chips, or short technical tags |
| Math | MathTex(...) / Tex(...) | requires LaTeX |
Minimum readable text size is font_size=18.
Text density rules:
- If more than 4 text elements are strongly visible, reduce body text toward
20-24 instead of 26-30.
- Keep title/subtitle stacks to 2 text blocks. If a third block is needed, move it to a side label, caption, or a new scene.
- Clamp all titles before
.to_edge(...), for example fit_text(title, max_width=11.0).
- Clamp any potentially long text block to the usable frame width instead of trusting the raw
font_size.
- If a width-clamped title still feels oversized, lower it toward
34-36 or split it into 2 lines. Do not keep a full-sentence title at 48.
- Do not write new text on top of old text in the same area. Use
ReplacementTransform, FadeOut, or a layout shift first.
- Use
buff >= 0.5 for edge-positioned text so draft renders do not clip.
Performance Targets
| Quality | Resolution | FPS | Use case |
|---|
-ql | 854x480 | 15 | draft iteration and timing checks |
-qm | 1280x720 | 30 | text-heavy preview and layout review |
-qh | 1920x1080 | 60 | production export only |
Default Workflow
- Run the bundled setup check first:
python3 skills/manim-video/scripts/check_setup.py
Treat the setup check as advisory by default. Missing manim, ffmpeg, or pdflatex should stop render commands, but it must not stop planning or script editing.
2. If the user wants a new project, create the target directory and write plan.md, script.py, and concat.txt directly. Preserve the exact requested output path.
3. Fill in plan.md before heavy coding. Read references/scene-planning.md and references/visual-design.md when the narrative, pacing, or screen layout is still fuzzy. When the user already gave a topic, draft the audience, teaching objective, misconception, aha moment, narrative arc, palette, typography, subtitle strategy, and scene beats yourself instead of asking the user to fill placeholders.
4. Keep reference loading small. For a normal request, start with only these core references:
- Add only one specialty reference when the task actually needs it:
- Read stage-specific references only when you reach that stage:
- Implement
script.py with one Scene subclass per clip. Use shared constants for palette, typography, and timing. Put subtitles on significant animations, keep scene exits clean, and make every scene independently renderable.
- For ordinary requests like "create a short animation explaining X", do not stop after planning and scripting when rendering is available. Produce a draft render in the same turn: render all scene classes at
-ql, update concat.txt, and stitch a draft video if ffmpeg is available. Render is part of the normal pipeline, not an optional next step.
- Use
manim ... as the default render entry point. A global manim CLI from uv tool install manim is fine. Fall back to python3 -m manim ... only when Manim is installed into the host interpreter but the CLI is unavailable.
- Before production render, run the production checklist in references/production-quality.md. Use
-qh only when the user explicitly asks for a final or high-quality export. For the default one-turn path, a stitched draft render is the finish line. Use for the exact command shapes.
If required tools are missing, the fallback is still useful:
- create
plan.md
- write or revise
script.py
- explain what still needs to be installed
- stop short of claiming a video was rendered
Working Rules
- Keep all project files in the workspace or in a user-specified output directory. Do not write task-specific files under
skills/manim-video/.
- If the user supplies a target directory such as
./tmp/manim-smoke, preserve that path exactly. Do not invent a new directory name, prepend the repo name, or compress the topic into the path.
- Prefer
manim ... as the default render command. python3 -m manim ... is a fallback, not the primary path.
- For explicit planning-only requests such as "just plan it", "only write the files", or "stop after creating files", first run
check_setup.py, then write plan.md, script.py, and concat.txt, then stop and report the created files.
- For ordinary requests such as "create a short animation explaining X", continue through the full pipeline in the same turn: fill
plan.md, write topic-specific script.py, render the draft scenes, and stitch a draft video when possible. Only stop early if the user asked to stop after setup or a real render blocker prevents progress.
- If
check_setup.py reports missing render dependencies, continue with planning and script generation. Only block manim ..., python3 -m manim ..., preview renders, and final stitching when the missing dependency actually matters for that step.
- Do not ask "Would you like me to continue?" or offer a preview-vs-full-render choice for an ordinary create request. If draft rendering is available, do it. Reserve follow-up questions for real blockers, explicit quality choices, or user-directed revisions.
- Treat
plan.md as the source of truth for audience, teaching goal, misconception, palette, typography, scene order, pacing, and scene variation.
- Do not reply that the generated plan is empty or ask the user to provide basic teaching goals, visuals, or narration when those can be inferred from the request.
- Make every scene independently renderable. One class per scene keeps rerenders cheap.
- Prefer visual intuition before dense symbolic derivation. Show the shape or process before the final formula.
- Make every scene look presentation-ready. If the frame feels amateur, cramped, or default-looking, revise layout, typography, spacing, or color before calling it done.
- Use shared constants at the top of
script.py for colors, opacities, fonts, sizes, and timing so scenes stay visually consistent.
- Use a clean sans font for titles, subtitles, and sentence-level copy. Reserve for code-like chips, identifiers, terminal snippets, or very short technical labels.
Common Commands
Setup check:
python3 skills/manim-video/scripts/check_setup.py
Strict render gate:
python3 skills/manim-video/scripts/check_setup.py --strict
Install Manim globally with uv:
uv tool install manim
LaTeX install hints for MathTex and Tex:
brew install --cask mactex-no-gui
sudo apt install texlive-full
sudo dnf install texlive-scheme-full
Create a new project directory:
mkdir -p my-video
cd my-video
Render a draft:
cd my-video
manim -ql script.py Scene1Introduction Scene2Invariant
Host-Python fallback render:
cd my-video
python3 -m manim -ql script.py Scene1Introduction Scene2Invariant
Host-CLI fallback render:
cd my-video
manim -ql script.py Scene1Introduction Scene2Invariant
Preview a still frame:
cd my-video
manim -s -ql script.py Scene2Invariant
Stitch clips:
ffmpeg -y -f concat -safe 0 -i concat.txt -c copy final.mp4
References
Validation
Run:
python3 skills/skill-creator/scripts/quick_validate.py skills/manim-video