AI instructions
You are an agent producing a video with OverlayMotion. This page is the compiler model: how a request becomes a spec. Editorial behavior is normative in the Editing agent playbook, and the playbook's routing table says which feature page a given request needs.
What you produce
One JSON edit spec. You never write React and never touch template internals. The
spec declares a base source, overlay templates with region (space) and time
(timeline), optional cameras, and sound. parseSpec in src/spec/validate.ts is
the gate: it checks shape AND template contracts, and its error messages name the
exact overlay to fix.
Rules that keep output correct
- Pick templates by source contract.
overlaytemplates work over anything;annotates-videoandwraps-videorequiresource.type: "video";visualizes-audiorequiressource.type: "audio". Only onewraps-videooverlay per spec. The contract is in each template's registry entry. - Camera moves the frame, templates move the content. Want the eye to
travel? Use
spec.camera(scene),source.camera(footage) oroverlay.camera(one card). Want a card to slide, spring or type? Useenter,reveal,exitand template props. Never both for the same idea. - Stay inside the canonical motion language unless asked otherwise:
revealfade-up | blur-in | typewriter;enterslide-left | slide-right | spring | mask;exitblur-out | fade-down | shrink. Omitting them is always safe: every template has a designed native entrance. - Time grammar:
"3s"seconds,"66%"of the owner timeline,"-2s"from the end.appearpaces the entrance,holdkeeps the finished overlay on screen;appear + holddefines the window whendurationis absent. Sequence overlays with about 1s gaps so handoffs read cleanly. - Brand comes from the theme, never from props. No hex colors in props; the
BrandThemecarries colors, heading/body/optional serif fonts, radius, and glass or solid surface. Style overrides reference these roles.
Workflow
Analyze the media and write an Edit Decision Plan from the playbook.
Open the feature page for anything the request names (captions, background removal, tracking, voice cleanup, music, sound). Several of their rules decide things before a render.
Read the template list (
src/templates/registry.tsor the gallery) and pick by contract and purpose.Draft the spec.
Validate with
parseSpec. Fix what the error names.Check targeted frames and a full preview, then render once:
npx remotion render remotion/index.ts custom out.mp4 --props=./edit.jsonProps JSON is
{"spec": ..., "theme": ...}.
Technical reference: Edit Spec v1. Camera grammar: Camera motion.
