Prompting tips
Ask for animations the editor can edit.
An agent that follows docs/agents.md applies these rules on its own. Without it, add them to your prompt, or to the instructions file of your project, so the code the agent writes stays editable:
- Give every animation, setter, timeline, timeline child, layout and layout transition a unique, descriptive literal
id, such as'Hero title reveal', and every label a unique name. - Use the object form for timeline
call()andsync():call({ id, callback }, position)andsync({ id, target }, position). - Write values inline in each call, not in variables or shared objects.
- Use
stagger()andrandom({ ... })instead of function values, andcubicBezier(),linear(),spring()or a built-in ease such as'out(3)'instead of custom ease functions. - Put shared settings and initial poses in named
utils.set()calls. - Finish each timeline with
init()once everything is added. - Load the editor only in development, before the code that creates the animations.
Example prompt
With the anime.js Editor block in your AGENTS.md, describe only the motion:
Animate the hero section. The title fades up, then the three cards rise
one after another, then the footer fades in. Use one Anime.js timeline.
The agent gives the timeline and every child an id, and keeps the values inline.