{"id":112874,"plugin_id":"plugin_asdk_app_6aab97bee30881919b757db1f5d91f99","kind":"skill","collection_source":"plugin_package","comparison_source":"plugin_package","observed_at":"2026-11-24T12:11:43.983Z","digest":"cba0b3fbcc00cafada4cc274fb53d3c7962f3881bdfcca5b463c910a3c9ca31c","against":103591,"payload":{"description":"AI Producer-specific composition and editor contract. Read when using the AI Producer plugin to author its HTML workspace; not the general HyperFrames creation workflow.","included_files":[{"relative_path":"agents/openai.yaml","size_in_bytes":140},{"relative_path":"references/code-drawn.md","size_in_bytes":13194},{"relative_path":"references/motion-recipes.md","size_in_bytes":4608},{"relative_path":"references/pip-transition.md","size_in_bytes":2578}],"name":"aip-composition","skill_md_contents":"---\nname: aip-composition\ndescription: \"AI Producer-specific composition and editor contract. Read when using the AI Producer plugin to author its HTML workspace; not the general HyperFrames creation workflow.\"\n---\n\n# HyperFrames for an AI Producer project\n\n<!-- SPDX-License-Identifier: Apache-2.0 -->\n\nCopyright 2026 HeyGen, Inc. Modifications Copyright 2026 OpusClip. Modified by OpusClip for AIP; see [source attribution, license, and changes](../../THIRD_PARTY_NOTICES.md).\n\nHTML is the video: a composition is an HTML element with `data-*` timing attributes and one paused GSAP timeline the player drives. Two programs read it, AI Producer's editor with its own player and the export with AI Producer's own pinned HyperFrames, each with its own playback and editing contract; this page is the interface they read, nothing more.\n\n## What AI Producer accepts\n\n- The project lives under `render-engine/`: `index.html`, `compositions/*.html`, and assets under `public/`. AI Producer stages `public/source.mp4` (the recording) and `public/source.mp3` (its audio) and puts GSAP at `public/vendor/gsap.min.js`; load GSAP from that path.\n- The accepted files and upload limits are described in the [AI Producer workspace format](../aip/references/workspace.md). A composition's logic is inline.\n- Split each moment by what it draws. Text, labels, cards, counters, and anything the user may want to retype or restyle are DOM elements animated by GSAP, given real depth with CSS 3D (`perspective`, 3D rotation, `translateZ` stacking) rather than laid flat. A 3D object or space, a shader-driven surface, or data too dense for DOM is drawn on a `<canvas>` from script (Three.js for 3D) under [code-drawn layers](references/code-drawn.md), with DOM labels over it as one moment needs. The editor treats a canvas as one leaf the user cannot select or restyle, so anything they may want to edit stays DOM.\n- A user's image is staged at `public/images/<name>` and a user's clip at `public/videos/<stem>.mp4`, `<name>` being the filename reduced to ASCII letters, digits, `-`, `_` and `.` (a space becomes `-`, anything else is dropped), because other characters change the URL the browser asks for. The hand-back check does not follow `data-pip-src`, so stage a file referenced that way in the same upload batch as the composition and confirm it in the listing after the commit.\n\n## What the editor recognises in index.html\n\n- The root: `<div id=\"stage\" data-composition-id=\"finecut-root\" data-start=\"0\" data-duration=\"<total s>\" data-width=\"W\" data-height=\"H\">`. Place this root directly in the document body, not inside a `<template>`. The id is fixed: the editor seeks the root timeline as `window.__timelines[\"finecut-root\"]`, so a root transition lives on that timeline, and the root creates the registry before any composition registers:\n\n```html\n<script>\n  window.__timelines = window.__timelines || {};\n  const rootTl = gsap.timeline({ paused: true });\n  ...root tweens (never a speaker zoom or filter; see below)...\n  window.__timelines[\"finecut-root\"] = rootTl;\n</script>\n```\n\n- The speaker: `<video id=\"speaker\" class=\"clip\" src=\"public/source.mp4\" muted playsinline data-volume=\"0\">` and `<audio id=\"speaker-audio\" class=\"clip\" src=\"public/source.mp3\" data-volume=\"1\">`. Keep unique media IDs. Speaker video is silent; the source audio is the audible leader. Generic extra `<audio class=\"clip\">` tags are not AI Producer sound-effect tracks: AI Producer audio tracks require its editing document and derived `track-audio` elements. After a cut, use N video/audio pairs over the same two files. Each element has `class=\"clip speaker-clip\"`, `preload=\"none\"`, a unique `id`, and `data-start`, `data-duration`, `data-media-start`, and `data-track-index`. A pair shares its `data-hf-id` and timing; give each pair a distinct `data-hf-id`. DOM order is output order on each speaker track, so write the spans in playback order with consecutive output starts. The EditingScript AV track must carry the same clip IDs and source/output times; the [workspace helper](../aip/references/workspace.md) synchronizes it and caption timing before publication.\n- A visual moment: one `<div class=\"visual-host clip\" data-composition-id=\"<id>\" data-title=\"<short name>\" data-composition-src=\"compositions/<file>.html\" data-start data-duration data-track-index data-width data-height>` per moment. The host div is the moment the editor shows and lets the user move; content written straight into the root is not a moment. A moment is its own layer over the footage: what its composition draws sees none of the footage beneath it, so an effect that combines with what is under the moment, such as `mix-blend-mode`, goes on the host div in `index.html`, where it applies to the whole moment in the editor and the export. `data-title` is a few words naming the effect (for example `Commute title card`), the editor timeline's label for the moment, which shows the composition id when it is absent.\n- Captions: caption moments, ordinary visual moments whose ids are `captions-<n>`, one per stretch of speech, each cue static text in its composition; the [dynamic caption skill](../aip-dynamic-caption/SKILL.md) owns their timing, look and mounting. The id `narrator-captions`, `compositions/narrator_captions.html` and `compositions/transcript-src.json` are the service's caption layer: the editor and the export find it by that id, and only the service writes them. Never write that layer or reuse its id. When a project already has that layer, read [service-built captions](../aip-dynamic-caption/references/service-captions.md) before you edit its moments: it says how the layer stays mounted and which caption policy attributes a moment's host carries for it. Caption moments you write ignore them: each cue is placed and coloured in its own composition. An edit without captions needs none of these files.\n- A speaker seat or PIP that belongs to an editable visual moment lives inside that moment: `<div class=\"speaker-pip-frame\" data-aip-editable=\"speaker-pip-frame\"><video id=\"<unique>\" data-pip-src=\"public/source.mp4\" data-start=\"<the host's data-start>\" data-duration=\"<the host's data-duration>\" data-media-start=\"<source seconds at that start>\" muted playsinline data-volume=\"0\"></video></div>`, with no `src`. The one exception to the timing table is that this video's `data-start` is the host's global start, not 0, because the export re-anchors it on a cut project by setting its media offset to that value; the editor maps it through the cut itself. A speaker cutout that `frame_speaker` staged is wired as the [cutout reference](../aip-framing/references/cutout.md) says.\n- Footage other than the recording (a user clip, a stock clip): default to a root video clip on its own track in `index.html` for both PIP and split, `<video id=\"<unique>\" class=\"clip\" data-track-index=\"<n>\" src=\"public/videos/<stem>.mp4\" data-start data-duration data-media-start muted playsinline data-volume=\"0\">`, with the moment that frames it (a mask, a frame, a title) drawing over it; the user can move this clip on the timeline. Nested inside the moment's composition instead, the same tag has no `data-track-index` and takes `data-start=\"<the host's data-start>\"`, timed on the host's clock like a PIP, and moves with its moment.\n- A closing video the user supplies (an animated logo, an end card, an outro) plays whole after the last spoken word, not over it. Place it as the root clip above, starting where the last speaker clip ends, never inside a visual host, and raise `#stage` `data-duration` to its end: the export runs on to the end of the last root clip that passes the voice, capped at `#stage`, while a visual moment past the voice is cut. The clip plays muted, so size the music to the new end (`add_music` sections reaching it) for a bed under it; sound effects stay within the voice. Only this closing footage runs past the voice.\n- A speaker zoom or color filter: an empty host with no composition file, `<div class=\"visual-host clip\" data-composition-id=\"<id>\" data-aip-effect=\"zoom\" data-no-timeline data-start data-duration data-src-anchor data-track-index=\"20\" data-hide-captions=\"false\" data-effect-scale=\"<above 1, at most 3>\" data-effect-origin=\"<x% y%>\" data-effect-in=\"<s>\" data-effect-out=\"<s>\"></div>` for a zoom, or `data-aip-effect=\"filter\"` on `data-track-index=\"21\"` with `data-effect-filter=\"<grayscale, sepia, saturate, contrast, brightness, invert, hue-rotate, or blur functions>\"` in place of the scale and origin. The effect ramps in over `data-effect-in` seconds, holds, and ramps out over `data-effect-out` inside the host's window, and the speaker is at identity outside it. `data-src-anchor` is the source second at `data-start` (the covering speaker clip's `data-media-start` plus the offset into that clip), so a cut moves the effect with the words it covers. On a project cut from several videos (the editing script's `sources` list names two or more), the host also carries `data-source-id=\"<id>\"`, the id of the `sources` entry whose `path` the covering clip's `src` plays, because a second names no video on its own; preflight and the commit refuse an anchor without it (`anchor_file_missing`). Two zooms or two filters never overlap; a zoom may overlap a filter or a moment. Load the engine after the root script, `<script src=\"public/vendor/speaker-effects.js\"></script>`; the service writes that file in the commit that first loads it, so do not upload it.\n- A camera treatment beyond a zoom or filter (an impact shake, a white flash, a whip, a push, a handheld drift): a motion host, `<div class=\"visual-host clip\" data-composition-id=\"<id>\" data-aip-effect=\"motion\" data-no-timeline data-start data-duration data-src-anchor data-track-index=\"<900 to 907>\" data-hide-captions=\"false\" data-effect-motion=\"<name>\" data-effect-params='{\"<param>\":<number>}'></div>`, its `data-src-anchor` and, on several videos, its `data-source-id` written as for a zoom, and one inline `<script data-aip-motion=\"<name>\">` in `index.html` that assigns `window.__aipMotions[\"<name>\"] = { label, params: { <param>: { min, max, default, label, unit } }, frame(t, d, p, rand) }`. `frame` returns any of `x` and `y` (pixels), `scale` (1 to 3), `rotate` (degrees) and `overlay: { color: \"#rrggbb\", opacity }` (a full-frame color over everything, captions included), computed from its arguments alone: `t` is seconds into the host, `d` its duration, `p` the parameter values, and `rand(i)` a fixed phase per host. Never read `Math.random`, `Date`, `performance`, `crypto`, `Intl` or a timer anywhere in the script, and never set another name's entry: the service refuses either, because the preview, the export and each render window would draw different frames. Motions that overlap in time sit on different tracks and add up; offsets stay within 160 px and rotation within 8 degrees in total, and the service scales the picture just enough to keep its edges covered, or weakens a motion that 2x cannot cover. Declare every value a user should tune as a parameter (at most 8, each named in lower camel case of at most 16 characters, with values within +/-1,000,000); the editor shows each one as a field. Worked definitions: [motion recipes](references/motion-recipes.md).\n- An element the user should move and restyle as one object carries `data-aip-editable=\"<token>\"` where the token is one of that element's own classes; the editor also treats `.list-item`, `.glass-card`, `.media-card`, `.speaker-pip-frame` and `.item-bar` as such objects. Anything else inside a moment is reachable only as text or image leaves.\n\nNever implement a seat or PIP owned by a visual moment as absolute-time geometry tweens on the root speaker: moving or deleting the host does not rewrite root-timeline tweens, so the shape would stay at its old time. Root speaker geometry is only for a camera treatment no independently editable visual moment owns, and never for its scale, its filter or a per-frame camera move: a speaker zoom or color filter is an effect host, and a shake, flash, whip or push is a motion host. The optional [PIP example](references/pip-transition.md) shows the effect-owned full-frame/PIP transition.\n\n## A sub-composition file\n\n```html\n<template>\n  <div data-composition-id=\"<id>\" data-width=\"W\" data-height=\"H\">\n    ...content, with its <style> and <script> inside the template...\n    <script>\n      const root = document.querySelector('[data-composition-id=\"<id>\"]');\n      const tl = gsap.timeline({ paused: true });\n      ...tweens on root.querySelector(...) targets...\n      window.__timelines[\"<id>\"] = tl;\n    </script>\n  </div>\n</template>\n```\n\nThe inner div's `data-composition-id` equals the host's. Bind the root exactly as the snippet does, with `[data-composition-id=\"<id>\"]` and nothing else in that selector, and reach every element through descendant queries on that root. The export mount strips `data-composition-id` and the other `data-*` attributes from the inner div, so at export the host is the only element carrying the id: a selector that also requires a class, an id, an attribute, or `:not(.visual-host)` on the same element, or a `:scope >` child selector, matches nothing at export, the script throws before it registers, and the export refuses the moment. At export that host is the `root` the snippet binds, and the root rule `[data-composition-id=\"<id>\"] { ... }` styles only the template's own root inside it, so read no style off `root` and no attribute written on the template root: a custom property declared in the root rule reads as `\"\"` from `root` (`NaN` after `parseFloat`, dropping whatever is computed from it), and those attributes are not on the host. Read such a value from an element inside the root, where custom properties inherit, or keep it as a script constant. Scope styles and element queries to the composition's content so moments can coexist in one document. Keep the composition root visible at its base pose; animate an inner wrapper or its children, not the composition root or host. The editor mounts only what is inside `<template>` and the export mounts the template itself, so write nothing after `</template>` (a `<script>` there is part of the moment in neither); the file needs no mount script of its own.\n\nTimeline time 0 is the host's `data-start`, and the player seeks the timeline rather than playing it. Create and register the paused timeline synchronously after its DOM exists, and put render-critical changes on it, never in timers, requestAnimationFrame loops, playback callbacks, or CSS animations. Never call `tl.play()` or start media playback yourself; the player owns the clock. Keep animation repeats finite and randomness seeded so a seek reaches a deterministic state. A continuous move is a tween across its span, never a run of `tl.set` steps, which holds each pose for several frames and then jumps; a jitter over it goes on a channel of its own, such as `xPercent` and `yPercent` over a tweened `x` and `y`. A tween of `filter` replaces the element's whole filter, so an element whose look comes from `filter: url(#...)` keeps it on an inner element and takes the tween on its wrapper. The host attributes own the duration and active window: add no empty tweens to set duration, and never nest the child timeline into the root timeline yourself.\n\n## Timing attributes\n\n| attribute | on | value |\n| --- | --- | --- |\n| `data-start` | every clip | seconds, relative to the parent composition (a PIP or footage clip inside a composition: the host's global start, see above) |\n| `data-duration` | every clip | seconds, the clip's own length |\n| `data-track-index` | every clip | integer; clips on one track cannot overlap |\n| `data-media-start` | video and audio | offset into the source file, seconds |\n| `data-volume` | registered media | playback gain, 0 to 1; does not enroll arbitrary audio in AI Producer mixing |\n| `data-width`, `data-height` | compositions | the canvas, px |\n"},"changes":[{"path":"/included_files","type":"changed","before":[{"relative_path":"agents/openai.yaml","size_in_bytes":140},{"relative_path":"references/code-drawn.md","size_in_bytes":13194},{"relative_path":"references/motion-recipes.md","size_in_bytes":4417},{"relative_path":"references/pip-transition.md","size_in_bytes":2578}],"after":[{"relative_path":"agents/openai.yaml","size_in_bytes":140},{"relative_path":"references/code-drawn.md","size_in_bytes":13194},{"relative_path":"references/motion-recipes.md","size_in_bytes":4608},{"relative_path":"references/pip-transition.md","size_in_bytes":2578}]},{"path":"/skill_md_contents","type":"changed","before":"---\nname: aip-composition\ndescription: \"AI Producer-specific composition and editor contract. Read when using the AI Producer plugin to author its HTML workspace; not the general HyperFrames creation workflow.\"\n---\n\n# HyperFrames for an AI Producer project\n\n<!-- SPDX-License-Identifier: Apache-2.0 -->\n\nCopyright 2026 HeyGen, Inc. Modifications Copyright 2026 OpusClip. Modified by OpusClip for AIP; see [source attribution, license, and changes](../../THIRD_PARTY_NOTICES.md).\n\nHTML is the video: a composition is an HTML element with `data-*` timing attributes and one paused GSAP timeline the player drives. Two programs read it, AI Producer's editor with its own player and the export with AI Producer's own pinned HyperFrames, each with its own playback and editing contract; this page is the interface they read, nothing more.\n\n## What AI Producer accepts\n\n- The project lives under `render-engine/`: `index.html`, `compositions/*.html`, and assets under `public/`. AI Producer stages `public/source.mp4` (the recording) and `public/source.mp3` (its audio) and puts GSAP at `public/vendor/gsap.min.js`; load GSAP from that path.\n- The accepted files and upload limits are described in the [AI Producer workspace format](../aip/references/workspace.md). A composition's logic is inline.\n- Split each moment by what it draws. Text, labels, cards, counters, and anything the user may want to retype or restyle are DOM elements animated by GSAP, given real depth with CSS 3D (`perspective`, 3D rotation, `translateZ` stacking) rather than laid flat. A 3D object or space, a shader-driven surface, or data too dense for DOM is drawn on a `<canvas>` from script (Three.js for 3D) under [code-drawn layers](references/code-drawn.md), with DOM labels over it as one moment needs. The editor treats a canvas as one leaf the user cannot select or restyle, so anything they may want to edit stays DOM.\n- A user's image is staged at `public/images/<name>` and a user's clip at `public/videos/<stem>.mp4`, `<name>` being the filename reduced to ASCII letters, digits, `-`, `_` and `.` (a space becomes `-`, anything else is dropped), because other characters change the URL the browser asks for. The hand-back check does not follow `data-pip-src`, so stage a file referenced that way in the same upload batch as the composition and confirm it in the listing after the commit.\n\n## What the editor recognises in index.html\n\n- The root: `<div id=\"stage\" data-composition-id=\"finecut-root\" data-start=\"0\" data-duration=\"<total s>\" data-width=\"W\" data-height=\"H\">`. Place this root directly in the document body, not inside a `<template>`. The id is fixed: the editor seeks the root timeline as `window.__timelines[\"finecut-root\"]`, so a root transition lives on that timeline, and the root creates the registry before any composition registers:\n\n```html\n<script>\n  window.__timelines = window.__timelines || {};\n  const rootTl = gsap.timeline({ paused: true });\n  ...root tweens (never a speaker zoom or filter; see below)...\n  window.__timelines[\"finecut-root\"] = rootTl;\n</script>\n```\n\n- The speaker: `<video id=\"speaker\" class=\"clip\" src=\"public/source.mp4\" muted playsinline data-volume=\"0\">` and `<audio id=\"speaker-audio\" class=\"clip\" src=\"public/source.mp3\" data-volume=\"1\">`. Keep unique media IDs. Speaker video is silent; the source audio is the audible leader. Generic extra `<audio class=\"clip\">` tags are not AI Producer sound-effect tracks: AI Producer audio tracks require its editing document and derived `track-audio` elements. After a cut, use N video/audio pairs over the same two files. Each element has `class=\"clip speaker-clip\"`, `preload=\"none\"`, a unique `id`, and `data-start`, `data-duration`, `data-media-start`, and `data-track-index`. A pair shares its `data-hf-id` and timing; give each pair a distinct `data-hf-id`. DOM order is output order on each speaker track, so write the spans in playback order with consecutive output starts. The EditingScript AV track must carry the same clip IDs and source/output times; the [workspace helper](../aip/references/workspace.md) synchronizes it and caption timing before publication.\n- A visual moment: one `<div class=\"visual-host clip\" data-composition-id=\"<id>\" data-title=\"<short name>\" data-composition-src=\"compositions/<file>.html\" data-start data-duration data-track-index data-width data-height>` per moment. The host div is the moment the editor shows and lets the user move; content written straight into the root is not a moment. A moment is its own layer over the footage: what its composition draws sees none of the footage beneath it, so an effect that combines with what is under the moment, such as `mix-blend-mode`, goes on the host div in `index.html`, where it applies to the whole moment in the editor and the export. `data-title` is a few words naming the effect (for example `Commute title card`), the editor timeline's label for the moment, which shows the composition id when it is absent.\n- Captions: caption moments, ordinary visual moments whose ids are `captions-<n>`, one per stretch of speech, each cue static text in its composition; the [dynamic caption skill](../aip-dynamic-caption/SKILL.md) owns their timing, look and mounting. The id `narrator-captions`, `compositions/narrator_captions.html` and `compositions/transcript-src.json` are the service's caption layer: the editor and the export find it by that id, and only the service writes them. Never write that layer or reuse its id. When a project already has that layer, read [service-built captions](../aip-dynamic-caption/references/service-captions.md) before you edit its moments: it says how the layer stays mounted and which caption policy attributes a moment's host carries for it. Caption moments you write ignore them: each cue is placed and coloured in its own composition. An edit without captions needs none of these files.\n- A speaker seat or PIP that belongs to an editable visual moment lives inside that moment: `<div class=\"speaker-pip-frame\" data-aip-editable=\"speaker-pip-frame\"><video id=\"<unique>\" data-pip-src=\"public/source.mp4\" data-start=\"<the host's data-start>\" data-duration=\"<the host's data-duration>\" data-media-start=\"<source seconds at that start>\" muted playsinline data-volume=\"0\"></video></div>`, with no `src`. The one exception to the timing table is that this video's `data-start` is the host's global start, not 0, because the export re-anchors it on a cut project by setting its media offset to that value; the editor maps it through the cut itself. A speaker cutout that `frame_speaker` staged is wired as the [cutout reference](../aip-framing/references/cutout.md) says.\n- Footage other than the recording (a user clip, a stock clip): default to a root video clip on its own track in `index.html` for both PIP and split, `<video id=\"<unique>\" class=\"clip\" data-track-index=\"<n>\" src=\"public/videos/<stem>.mp4\" data-start data-duration data-media-start muted playsinline data-volume=\"0\">`, with the moment that frames it (a mask, a frame, a title) drawing over it; the user can move this clip on the timeline. Nested inside the moment's composition instead, the same tag has no `data-track-index` and takes `data-start=\"<the host's data-start>\"`, timed on the host's clock like a PIP, and moves with its moment.\n- A speaker zoom or color filter: an empty host with no composition file, `<div class=\"visual-host clip\" data-composition-id=\"<id>\" data-aip-effect=\"zoom\" data-no-timeline data-start data-duration data-src-anchor data-track-index=\"20\" data-hide-captions=\"false\" data-effect-scale=\"<above 1, at most 3>\" data-effect-origin=\"<x% y%>\" data-effect-in=\"<s>\" data-effect-out=\"<s>\"></div>` for a zoom, or `data-aip-effect=\"filter\"` on `data-track-index=\"21\"` with `data-effect-filter=\"<grayscale, sepia, saturate, contrast, brightness, invert, hue-rotate, or blur functions>\"` in place of the scale and origin. The effect ramps in over `data-effect-in` seconds, holds, and ramps out over `data-effect-out` inside the host's window, and the speaker is at identity outside it. `data-src-anchor` is the source second at `data-start` (the covering speaker clip's `data-media-start` plus the offset into that clip), so a cut moves the effect with the words it covers. Two zooms or two filters never overlap; a zoom may overlap a filter or a moment. Load the engine after the root script, `<script src=\"public/vendor/speaker-effects.js\"></script>`; the service writes that file in the commit that first loads it, so do not upload it.\n- A camera treatment beyond a zoom or filter (an impact shake, a white flash, a whip, a push, a handheld drift): a motion host, `<div class=\"visual-host clip\" data-composition-id=\"<id>\" data-aip-effect=\"motion\" data-no-timeline data-start data-duration data-src-anchor data-track-index=\"<900 to 907>\" data-hide-captions=\"false\" data-effect-motion=\"<name>\" data-effect-params='{\"<param>\":<number>}'></div>`, and one inline `<script data-aip-motion=\"<name>\">` in `index.html` that assigns `window.__aipMotions[\"<name>\"] = { label, params: { <param>: { min, max, default, label, unit } }, frame(t, d, p, rand) }`. `frame` returns any of `x` and `y` (pixels), `scale` (1 to 3), `rotate` (degrees) and `overlay: { color: \"#rrggbb\", opacity }` (a full-frame color over everything, captions included), computed from its arguments alone: `t` is seconds into the host, `d` its duration, `p` the parameter values, and `rand(i)` a fixed phase per host. Never read `Math.random`, `Date`, `performance`, `crypto`, `Intl` or a timer anywhere in the script, and never set another name's entry: the service refuses either, because the preview, the export and each render window would draw different frames. Motions that overlap in time sit on different tracks and add up; offsets stay within 160 px and rotation within 8 degrees in total, and the service scales the picture just enough to keep its edges covered, or weakens a motion that 2x cannot cover. Declare every value a user should tune as a parameter (at most 8, each named in lower camel case of at most 16 characters, with values within +/-1,000,000); the editor shows each one as a field. Worked definitions: [motion recipes](references/motion-recipes.md).\n- An element the user should move and restyle as one object carries `data-aip-editable=\"<token>\"` where the token is one of that element's own classes; the editor also treats `.list-item`, `.glass-card`, `.media-card`, `.speaker-pip-frame` and `.item-bar` as such objects. Anything else inside a moment is reachable only as text or image leaves.\n\nNever implement a seat or PIP owned by a visual moment as absolute-time geometry tweens on the root speaker: moving or deleting the host does not rewrite root-timeline tweens, so the shape would stay at its old time. Root speaker geometry is only for a camera treatment no independently editable visual moment owns, and never for its scale, its filter or a per-frame camera move: a speaker zoom or color filter is an effect host, and a shake, flash, whip or push is a motion host. The optional [PIP example](references/pip-transition.md) shows the effect-owned full-frame/PIP transition.\n\n## A sub-composition file\n\n```html\n<template>\n  <div data-composition-id=\"<id>\" data-width=\"W\" data-height=\"H\">\n    ...content, with its <style> and <script> inside the template...\n    <script>\n      const root = document.querySelector('[data-composition-id=\"<id>\"]');\n      const tl = gsap.timeline({ paused: true });\n      ...tweens on root.querySelector(...) targets...\n      window.__timelines[\"<id>\"] = tl;\n    </script>\n  </div>\n</template>\n```\n\nThe inner div's `data-composition-id` equals the host's. Bind the root exactly as the snippet does, with `[data-composition-id=\"<id>\"]` and nothing else in that selector, and reach every element through descendant queries on that root. The export mount strips `data-composition-id` and the other `data-*` attributes from the inner div, so at export the host is the only element carrying the id: a selector that also requires a class, an id, an attribute, or `:not(.visual-host)` on the same element, or a `:scope >` child selector, matches nothing at export, the script throws before it registers, and the export refuses the moment. At export that host is the `root` the snippet binds, and the root rule `[data-composition-id=\"<id>\"] { ... }` styles only the template's own root inside it, so read no style off `root` and no attribute written on the template root: a custom property declared in the root rule reads as `\"\"` from `root` (`NaN` after `parseFloat`, dropping whatever is computed from it), and those attributes are not on the host. Read such a value from an element inside the root, where custom properties inherit, or keep it as a script constant. Scope styles and element queries to the composition's content so moments can coexist in one document. Keep the composition root visible at its base pose; animate an inner wrapper or its children, not the composition root or host. The editor mounts only what is inside `<template>` and the export mounts the template itself, so write nothing after `</template>` (a `<script>` there is part of the moment in neither); the file needs no mount script of its own.\n\nTimeline time 0 is the host's `data-start`, and the player seeks the timeline rather than playing it. Create and register the paused timeline synchronously after its DOM exists, and put render-critical changes on it, never in timers, requestAnimationFrame loops, playback callbacks, or CSS animations. Never call `tl.play()` or start media playback yourself; the player owns the clock. Keep animation repeats finite and randomness seeded so a seek reaches a deterministic state. A continuous move is a tween across its span, never a run of `tl.set` steps, which holds each pose for several frames and then jumps; a jitter over it goes on a channel of its own, such as `xPercent` and `yPercent` over a tweened `x` and `y`. A tween of `filter` replaces the element's whole filter, so an element whose look comes from `filter: url(#...)` keeps it on an inner element and takes the tween on its wrapper. The host attributes own the duration and active window: add no empty tweens to set duration, and never nest the child timeline into the root timeline yourself.\n\n## Timing attributes\n\n| attribute | on | value |\n| --- | --- | --- |\n| `data-start` | every clip | seconds, relative to the parent composition (a PIP or footage clip inside a composition: the host's global start, see above) |\n| `data-duration` | every clip | seconds, the clip's own length |\n| `data-track-index` | every clip | integer; clips on one track cannot overlap |\n| `data-media-start` | video and audio | offset into the source file, seconds |\n| `data-volume` | registered media | playback gain, 0 to 1; does not enroll arbitrary audio in AI Producer mixing |\n| `data-width`, `data-height` | compositions | the canvas, px |\n","after":"---\nname: aip-composition\ndescription: \"AI Producer-specific composition and editor contract. Read when using the AI Producer plugin to author its HTML workspace; not the general HyperFrames creation workflow.\"\n---\n\n# HyperFrames for an AI Producer project\n\n<!-- SPDX-License-Identifier: Apache-2.0 -->\n\nCopyright 2026 HeyGen, Inc. Modifications Copyright 2026 OpusClip. Modified by OpusClip for AIP; see [source attribution, license, and changes](../../THIRD_PARTY_NOTICES.md).\n\nHTML is the video: a composition is an HTML element with `data-*` timing attributes and one paused GSAP timeline the player drives. Two programs read it, AI Producer's editor with its own player and the export with AI Producer's own pinned HyperFrames, each with its own playback and editing contract; this page is the interface they read, nothing more.\n\n## What AI Producer accepts\n\n- The project lives under `render-engine/`: `index.html`, `compositions/*.html`, and assets under `public/`. AI Producer stages `public/source.mp4` (the recording) and `public/source.mp3` (its audio) and puts GSAP at `public/vendor/gsap.min.js`; load GSAP from that path.\n- The accepted files and upload limits are described in the [AI Producer workspace format](../aip/references/workspace.md). A composition's logic is inline.\n- Split each moment by what it draws. Text, labels, cards, counters, and anything the user may want to retype or restyle are DOM elements animated by GSAP, given real depth with CSS 3D (`perspective`, 3D rotation, `translateZ` stacking) rather than laid flat. A 3D object or space, a shader-driven surface, or data too dense for DOM is drawn on a `<canvas>` from script (Three.js for 3D) under [code-drawn layers](references/code-drawn.md), with DOM labels over it as one moment needs. The editor treats a canvas as one leaf the user cannot select or restyle, so anything they may want to edit stays DOM.\n- A user's image is staged at `public/images/<name>` and a user's clip at `public/videos/<stem>.mp4`, `<name>` being the filename reduced to ASCII letters, digits, `-`, `_` and `.` (a space becomes `-`, anything else is dropped), because other characters change the URL the browser asks for. The hand-back check does not follow `data-pip-src`, so stage a file referenced that way in the same upload batch as the composition and confirm it in the listing after the commit.\n\n## What the editor recognises in index.html\n\n- The root: `<div id=\"stage\" data-composition-id=\"finecut-root\" data-start=\"0\" data-duration=\"<total s>\" data-width=\"W\" data-height=\"H\">`. Place this root directly in the document body, not inside a `<template>`. The id is fixed: the editor seeks the root timeline as `window.__timelines[\"finecut-root\"]`, so a root transition lives on that timeline, and the root creates the registry before any composition registers:\n\n```html\n<script>\n  window.__timelines = window.__timelines || {};\n  const rootTl = gsap.timeline({ paused: true });\n  ...root tweens (never a speaker zoom or filter; see below)...\n  window.__timelines[\"finecut-root\"] = rootTl;\n</script>\n```\n\n- The speaker: `<video id=\"speaker\" class=\"clip\" src=\"public/source.mp4\" muted playsinline data-volume=\"0\">` and `<audio id=\"speaker-audio\" class=\"clip\" src=\"public/source.mp3\" data-volume=\"1\">`. Keep unique media IDs. Speaker video is silent; the source audio is the audible leader. Generic extra `<audio class=\"clip\">` tags are not AI Producer sound-effect tracks: AI Producer audio tracks require its editing document and derived `track-audio` elements. After a cut, use N video/audio pairs over the same two files. Each element has `class=\"clip speaker-clip\"`, `preload=\"none\"`, a unique `id`, and `data-start`, `data-duration`, `data-media-start`, and `data-track-index`. A pair shares its `data-hf-id` and timing; give each pair a distinct `data-hf-id`. DOM order is output order on each speaker track, so write the spans in playback order with consecutive output starts. The EditingScript AV track must carry the same clip IDs and source/output times; the [workspace helper](../aip/references/workspace.md) synchronizes it and caption timing before publication.\n- A visual moment: one `<div class=\"visual-host clip\" data-composition-id=\"<id>\" data-title=\"<short name>\" data-composition-src=\"compositions/<file>.html\" data-start data-duration data-track-index data-width data-height>` per moment. The host div is the moment the editor shows and lets the user move; content written straight into the root is not a moment. A moment is its own layer over the footage: what its composition draws sees none of the footage beneath it, so an effect that combines with what is under the moment, such as `mix-blend-mode`, goes on the host div in `index.html`, where it applies to the whole moment in the editor and the export. `data-title` is a few words naming the effect (for example `Commute title card`), the editor timeline's label for the moment, which shows the composition id when it is absent.\n- Captions: caption moments, ordinary visual moments whose ids are `captions-<n>`, one per stretch of speech, each cue static text in its composition; the [dynamic caption skill](../aip-dynamic-caption/SKILL.md) owns their timing, look and mounting. The id `narrator-captions`, `compositions/narrator_captions.html` and `compositions/transcript-src.json` are the service's caption layer: the editor and the export find it by that id, and only the service writes them. Never write that layer or reuse its id. When a project already has that layer, read [service-built captions](../aip-dynamic-caption/references/service-captions.md) before you edit its moments: it says how the layer stays mounted and which caption policy attributes a moment's host carries for it. Caption moments you write ignore them: each cue is placed and coloured in its own composition. An edit without captions needs none of these files.\n- A speaker seat or PIP that belongs to an editable visual moment lives inside that moment: `<div class=\"speaker-pip-frame\" data-aip-editable=\"speaker-pip-frame\"><video id=\"<unique>\" data-pip-src=\"public/source.mp4\" data-start=\"<the host's data-start>\" data-duration=\"<the host's data-duration>\" data-media-start=\"<source seconds at that start>\" muted playsinline data-volume=\"0\"></video></div>`, with no `src`. The one exception to the timing table is that this video's `data-start` is the host's global start, not 0, because the export re-anchors it on a cut project by setting its media offset to that value; the editor maps it through the cut itself. A speaker cutout that `frame_speaker` staged is wired as the [cutout reference](../aip-framing/references/cutout.md) says.\n- Footage other than the recording (a user clip, a stock clip): default to a root video clip on its own track in `index.html` for both PIP and split, `<video id=\"<unique>\" class=\"clip\" data-track-index=\"<n>\" src=\"public/videos/<stem>.mp4\" data-start data-duration data-media-start muted playsinline data-volume=\"0\">`, with the moment that frames it (a mask, a frame, a title) drawing over it; the user can move this clip on the timeline. Nested inside the moment's composition instead, the same tag has no `data-track-index` and takes `data-start=\"<the host's data-start>\"`, timed on the host's clock like a PIP, and moves with its moment.\n- A closing video the user supplies (an animated logo, an end card, an outro) plays whole after the last spoken word, not over it. Place it as the root clip above, starting where the last speaker clip ends, never inside a visual host, and raise `#stage` `data-duration` to its end: the export runs on to the end of the last root clip that passes the voice, capped at `#stage`, while a visual moment past the voice is cut. The clip plays muted, so size the music to the new end (`add_music` sections reaching it) for a bed under it; sound effects stay within the voice. Only this closing footage runs past the voice.\n- A speaker zoom or color filter: an empty host with no composition file, `<div class=\"visual-host clip\" data-composition-id=\"<id>\" data-aip-effect=\"zoom\" data-no-timeline data-start data-duration data-src-anchor data-track-index=\"20\" data-hide-captions=\"false\" data-effect-scale=\"<above 1, at most 3>\" data-effect-origin=\"<x% y%>\" data-effect-in=\"<s>\" data-effect-out=\"<s>\"></div>` for a zoom, or `data-aip-effect=\"filter\"` on `data-track-index=\"21\"` with `data-effect-filter=\"<grayscale, sepia, saturate, contrast, brightness, invert, hue-rotate, or blur functions>\"` in place of the scale and origin. The effect ramps in over `data-effect-in` seconds, holds, and ramps out over `data-effect-out` inside the host's window, and the speaker is at identity outside it. `data-src-anchor` is the source second at `data-start` (the covering speaker clip's `data-media-start` plus the offset into that clip), so a cut moves the effect with the words it covers. On a project cut from several videos (the editing script's `sources` list names two or more), the host also carries `data-source-id=\"<id>\"`, the id of the `sources` entry whose `path` the covering clip's `src` plays, because a second names no video on its own; preflight and the commit refuse an anchor without it (`anchor_file_missing`). Two zooms or two filters never overlap; a zoom may overlap a filter or a moment. Load the engine after the root script, `<script src=\"public/vendor/speaker-effects.js\"></script>`; the service writes that file in the commit that first loads it, so do not upload it.\n- A camera treatment beyond a zoom or filter (an impact shake, a white flash, a whip, a push, a handheld drift): a motion host, `<div class=\"visual-host clip\" data-composition-id=\"<id>\" data-aip-effect=\"motion\" data-no-timeline data-start data-duration data-src-anchor data-track-index=\"<900 to 907>\" data-hide-captions=\"false\" data-effect-motion=\"<name>\" data-effect-params='{\"<param>\":<number>}'></div>`, its `data-src-anchor` and, on several videos, its `data-source-id` written as for a zoom, and one inline `<script data-aip-motion=\"<name>\">` in `index.html` that assigns `window.__aipMotions[\"<name>\"] = { label, params: { <param>: { min, max, default, label, unit } }, frame(t, d, p, rand) }`. `frame` returns any of `x` and `y` (pixels), `scale` (1 to 3), `rotate` (degrees) and `overlay: { color: \"#rrggbb\", opacity }` (a full-frame color over everything, captions included), computed from its arguments alone: `t` is seconds into the host, `d` its duration, `p` the parameter values, and `rand(i)` a fixed phase per host. Never read `Math.random`, `Date`, `performance`, `crypto`, `Intl` or a timer anywhere in the script, and never set another name's entry: the service refuses either, because the preview, the export and each render window would draw different frames. Motions that overlap in time sit on different tracks and add up; offsets stay within 160 px and rotation within 8 degrees in total, and the service scales the picture just enough to keep its edges covered, or weakens a motion that 2x cannot cover. Declare every value a user should tune as a parameter (at most 8, each named in lower camel case of at most 16 characters, with values within +/-1,000,000); the editor shows each one as a field. Worked definitions: [motion recipes](references/motion-recipes.md).\n- An element the user should move and restyle as one object carries `data-aip-editable=\"<token>\"` where the token is one of that element's own classes; the editor also treats `.list-item`, `.glass-card`, `.media-card`, `.speaker-pip-frame` and `.item-bar` as such objects. Anything else inside a moment is reachable only as text or image leaves.\n\nNever implement a seat or PIP owned by a visual moment as absolute-time geometry tweens on the root speaker: moving or deleting the host does not rewrite root-timeline tweens, so the shape would stay at its old time. Root speaker geometry is only for a camera treatment no independently editable visual moment owns, and never for its scale, its filter or a per-frame camera move: a speaker zoom or color filter is an effect host, and a shake, flash, whip or push is a motion host. The optional [PIP example](references/pip-transition.md) shows the effect-owned full-frame/PIP transition.\n\n## A sub-composition file\n\n```html\n<template>\n  <div data-composition-id=\"<id>\" data-width=\"W\" data-height=\"H\">\n    ...content, with its <style> and <script> inside the template...\n    <script>\n      const root = document.querySelector('[data-composition-id=\"<id>\"]');\n      const tl = gsap.timeline({ paused: true });\n      ...tweens on root.querySelector(...) targets...\n      window.__timelines[\"<id>\"] = tl;\n    </script>\n  </div>\n</template>\n```\n\nThe inner div's `data-composition-id` equals the host's. Bind the root exactly as the snippet does, with `[data-composition-id=\"<id>\"]` and nothing else in that selector, and reach every element through descendant queries on that root. The export mount strips `data-composition-id` and the other `data-*` attributes from the inner div, so at export the host is the only element carrying the id: a selector that also requires a class, an id, an attribute, or `:not(.visual-host)` on the same element, or a `:scope >` child selector, matches nothing at export, the script throws before it registers, and the export refuses the moment. At export that host is the `root` the snippet binds, and the root rule `[data-composition-id=\"<id>\"] { ... }` styles only the template's own root inside it, so read no style off `root` and no attribute written on the template root: a custom property declared in the root rule reads as `\"\"` from `root` (`NaN` after `parseFloat`, dropping whatever is computed from it), and those attributes are not on the host. Read such a value from an element inside the root, where custom properties inherit, or keep it as a script constant. Scope styles and element queries to the composition's content so moments can coexist in one document. Keep the composition root visible at its base pose; animate an inner wrapper or its children, not the composition root or host. The editor mounts only what is inside `<template>` and the export mounts the template itself, so write nothing after `</template>` (a `<script>` there is part of the moment in neither); the file needs no mount script of its own.\n\nTimeline time 0 is the host's `data-start`, and the player seeks the timeline rather than playing it. Create and register the paused timeline synchronously after its DOM exists, and put render-critical changes on it, never in timers, requestAnimationFrame loops, playback callbacks, or CSS animations. Never call `tl.play()` or start media playback yourself; the player owns the clock. Keep animation repeats finite and randomness seeded so a seek reaches a deterministic state. A continuous move is a tween across its span, never a run of `tl.set` steps, which holds each pose for several frames and then jumps; a jitter over it goes on a channel of its own, such as `xPercent` and `yPercent` over a tweened `x` and `y`. A tween of `filter` replaces the element's whole filter, so an element whose look comes from `filter: url(#...)` keeps it on an inner element and takes the tween on its wrapper. The host attributes own the duration and active window: add no empty tweens to set duration, and never nest the child timeline into the root timeline yourself.\n\n## Timing attributes\n\n| attribute | on | value |\n| --- | --- | --- |\n| `data-start` | every clip | seconds, relative to the parent composition (a PIP or footage clip inside a composition: the host's global start, see above) |\n| `data-duration` | every clip | seconds, the clip's own length |\n| `data-track-index` | every clip | integer; clips on one track cannot overlap |\n| `data-media-start` | video and audio | offset into the source file, seconds |\n| `data-volume` | registered media | playback gain, 0 to 1; does not enroll arbitrary audio in AI Producer mixing |\n| `data-width`, `data-height` | compositions | the canvas, px |\n"}],"summary":"Fields changed: 2. /included_files, /skill_md_contents.","summary_kind":"deterministic","summary_metadata":{}}