transform-animations — Claude Code rule: morphing objects in ManimGL
transform-animations — a rule that teaches Claude Code and Codex how to transform objects in ManimGL — from basic shape morphing to complex function-based transformations. Use it when writing Python animations of mathematical objects.
AGPL-3.0 ★ 78,316 updated 2026-10-24
.claude/rules/transform-animations.mdWhat transform-animations does
This rule covers the core transformation methods in ManimGL: Transform changes an object's appearance without replacing it, ReplacementTransform swaps the source with the target, TransformMatchingTex morphs LaTeX expressions by matching substrings. It includes TransformMatchingShapes for morphing groups of shapes, MoveToTarget for animating to a target state, FadeTransform for crossfades, and rotation and scaling methods.
The rule provides examples for advanced operations: applying custom functions to coordinates (apply_function), transformations on the complex plane (apply_complex_function), and multi-step animation sequences. Each example shows the method signature, key parameters, and when to use each approach.
You need Python and ManimGL installed. The rule goes in .claude/rules/ for Claude Code or .cursor/rules/ for Cursor — the exact path depends on your IDE.
What it helps with
- Morph one shape into another while keeping the original object reference
- Smoothly transform a mathematical formula by matching its parts across expressions
- Animate a transformation of grouped shapes based on their geometry
- Apply a custom mathematical function to an object's coordinates
- Sequentially change object properties: position, scale, and color
Example prompts for the agent
- Transform a circle into a square using
ReplacementTransform - Use
TransformMatchingTexon two equations that share variables - Rotate a cube 90 degrees and then scale it by 2
How to install transform-animations
Manually: put the files in place
.claude/rules/transform-animations.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/transform-animations.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/transform-animations.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/transform-animations.mdManually: put the files in place
.clinerules/transform-animations.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about transform-animations
How do I install transform-animations in Claude Code?
Copy the rule file to .claude/rules/transform-animations.md in your project root. Claude Code will load it automatically the next time you open a Python file. Other IDEs use different paths: .cursor/rules/ for Cursor, .clinerules/ for Cline.
What does transform-animations do?
The rule gives Claude Code and Codex context about ManimGL transformations — methods for morphing shapes, transforming equations, rotating and scaling objects. It shows syntax and explains when to use Transform, ReplacementTransform, or TransformMatchingTex.
What's the difference between Transform and ReplacementTransform?
Transform changes how the source object looks but keeps it in the scene under the same variable. ReplacementTransform removes the source and puts the target in its place — after the animation, only the target object remains. Use Transform if you need to reference the original object later; use ReplacementTransform when you're done with the source.