Overlay
montaj/overlay is an agent-authored task — no CLI step, no API call. You decide what overlays the video needs, write the JSX files, and add them to the project's visual tracks.
Before writing any JSX, load skill write-overlay — it contains the full JSX authoring reference (globals, interpolate/spring utilities, canvas rules, examples).
Sub-skills
| Name | When to load |
|------|--------------|
| write-overlay | Before writing any JSX overlay — globals, interpolate/spring utilities, canvas rules, examples. |
| image-search | When the prompt asks to source outside imagery (a photo of a person, a logo, an event/B-roll still) — find via search_images + download via fetch_image, then place as an image clip on tracks[1+]. |
Process
1. Read the editing prompt and transcripts
The prompt tells you the tone and intent. The transcript tells you the moments worth annotating. Read both before deciding what to write. Read the speech with the speech_text step (one line per phrase), not the transcribe words JSON.
2. Decide what overlays to write
Decide from the prompt and the transcript what the video needs that isn't already in the footage.
If the prompt asks you to source images ("add a photo of X", "find images of the IPO"), load skill image-search to find them via search_images and download via fetch_image, then add each as a type: "image" clip on tracks[1+]. A still photo is an image clip, not an overlay; overlays are animated graphics.
If the prompt says "no overlays" — write nothing.
Placement and timing constraints
- Never hardcode frame counts; projects can be 24, 30 or 60fps. Derive durations from
fps(for exampleMath.round(fps * 0.2)). - Keep clear of the captions and the bottom controls. Montaj's captions draw between about 56% and 76% of the frame height in every style and aspect (their block sits 24-26% up from the bottom;
accenthigher), not in the bottom few hundred pixels. On a tall phone frame the apps' progress bar and controls also take the bottom ~350px. Put an overlay that shares the screen with captions above 64% of the height (bottomof 36% or more), or anchor it from the top.lookreports text that crosses the captions. - Avoid the right ~200px between 45% and 85% of a tall phone frame's height: TikTok and Instagram stack action buttons (like, comment, share, follow) down the right edge there. Don't push text or icons into that zone. On every aspect, keep text inside the 5% title-safe margin.
3. Tie overlays to the transcript
Use word-level timings from the transcript JSON to sync overlays to speech (only here: speech_text carries no times).
4. Write the JSX files
One JSX file per overlay component. Save to overlays/<name>.jsx in the project directory.
There are no built-in templates. Every overlay is custom JSX.
See skill write-overlay for the full authoring reference.
5. Save overlays to the project
Overlays live in tracks[1+] — overlay tracks in the unified tracks array. Each track is an object ({id, items, ...}); its items array holds the track's clips/overlays. Items in the same track cannot overlap in time; items in different tracks stack by track: tracks holding video draw below all others, then higher indexes on top, and within a track its clips draw before its overlays (the editor, sample_frame and the export agree). So an image on a track above a 3D or full-screen overlay hides it. tracks[0] is always the primary footage track.
{
"tracks": [
{ "id": "trk-0", "items": [] },
{
"id": "trk-1",
"items": [
{
"id": "ov-0",
"type": "overlay",
"src": "/abs/path/to/project/overlays/hook.jsx",
"props": { "text": "The source code got leaked" },
"start": 0.0,
"end": 3.0
}
]
}
]
}
For multiple non-overlapping overlays, images or clips, add them to the same existing track of that kind instead of one track each, so the person has nothing to merge by hand. Open a new track only when items overlap in time or must stack at a different z-level.
Follow save discipline: read the project, merge the updated tracks array into the fresh state, then save the project (delta).
Rules
- Always use absolute paths for
src— the render engine won't resolve relative paths - Don't overlap items at the same position at the same time
- To cover footage fully, set
"opaque": trueon the item — the render engine removes transparency and lets the JSX root's CSS define the background. The audio track is unaffected. - Leave
offsetX,offsetY,scaleat defaults (0,0,1) — the human positions overlays via the UI drag tool after preview - Use assets from
project.assets— pass assetsrcpaths asprops, don't hardcode paths inside JSX - Expose text styling as props — a text overlay you want editable in the editor's properties panel must READ its font, size, weight, style, color, alignment, transform, and background from
props(the nine standard text props) with sensible defaults, not hardcode them in the JSX. A hardcoded style shows no control in the panel. See skillwrite-overlay→ "Make text overlays editable in the properties panel"
Render Constraints
- Canvas is 1080 on the short edge with the aspect ratio of
project.settings.resolution(default[1080, 1920]portrait) — always, regardless of output resolution. The render pipeline captures overlay segments at design resolution (Puppeteer viewport = 1080-short-edge) and upscales to the final output resolution (e.g. 2× for 4K) at compose time. All sizing in JSX is authored for 1080-design coordinates. - Never apply
transform: translateorscaleto the root element — these are applied by the pipeline at compose time. Applying them in JSX pushes content off-canvas. - Animations must complete before the overlay ends — the last frame is held. If you fade out, opacity must reach 0 before the final frame. No mid-fade endings.
- HDR output — when the project's
settings.colorSpaceishdr_hlgorhdr_pq, the pipeline encodes the final output as HEVC 10-bityuv420p10lewith bt2020 color metadata (transferarib-std-b67for HLG orsmpte2084for PQ). Overlay segments are composited into the project's working color space at compose time; no action required in JSX. - Frosted glass needs
glass_plate, neverbackdrop-filter— each overlay item is captured in its own page, sobackdrop-filtercannot see the footage (or another overlay). Runglass_platefor the item and draw its plate frame inside the glass shape;track_pointspins the shape to moving footage. See skillwrite-overlay, "Frosted glass over footage".