cybercode-cli 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,194 @@
1
+ ---
2
+ name: faceless-explainer
3
+ description: "turn arbitrary text — an article, notes, a topic, a brief — into a faceless explainer video, up to ~3 min (sweet spot 30-90s), where every visual is invented (typography, abstract graphics, diagrams, data-viz) rather than captured. There is no URL, no website capture, and no real assets. Use this skill for topic explainers, concept breakdowns, how-tos, listicles, and narrative explainers. Do not use it for a product launch/promo (use /product-launch-video), a tour of a real website (use /website-to-video), a GitHub PR (use /pr-to-video), captions on existing footage (use /embedded-captions), or a short unnarrated motion graphic (use /motion-graphics). If the intent is unclear, route through /hyperframes first."
4
+ ---
5
+
6
+ # Faceless Explainer to HyperFrames
7
+
8
+ Use this skill to turn a body of text into an explainer video: pick a design system, plan a teaching story, and build it frame by frame in HyperFrames. **Faceless** means every visual is invented downstream — there is no capture step and no real asset inventory.
9
+
10
+ > **Confirm the route before Step 0.** You are the orchestrator. Run each step, verify its gate, and only then continue. This skill is for **explaining a topic from text, with no product and no website to capture**. Route other intents elsewhere: a product launch/promo → `/product-launch-video`; a tour of a real site → `/website-to-video`; a GitHub PR → `/pr-to-video`; captions on existing footage → `/embedded-captions`; a short unnarrated motion graphic → `/motion-graphics`. If the user says only "make a video" or the route is uncertain, read `/hyperframes` first.
11
+
12
+ You are the orchestrator. Work in `videos/<project>/`. Run steps in order and pass each gate before continuing. User-gated steps are Step 0, Step 3, and Step 6. Do every step yourself except Step 5, where you dispatch one sub-agent per frame. Do not put design or motion rules here; those live in the frame-worker sub-agent, `hyperframes-creative`, and `hyperframes-animation`.
13
+
14
+ Workflow: Step 0 setup → `hyperframes.json`; Step 1 brief → `capture/extracted/`; Step 2 design system → `frame.md`; Step 3 storyboard/script → `STORYBOARD.md` and `SCRIPT.md`; Step 3.1 audio → `audio_meta.json`; Step 4 visual design → enriched `STORYBOARD.md`; Step 5 frames → `compositions/frames/NN-*.html` and `index.html`; Step 6 final render → `renders/video.mp4`.
15
+
16
+ ---
17
+
18
+ ## Step 0: Setup and Brief
19
+
20
+ Goal: Lock the core video brief and create the HyperFrames project if needed.
21
+
22
+ Initialize only if `hyperframes.json` is missing. Name `<project>` from the topic in kebab-case, such as `compound-interest-explained`; never use workspace name or timestamp.
23
+
24
+ `npx hyperframes init "videos/<project>" --non-interactive --skip-skills --example=blank`
25
+
26
+ **Gate:** `hyperframes.json` exists, and angle, length, aspect ratio, and language are locked.
27
+
28
+ ---
29
+
30
+ ## Step 1: Brief (no capture)
31
+
32
+ Goal: Fold the user's text into the project as the source of information. There is **no website capture and no real assets** — this is a faceless explainer.
33
+
34
+ Save the user's full input verbatim, then create the synthetic capture package by hand:
35
+
36
+ - `capture/extracted/visible-text.txt` — the full article / notes / topic / brief, verbatim. This is the source of **information**, not a story template (Step 3 reshapes it).
37
+ - `capture/extracted/tokens.json` — `{ "title": "", "description": "", "colors": [], "fonts": [] }`. Fill `title`/`description` from the brief. Leave `colors`/`fonts` empty unless the user explicitly gave brand colors or fonts — then add them (the design preset supplies a complete palette regardless).
38
+
39
+ Do **not** run `npx hyperframes capture` (there is no URL). Do not create `asset-descriptions.md` or populate `capture/assets/` — faceless visuals are invented in Steps 4-5, not captured. The one exception: if the user supplied a real image, place it under `public/<basename>` and note it for Step 3.
40
+
41
+ **Gate:** `capture/extracted/visible-text.txt` and `capture/extracted/tokens.json` exist; you can state the explainer's topic and audience in one clear sentence.
42
+
43
+ ---
44
+
45
+ ## Step 2: Design System
46
+
47
+ Goal: Choose one shipped frame preset; a script turns it into this video's `frame.md` + caption skin.
48
+
49
+ You make the one judgment call — **which preset**. Read `../hyperframes-creative/references/design-spec.md` and browse `../hyperframes-creative/frame-presets/`; pick the preset whose look best fits the topic, tone, and audience. Then run:
50
+
51
+ ```bash
52
+ node <SKILL_DIR>/scripts/build-frame.mjs --preset <name> --hyperframes .
53
+ ```
54
+
55
+ The script does the rest deterministically: copies the preset's `FRAME.md` → `frame.md` and **remixes** it onto any brand tokens in `capture/extracted/tokens.json` (brand colors mapped onto the preset's color keys by role; the preset's display + body fonts swapped for the brand's), copies the preset's `caption-skin.html` verbatim, and self-validates (exits 1 on a broken mapping). Proceed as soon as it exits 0 — no hand-editing of the spec.
56
+
57
+ A faceless explainer usually has **no brand colors/fonts** (`tokens.json` colors/fonts empty) → the script keeps the preset's own palette, a complete shippable design. Only when the user named brand colors/fonts add them to `tokens.json` before running, and only adjust `frame.md` by hand afterward if a mapping truly needs it.
58
+
59
+ **Gate:** `build-frame.mjs` exited 0 — `frame.md` exists from a named preset, and (when the preset ships one) `caption-skin.html` is at the project root.
60
+
61
+ ---
62
+
63
+ ## Step 3: Storyboard and Script
64
+
65
+ Goal: Turn the text into an approved frame-by-frame teaching plan.
66
+
67
+ Read `references/story-design.md`, `../hyperframes-core/references/storyboard-format.md`, and `../hyperframes-core/references/script-format.md`. Use them to write `STORYBOARD.md` and, when narration is needed, `SCRIPT.md`.
68
+
69
+ Use `story-design.md` for the explainer structure (concept / how-to / listicle / story), hook strategy, clarity techniques, emotional beats, the type-enum mapping, and `VO_MODE`. The video's sequence comes from **narrative design, not the input text's paragraph order** — reorder, merge, omit, compress. Faceless visuals are invented downstream, so frames do **not** carry an asset inventory: leave `asset_candidates` empty unless the user supplied a real `public/<basename>` image. Use the exact required fields from the storyboard and script references.
70
+
71
+ After drafting, show a frame-by-frame summary. In that same message ask the user two things: (a) to approve or request changes, and (b) whether they want a live preview of the storyboard scaffold (`npx hyperframes preview`) — open it only on a yes. Iterate until approved, and carry the preview choice to Step 6.
72
+
73
+ **Gate:** `STORYBOARD.md` exists, every frame has the required narrative fields, `SCRIPT.md` exists when narration is needed, and the user approved the frame-by-frame plan.
74
+
75
+ ---
76
+
77
+ ## Step 3.1: Audio
78
+
79
+ Goal: Generate narration, word timings, music, and audio metadata from the approved script.
80
+
81
+ Start audio after Step 3 approval. Run it in the background, then continue to Step 4.
82
+
83
+ `node <SKILL_DIR>/scripts/audio.mjs --script ./SCRIPT.md --storyboard ./STORYBOARD.md --hyperframes . --out ./audio_meta.json &`
84
+
85
+ The audio script handles narration, word timings, BGM lookup from HeyGen's music library, and timing metadata. BGM mood comes from the storyboard's `music:` field. This uses the HeyGen Audio API for retrieval, not generation, and the same `~/.heygen` credential as TTS. For provider details, read `../hyperframes-media/references/tts.md`.
86
+
87
+ If there is no narration and no `SCRIPT.md`, skip voice generation. BGM may still run if the storyboard has a music mood.
88
+
89
+ **Gate:** audio job has started, or the project is marked silent.
90
+
91
+ ---
92
+
93
+ ## Step 4: Frame Visual Design
94
+
95
+ Goal: Add the visual direction, layout intent, and motion choices to each storyboard frame.
96
+
97
+ Edit `STORYBOARD.md` in place. Do not create another storyboard. Use `frame.md` as the source of truth for color, type, layout feel, and style.
98
+
99
+ Read `references/visual-design.md`, `references/composition.md`, `references/motion-language.md`, and `../hyperframes-animation/`. Use `visual-design.md` for required frame fields and the required `## Video direction` block. Use `composition.md` for layout, hierarchy, focal points, and the invented-visual treatment. Use `motion-language.md` and `../hyperframes-animation/` for valid effects and blueprint IDs. Do not invent effect names or blueprint IDs.
100
+
101
+ For every frame, add required visual and motion fields, including `effects` and `focal` and/or `roles`. Because the explainer is faceless, `focal`/`roles` describe **invented visual elements** (a hero word, a diagram node, a data-viz series), not captured assets. Add one video-wide `## Video direction` block for overall visual direction, motion style, pacing, and design rules.
102
+
103
+ Do not change story, script, `transition_in`, or the source text. Do not write HTML in this step. There is **no asset-staging step** — faceless visuals are built by the workers in Step 5. If the user supplied a real `public/<basename>` image, reference it by path in the relevant frame's `focal`/`roles`; otherwise nothing to stage.
104
+
105
+ **Gate:** every frame has `effects` plus `focal` and/or `roles`; `## Video direction` exists.
106
+
107
+ ---
108
+
109
+ ## Step 5: Build Frames
110
+
111
+ Goal: Build every storyboard frame as an HTML composition and assemble the playable video.
112
+
113
+ Wait for Step 3.1 audio to finish if audio was started. Then sync durations and fetch SFX; skip both if silent.
114
+
115
+ `node <SKILL_DIR>/scripts/audio.mjs sync-durations --audio-meta ./audio_meta.json --storyboard ./STORYBOARD.md`
116
+
117
+ `node <SKILL_DIR>/scripts/audio.mjs fetch-sfx --storyboard ./STORYBOARD.md --hyperframes .`
118
+
119
+ Duration sync is mechanical: real voice duration wins; silent frames keep estimates; never hand-edit synced durations.
120
+
121
+ Before dispatch, read `sub-agents/frame-worker.md` and `../hyperframes-core/references/subagent-dispatch.md`. Dispatch one sub-agent per frame, in parallel if possible; otherwise run workers in waves. Each worker gets exactly one frame.
122
+
123
+ Each worker context must include `PROJECT_DIR`, `frame_id`, canvas size, caption status and keep-out band if captions are enabled, and `ANIM_DIR` as the absolute path to `../hyperframes-animation/`. Each worker reads `frame.md`, its own `## Frame N` block from `STORYBOARD.md`, and the recipe body for each cited effect or blueprint ID. Each worker writes only `compositions/frames/NN-*.html`. Workers must never edit `STORYBOARD.md`.
124
+
125
+ As each worker returns, the orchestrator marks that frame as `animated` in `STORYBOARD.md`.
126
+
127
+ After audio timings exist, build captions in the background and assemble the index:
128
+
129
+ `node <SKILL_DIR>/scripts/captions.mjs build --storyboard ./STORYBOARD.md --audio-meta ./audio_meta.json --hyperframes . --out ./caption_groups.json &`
130
+
131
+ `node <SKILL_DIR>/scripts/assemble-index.mjs --storyboard ./STORYBOARD.md --hyperframes .`
132
+
133
+ `captions.mjs` uses the project's `caption-skin.html` (copied in Step 2) as the caption look, injecting brand tokens from `frame.md`; with no skin present it renders the built-in default pill. `captions: skipped (<reason>)` is valid. Continue without captions when explicitly skipped.
134
+
135
+ **Gate:** every frame is marked `animated`, `index.html` exists, and captions are built or explicitly skipped.
136
+
137
+ ---
138
+
139
+ ## Step 6: Finalize
140
+
141
+ Goal: Verify the assembled video, get user approval, and render the final MP4.
142
+
143
+ Inject transitions, run checks, pause for review, then render.
144
+
145
+ `node <SKILL_DIR>/scripts/transitions.mjs inject --storyboard ./STORYBOARD.md --hyperframes .`
146
+
147
+ `node <SKILL_DIR>/scripts/transitions.mjs verify --storyboard ./STORYBOARD.md --index ./index.html`
148
+
149
+ `npx hyperframes lint`
150
+
151
+ `npx hyperframes validate`
152
+
153
+ `npx hyperframes inspect --strict-layout`
154
+
155
+ `npx hyperframes snapshot --at <frame-midpoints>`
156
+
157
+ If a command fails, surface stderr and stop. Do not pile on recovery commands. If a gate names a frame, fix `compositions/frames/NN-*.html` with the cheapest safe fix: edit the frame HTML for a local issue; re-dispatch the frame worker only when the whole shot must be rebuilt.
158
+
159
+ After checks pass, pause for user review. The video is assembled, viewable, and editable in Studio. Manage preview only once across Step 3 and Step 6: open it if the user asked earlier, offer it if they declined earlier, and do not ask again if they are already reviewing in Studio.
160
+
161
+ Preview: `npx hyperframes preview`
162
+
163
+ Render only after user approval:
164
+
165
+ `npx hyperframes render --quality high --output renders/video.mp4`
166
+
167
+ Do not rerun `lint`, `validate`, `inspect`, or `snapshot` after rendering unless the user asks.
168
+
169
+ **Gate:** `lint`, `validate`, and `inspect` passed before render; user approved at the review pause; `renders/video.mp4` exists. Final reply states MP4 path and final duration.
170
+
171
+ ---
172
+
173
+ ## Quick Reference
174
+
175
+ **Formats:** landscape `1920x1080` by default; portrait `1080x1920`; square `1080x1080`. Set the format once in the storyboard frontmatter.
176
+
177
+ **Faceless deltas vs a captured-asset workflow:** no Step 1 capture (synthetic `tokens.json` + `visible-text.txt`); no `asset-descriptions.md` and no `capture/assets/`; no asset-staging in Step 4; `asset_candidates` empty by default; every visual is invented by the Step 5 workers (typography / abstract graphics / diagrams / data-viz). A user-supplied `public/<basename>` image is the only real asset path.
178
+
179
+ **Background scripts:** the workflow ships only these under `scripts/`: `build-frame` for adopting + brand-remixing a frame preset into `frame.md` (+ caption skin); `audio` for TTS, transcription, BGM, SFX, and duration syncing; `captions`; `transitions` for inject and verify; and `assemble-index`. Everything else is the `hyperframes` CLI.
180
+
181
+ | Read | When |
182
+ | ------------------------------------------------------------------------------------------------------------ | --------------------------------------------- |
183
+ | `[../hyperframes-creative/frame-presets/](../hyperframes-creative/frame-presets/)` | Step 2: choose and adopt a frame preset. |
184
+ | `[../hyperframes-creative/references/design-spec.md](../hyperframes-creative/references/design-spec.md)` | Step 2: apply brand tokens correctly. |
185
+ | `[references/story-design.md](references/story-design.md)` | Step 3: plan the explainer story. |
186
+ | `[../hyperframes-core/references/storyboard-format.md](../hyperframes-core/references/storyboard-format.md)` | Step 3: write `STORYBOARD.md`. |
187
+ | `[../hyperframes-core/references/script-format.md](../hyperframes-core/references/script-format.md)` | Step 3: write `SCRIPT.md`. |
188
+ | `[../hyperframes-media/references/tts.md](../hyperframes-media/references/tts.md)` | Step 3.1: choose or understand TTS providers. |
189
+ | `[references/visual-design.md](references/visual-design.md)` | Step 4: enrich the storyboard visually. |
190
+ | `[references/composition.md](references/composition.md)` | Step 4: judge composition. |
191
+ | `[references/motion-language.md](references/motion-language.md)` | Step 4: judge motion language. |
192
+ | `[../hyperframes-animation/](../hyperframes-animation/)` | Step 4: cite effect and blueprint IDs. |
193
+ | `[sub-agents/frame-worker.md](sub-agents/frame-worker.md)` | Step 5: dispatch per-frame workers. |
194
+ | `[../hyperframes-core/references/subagent-dispatch.md](../hyperframes-core/references/subagent-dispatch.md)` | Step 5: dispatch sub-agents safely. |
@@ -0,0 +1,141 @@
1
+ ---
2
+ name: general-video
3
+ description: >
4
+ The fallback workflow for authoring custom HyperFrames video compositions at
5
+ any length or format — longer or multi-scene pieces, brand / sizzle reels,
6
+ montages, title cards, static loops, and freeform compositions. Input- and
7
+ length-agnostic. If a specialized workflow clearly fits the input — a
8
+ marketed product, a website, a topic explainer, a GitHub PR, existing
9
+ footage, a short motion graphic, or a Remotion port — prefer it (see
10
+ /hyperframes); use this only as the general fallback when none fit.
11
+ metadata: { "tags": "orchestrator, general-video, fallback, freeform, composition-authoring" }
12
+ ---
13
+
14
+ # general-video — general video workflow
15
+
16
+ > **Confirm the route before you build.** This is the **fallback** for custom composition authoring. If the input clearly fits a specialized workflow, prefer it: marketed product → `/product-launch-video`; general site → `/website-to-video`; topic explainer → `/faceless-explainer`; GitHub PR → `/pr-to-video`; existing footage → `/embedded-captions` · `/graphic-overlays`; short unnarrated motion graphic → `/motion-graphics`; Remotion port → `/remotion-to-hyperframes`. **Out of scope**: live / at-render-time data, NLE-style editing of a finished video, or producing footage HyperFrames can't capture. Unsure? **Read `/hyperframes` first.**
17
+
18
+ **Build exactly what was asked.** A title card is a title card — not a title card + three supporting scenes + ambient music + captions. If extra scenes or elements would genuinely improve the piece, _propose_ them; don't add them silently. For small edits (fix a color, adjust one duration, add one element), skip the planning steps and go straight to the build.
19
+
20
+ ## Approach
21
+
22
+ ### Discovery — open-ended requests only
23
+
24
+ For vague, exploratory requests ("make something for our brand", "a cool intro") — understand intent before picking colors:
25
+
26
+ - **Audience** — who watches? developers / executives / general consumers?
27
+ - **Platform** — where does it play? social (15s) / website hero / product demo / internal?
28
+ - **Priority** — what matters most? motion quality / content accuracy / brand fidelity / speed?
29
+ - **Variations** — one best shot, or 2-3 meaningfully different options (different pacing, energy, or structure — not just color swaps)?
30
+
31
+ For specific requests ("add a title card", "fix the timing on scene 3"), skip discovery.
32
+
33
+ ### Step 1 — Design system → `hyperframes-creative`
34
+
35
+ Establish the visual identity first. If the project has a design spec, read it (precedence `frame.md` → `design.md` → `DESIGN.md`; treat it as brand truth — exact colors, fonts, constraints).
36
+
37
+ **If no spec exists, you MUST read BOTH `hyperframes-creative/references/house-style.md` AND `hyperframes-creative/references/video-composition.md` before choosing any color or font.** `house-style.md` gives the "interpret the prompt / generate real content" opener, lazy-default list, and layer recipe; `video-composition.md` gives the video-medium density / scale / **foreground detailing** (data bars, registration marks, monospace metadata, "8-10 elements, two the user didn't ask for") that separates "produced" from "generated." Reading only one is the most common miss — `video-composition.md` is the one agents skip, and it is exactly the one that prevents flat, centered, web-page-looking output. Do not self-invent a palette and skip these; crossing into `hyperframes-creative` is mandatory here, not an optional branch. From there, also pull a named style/mood → `references/visual-styles.md`, or the interactive picker → `references/design-picker.md`, as needed. The spec/style defines the **brand**, not the composition rules.
38
+
39
+ **Find the angle (vague brief, no spec):** before picking colors, write ONE sentence — what does this name/word/topic evoke, and what visual _world_ (metaphor, setting, instrument, motif) expresses it? E.g. a cybersecurity tool → vault doors / perimeter scan lines / lock tumblers; a meditation app → tide, breath, slow light bloom. Read the _meaning_ of the subject, not just its letters; pick a concrete angle over a literal restyle. This is the cheap substitute for prompt expansion (Step 2) on single-scene pieces, where expansion is correctly skipped — and it is the difference between a designed concept and a generic logo-on-a-gradient.
40
+
41
+ <HARD-GATE>
42
+ Before writing ANY composition HTML, verify you have ALL FOUR:
43
+ 1. **A visual identity** grounded in the spec or `house-style.md` — not invented on the spot. (Reaching for `#333`, `#3b82f6`, or `Roboto`? You skipped it.)
44
+ 2. **A one-sentence concept angle** (the "find the angle" step) for anything beyond a trivial edit — not a literal restyle of the prompt words.
45
+ 3. **A font pairing from the embed list** (`hyperframes-creative/references/typography.md` → "Fonts that embed") chosen on purpose — not `Inter`/`Helvetica Neue`/`system-ui` by default, and never an un-embedded display font you're just hoping renders (un-bundled names embed only if auto-captured locally — and cloud renders won't capture them).
46
+ 4. **A foreground/density plan from `video-composition.md`** — the anchor-to-edges, 8-10-elements, foreground-metadata, background-texture rules. (Centered stack on a flat color with fewer than ~6 elements and no edge-anchored detail? You skipped it — that is the generic tell.)
47
+ </HARD-GATE>
48
+
49
+ ### Step 2 — Prompt expansion → `hyperframes-creative`
50
+
51
+ Run for every multi-scene composition (skip for single-scene pieces and trivial edits). Ground the request against the design spec + house style into a consistent intermediate that downstream work reads the same way. See `hyperframes-creative/references/prompt-expansion.md`.
52
+
53
+ ### Step 3 — Plan
54
+
55
+ Before writing HTML, think at a high level:
56
+
57
+ 1. **What** — the viewer experience: narrative arc, key moments, emotional beats.
58
+ 2. **Structure** — how many compositions, sub-comp vs inline, which tracks carry video / audio / overlays / captions. For the monolithic-single-file vs modular-sub-comp call, see `hyperframes-core/references/composition-patterns.md` § Two Architectures (rule of thumb: ≥3 hard scene cuts, or any reused scene → modularize; a short single-scene piece stays one file).
59
+ 3. **Rhythm** — name the pattern before implementing (e.g. `fast-fast-SLOW-SHADER-hold`); see `hyperframes-creative/references/beat-direction.md`.
60
+ 4. **Timing** — which clips drive duration, where transitions land, the pacing.
61
+ 5. **Layout** — build the end state first (see below).
62
+ 6. **Animate** — then add motion via `hyperframes-animation`.
63
+
64
+ ## Layout Before Animation
65
+
66
+ Position every element where it sits at its **most visible moment** — fully entered, correctly placed, not yet exiting. Write that as static HTML + CSS first. **No GSAP yet.**
67
+
68
+ **Why:** if you position elements at their animated start state (offscreen, scaled to 0, opacity 0) and tween to where you _think_ they land, you are guessing the final layout — overlaps stay invisible until render. Build the end state first and you see and fix layout problems before adding motion.
69
+
70
+ 1. **Identify the hero frame** for each scene — the moment the most elements are simultaneously visible. That is the layout you build.
71
+ 2. **Write static CSS** for that frame. The content container must fill the scene with padding, not absolute offsets:
72
+
73
+ ```css
74
+ .scene-content {
75
+ display: flex;
76
+ flex-direction: column;
77
+ justify-content: center;
78
+ width: 100%;
79
+ height: 100%;
80
+ padding: 120px 160px; /* padding positions content; fills any scene size */
81
+ gap: 24px;
82
+ box-sizing: border-box;
83
+ }
84
+ ```
85
+
86
+ Never use `position: absolute; top: Npx` on a content container — it overflows when content is taller than the space. Reserve absolute positioning for decoratives.
87
+
88
+ > ⚠ **The `width/height: 100%` above only resolves if every ancestor has a resolved height.** The root `<div data-composition-id>` and any wrapper between it and `.scene-content` must be sized (`position: relative; width: 1920px; height: 1080px` on the root — see `hyperframes-core` → "Root must be sized"). Skip this and the flex container collapses to ~0, content piles into the **top-left corner**, and the first glyph clips at x=0 — while `lint`/`inspect` still report 0 issues. And **always keep the `padding`** (≥80px) on `.scene-content`: it is the title-safe margin. Never replace it with bare `gap`.
89
+
90
+ 3. **Add entrances** — animate FROM offscreen/invisible TO the CSS position with `gsap.from()` (in sub-compositions prefer `gsap.fromTo()` so the start state is explicit; see `hyperframes-core/references/sub-compositions.md`). The CSS position is ground truth; the tween is the journey to it.
91
+ 4. **Exits are transition-handled** — per the scene-transition rules in `hyperframes-animation/transitions/`, only the **final** scene animates elements out; between scenes the transition IS the exit.
92
+
93
+ **Shared space across time:** if element A exits before element B enters in the same area, both still need correct CSS positions for their respective hero frames — timeline ordering keeps them from coexisting, and the layout step catches accidental overlap. Layered glows/shadows and z-stacked depth are _intentional_ overlap; the step is about catching _unintentional_ collisions (two headlines on top of each other, content bleeding off-frame).
94
+
95
+ ## Build — delegate to the domain skills
96
+
97
+ This maps the skill's full surface (see the `description`) to its references — non-exhaustive; when an intent isn't listed, route through `hyperframes-creative` (look/concept), `hyperframes-animation` (motion), `hyperframes-core` (contract), `hyperframes-media` (audio/captions). **The first row is ADDITIVE — read it AND your intent row, not one or the other.**
98
+
99
+ | Building… | Read first (in order) |
100
+ | --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
101
+ | **ALWAYS — every non-trivial piece, on top of your intent row below** | `hyperframes-creative/references/house-style.md` + `references/video-composition.md` (also gated in Step 1 / HARD-GATE; the "produced, not generated" foreground detailing) |
102
+ | **Kinetic typography / text-forward** | `hyperframes-animation/techniques.md` (kinetic type) + `adapters/gsap-easing-and-stagger.md` + `rules/kinetic-beat-slam.md` |
103
+ | **Title card / lower-third / overlay / PiP / text-behind-subject** | `hyperframes-creative/references/composition-patterns.md` + (for the centered/sized frame) `hyperframes-core` → "Root must be sized" |
104
+ | **Logo / brand-mark reveal** | `hyperframes-animation/rules/svg-path-draw.md` (draw-on) + `rules/3d-text-depth-layers.md` + `rules/scale-swap-transition.md` |
105
+ | **Data / stats / numbers** | `hyperframes-animation/rules/counting-dynamic-scale.md` + `rules/stat-bars-and-fills.md` + `hyperframes-creative/references/data-in-motion.md` |
106
+ | **Product / app / UI demo** | `hyperframes-animation/rules/3d-page-scroll.md` + `rules/cursor-click-ripple.md` + `rules/press-release-spring.md` |
107
+ | **Audio-reactive / music-driven** | `hyperframes-creative/references/audio-reactive.md` (pre-extract bands; map to motion) |
108
+ | **Narrated / voiceover / music / SFX / captions** | `hyperframes-media` → the shared audio engine `scripts/audio.mjs` (one call = TTS + BGM + SFX → `audio_meta.json`); caption authoring + asset placement via `hyperframes-core`. See **Audio** below. |
109
+ | **Multi-scene / transitions** | `hyperframes-animation/transitions/overview.md` **then** `transitions/catalog.md` (you are not done after the overview — the GSAP recipe is in the catalog) |
110
+ | **Modular / sub-compositions** | `hyperframes-core/references/composition-patterns.md` + `references/sub-compositions.md` |
111
+
112
+ ### Audio: one engine (TTS · BGM · SFX)
113
+
114
+ Only when the piece calls for it (per "build exactly what was asked" — no ambient music on a title card). Don't hand-roll TTS or vendor a copy: write a neutral `audio_request.json` and call the shared engine in `hyperframes-media`. It auto-degrades on one switch — HeyGen credential present → HeyGen TTS + music/SFX **retrieval**; absent → ElevenLabs/Kokoro TTS, Lyria/MusicGen BGM **generation**, and the bundled SFX library. Full flag list + request/meta schema: the header comment of `hyperframes-media/scripts/audio.mjs`.
115
+
116
+ ```jsonc
117
+ // audio_request.json — one line per narrated segment; `id` is yours (joins audio_meta back)
118
+ {
119
+ "lines": [
120
+ { "id": "s1", "text": "Your opening line.", "sfx": ["whoosh"] },
121
+ { "id": "s2", "text": "The next beat." },
122
+ ],
123
+ "bgm": { "query": "calm cinematic underscore" }, // omit "mode" → auto (retrieve if HeyGen, else generate); "none" to disable
124
+ }
125
+ ```
126
+
127
+ ```bash
128
+ # <MEDIA_DIR> = the installed hyperframes-media skill dir (sibling of this skill)
129
+ node <MEDIA_DIR>/scripts/audio.mjs --request ./audio_request.json --hyperframes . --out ./audio_meta.json
130
+ ```
131
+
132
+ Then read `audio_meta.json`: mount each `voices[].path` + (`bgm.path`, `sfx[]`) as `<audio>` tracks and use `voices[].words` for captions, all per `hyperframes-core` (audio tracks + caption authoring). If BGM took the generate path (`bgm_pending: true`), run `hyperframes-media/scripts/wait-bgm.mjs` before final render.
133
+
134
+ ## Output checklist → `hyperframes-cli`
135
+
136
+ - [ ] `npx hyperframes lint` and `npx hyperframes validate` pass (block on results)
137
+ - [ ] design adherence verified if a spec (`frame.md` / `design.md`) exists — checklist in `hyperframes-creative/references/design-adherence.md`
138
+ - [ ] `npx hyperframes inspect` passes, or every overflow is intentionally marked
139
+ - [ ] contrast warnings addressed; for multi-scene work, review the animation map (`hyperframes-animation/scripts/animation-map.mjs`)
140
+ - [ ] deliver the preview; render to MP4 only on explicit request
141
+ - [ ] surface the preview **only at handoff** (it is the stable, final preview); don't pop one mid-build — build-phase snapshots are headless
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: hyperframes-animation
3
+ description: "All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). HyperFrames-native: single paused timeline, seek-safe, deterministic."
4
+ ---
5
+
6
+ # HyperFrames Animation
7
+
8
+ All motion knowledge in one skill: **rules** (atomic recipes), **blueprints** (multi-phase scene templates), **transitions** (scene-to-scene), **techniques** (broader motion-design patterns), and **adapters** (per-runtime APIs).
9
+
10
+ For the composition contract (data attributes, sub-compositions, determinism) see `hyperframes-core`.
11
+
12
+ ## Default: compose atomic rules
13
+
14
+ Pick 2-4 rules from `rules-index.md`, glue them together with a single paused GSAP timeline, done. This is faster and produces less code than starting from a blueprint.
15
+
16
+ ## Load a blueprint when
17
+
18
+ - The scene matches an existing pre-designed multi-phase template (brand-reveal, social-proof, demo-page-scroll-spotlight, etc.) and reusing its phase pipeline saves real authoring time
19
+ - You want runnable ground-truth code for a complex 4-5 phase choreography
20
+
21
+ Blueprints live in `blueprints-index.md`. Each entry points to `blueprints/<id>.md` (recipe) and `examples/<id>.html` (runnable sample). Do not read it speculatively; load it when you've already decided you need scene-level orchestration.
22
+
23
+ ## Routing
24
+
25
+ | Want to… | Read |
26
+ | ------------------------------------------------------------------------------ | --------------------------------------------------- |
27
+ | Pick an atomic motion pattern by trigger / tag | `rules-index.md` |
28
+ | Read one rule's full HTML / CSS / GSAP recipe | `rules/<name>.md` |
29
+ | Pick a multi-phase scene template | `blueprints-index.md` |
30
+ | Read one blueprint's full recipe | `blueprints/<id>.md` + `examples/<id>.html` |
31
+ | Author a scene transition (CSS-driven, between two clips) | `transitions/overview.md`, `transitions/catalog.md` |
32
+ | Look up a broader motion-design technique | `techniques.md` |
33
+ | Analyze an existing composition's animation map | `scripts/animation-map.mjs` |
34
+ | GSAP API — timeline / tweens / position parameters | `adapters/gsap.md` |
35
+ | GSAP — drop-in effect recipes | `rules/gsap-effects.md` |
36
+ | GSAP — transforms / perf | `adapters/gsap-transforms-and-perf.md` |
37
+ | GSAP — eases / stagger | `adapters/gsap-easing-and-stagger.md` |
38
+ | GSAP — timeline / labels | `adapters/gsap-timeline-and-labels.md` |
39
+ | Lottie / dotLottie (After Effects exports, `window.__hfLottie`) | `adapters/lottie.md` |
40
+ | Three.js / WebGL (3D scenes, `AnimationMixer`, `hf-seek`) | `adapters/three.md` |
41
+ | Anime.js (`window.__hfAnime`) | `adapters/animejs.md` |
42
+ | CSS keyframes (`animation-delay` / `play-state` / `fill-mode`) | `adapters/css-animations.md` |
43
+ | Web Animations API (`element.animate()`, `currentTime` seek) | `adapters/waapi.md` |
44
+ | TypeGPU / WebGPU (`navigator.gpu`, WGSL, compute pipelines) | `adapters/typegpu.md` |
45
+ | HTML-as-texture + WebGL/GLSL post-fx (capture live DOM via `drawElementImage`) | `adapters/html-in-canvas-patterns.md` |
46
+ | Named text-animation effects (24 IDs via external `animate-text` skill) | `adapters/animate-text.md` |
47
+
48
+ ## Picking a runtime
49
+
50
+ - **GSAP** is the default for 95% of motion work — covers timeline orchestration, transforms, easing, stagger. All atomic rules in this skill are GSAP-based.
51
+ - **Lottie** when an asset has its own pre-baked timeline (typically After Effects exports).
52
+ - **Three.js** for 3D scenes, camera motion, shader-driven visuals.
53
+ - **Anime.js** for lightweight tweening when GSAP is overkill.
54
+ - **CSS** for simple repeated motifs, decoration, shimmer — no JavaScript animation cost.
55
+ - **WAAPI** for native browser keyframes without a GSAP dependency.
56
+ - **TypeGPU / WebGPU** for GPU-rendered canvases (particles, liquid glass, custom shaders).
57
+
58
+ Multiple runtimes can coexist in one composition. Each registers its instances on the runtime-specific global so HyperFrames can seek all of them in one pass.
59
+
60
+ ## Critical Constraints
61
+
62
+ **Prerequisite: `hyperframes-core` → Non-Negotiable Rules** (single paused timeline, `data-duration` governs length, no `Math.random` / `Date.now` / `performance.now`, no `repeat: -1`, no `gsap.set` on later-scene clips, no `display` / `visibility` animation, no timeline construction inside `async` / `setTimeout` / `Promise`). Don't restate those here.
63
+
64
+ Animation-craft additions on top of core's contract:
65
+
66
+ - **Pre-calculated layout constants** — never derive positions from `getBoundingClientRect()` at tween time. Tween-time DOM measurements desync because the renderer samples in parallel; compute coordinates once at composition setup and reuse.
67
+ - **Spatial motion uses GSAP transform aliases only** (`x`, `y`, `scale`, `rotation`). Core's allowlist also permits `opacity` / `color` / `backgroundColor` / `borderRadius` for non-spatial property tweens — but never `width` / `height` / `top` / `left` for layout changes.
68
+
69
+ ## Scripts
70
+
71
+ ```bash
72
+ node skills/hyperframes-animation/scripts/animation-map.mjs <composition-dir> \
73
+ --out <composition-dir>/.hyperframes/anim-map
74
+ ```
75
+
76
+ Reads every GSAP timeline registered on `window.__timelines`, enumerates tweens, samples bboxes, computes flags, outputs `animation-map.json`. Use it to audit choreography (dead zones, stagger consistency, lifecycle warnings) after authoring.
77
+
78
+ ## See Also
79
+
80
+ - `hyperframes-core` — composition structure, data attributes, sub-compositions, deterministic render contract
81
+ - `hyperframes-creative` — palettes, typography, narration, beat planning (non-animation creative direction)
82
+ - `hyperframes-cli` — `npx hyperframes lint / validate / inspect / preview / render`
@@ -0,0 +1,109 @@
1
+ ---
2
+ name: hyperframes-cli
3
+ description: HyperFrames CLI dev loop. Use when running npx hyperframes init, add, catalog, capture, lint, validate, inspect, layout, snapshot, preview, play, render, publish, lambda, doctor, browser, info, upgrade, skills, compositions, docs, benchmark, telemetry, transcribe, tts, or remove-background, or when troubleshooting the HyperFrames build/render environment. Entry point for AWS Lambda cloud rendering (`hyperframes lambda deploy / render / progress / destroy / policies`).
4
+ ---
5
+
6
+ # HyperFrames CLI
7
+
8
+ Everything runs through `npx hyperframes` unless project instructions specify a local wrapper. Obey the local wrapper exactly. Requires Node.js >= 22 and FFmpeg.
9
+
10
+ ## Workflow
11
+
12
+ 1. **Scaffold** — `npx hyperframes init my-video` (or `capture` from a URL)
13
+ 2. **Write** — author HTML composition (see the `hyperframes-core` skill)
14
+ 3. **Lint** — `npx hyperframes lint`
15
+ 4. **Validate** — `npx hyperframes validate` (runtime errors + contrast)
16
+ 5. **Visual inspect** — `npx hyperframes inspect`
17
+ 6. **Preview** — `npx hyperframes preview` opens **Studio**, the timeline editor where the user can manually edit anything (not just watch). Review there, then ask before rendering.
18
+ 7. **Render** — pick the variant:
19
+ - Iterate: `npx hyperframes render --quality draft`
20
+ - Deliver: `npx hyperframes render --quality high --output out.mp4`
21
+ - CI / cross-host repro: `npx hyperframes render --docker --strict --output out.mp4`
22
+ - Cloud (long / large): `npx hyperframes lambda render ./my-project --width 1920 --height 1080 --wait` (see Lambda below)
23
+
24
+ Run lint, validate, and inspect before preview. `lint` catches missing `data-composition-id`, overlapping tracks, and unregistered timelines. `validate` loads the composition in headless Chrome and reports runtime console errors plus WCAG contrast issues. `inspect` seeks through the timeline and reports text spilling out of bubbles/containers or off the canvas — and, when a `*.motion.json` sidecar is present, verifies motion intent (entrances firing under seek, stagger order, in-frame, liveness) against that same seeked timeline.
25
+
26
+ For motion-heavy work, prefer snapshot-driven iteration and a `*.motion.json` sidecar — see `references/lint-validate-inspect.md` for the discipline and motion-verification spec.
27
+
28
+ ## Agent Conventions
29
+
30
+ Cross-cutting rules that hold for every command:
31
+
32
+ - **`--json` is available on every command except `render`, `preview`, and `play`.** Use it for any agent / CI invocation of the supported commands; output includes a `_meta` envelope (cli version, latest available, update advice). `render` reports status via stdout + exit code only — verify success with the post-render check below; `preview` / `play` are servers, no JSON.
33
+ - **`doctor --json` always exits 0**, even when the environment is broken. Gate on the payload's `ok` field: `npx hyperframes doctor --json | jq -e '.ok' > /dev/null`. This insulates pipelines from CLI release churn.
34
+ - **Non-TTY mode is auto-detected.** When `stdout` is not a TTY (CI, agents, piped output) the CLI auto-switches to non-interactive; `init` then **requires `--example`**. Pass `--non-interactive` to force this mode even on a TTY.
35
+ - **CI gating on render**: `--strict` fails on lint errors, `--strict-all` fails on warnings too, `--strict-variables` fails on undeclared `--variables` keys.
36
+ - **Paths in `--json` are redacted** — `$HOME` becomes the literal `$HOME` so output is safe to paste into bug reports and agent contexts.
37
+ - **Render is user-gated.** Never auto-render once the checks pass. Pause at `preview`, tell the user the video is editable in Studio, and render only after they approve.
38
+ - **Post-render verification.** After `render` returns exit 0, confirm the output file exists and has plausible size before reporting success: `[ -s "$OUTPUT" ] || echo "render produced no output"`. The CLI prints `◇ <path>` on success; for long renders also sanity-check duration with `ffprobe -i "$OUTPUT" -show_format -v error`.
39
+
40
+ ## Routing
41
+
42
+ | Want to… | Read |
43
+ | ---------------------------------------------------------------------------------------------------------- | ------------------------------------- |
44
+ | Scaffold a project (`init`, `capture`, `skills`) | `references/init-and-scaffold.md` |
45
+ | Check correctness (`lint`, `validate`, `inspect`, `snapshot`) | `references/lint-validate-inspect.md` |
46
+ | Preview or render (`preview`, `play`, `render`, `publish`) | `references/preview-render.md` |
47
+ | Diagnose the environment (`doctor`, `browser`) | `references/doctor-browser.md` |
48
+ | Cloud render on AWS Lambda (`lambda deploy / sites / render / progress / destroy / policies`) | `references/lambda.md` |
49
+ | Everything else (`info`, `upgrade`, `compositions`, `docs`, `benchmark`, `telemetry`, asset preprocessing) | `references/upgrade-info-misc.md` |
50
+
51
+ ## Cross-Skill Hand-Offs
52
+
53
+ - **Tailwind projects** (`init --tailwind`) → use `hyperframes-core` (Tailwind reference) before editing classes or theme tokens.
54
+ - **Registry blocks/components** (`hyperframes add`, `hyperframes catalog`) → use `hyperframes-registry` for install paths, sub-composition wiring, and snippet merging.
55
+ - **Asset preprocessing** (`tts`, `transcribe`, `remove-background`) → use `hyperframes-media` for voice selection, Whisper model rules, captions, and TTS-to-captions chain.
56
+ - **Parametrized renders** (`--variables`) → declared via `data-composition-variables` on `<html>`; see `hyperframes-core` for the full schema.
57
+
58
+ ## Lambda (Cloud Rendering)
59
+
60
+ `hyperframes lambda` deploys distributed rendering to AWS Lambda and drives renders from your laptop or CI. End-to-end is three commands:
61
+
62
+ ```bash
63
+ npx hyperframes lambda deploy # provision SAM stack (Lambda + Step Functions + S3)
64
+ npx hyperframes lambda render ./my-project --width 1920 --height 1080 --wait
65
+ npx hyperframes lambda destroy # tear down (S3 bucket is retained)
66
+ ```
67
+
68
+ Use Lambda when a render is too long / too large for one host (multi-minute videos, 4K, large parallel batches) and you have AWS credentials configured. For dev-loop iteration stay on local `render`.
69
+
70
+ See `references/lambda.md` for prerequisites, all 6 subcommands (`deploy`, `sites create`, `render`, `progress`, `destroy`, `policies`), IAM policy validation, state files, and cost / cleanup rules.
71
+
72
+ ## Minimum Completion Gate
73
+
74
+ ### Static gates
75
+
76
+ ```bash
77
+ npx hyperframes lint
78
+ npx hyperframes validate
79
+ ```
80
+
81
+ Add `inspect` for layout-sensitive work and `render --strict` in CI to fail on lint errors.
82
+
83
+ ### Visual smoke test — required when the project uses sub-compositions
84
+
85
+ `lint` / `validate` / `inspect` evaluate each composition **in isolation**. They never load `index.html` and mount sub-compositions via `data-composition-src`, so they cannot catch cross-file mount failures (see `hyperframes-core` → `references/sub-compositions.md`, "Common pitfalls"). The only gate that catches them is one that actually loads `index.html` and seeks the timeline.
86
+
87
+ Use `hyperframes snapshot` — it loads the project the same way `render` does (so it exercises the same mount path) but only captures the timestamps you request, so it's seconds instead of a full render:
88
+
89
+ ```bash
90
+ # Capture one frame at the midpoint of every sub-composition.
91
+ # Midpoints = data-start + data-duration/2 for each host slot in index.html.
92
+ npx hyperframes snapshot --at <t1>,<t2>,<t3>,...
93
+
94
+ # Or, if you don't need per-scene targeting, an evenly-spaced sample:
95
+ npx hyperframes snapshot --frames 9
96
+ ```
97
+
98
+ Output lands in `snapshots/frame-NN-at-Xs.png`. Eyeball each frame against the scene plan.
99
+
100
+ Per-frame red flags (each maps to a specific failure mode the static gates miss):
101
+
102
+ | What you see | Root cause |
103
+ | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
104
+ | Text shows up tiny + unstyled in the top-left corner | `<style>` block left in `<head>` outside `<template>` (Pitfall 1) — no CSS reached live DOM |
105
+ | SVG/icon elements blown up to canvas-size | Same as above — no width/height constraints applied |
106
+ | Hero element of the scene is missing entirely; only background + watermark visible | Host-id ≠ template id (Pitfall 2) — timeline never ran, frame captured at initial state |
107
+ | Snapshot command logs `Sub-composition timelines not registered after 45000ms` | Pitfall 2 — direct confirmation |
108
+
109
+ `snapshots/` can be deleted after eyeballing; the user-facing final render is a separate pass with `npx hyperframes render`.
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: hyperframes-core
3
+ description: The HyperFrames composition contract — build one renderable project. Use for composition structure, the `data-*` timing attributes, `class="clip"`, tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
4
+ ---
5
+
6
+ # HyperFrames Core
7
+
8
+ HyperFrames renders video from HTML. A composition is an HTML file whose DOM declares timing with `data-*` attributes, whose animation runtime is seekable, and whose media playback is owned by the framework.
9
+
10
+ This skill is the **technical contract** — how to build one hyperframes project. The body below is the build guide; per-topic detail lives in `references/` (index next), read on demand. Other concerns live in the sibling domain skills — `hyperframes-animation`, `hyperframes-creative`, `hyperframes-media`, `hyperframes-cli`, `hyperframes-registry`. The capability map in `/hyperframes` says what each one covers.
11
+
12
+ ## References
13
+
14
+ | File | Read it to… |
15
+ | ------------------------------------ | ------------------------------------------------------------------------------------------------- |
16
+ | `references/minimal-composition.md` | start from the smallest renderable composition skeleton |
17
+ | `references/composition-patterns.md` | choose monolithic vs modular; structure a modular `index.html`; pick a sub-comp archetype |
18
+ | `references/data-attributes.md` | look up any `data-*` (root / clip / sub-comp host / legacy aliases); use `class="clip"` |
19
+ | `references/tracks-and-clips.md` | pick `data-track-index`, handle same-track overlap / z-index, time a clip relative to another |
20
+ | `references/sub-compositions.md` | wire a sub-composition (host attrs, `<template>`, per-instance vars) and animate inside it |
21
+ | `references/variables-and-media.md` | declare variables; place `<video>`/`<audio>`, set volume, trim |
22
+ | `references/determinism-rules.md` | build a seekable timeline; determinism bans; the animatable-property allowlist; layout / text fit |
23
+ | `references/full-screen-motion.md` | author full-frame motion with shared backgrounds |
24
+ | `references/storyboard-format.md` | author a `STORYBOARD.md` plan (+ the parsed manifest) |
25
+ | `references/script-format.md` | author the optional `SCRIPT.md` locked narration |
26
+ | `references/subagent-dispatch.md` | map subagent dispatch verbs (parallel fan-out / background / wait) to your harness |
27
+ | `references/tailwind.md` | work in a Tailwind v4 project (`init --tailwind`; runtime contract differs from Studio's v3) |
28
+
29
+ For animation runtime specifics (GSAP API, Lottie, Three.js, etc.) go to `hyperframes-animation` → `adapters/<runtime>.md`.
30
+
31
+ ## Building a composition
32
+
33
+ ### Two root forms (not interchangeable)
34
+
35
+ - **Standalone** (top-level `index.html`) — root `<div data-composition-id="…">` sits directly in `<body>`, **no `<template>` wrapper** (wrapping it hides all content and breaks rendering).
36
+ - **Sub-composition** (loaded via `data-composition-src`) — root **must** be wrapped in `<template>`.
37
+
38
+ > ⚠ Transport rule: the runtime **only clones `<template>` contents**; everything outside (incl. `<head>` styles/scripts) is discarded — put `<style>`/`<script>` **inside** the template.
39
+ > ⚠ Host-id rule: the host slot's `data-composition-id` must **exactly equal** the inner template's `data-composition-id` **and** the `window.__timelines["<id>"]` key — no `-mount`/`-slot`/`-host` suffix.
40
+
41
+ File shape, host wiring, and the pre-render checklist → `references/sub-compositions.md`.
42
+
43
+ ### Root must be sized (silent layout bug)
44
+
45
+ The standalone root needs an explicit **sized box** (`width`/`height` in px), and every ancestor down to a `height:100%` element must have a resolved height — otherwise a flex/`100%` child collapses to ~0 and content piles into the top-left corner. `lint`/`validate`/`inspect` do **not** catch this. Skeleton → `references/minimal-composition.md`.
46
+
47
+ ### One paused timeline
48
+
49
+ Each composition registers **exactly one** `gsap.timeline({ paused: true })` at `window.__timelines["<id>"]` (key = root `data-composition-id`), built **synchronously** at page load. Render duration = root `data-duration`, not timeline length. Don't manually nest sub-timelines into the host. Full contract (incl. non-GSAP runtimes) → `references/determinism-rules.md` + `hyperframes-animation/adapters/`.
50
+
51
+ ### Non-negotiable rules (silent bugs `lint`/`validate`/`inspect` won't catch)
52
+
53
+ Surfaced here; full rationale in the linked reference. Do not violate:
54
+
55
+ - No render-time clocks / unseeded `Math.random` / network / input-state; no `repeat: -1` (use a finite count). → `determinism-rules.md`
56
+ - Animate only the visual-property allowlist; never `display`/`visibility`; no `gsap.set` on later-scene clips. → `determinism-rules.md`
57
+ - No `<br>` in body text; transformed elements must be block-level + sized; pulsing absolute decoratives need peak clearance. → `determinism-rules.md`
58
+ - `<video>`/`<audio>` must be a **direct child of the host root** (never inside a sub-comp `<template>`/wrapper); the framework owns playback. → `variables-and-media.md`
59
+ - Every `id` must be unique across the **assembled** page; inside a sub-comp, prefix ids with the composition id (`#<id>-hero`). Duplicate `<video>`/`<img>` ids render **blank** — the producer injects frames by `getElementById`, and cross-file dupes slip past `lint`. → `composition-patterns.md`
60
+ - A full-screen scene fill goes on a full-bleed **child** (`position:absolute; inset:0`), never on the composition root itself — the producer's frame compositing can drop the root element's own `background` (the frame renders **black**) even though preview/`snapshot` show it correctly. → `composition-patterns.md`
61
+
62
+ ## Editing existing compositions
63
+
64
+ - Read the files first. Preserve unrelated timing, tracks, IDs, variables, media paths.
65
+ - Match existing composition IDs and timeline keys.
66
+ - Adding a clip: pick a non-overlapping `data-track-index` or adjust surrounding timing intentionally.
67
+ - Adding a sub-composition: verify its internal `data-composition-id` before wiring the host.
68
+
69
+ ## Validation
70
+
71
+ Use `hyperframes-cli` for command details
72
+
73
+ - [ ] `npx hyperframes lint` passes (0 errors)
74
+ - [ ] `npx hyperframes validate` passes (0 console errors)
75
+ - [ ] `npx hyperframes inspect` passes (0 errors)
76
+ - [ ] Projects with sub-compositions: `npx hyperframes snapshot --at <midpoints>` and eyeball each frame
77
+ - [ ] `npx hyperframes preview` for review (the user can edit anything in Studio's timeline)
78
+ - [ ] `npx hyperframes render` only after the user approves