SKILL.md
SKILL.mdBrowse 17 files
3,117 tokens
12,150 bytes
Token encoding: o200k_base
Snapshot 24fd22b
1---2name: manim-video3description: "Manim CE animations: 3Blue1Brown math/algo videos."4version: 1.0.05author: SHL0MS, Hermes Agent6license: MIT7platforms: [linux, macos, windows]8metadata:9 hermes:10 tags: [Manim, Animation, Math, Video]11 related_skills: []12---13 14# Manim Video Production Pipeline15 16## When to use17 18Use when users request: animated explanations, math animations, concept visualizations, algorithm walkthroughs, technical explainers, 3Blue1Brown style videos, or any programmatic animation with geometric/mathematical content. Creates 3Blue1Brown-style explainer videos, algorithm visualizations, equation derivations, architecture diagrams, and data stories using Manim Community Edition.19 20## Creative Standard21 22This is educational cinema. Every frame teaches. Every animation reveals structure.23 24**Before writing a single line of code**, articulate the narrative arc. What misconception does this correct? What is the "aha moment"? What visual story takes the viewer from confusion to understanding? The user's prompt is a starting point — interpret it with pedagogical ambition.25 26**Geometry before algebra.** Show the shape first, the equation second. Visual memory encodes faster than symbolic memory. When the viewer sees the geometric pattern before the formula, the equation feels earned.27 28**First-render excellence is non-negotiable.** The output must be visually clear and aesthetically cohesive without revision rounds. If something looks cluttered, poorly timed, or like "AI-generated slides," it is wrong.29 30**Opacity layering directs attention.** Never show everything at full brightness. Primary elements at 1.0, contextual elements at 0.4, structural elements (axes, grids) at 0.15. The brain processes visual salience in layers.31 32**Breathing room.** Every animation needs `self.wait()` after it. The viewer needs time to absorb what just appeared. Never rush from one animation to the next. A 2-second pause after a key reveal is never wasted.33 34**Cohesive visual language.** All scenes share a color palette, consistent typography sizing, matching animation speeds. A technically correct video where every scene uses random different colors is an aesthetic failure.35 36## Prerequisites37 38Run `scripts/setup.sh` to verify all dependencies. Requires: Python 3.10+, Manim Community Edition v0.20+ (`pip install manim`), LaTeX (`texlive-full` on Linux, `mactex` on macOS), and ffmpeg. Reference docs tested against Manim CE v0.20.1.39 40## Modes41 42| Mode | Input | Output | Reference |43|------|-------|--------|-----------|44| **Concept explainer** | Topic/concept | Animated explanation with geometric intuition | `references/scene-planning.md` |45| **Equation derivation** | Math expressions | Step-by-step animated proof | `references/equations.md` |46| **Algorithm visualization** | Algorithm description | Step-by-step execution with data structures | `references/graphs-and-data.md` |47| **Data story** | Data/metrics | Animated charts, comparisons, counters | `references/graphs-and-data.md` |48| **Architecture diagram** | System description | Components building up with connections | `references/mobjects.md` |49| **Paper explainer** | Research paper | Key findings and methods animated | `references/scene-planning.md` |50| **3D visualization** | 3D concept | Rotating surfaces, parametric curves, spatial geometry | `references/camera-and-3d.md` |51 52## Stack53 54Single Python script per project. No browser, no Node.js, no GPU required.55 56| Layer | Tool | Purpose |57|-------|------|---------|58| Core | Manim Community Edition | Scene rendering, animation engine |59| Math | LaTeX (texlive/MiKTeX) | Equation rendering via `MathTex` |60| Video I/O | ffmpeg | Scene stitching, format conversion, audio muxing |61| TTS | ElevenLabs / Qwen3-TTS (optional) | Narration voiceover |62 63## Pipeline64 65```66PLAN --> CODE --> RENDER --> STITCH --> AUDIO (optional) --> REVIEW67```68 691. **PLAN** — Write `plan.md` with narrative arc, scene list, visual elements, color palette, voiceover script702. **CODE** — Write `script.py` with one class per scene, each independently renderable713. **RENDER** — `manim -ql script.py Scene1 Scene2 ...` for draft, `-qh` for production724. **STITCH** — ffmpeg concat of scene clips into `final.mp4`735. **AUDIO** (optional) — Add voiceover and/or background music via ffmpeg. See `references/rendering.md`746. **REVIEW** — Render preview stills, verify against plan, adjust75 76## Project Structure77 78```79project-name/80 plan.md # Narrative arc, scene breakdown81 script.py # All scenes in one file82 concat.txt # ffmpeg scene list83 final.mp4 # Stitched output84 media/ # Auto-generated by Manim85 videos/script/480p15/86```87 88## Creative Direction89 90### Color Palettes91 92| Palette | Background | Primary | Secondary | Accent | Use case |93|---------|-----------|---------|-----------|--------|----------|94| **Classic 3B1B** | `#1C1C1C` | `#58C4DD` (BLUE) | `#83C167` (GREEN) | `#FFFF00` (YELLOW) | General math/CS |95| **Warm academic** | `#2D2B55` | `#FF6B6B` | `#FFD93D` | `#6BCB77` | Approachable |96| **Neon tech** | `#0A0A0A` | `#00F5FF` | `#FF00FF` | `#39FF14` | Systems, architecture |97| **Monochrome** | `#1A1A2E` | `#EAEAEA` | `#888888` | `#FFFFFF` | Minimalist |98 99### Animation Speed100 101| Context | run_time | self.wait() after |102|---------|----------|-------------------|103| Title/intro appear | 1.5s | 1.0s |104| Key equation reveal | 2.0s | 2.0s |105| Transform/morph | 1.5s | 1.5s |106| Supporting label | 0.8s | 0.5s |107| FadeOut cleanup | 0.5s | 0.3s |108| "Aha moment" reveal | 2.5s | 3.0s |109 110### Typography Scale111 112| Role | Font size | Usage |113|------|-----------|-------|114| Title | 48 | Scene titles, opening text |115| Heading | 36 | Section headers within a scene |116| Body | 30 | Explanatory text |117| Label | 24 | Annotations, axis labels |118| Caption | 20 | Subtitles, fine print |119 120### Fonts121 122**Use monospace fonts for all text.** Manim's Pango renderer produces broken kerning with proportional fonts at all sizes. See `references/visual-design.md` for full recommendations.123 124```python125MONO = "Menlo" # define once at top of file126 127Text("Fourier Series", font_size=48, font=MONO, weight=BOLD) # titles128Text("n=1: sin(x)", font_size=20, font=MONO) # labels129MathTex(r"\nabla L") # math (uses LaTeX)130```131 132Minimum `font_size=18` for readability.133 134### Per-Scene Variation135 136Never use identical config for all scenes. For each scene:137- **Different dominant color** from the palette138- **Different layout** — don't always center everything139- **Different animation entry** — vary between Write, FadeIn, GrowFromCenter, Create140- **Different visual weight** — some scenes dense, others sparse141 142## Workflow143 144### Step 1: Plan (plan.md)145 146Before any code, write `plan.md`. See `references/scene-planning.md` for the comprehensive template.147 148### Step 2: Code (script.py)149 150One class per scene. Every scene is independently renderable.151 152```python153from manim import *154 155BG = "#1C1C1C"156PRIMARY = "#58C4DD"157SECONDARY = "#83C167"158ACCENT = "#FFFF00"159MONO = "Menlo"160 161class Scene1_Introduction(Scene):162 def construct(self):163 self.camera.background_color = BG164 title = Text("Why Does This Work?", font_size=48, color=PRIMARY, weight=BOLD, font=MONO)165 self.add_subcaption("Why does this work?", duration=2)166 self.play(Write(title), run_time=1.5)167 self.wait(1.0)168 self.play(FadeOut(title), run_time=0.5)169```170 171Key patterns:172- **Subtitles** on every animation: `self.add_subcaption("text", duration=N)` or `subcaption="text"` on `self.play()`173- **Shared color constants** at file top for cross-scene consistency174- **`self.camera.background_color`** set in every scene175- **Clean exits** — FadeOut all mobjects at scene end: `self.play(FadeOut(Group(*self.mobjects)))`176 177### Step 3: Render178 179```bash180manim -ql script.py Scene1_Introduction Scene2_CoreConcept # draft181manim -qh script.py Scene1_Introduction Scene2_CoreConcept # production182```183 184### Step 4: Stitch185 186```bash187cat > concat.txt << 'EOF'188file 'media/videos/script/480p15/Scene1_Introduction.mp4'189file 'media/videos/script/480p15/Scene2_CoreConcept.mp4'190EOF191ffmpeg -y -f concat -safe 0 -i concat.txt -c copy final.mp4192```193 194### Step 5: Review195 196```bash197manim -ql --format=png -s script.py Scene2_CoreConcept # preview still198```199 200## Critical Implementation Notes201 202### Raw Strings for LaTeX203```python204# WRONG: MathTex("\frac{1}{2}")205# RIGHT:206MathTex(r"\frac{1}{2}")207```208 209### buff >= 0.5 for Edge Text210```python211label.to_edge(DOWN, buff=0.5) # never < 0.5212```213 214### FadeOut Before Replacing Text215```python216self.play(ReplacementTransform(note1, note2)) # not Write(note2) on top217```218 219### Never Animate Non-Added Mobjects220```python221self.play(Create(circle)) # must add first222self.play(circle.animate.set_color(RED)) # then animate223```224 225## Performance Targets226 227| Quality | Resolution | FPS | Speed |228|---------|-----------|-----|-------|229| `-ql` (draft) | 854x480 | 15 | 5-15s/scene |230| `-qm` (medium) | 1280x720 | 30 | 15-60s/scene |231| `-qh` (production) | 1920x1080 | 60 | 30-120s/scene |232 233Always iterate at `-ql`. Only render `-qh` for final output.234 235## References236 237| File | Contents |238|------|----------|239| `references/animations.md` | Core animations, rate functions, composition, `.animate` syntax, timing patterns |240| `references/mobjects.md` | Text, shapes, VGroup/Group, positioning, styling, custom mobjects |241| `references/visual-design.md` | 12 design principles, opacity layering, layout templates, color palettes |242| `references/equations.md` | LaTeX in Manim, TransformMatchingTex, derivation patterns |243| `references/graphs-and-data.md` | Axes, plotting, BarChart, animated data, algorithm visualization |244| `references/camera-and-3d.md` | MovingCameraScene, ThreeDScene, 3D surfaces, camera control |245| `references/scene-planning.md` | Narrative arcs, layout templates, scene transitions, planning template |246| `references/rendering.md` | CLI reference, quality presets, ffmpeg, voiceover workflow, GIF export |247| `references/troubleshooting.md` | LaTeX errors, animation errors, common mistakes, debugging |248| `references/animation-design-thinking.md` | When to animate vs show static, decomposition, pacing, narration sync |249| `references/updaters-and-trackers.md` | ValueTracker, add_updater, always_redraw, time-based updaters, patterns |250| `references/paper-explainer.md` | Turning research papers into animations — workflow, templates, domain patterns |251| `references/decorations.md` | SurroundingRectangle, Brace, arrows, DashedLine, Angle, annotation lifecycle |252| `references/production-quality.md` | Pre-code, pre-render, post-render checklists, spatial layout, color, tempo |253 254---255 256## Creative Divergence (use only when user requests experimental/creative/unique output)257 258If the user asks for creative, experimental, or unconventional explanatory approaches, select a strategy and reason through it BEFORE designing the animation.259 260- **SCAMPER** — when the user wants a fresh take on a standard explanation261- **Assumption Reversal** — when the user wants to challenge how something is typically taught262 263### SCAMPER Transformation264Take a standard mathematical/technical visualization and transform it:265- **Substitute**: replace the standard visual metaphor (number line → winding path, matrix → city grid)266- **Combine**: merge two explanation approaches (algebraic + geometric simultaneously)267- **Reverse**: derive backward — start from the result and deconstruct to axioms268- **Modify**: exaggerate a parameter to show why it matters (10x the learning rate, 1000x the sample size)269- **Eliminate**: remove all notation — explain purely through animation and spatial relationships270 271### Assumption Reversal2721. List what's "standard" about how this topic is visualized (left-to-right, 2D, discrete steps, formal notation)2732. Pick the most fundamental assumption2743. Reverse it (right-to-left derivation, 3D embedding of a 2D concept, continuous morphing instead of steps, zero notation)2754. Explore what the reversal reveals that the standard approach hides276 Discovery context
Discovered by repository scan. No exact path reference found in the snapshot’s root AGENTS.md.