Co-Pilot / 辅助式
更新于 a month ago

manim_skill

Aadithya-s-k
0.1k
adithya-s-k/manim_skill
80
Agent 评分

💡 摘要

为 Manim 社区版和 ManimGL 两个动画框架提供最佳实践和代码示例的 AI 智能体技能集合。

🎯 适合人群

制作视频课程的数学和科学教育者辅助生成 Manim 代码的 AI 智能体数据可视化开发者技术内容创作者动画库的开源贡献者

🤖 AI 吐槽:这就像为同一语言的两种方言编了一本双语词典,但你仍然需要学习如何说话。

安全分析中风险

README 描述了通过 shell 命令安装和执行 Python 包(manim, manimgl)及系统工具(FFmpeg, LaTeX),这带来了固有的供应链和任意代码执行风险。缓解措施:使用虚拟环境并在安装前验证软件包签名。

Manim Skills Repository

Visitors GitHub stars GitHub forks GitHub issues License

⚡ Quick Start: Add both Manim skills to your AI agent instantly:

npx skills add adithya-s-k/manim_skill

A comprehensive collection of best practices, patterns, and examples for both Manim Community Edition and ManimGL (3Blue1Brown's version). This repository provides battle-tested code examples and guidelines for creating mathematical animations.

📚 About the Two Versions

Manim Community Edition (manim)

  • Repository: https://github.com/ManimCommunity/manim
  • Focus: Community-maintained, stable, well-documented
  • Best For: Production use, educational content, collaborative projects
  • Command: manim CLI
  • Import: from manim import *

ManimGL (manimgl)

  • Repository: https://github.com/3b1b/manim
  • Focus: Grant Sanderson's (3Blue1Brown) original version with OpenGL rendering
  • Best For: Interactive development, 3D scenes, rapid prototyping
  • Command: manimgl CLI
  • Import: from manimlib import *

Important: These are separate, incompatible frameworks. Code written for one will not work with the other without modifications.


🚀 Installation

Prerequisites (Both Versions)

  1. Python 3.7+ - Required
  2. FFmpeg - For video encoding
  3. LaTeX - For mathematical typesetting (TeX Live, MiKTeX, or MacTeX)

Install FFmpeg

macOS:

brew install ffmpeg

Ubuntu/Debian:

sudo apt update sudo apt install ffmpeg

Windows: Download from https://ffmpeg.org/download.html and add to PATH

Install LaTeX

macOS:

brew install mactex

Ubuntu/Debian:

sudo apt install texlive-full

Windows: Install MiKTeX from https://miktex.org/download


Installing Manim Community Edition

# Using pip pip install manim # Using uv (recommended for this project) uv pip install manim # Verify installation manim --version

Documentation: https://docs.manim.community/


Installing ManimGL

# Using pip pip install manimgl # Using uv (recommended for this project) uv pip install manimgl # Verify installation manimgl --version

Additional macOS (ARM) requirement:

arch -arm64 brew install pkg-config cairo

🔌 Skills.sh Integration

This repository provides two AI Agent Skills that can be installed with a single command using skills.sh:

Install with npx (Recommended)

# Install Manim Community Edition best practices npx skills add adithya-s-k/manim_skill/skills/manimce-best-practices # Install ManimGL best practices npx skills add adithya-s-k/manim_skill/skills/manimgl-best-practices # Or install both npx skills add adithya-s-k/manim_skill/skills/manimce-best-practices adithya-s-k/manim_skill/skills/manimgl-best-practices

What are Skills?

Skills are reusable capabilities for AI coding agents. Once installed, your AI assistant (like Claude, GitHub Copilot, or Cursor) automatically gains access to:

  • ✅ Domain-specific best practices
  • ✅ Working code examples
  • ✅ Common patterns and anti-patterns
  • ✅ Framework-specific knowledge

The skills follow the Agent Skills open standard and work across multiple AI tools.

When Skills Activate

manimce-best-practices - Automatically loads when:

  • You import from manim import *
  • You use the manim CLI command
  • You work with Scene classes, mathematical animations, or LaTeX rendering
  • You create educational videos or visual explanations with Manim Community

manimgl-best-practices - Automatically loads when:

  • You import from manimlib import *
  • You use the manimgl CLI command
  • You work with InteractiveScene, 3D rendering, or camera frame control
  • You use interactive mode with .embed() or checkpoint_paste()

📖 Using This Repository

Repository Structure

manim_skill/
├── skills/
│   ├── manimce-best-practices/     # Manim Community Edition skills
│   │   ├── SKILL.md                # Skill metadata
│   │   └── rules/                  # Individual best practice guides
│   │       ├── animations.md
│   │       ├── scenes.md
│   │       ├── mobjects.md
│   │       └── ...
│   │
│   └── manimgl-best-practices/     # ManimGL skills
│       ├── SKILL.md
│       └── rules/
│           ├── animations.md
│           ├── 3d.md
│           ├── camera.md
│           └── ...
│
└── tests/
    ├── manimce/                    # Tests for Community Edition
    └── manimgl/                    # Tests for ManimGL

What's Inside Each Skill File?

Each .md file contains:

  • Best practices for specific Manim features
  • Working code examples (all tested!)
  • Common patterns and use cases
  • Pitfalls to avoid
  • API differences between versions

🎯 Quick Start Examples

Manim Community Edition

from manim import * class BasicExample(Scene): def construct(self): circle = Circle() circle.set_fill(BLUE, opacity=0.5) circle.set_stroke(BLUE_E, width=4) self.play(Create(circle)) self.wait()

Run it:

manim -pql scene.py BasicExample # -p: preview after rendering # -q: quality (l=low, m=medium, h=high)

ManimGL

from manimlib import * class BasicExample(InteractiveScene): def construct(self): circle = Circle() circle.set_fill(BLUE, opacity=0.5) circle.set_stroke(BLUE_E, width=4) self.play(ShowCreation(circle)) self.wait()

Run it:

manimgl scene.py BasicExample --write_file # --write_file: save video output # -s: skip to last frame # -w: write file without opening

🧪 Running Tests

This repository includes comprehensive tests to ensure all code examples work correctly.

Test Manim Community Edition Skills

# Test all files uv run python tests/manimce/test_all_skills.py # Test specific file uv run python tests/manimce/test_all_skills.py animations.md # Run with multiple workers (faster) uv run python tests/manimce/test_all_skills.py -j 4

Test ManimGL Skills

# Test all files uv run python tests/manimgl/test_all_skills.py # Test specific file uv run python tests/manimgl/test_all_skills.py 3d.md # Run with multiple workers (use caution - can cause OOM) uv run python tests/manimgl/test_all_skills.py -j 4

Note: Parallel testing with many workers can cause out-of-memory errors. Use 4-6 workers max, or test files individually.


🔍 Key Differences Between Versions

| Feature | Manim Community | ManimGL | |---------|----------------|---------| | Import | from manim import * | from manimlib import * | | CLI Command | manim | manimgl | | Scene Base Class | Scene, MovingCameraScene | Scene, InteractiveScene | | Creation Animation | Create() | ShowCreation() | | Text Class | Text(), MathTex() | Text(), Tex() | | 3D Rendering | Limited | Full OpenGL support | | Interactive Mode | No | Yes (-se flag, .embed()) | | Camera Control | MovingCameraScene | self.camera.frame | | Configuration | Python config | YAML files | | Color Constants | Same | Same + variations (e.g., BLUE_A, BLUE_E) |


📚 Exploring Skills

For Manim Community Edition:

Start with these guides in skills/manimce-best-practices/rules/:

  1. scenes.md - Scene structure and lifecycle
  2. animations.md - Basic animation patterns
  3. mobjects.md - Creating and manipulating objects
  4. colors.md - Color systems and styling
  5. text.md - Text and LaTeX rendering

For ManimGL:

Start with these guides in skills/manimgl-best-practices/rules/:

  1. scenes.md - Scene types and InteractiveScene
  2. animations.md - Animation fundamentals
  3. camera.md - Camera movement and 3D orientation
  4. 3d.md - 3D object creation and rendering
  5. interactive.md - Interactive development workflow

🤝 Contributing

Found an issue with an example? Want to add a new best practice?

  1. Ensure your code example works with the target Manim version
  2. Add it to the appropriate skill file
  3. Run the tests to verify: uv run python tests/<version>/test_all_skills.py <filename>
  4. Submit a pull request

📄 License

This repository is licensed under the MIT License - see the LICENSE file for details.

Note: This license applies to the educational materials and code examples in this repository. The underlying Manim frameworks (Manim Community Edition and ManimGL) have their own respective licenses.


🔗 Resources

Manim Community Edition

  • Documentation: https://docs.manim.community/
  • Discord: https://www.manim.community/discord/
  • GitHub: https://github.com/ManimCommunity/manim

ManimGL

  • Documentation: https://3b1b.github.io/manim/
  • GitHub: https://github.com/3b1b/manim
  • Tutorial Videos: Grant's YouTube channel

General

  • 3Blue1Brown: https://www.youtube.com/@3blue1brown
  • Manim Community: https://www.manim.community/

⚠️ Troubleshooting

Common Issues

"Command not found: manim/manimgl"

  • Verify installation: pip list | grep manim
  • Check PATH configuration
  • Try: python -m manim or python -m manimlib

LaTeX errors

  • Install full LaTeX distribution (not basic)
  • ManimCE: Try manim --tex_template <template> with different templates
  • ManimGL: Check `custom_defaults.y
五维分析
清晰度8/10
创新性6/10
实用性9/10
完整性9/10
可维护性8/10
优缺点分析

优点

  • 清晰区分了两个主要的 Manim 分支
  • 提供了经过测试的可用代码示例
  • 通过 skills.sh 与 AI 智能体生态系统集成
  • 包含全面的安装和故障排除指南

缺点

  • 管理两个不兼容框架的复杂性
  • 需要大量的系统依赖(FFmpeg, LaTeX)
  • 并行测试可能导致内存不足错误
  • 主要是文档而非可执行工具

相关技能

pytorch

S
toolCode Lib / 代码库
92/ 100

“它是深度学习的瑞士军刀,但祝你好运能从47种安装方法里找到那个不会搞崩你系统的那一个。”

agno

S
toolCode Lib / 代码库
90/ 100

“它承诺成为智能体领域的Kubernetes,但得看开发者有没有耐心学习又一个编排层。”

nuxt-skills

S
toolCo-Pilot / 辅助式
90/ 100

“这本质上是一份组织良好的小抄,能把你的 AI 助手变成一只 Nuxt 框架的复读机。”

免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。

版权归原作者所有 adithya-s-k.