math-to-manim

Math-To-Manim: Reverse Knowledge Tree Animation Pipeline

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "math-to-manim" with this command: npx skills add harleycoops/math-to-manim/harleycoops-math-to-manim-math-to-manim

Math-To-Manim: Reverse Knowledge Tree Animation Pipeline

Transform any concept into professional mathematical animations using a six-agent workflow that requires NO training data - only pure LLM reasoning.

Core Innovation: Reverse Knowledge Tree

Instead of training on example animations, this system recursively asks: "What must I understand BEFORE this concept?" This builds pedagogically sound animations that flow naturally from foundation concepts to advanced topics.

When to Use This Skill

Invoke this workflow when:

  • Creating mathematical or scientific animations

  • Building educational visualizations with Manim

  • Generating code from conceptual explanations

  • Needing pedagogically structured content progression

The Six-Agent Pipeline

Agent 1: ConceptAnalyzer

Parse user intent to extract:

  • Core concept (specific topic name)

  • Domain (physics, math, CS, etc.)

  • Level (beginner/intermediate/advanced)

  • Goal (learning objective)

Agent 2: PrerequisiteExplorer (Key Innovation)

Recursively build knowledge tree:

  • Ask: "What are the prerequisites for [concept]?"

  • For each prerequisite, recursively ask the same question

  • Stop when hitting foundation concepts (high school level)

  • Build DAG structure with depth tracking

Foundation detection criteria: Would a high school graduate understand this without further explanation?

Agent 3: MathematicalEnricher

For each node in the tree, add:

  • LaTeX equations (2-5 key formulas)

  • Variable definitions and interpretations

  • Worked examples with typical values

  • Complexity-appropriate rigor

Agent 4: VisualDesigner

For each node, design:

  • Visual elements (graphs, 3D objects, diagrams)

  • Color scheme (maintain consistency)

  • Animation sequences (FadeIn, Transform, etc.)

  • Camera movements and transitions

  • Duration and pacing

Agent 5: NarrativeComposer

Walk tree from foundation to target:

  • Topologically sort nodes

  • Generate 200-300 word segment per concept

  • Include exact LaTeX, colors, animations

  • Stitch into 2000+ token verbose prompt

Agent 6: CodeGenerator

Generate working Manim code:

  • Use Manim Community Edition

  • Handle LaTeX with raw strings: r"$\frac{a}{b}$"

  • Implement all visual specifications

  • Produce runnable Python file

Workflow Execution

To execute this workflow for a user request:

Step 1: Analyze the Concept

Extract intent

analysis = { "core_concept": "quantum tunneling", "domain": "physics/quantum mechanics", "level": "intermediate", "goal": "Understand barrier penetration" }

Step 2: Build Knowledge Tree

Recursively discover prerequisites with max depth of 3-4 levels:

Target: quantum tunneling ├─ wave-particle duality │ ├─ de Broglie wavelength [FOUNDATION] │ └─ Heisenberg uncertainty ├─ Schrödinger equation │ ├─ wave function │ └─ probability density └─ potential barriers [FOUNDATION]

Step 3: Enrich with Mathematics

Add to each node:

  • Primary equations in LaTeX

  • Variable definitions

  • Physical interpretations

Step 4: Design Visuals

Specify for each concept:

  • Elements: ['wave_function', 'potential_barrier']

  • Colors: {'wave': 'BLUE', 'barrier': 'RED'}

  • Animations: ['FadeIn', 'Create', 'Transform']

  • Duration: 15-30 seconds per concept

Step 5: Compose Narrative

Generate verbose prompt with:

  • Scene-by-scene instructions

  • Exact LaTeX formulas

  • Specific animation timings

  • Color and position details

Step 6: Generate Code

Produce complete Python file:

from manim import *

class ConceptAnimation(ThreeDScene): def construct(self): # Implementation following verbose prompt ...

Critical Implementation Details

LaTeX Handling

Always use raw strings for LaTeX:

equation = MathTex(r"E = mc^2")

Color Consistency

Define color palette at scene start and reuse throughout.

Transition Pattern

Connect concepts with smooth animations:

  • Previous concept fades

  • New concept builds from prior elements

  • Use Transform or ReplacementTransform

Verbose Prompt Format

Structure prompts with:

  • Overview section with concept count and duration

  • Scene-by-scene instructions

  • Exact specifications (no ambiguity)

See references/verbose-prompt-format.md for complete template.

Output Files

The pipeline generates:

  • {concept}_prompt.txt

  • Verbose prompt

  • {concept}_tree.json

  • Knowledge tree structure

  • {concept}_animation.py

  • Manim Python code

  • {concept}_result.json

  • Complete metadata

Additional Resources

Reference Files

  • references/reverse-knowledge-tree.md

  • Detailed algorithm explanation

  • references/agent-system-prompts.md

  • All six agent prompts

  • references/verbose-prompt-format.md

  • Complete prompt template

  • references/manim-code-patterns.md

  • Code generation patterns

Example Files

  • examples/pythagorean-theorem/
  • Complete workflow example

Quick Start

For immediate use, follow this simplified pattern:

  • Parse: Extract the core concept from user input

  • Discover: Build prerequisite tree (depth 3-4)

  • Enrich: Add math and visual specs to each node

  • Compose: Generate verbose prompt (2000+ tokens)

  • Generate: Produce working Manim code

The key insight: verbose, specific prompts with exact LaTeX and visual specifications produce dramatically better code than vague descriptions.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

math-to-manim

No summary provided by upstream source.

Repository SourceNeeds Review
Research

Survey Designer

问卷设计工具。创建专业问卷、添加题型、设置逻辑跳转、数据分析、模板库、多格式导出。Survey designer with question types, skip logic, analysis, templates, and export. Use when you need survey designer...

Registry SourceRecently Updated
Research

test

Competitor monitoring, pricing analysis, market positioning, and SWOT generation. Use when you need to track competitor moves, benchmark pricing, analyze mar...

Registry SourceRecently Updated
Research

Agent Fact Check Verify

嚴謹多來源資訊查核與可信度判定技能。用於「查證/核實/核實這個/是真的嗎/是否正確」類請求,整合政府、官方、主流媒體、事實查核站、X(Twitter)、Reddit 等來源,採用內部 100 分制規則化評分(不對使用者公開分數),對外輸出中立且整合式結論。

Registry SourceRecently Updated