Skip to content

Write HTML. Render video. Built for agents.

feat(cli): default BeginFrame, agent blank, and looks quality (#3927)

Miguel Ángelf059a6eb539e
diff --git a/docs/packages/cli.mdx b/docs/packages/cli.mdx
index aecb67293f..e0b4141a3a 100644
--- a/docs/packages/cli.mdx
+++ b/docs/packages/cli.mdx
@@ -89,19 +89,19 @@ off the check, the install, and the notice.
Scaffold a new composition project from an example.
```bash
-# Agents and CI — every input from a flag
-npx hyperframes init my-video --example blank --video video.mp4 --non-interactive
+# Default: centered Inter blank. Non-TTY skips the wizard.
+npx hyperframes init my-video
-# With the Tailwind browser runtime
-npx hyperframes init my-video --example blank --tailwind
+# Start from a video file
+npx hyperframes init my-video --video video.mp4 --non-interactive
-# Interactive on a TTY
-npx hyperframes init my-video
+# With the Tailwind browser runtime
+npx hyperframes init my-video --tailwind
```
| Flag | Description |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| `--example, -e` | Example to scaffold. Required with `--non-interactive`. See [Examples](/examples) for the full list. |
+| `--example, -e` | Example to scaffold. Default is the centered blank. See [Examples](/examples) for the full list. |
| `--resolution` | Canvas preset: `landscape` (1920×1080), `portrait` (1080×1920), `landscape-4k` (3840×2160), `portrait-4k` (2160×3840), `square` (1080×1080), `square-4k` (2160×2160). Aliases: `1080p`, `4k`, `uhd`, `1080p-square`, `square-1080p`, `4k-square`. Default: keep template dimensions. |
| `--video, -v` | Path to a video file (MP4, WebM, MOV) |
| `--audio, -a` | Path to an audio file (MP3, WAV, M4A) |
@@ -857,7 +857,7 @@ The flags that come up most:
| `--composition, -c` | `index.html` | Render a different composition file. Sub-compositions using `<template>` wrappers must be referenced from `index.html` via `data-composition-src`. |
| `--format` | `mp4` | `mp4`, `webm`, `mov`, `gif`, or `png-sequence`. WebM and MOV carry transparency; `png-sequence` writes RGBA frames to a directory. |
| `--fps, -f` | root `data-fps`, otherwise 30 | 1–240, or an ffmpeg rational like `30000/1001` for 29.97 |
-| `--quality, -q` | `standard` | `draft`, `standard`, or `high`. Drives MP4/WebM encoder settings; MOV always uses the fixed alpha-preserving ProRes 4444 profile. |
+| `--quality, -q` | `looks` | `draft`, `looks` (CRF 16, default), `delivery` (= `high`), `standard`, or `high`. MOV always uses the fixed alpha-preserving ProRes 4444 profile. |
| `--resolution` | the composition's size | Supersample to a preset via Chrome's `deviceScaleFactor`. Aspect ratio must match and the scale must be a whole multiple. Not with `--hdr`. See [4K rendering](/guides/4k-rendering). |
| `--docker` | off | Render inside Docker for [deterministic output](/concepts/determinism) |
| `--variables` | — | JSON object merged over the composition's `data-composition-variables` defaults |
diff --git a/docs/prompting/rules-and-anti-patterns.mdx b/docs/prompting/rules-and-anti-patterns.mdx
index 811dcfdba9..0801c6b865 100644
--- a/docs/prompting/rules-and-anti-patterns.mdx
+++ b/docs/prompting/rules-and-anti-patterns.mdx
@@ -23,7 +23,7 @@ The skills enforce these automatically, but if you hand-edit compositions or deb
## Lint rules to know
-The linter added eight more rules that catch subtler seek-order and SVG-drawing mistakes — cases where a render can look right in the live preview and still render wrong on a cold, non-linear render worker. Two further hazards below carry no rule code: they surface in the render, not the linter. Phrase prompts to avoid these up front rather than debugging them after a render.
+The linter added more rules that catch subtler seek-order and SVG-drawing mistakes — cases where a render can look right in the live preview and still render wrong on a cold, non-linear render worker — plus one centering footgun that shows in the preview too. Two further hazards below carry no rule code: they surface in the render, not the linter. Phrase prompts to avoid these up front rather than debugging them after a render.
### Cold-seek visibility
@@ -47,6 +47,10 @@ These four all come from the same root cause: a cold render worker seeks non-lin
- **Function-valued tween vars receive `(index, target, targets)` — the first argument is a number, not the element.** Don't ask for a function value that calls an element method on its first parameter, or that reads transform-sensitive layout (its result would depend on the worker's own seek order). Use the second parameter for the element, index arithmetic like `(i) => i * 20`, or a value computed once at build time. (`gsap_function_value_hazard`, PR [#2611](https://github.com/heygen-com/hyperframes/pull/2611))
- **Don't measure DOM geometry inside a timeline callback.** `getBoundingClientRect()`, `getTotalLength()`, and `getComputedStyle()` all depend on whatever DOM state the render happens to be in — and timeline callbacks re-fire on every seek, so a cold worker's own non-linear seek order can hand the callback a different measurement than the live preview did. Ask for geometry to be computed once at build time instead. (`gsap_callback_dom_measurement`, PR [#2611](https://github.com/heygen-com/hyperframes/pull/2611))
+### Centering
+
+- **Don't center with CSS `transform: translate(-50%, -50%)` on an element GSAP moves with `x` or `y`.** GSAP writes the whole transform, so the first tween throws the centering away and the element jumps. Center with layout (flex or grid on the parent) or let GSAP own the offset: `tl.fromTo("#title", { xPercent: -50, yPercent: -50, y: 40 }, { xPercent: -50, yPercent: -50, y: 0 })`. (`gsap_css_transform_conflict`)
+
### SVG draw-on
Two more ways an SVG "line draws itself" effect (animated `strokeDasharray` / `strokeDashoffset`) can render as a static, undrawn line.
diff --git a/packages/cli/scripts/build-copy.mjs b/packages/cli/scripts/build-copy.mjs
index 55f198e91a..847a6211aa 100644
--- a/packages/cli/scripts/build-copy.mjs
+++ b/packages/cli/scripts/build-copy.mjs
@@ -66,7 +66,7 @@ async function main() {
await waitForStudioDist(studioDist);
copyDirContents(studioDist, join(DIST, "studio"));
- for (const tmpl of ["blank", "_shared"]) {
+ for (const tmpl of ["blank", "from-file", "_shared"]) {
copyDir(join(CLI_ROOT, "src", "templates", tmpl), join(DIST, "templates", tmpl));
}
diff --git a/packages/cli/src/commands/init.test.ts b/packages/cli/src/commands/init.test.ts
index 3d2a25dbce..e9f0e1b75a 100644
--- a/packages/cli/src/commands/init.test.ts
+++ b/packages/cli/src/commands/init.test.ts
@@ -1,6 +1,14 @@
import { describe, expect, it } from "vitest";
import { spawnSync } from "node:child_process";
-import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
+import {
+ copyFileSync,
+ existsSync,
+ mkdirSync,
+ mkdtempSync,
+ readFileSync,
+ rmSync,
+ writeFileSync,
+} from "node:fs";
import { tmpdir } from "node:os";
import { join, resolve } from "node:path";
import { fileURLToPath } from "node:url";
@@ -56,14 +64,22 @@ describe("hyperframes init flag rename", () => {
expect(initSource).not.toMatch(/await ensureModel\(modelFlag/g);
});
- it("requires an explicit source in non-interactive mode", () => {
+ it("bare init scaffolds the centered blank without --example", () => {
const dir = mkdtempSync(join(tmpdir(), "hf-init-test-"));
const target = join(dir, "proj");
try {
const res = runInit([target, "--non-interactive"]);
- expect(res.status).toBe(1);
- expect(res.stderr).toContain("Non-interactive init requires --example, --video, or --audio");
- expect(existsSync(target)).toBe(false);
+ expect(res.status).toBe(0);
+ const html = readFileSync(join(target, "index.html"), "utf-8");
+ expect(html).toContain('data-composition-id="main"');
+ expect(html).toContain("display: flex");
+ expect(html).toContain("align-items: center");
+ expect(html).toContain("font-family: Inter");
+ expect(html).toContain("tl.seek(0)");
+ expect(html).not.toMatch(/transform:\s*translate\(-50%/);
+ expect(html).toMatch(/#root\s*\{[^}]*width:\s*100%/);
+ expect(html).not.toContain("window.__timelines = window.__timelines || {}");
+ expectScaffoldedScripts(target);
} finally {
rmSync(dir, { recursive: true, force: true });
}
@@ -82,6 +98,21 @@ describe("hyperframes init flag rename", () => {
}
});
+ it("deprecated --agent still scaffolds the same centered blank", () => {
+ const dir = mkdtempSync(join(tmpdir(), "hf-init-test-"));
+ const target = join(dir, "proj");
+ try {
+ const res = runInit([target, "--agent"]);
+ expect(res.status).toBe(0);
+ const html = readFileSync(join(target, "index.html"), "utf-8");
+ expect(html).toContain("font-family: Inter");
+ expect(html).toContain("tl.seek(0)");
+ expectScaffoldedScripts(target);
+ } finally {
+ rmSync(dir, { recursive: true, force: true });
+ }
+ });
+
it("--example blank scaffolds a bundled project with npm scripts", () => {
const dir = mkdtempSync(join(tmpdir(), "hf-init-test-"));
const target = join(dir, "proj");
@@ -169,6 +200,34 @@ describe("hyperframes init flag rename", () => {
expect(injected).not.toContain("setTimeout");
});
+ it("packs from-file and wires --video into the composition", () => {
+ const copySource = readFileSync(
+ new URL("../../scripts/build-copy.mjs", import.meta.url),
+ "utf-8",
+ );
+ expect(copySource).toContain('for (const tmpl of ["blank", "from-file", "_shared"])');
+ const dir = mkdtempSync(join(tmpdir(), "hf-init-test-"));
+ const target = join(dir, "proj");
+ const clip = join(dir, "clip.mp4");
+ copyFileSync(
+ resolve(
+ fileURLToPath(import.meta.url),
+ "../../../../studio/tests/e2e/fixtures/design-panel-qa/assets/test.mp4",
+ ),
+ clip,
+ );
+ try {
+ const res = runInit([target, "--non-interactive", "--skip-transcribe", "--video", clip]);
+ expect(res.status).toBe(0);
+ const html = readFileSync(join(target, "index.html"), "utf-8");
+ expect(html).toContain('id="a-roll"');
+ expect(html).toContain('src="clip.mp4"');
+ expect(existsSync(join(target, "clip.mp4"))).toBe(true);
+ } finally {
+ rmSync(dir, { recursive: true, force: true });
+ }
+ });
+
it("-v works as the short alias for --video", () => {
const dir = mkdtempSync(join(tmpdir(), "hf-init-test-"));
const target = join(dir, "proj");
diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts
index 47a2f7d156..d3f614b7ed 100644
--- a/packages/cli/src/commands/init.ts
+++ b/packages/cli/src/commands/init.ts
@@ -15,14 +15,11 @@ export const examples: Example[] = [
["Scaffold a portrait video", "hyperframes init my-video --resolution portrait"],
["Start from an existing video file", "hyperframes init my-video --video clip.mp4"],
["Start from an audio file", "hyperframes init my-video --audio track.mp3"],
- ["Scaffold with Tailwind CSS", "hyperframes init my-video --example blank --tailwind"],
- [
- "Non-interactive mode (for CI or AI agents)",
- "hyperframes init my-video --example blank --non-interactive",
- ],
+ ["Scaffold with Tailwind CSS", "hyperframes init my-video --tailwind"],
+ ["Non-interactive mode (for CI or AI agents)", "hyperframes init my-video --non-interactive"],
[
"Opt out of the GitHub skills check (CI/tests only)",
- "HYPERFRAMES_SKIP_SKILLS=1 hyperframes init my-video --example blank --non-interactive",
+ "HYPERFRAMES_SKIP_SKILLS=1 hyperframes init my-video --non-interactive",
],
];
import {
@@ -57,6 +54,13 @@ import {
type CanvasResolution,
} from "@hyperframes/core";
+function resolveScaffoldTemplateId(exampleFlag: string | undefined, hasMediaFile: boolean): string {
+ const example = exampleFlag === "agent" ? "blank" : exampleFlag;
+ if (example && example !== "blank") return example;
+ if (hasMediaFile) return "from-file";
+ return "blank";
+}
+
interface VideoMeta {
durationSeconds: number;
width: number;
@@ -722,6 +726,11 @@ export default defineCommand({
type: "boolean",
description: "Disable interactive prompts (for CI/agents)",
},
+ agent: {
+ type: "boolean",
+ hidden: true,
+ description: "Deprecated alias; default init is the centered blank",
+ },
"skip-skills": {
type: "boolean",
description:
@@ -783,7 +792,7 @@ export default defineCommand({
const skipSkills = process.env.HYPERFRAMES_SKIP_SKILLS === "1";
const skipSkillsFlagIgnored = args["skip-skills"] === true && !skipSkills;
const tailwind = args.tailwind === true;
- const nonInteractive = args["non-interactive"] === true;
+ const nonInteractive = args["non-interactive"] === true || args.agent === true;
const modelFlag = args.model;
const languageFlag = args.language;
const initialTranscriptionModel = initialModelForLanguage(
@@ -820,17 +829,7 @@ export default defineCommand({
// Non-interactive mode — all inputs from flags, defaults where missing
// -----------------------------------------------------------------------
if (!interactive) {
- if (!exampleFlag && !videoFlag && !audioFlag) {
- console.error(
- c.error(
- "Non-interactive init requires --example, --video, or --audio. " +
- "For an empty starter project, pass --example blank explicitly.",
- ),
- );
- failCommand();
- }
-
- const templateId = exampleFlag ?? "blank";
+ const templateId = resolveScaffoldTemplateId(exampleFlag, Boolean(videoFlag || audioFlag));
const name = args.name ?? "my-video";
const destDir = resolve(name);
@@ -1091,8 +1090,8 @@ export default defineCommand({
// 3. Pick example — skip prompt if --example was provided
let templateId: string;
- if (exampleFlag) {
- templateId = exampleFlag;
+ if (exampleFlag || videoFlag || audioFlag) {
+ templateId = resolveScaffoldTemplateId(exampleFlag, Boolean(videoFlag || audioFlag));
} else {
// Resolve full template list (bundled + remote)
const allTemplates = await resolveTemplateList();
diff --git a/packages/cli/src/commands/render.test.ts b/packages/cli/src/commands/render.test.ts
index bcd7871f34..4c9e065bc9 100644
--- a/packages/cli/src/commands/render.test.ts
+++ b/packages/cli/src/commands/render.test.ts
@@ -429,13 +429,53 @@ describe("renderLocal browser GPU config", () => {
quiet: true,
});
- expect(producerState.resolveConfigCalls).toContainEqual({ browserGpuMode: "auto" });
+ expect(producerState.resolveConfigCalls).toContainEqual({
+ browserGpuMode: "auto",
+ forceScreenshot: false,
+ });
expect(producerState.createdJobs[0]?.producerConfig).toMatchObject({
browserGpuMode: "auto",
resolved: true,
});
});
+ it("honors PRODUCER_FORCE_SCREENSHOT=true even on local auto GPU", async () => {
+ const prev = process.env.PRODUCER_FORCE_SCREENSHOT;
+ process.env.PRODUCER_FORCE_SCREENSHOT = "true";
+ try {
+ await renderLocal("/tmp/project", "/tmp/out.mp4", {
+ fps: { num: 30, den: 1 },
+ quality: "standard",
+ format: "mp4",
+ gpu: false,
+ browserGpuMode: "auto",
+ hdrMode: "auto",
+ quiet: true,
+ });
+ expect(producerState.resolveConfigCalls).toContainEqual({ browserGpuMode: "auto" });
+ expect(producerState.resolveConfigCalls[0]).not.toHaveProperty("forceScreenshot");
+ } finally {
+ if (prev === undefined) delete process.env.PRODUCER_FORCE_SCREENSHOT;
+ else process.env.PRODUCER_FORCE_SCREENSHOT = prev;
+ }
+ });
+
+ it("keeps the screenshot clamp when --resolution supersamples", async () => {
+ await renderLocal("/tmp/project", "/tmp/out.mp4", {
+ fps: { num: 30, den: 1 },
+ quality: "standard",
+ format: "mp4",
+ gpu: false,
+ browserGpuMode: "auto",
+ hdrMode: "auto",
+ quiet: true,
+ outputResolution: "landscape",
+ });
+
+ expect(producerState.resolveConfigCalls).toContainEqual({ browserGpuMode: "auto" });
+ expect(producerState.resolveConfigCalls[0]).not.toHaveProperty("forceScreenshot");
+ });
+
it("passes an explicit hardware override for default local browser GPU", async () => {
await renderLocal("/tmp/project", "/tmp/out.mp4", {
fps: { num: 30, den: 1 },
diff --git a/packages/cli/src/commands/render.ts b/packages/cli/src/commands/render.ts
index b14f1a01d8..09b6ffa291 100644
--- a/packages/cli/src/commands/render.ts
+++ b/packages/cli/src/commands/render.ts
@@ -54,7 +54,14 @@ import { resolve, dirname, join, basename } from "node:path";
import { execFileSync, spawn } from "node:child_process";
import { loadProducer } from "../utils/producer.js";
import { c } from "../ui/colors.js";
-import { formatBytes, formatRenderSummaryDetail, errorBox } from "../ui/format.js";
+import {
+ formatBytes,
+ formatRenderSummaryDetail,
+ formatRenderPipelineDetail,
+ formatScreenshotFallbackHint,
+ resolvePrintedCaptureMode,
+ errorBox,
+} from "../ui/format.js";
import { warnIfWebmAlphaDropped } from "../utils/webmAlphaCheck.js";
import { renderProgress } from "../ui/progress.js";
import {
@@ -91,7 +98,7 @@ import {
runPostRenderStep,
runPostRenderStepAsync,
} from "../utils/render-success-state.js";
-import type { ProducerLogger, RenderJob } from "@hyperframes/producer";
+import type { ProducerLogger, RenderJob, RenderPerfSummary } from "@hyperframes/producer";
import { EXTRACT_CACHE_DIR_DISABLED_ALIASES, type VideoFrameFormat } from "@hyperframes/engine";
import {
checkOutputResolutionCompatibility,
@@ -143,8 +150,8 @@ export default defineCommand({
type: "string",
alias: "q",
description:
- "Quality: draft, standard, high. MOV always uses the fixed alpha-preserving ProRes 4444 profile.",
- default: "standard",
+ "Quality: draft, looks, delivery, or standard/high. looks is the default (CRF 16). delivery is high. MOV always uses the fixed alpha-preserving ProRes 4444 profile.",
+ default: "looks",
},
skill: {
type: "string",
@@ -885,6 +892,13 @@ export async function renderLocal(
const engineConfig = producer.resolveConfig({
browserGpuMode: options.browserGpuMode ?? "software",
+ // Local auto opts out of the software-GPU screenshot clamp. Docker and
+ // --no-browser-gpu request software; --resolution supersamples via screenshot.
+ ...(options.browserGpuMode === "auto" &&
+ options.outputResolution == null &&
+ process.env.PRODUCER_FORCE_SCREENSHOT !== "true"
+ ? { forceScreenshot: false }
+ : {}),
...(options.pageNavigationTimeoutMs != null
? { pageNavigationTimeout: options.pageNavigationTimeoutMs }
: {}),
@@ -961,8 +975,8 @@ export async function renderLocal(
outputPath,
elapsed,
options.quiet,
- job.perfSummary?.compositionDurationSeconds,
- job.perfSummary?.totalFrames,
+ job.perfSummary,
+ options.browserGpuMode,
),
);
runPostRenderStep("warnIfWebmAlphaDropped", () =>
@@ -1602,48 +1616,70 @@ function trackRenderMetrics(
});
}
-function printRenderComplete(
- outputPath: string,
- elapsedMs: number,
- quiet: boolean,
- outputDurationSeconds?: number,
- frameCount?: number,
-): void {
- if (quiet) return;
-
- let fileSize = "unknown";
- let isDirectory = false;
+function readOutputFootprint(outputPath: string): { fileSize: string; isDirectory: boolean } {
try {
const stat = statSync(outputPath);
- isDirectory = stat.isDirectory();
- if (stat.isDirectory()) {
- // png-sequence output is a directory; sum the contained file sizes so
- // the user sees the on-disk footprint of the deliverable rather than
- // the platform-specific size of the directory inode itself.
- let total = 0;
- for (const entry of readdirSync(outputPath, { withFileTypes: true })) {
- if (!entry.isFile()) continue;
- try {
- total += statSync(join(outputPath, entry.name)).size;
- } catch {
- // skip unreadable entries
- }
+ if (!stat.isDirectory()) return { fileSize: formatBytes(stat.size), isDirectory: false };
+ // png-sequence output is a directory; sum contained file sizes so the
+ // user sees the deliverable footprint, not the directory inode size.
+ let total = 0;
+ for (const entry of readdirSync(outputPath, { withFileTypes: true })) {
+ if (!entry.isFile()) continue;
+ try {
+ total += statSync(join(outputPath, entry.name)).size;
+ } catch {
+ // skip unreadable entries
}
- fileSize = formatBytes(total);
- } else {
- fileSize = formatBytes(stat.size);
}
+ return { fileSize: formatBytes(total), isDirectory: true };
} catch {
- // file doesn't exist or is inaccessible
+ return { fileSize: "unknown", isDirectory: false };
}
+}
+function printRenderComplete(
+ outputPath: string,
+ elapsedMs: number,
+ quiet: boolean,
+ perf?: RenderPerfSummary,
+ requestedGpuMode?: "auto" | "hardware" | "software",
+): void {
+ if (quiet) return;
+ const { fileSize, isDirectory } = readOutputFootprint(outputPath);
const detail = formatRenderSummaryDetail({
elapsedMs,
- outputDurationSeconds,
+ outputDurationSeconds: perf?.compositionDurationSeconds,
isDirectory,
- frameCount,
+ frameCount: perf?.totalFrames,
});
console.log("");
console.log(c.success("\u25C7") + " " + c.accent(outputPath));
console.log(" " + c.bold(fileSize) + c.dim(" \u00B7 " + detail));
+ if (perf) printRenderPipeline(perf, requestedGpuMode);
+}
+
+function printRenderPipeline(
+ perf: RenderPerfSummary,
+ requestedGpuMode?: "auto" | "hardware" | "software",
+): void {
+ // aggregateDrawElement reports "unknown" when no session recorded a mode.
+ const capture = {
+ captureMode: resolvePrintedCaptureMode(
+ perf.drawElement?.mode,
+ perf.observability?.capture.captureMode,
+ ),
+ browserGpuMode: perf.observability?.capture.browserGpuMode,
+ };
+ const pipeline = formatRenderPipelineDetail({
+ ...capture,
+ streamingEncode: perf.observability?.capture.useStreamingEncode,
+ stages: perf.stages,
+ });
+ if (pipeline) console.log(" " + c.dim(pipeline));
+ const hint = formatScreenshotFallbackHint({
+ ...capture,
+ requestedGpuMode,
+ platform: process.platform,
+ });
+ if (hint) console.log(" " + c.dim(hint));
}
diff --git a/packages/cli/src/commands/render/plan.test.ts b/packages/cli/src/commands/render/plan.test.ts
index da3a058a6c..5aaa6e08e1 100644
--- a/packages/cli/src/commands/render/plan.test.ts
+++ b/packages/cli/src/commands/render/plan.test.ts
@@ -89,6 +89,25 @@ describe("createRenderPlan", () => {
expect(() => createRenderPlan({ dir: projectDir, quality: "maximum" })).toThrow(CliUsageError);
});
+ it("maps looks to standard encode with CRF 16, and delivery to high", () => {
+ expect(createRenderPlan({ dir: projectDir, quality: "looks" })).toMatchObject({
+ quality: "standard",
+ crf: 16,
+ });
+ expect(createRenderPlan({ dir: projectDir, quality: "delivery" })).toMatchObject({
+ quality: "high",
+ crf: undefined,
+ });
+ expect(createRenderPlan({ dir: projectDir })).toMatchObject({ quality: "standard", crf: 16 });
+ });
+
+ it("does not inject looks CRF when --crf or MOV is already set", () => {
+ expect(createRenderPlan({ dir: projectDir, quality: "looks", crf: "20" }).crf).toBe(20);
+ expect(
+ createRenderPlan({ dir: projectDir, format: "mov", quality: "looks" }).crf,
+ ).toBeUndefined();
+ });
+
it.each([
["--crf", { crf: "18" }],
["--video-bitrate", { "video-bitrate": "78M" }],
diff --git a/packages/cli/src/commands/render/plan.ts b/packages/cli/src/commands/render/plan.ts
index 52f2efb0ad..83a25c5048 100644
--- a/packages/cli/src/commands/render/plan.ts
+++ b/packages/cli/src/commands/render/plan.ts
@@ -31,7 +31,13 @@ import { normalizeSkillSlug } from "../../telemetry/skill.js";
import { loadProjectConfig } from "../../utils/projectConfig.js";
import { type CatalogUsage, summarizeCatalogUsage } from "../../utils/catalogUsage.js";
-const VALID_QUALITY = new Set(["draft", "standard", "high"]);
+const QUALITY_ALIASES = {
+ draft: { quality: "draft" as const },
+ standard: { quality: "standard" as const },
+ high: { quality: "high" as const },
+ looks: { quality: "standard" as const, crf: 16 },
+ delivery: { quality: "high" as const },
+} as const;
const RENDER_FORMATS = ["mp4", "webm", "mov", "png-sequence", "gif"] as const;
const VALID_FORMAT = new Set<string>(RENDER_FORMATS);
const RENDER_FORMAT_LABEL = "mp4, webm, mov, png-sequence, or gif";
@@ -189,12 +195,16 @@ export function createRenderPlan(args: RenderCommandArgs, now = new Date()): Ren
}
let fps = fpsParse.value;
- const qualityRaw = args.quality ?? "standard";
- if (!VALID_QUALITY.has(qualityRaw)) {
- errorBox("Invalid quality", `Got "${qualityRaw}". Must be draft, standard, or high.`);
+ const qualityRaw = args.quality ?? "looks";
+ if (!(qualityRaw in QUALITY_ALIASES)) {
+ errorBox(
+ "Invalid quality",
+ `Got "${qualityRaw}". Must be draft, looks, delivery, standard, or high.`,
+ );
failUsage();
}
- const quality = qualityRaw as RenderQuality;
+ const qualityAlias = QUALITY_ALIASES[qualityRaw as keyof typeof QUALITY_ALIASES];
+ const quality = qualityAlias.quality;
// Attribution resolves the explicit --skill flag first, then falls back to
// the owning skill persisted in hyperframes.json — so re-renders, batch
@@ -388,7 +398,11 @@ export function createRenderPlan(args: RenderCommandArgs, now = new Date()): Ren
`Got "${args.crf}". Must be a non-negative integer.`,
0,
)
- : undefined;
+ : format === "mov" || args["video-bitrate"]
+ ? undefined
+ : "crf" in qualityAlias
+ ? qualityAlias.crf
+ : undefined;
let vp9CpuUsed: number | undefined;
if (args["vp9-cpu-used"] != null) {
const parsed = Number(args["vp9-cpu-used"]);
diff --git a/packages/cli/src/docs/examples.md b/packages/cli/src/docs/examples.md
index e79e96073b..f4dad33f7d 100644
--- a/packages/cli/src/docs/examples.md
+++ b/packages/cli/src/docs/examples.md
@@ -4,7 +4,7 @@ Built-in templates available via `npx hyperframes init --example <name>`.
## blank
-Empty 1920x1080 composition with GSAP timeline wired up. Start from scratch.
+Centered Inter stage, paused GSAP timeline. Default `hyperframes init` scaffold.
## title-card
diff --git a/packages/cli/src/telemetry/agent_runtime.test.ts b/packages/cli/src/telemetry/agent_runtime.test.ts
index 3d46b12279..3bd669d253 100644
--- a/packages/cli/src/telemetry/agent_runtime.test.ts
+++ b/packages/cli/src/telemetry/agent_runtime.test.ts
@@ -1,4 +1,5 @@
import { describe, expect, it, beforeEach, afterEach, vi } from "vitest";
+import { HINT_KEY_PATTERN } from "./agent_runtime.js";
// agent_runtime.ts reads node:os via release/platform and node:fs for the
// /proc files. detectAgentRuntime is exercised by mutating process.env;
@@ -27,6 +28,10 @@ const VENDOR_ENV_KEYS = [
function stripVendorEnv(): void {
for (const key of VENDOR_ENV_KEYS) delete process.env[key];
+ // Ambient session keys would otherwise fill the 16-key hint cap.
+ for (const key of Object.keys(process.env)) {
+ if (HINT_KEY_PATTERN.test(key.toUpperCase())) delete process.env[key];
+ }
}
describe("detectAgentRuntime — base behavior", () => {
@@ -394,6 +399,15 @@ describe("detectAgentHints — new-agent discovery signals", () => {
expect(detectAgentHints().agent_env_hints).toContain("FOO_AGENT_SESSION_ID");
});
+ it("clears a full 16-key ambient cap so a fixture key still fits", async () => {
+ for (let i = 0; i < 16; i++) process.env[`AAA_AGENT_${String(i).padStart(2, "0")}`] = "1";
+ process.env["FOO_AGENT_SESSION_ID"] = "x";
+ stripVendorEnv();
+ process.env["FOO_AGENT_SESSION_ID"] = "x";
+ const { detectAgentHints } = await import("./agent_runtime.js");
+ expect(detectAgentHints().agent_env_hints).toContain("FOO_AGENT_SESSION_ID");
+ });
+
it("excludes SSH/GPG agent false-friends from agent_env_hints", async () => {
process.env["SSH_AGENT_PID"] = "12345";
const { detectAgentHints } = await import("./agent_runtime.js");
diff --git a/packages/cli/src/telemetry/agent_runtime.ts b/packages/cli/src/telemetry/agent_runtime.ts
index a7b21367ee..8cd40a246d 100644
--- a/packages/cli/src/telemetry/agent_runtime.ts
+++ b/packages/cli/src/telemetry/agent_runtime.ts
@@ -340,7 +340,7 @@ function sanitizeHint(value: string | undefined): string | null {
// friends, which are credential agents, not coding agents. No bare `CODING`
// token — it substring-matches `ENCODING` (e.g. PYTHONIOENCODING) and real
// coding-agent keys already match via `AGENT` (e.g. PI_CODING_AGENT).
-const HINT_KEY_PATTERN = /AGENT|ASSISTANT|COPILOT|CODEX|CLAUDE|LLM|_THREAD_ID$|_SESSION_ID$/;
+export const HINT_KEY_PATTERN = /AGENT|ASSISTANT|COPILOT|CODEX|CLAUDE|LLM|_THREAD_ID$|_SESSION_ID$/;
function isDiscoveryHintKey(upperKey: string): boolean {
if (upperKey === "AGENT" || upperKey === "AI_AGENT") return false;
diff --git a/packages/cli/src/templates/blank/index.html b/packages/cli/src/templates/blank/index.html
index 8ce4ea8cdd..3404e5223d 100644
--- a/packages/cli/src/templates/blank/index.html
+++ b/packages/cli/src/templates/blank/index.html
@@ -16,15 +16,21 @@
width: 1920px;
height: 1080px;
overflow: hidden;
- background: #000;
+ background: #0a0a0a;
}
- body {
- font-family: "Inter", sans-serif;
+ #root {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}
- code,
- pre,
- .monospace {
- font-family: "JetBrains Mono", monospace;
+ #title {
+ color: #f4f4f5;
+ font-size: 72px;
+ font-weight: 600;
+ letter-spacing: -0.03em;
}
</style>
</head>
@@ -33,43 +39,17 @@
id="root"
data-composition-id="main"
data-start="0"
- data-duration="__VIDEO_DURATION__"
+ data-duration="10"
data-width="1920"
data-height="1080"
>
- <video
- id="a-roll"
- class="clip"
- src="__VIDEO_SRC__"
- muted
- playsinline
- data-duration="__VIDEO_DURATION__"
- data-track-index="0"
- style="position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover"
- ></video>
- <audio
- id="a-roll-audio"
- src="__VIDEO_SRC__"
- data-start="0"
- data-duration="__VIDEO_DURATION__"
- data-track-index="2"
- data-volume="1"
- ></audio>
-
- <!--
- Add your clips here. Example:
- <div id="title" class="clip" data-start="0" data-duration="5" data-track-index="1"
- style="font-size: 64px; color: #fff; padding: 40px">
- Hello World
- </div>
- -->
+ <h1 id="title" class="clip" data-start="0" data-duration="10" data-track-index="0">Title</h1>
</div>
-
<script>
- window.__timelines = window.__timelines || {};
const tl = gsap.timeline({ paused: true });
- // Example: tl.from("#title", { opacity: 0, y: -50, duration: 1 }, 0);
+ // Example: tl.fromTo("#title", { opacity: 0, y: 24 }, { opacity: 1, y: 0, duration: 0.6 }, 0);
window.__timelines["main"] = tl;
+ tl.seek(0);
</script>
</body>
</html>
diff --git a/packages/cli/src/templates/from-file/index.html b/packages/cli/src/templates/from-file/index.html
new file mode 100644
index 0000000000..04c92deb98
--- /dev/null
+++ b/packages/cli/src/templates/from-file/index.html
@@ -0,0 +1,74 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=1920, height=1080" />
+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>
+ <style>
+ * {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+ }
+ html,
+ body {
+ margin: 0;
+ width: 1920px;
+ height: 1080px;
+ overflow: hidden;
+ background: #000;
+ }
+ body {
+ font-family: "Inter", sans-serif;
+ }
+ code,
+ pre,
+ .monospace {
+ font-family: "JetBrains Mono", monospace;
+ }
+ </style>
+ </head>
+ <body>
+ <div
+ id="root"
+ data-composition-id="main"
+ data-start="0"
+ data-duration="__VIDEO_DURATION__"
+ data-width="1920"
+ data-height="1080"
+ >
+ <video
+ id="a-roll"
+ class="clip"
+ src="__VIDEO_SRC__"
+ muted
+ playsinline
+ data-duration="__VIDEO_DURATION__"
+ data-track-index="0"
+ style="position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover"
+ ></video>
+ <audio
+ id="a-roll-audio"
+ src="__VIDEO_SRC__"
+ data-start="0"
+ data-duration="__VIDEO_DURATION__"
+ data-track-index="2"
+ data-volume="1"
+ ></audio>
+
+ <!--
+ Add your clips here. Example:
+ <div id="title" class="clip" data-start="0" data-duration="5" data-track-index="1"
+ style="font-size: 64px; color: #fff; padding: 40px">
+ Hello World
+ </div>
+ -->
+ </div>
+
+ <script>
+ const tl = gsap.timeline({ paused: true });
+ // Example: tl.from("#title", { opacity: 0, y: -50, duration: 1 }, 0);
+ window.__timelines["main"] = tl;
+ </script>
+ </body>
+</html>
diff --git a/packages/cli/src/templates/generators.ts b/packages/cli/src/templates/generators.ts
index b64ddb170a..5281c66d06 100644
--- a/packages/cli/src/templates/generators.ts
+++ b/packages/cli/src/templates/generators.ts
@@ -20,7 +20,7 @@ export const BUNDLED_TEMPLATES: TemplateOption[] = [
{
id: "blank",
label: "Blank",
- hint: "Empty composition — just the scaffolding",
+ hint: "Centered Inter stage, paused timeline",
source: "bundled",
},
];
diff --git a/packages/cli/src/ui/format.test.ts b/packages/cli/src/ui/format.test.ts
index f1d17374bb..c7c1fe4db7 100644
--- a/packages/cli/src/ui/format.test.ts
+++ b/packages/cli/src/ui/format.test.ts
@@ -1,6 +1,81 @@
import { describe, expect, it } from "vitest";
-import { formatRenderSummaryDetail } from "./format.js";
+import {
+ formatRenderPipelineDetail,
+ formatRenderSummaryDetail,
+ formatScreenshotFallbackHint,
+ resolvePrintedCaptureMode,
+} from "./format.js";
+
+describe("formatRenderPipelineDetail", () => {
+ it("names the capture path, gpu mode and each stage in pipeline order", () => {
+ const line = formatRenderPipelineDetail({
+ captureMode: "screenshot",
+ browserGpuMode: "software",
+ stages: { encodeMs: 5767, captureFrameMs: 22856, compileMs: 685, assembleMs: 509 },
+ });
+ expect(line).toBe(
+ "screenshot capture · software gpu · compile 0.7s · capture 22.9s · encode 5.8s · assemble 0.5s",
+ );
+ });
+
+ it("skips fields that were never measured and returns nothing for an empty summary", () => {
+ expect(formatRenderPipelineDetail({ captureMode: "beginframe", stages: {} })).toBe(
+ "beginframe capture",
+ );
+ expect(formatRenderPipelineDetail({ stages: {} })).toBeUndefined();
+ });
+
+ it("keeps a measured 0 ms stage instead of dropping it", () => {
+ // a silent composition still records audioProcessMs = 0
+ expect(formatRenderPipelineDetail({ stages: { audioProcessMs: 0 } })).toBe("audio 0.0s");
+ });
+
+ it("labels encode as overlapped when the streaming encoder ran", () => {
+ expect(
+ formatRenderPipelineDetail({
+ streamingEncode: true,
+ stages: { captureFrameMs: 10_000, encodeMs: 4_000 },
+ }),
+ ).toBe("capture 10.0s · encode (during capture) 4.0s");
+ });
+});
+
+describe("resolvePrintedCaptureMode", () => {
+ it("prefers the session mode, including a joined fallback, over observability", () => {
+ expect(resolvePrintedCaptureMode("drawelement", "screenshot")).toBe("drawelement");
+ expect(resolvePrintedCaptureMode("beginframe|screenshot", "screenshot")).toBe(
+ "beginframe|screenshot",
+ );
+ });
+
+ it("treats the aggregator's unknown sentinel as absent and uses observability", () => {
+ expect(resolvePrintedCaptureMode("unknown", "screenshot")).toBe("screenshot");
+ expect(resolvePrintedCaptureMode(undefined, "beginframe")).toBe("beginframe");
+ expect(resolvePrintedCaptureMode("unknown", undefined)).toBeUndefined();
+ });
+});
+
+describe("formatScreenshotFallbackHint", () => {
+ const slow = {
+ captureMode: "screenshot",
+ browserGpuMode: "software" as const,
+ requestedGpuMode: "auto" as const,
+ platform: "linux" as const,
+ };
+
+ it("explains the slow path only for linux + auto-probed software gpu + screenshot", () => {
+ expect(formatScreenshotFallbackHint(slow)).toContain("BeginFrame did not run");
+ expect(formatScreenshotFallbackHint({ ...slow, platform: "darwin" })).toBeUndefined();
+ expect(formatScreenshotFallbackHint({ ...slow, browserGpuMode: "hardware" })).toBeUndefined();
+ expect(formatScreenshotFallbackHint({ ...slow, captureMode: "beginframe" })).toBeUndefined();
+ });
+
+ it("stays silent when software gpu was requested, as --docker and --no-browser-gpu do", () => {
+ expect(formatScreenshotFallbackHint({ ...slow, requestedGpuMode: "software" })).toBeUndefined();
+ expect(formatScreenshotFallbackHint({ ...slow, requestedGpuMode: undefined })).toBeUndefined();
+ });
+});
describe("formatRenderSummaryDetail", () => {
it("shows the output video length as the primary figure and labels render time", () => {
diff --git a/packages/cli/src/ui/format.ts b/packages/cli/src/ui/format.ts
index e76792ac33..f2dea5ce7f 100644
--- a/packages/cli/src/ui/format.ts
+++ b/packages/cli/src/ui/format.ts
@@ -1,3 +1,4 @@
+import type { BrowserGpuMode } from "../browser/gpuPolicy.js";
import { c } from "./colors.js";
export function formatBytes(bytes: number): string {
@@ -39,6 +40,74 @@ export function formatRenderSummaryDetail(input: {
return [middle, renderTime].filter(Boolean).join(" · ");
}
+type PipelineStageKey =
+ | "compileMs"
+ | "videoExtractMs"
+ | "audioProcessMs"
+ | "browserProbeMs"
+ | "captureSetupMs"
+ | "captureFrameMs"
+ | "encodeMs"
+ | "assembleMs";
+
+const PIPELINE_STAGES: ReadonlyArray<readonly [PipelineStageKey, string]> = [
+ ["compileMs", "compile"],
+ ["videoExtractMs", "extract"],
+ ["audioProcessMs", "audio"],
+ ["browserProbeMs", "probe"],
+ ["captureSetupMs", "setup"],
+ ["captureFrameMs", "capture"],
+ ["encodeMs", "encode"],
+ ["assembleMs", "assemble"],
+];
+
+/** Session mode wins unless it is the aggregator's empty `"unknown"` sentinel. */
+export function resolvePrintedCaptureMode(
+ sessionMode?: string,
+ observabilityCaptureMode?: string,
+): string | undefined {
+ if (sessionMode && sessionMode !== "unknown") return sessionMode;
+ return observabilityCaptureMode;
+}
+
+/** Capture path, gpu mode, and stage timings for the render summary. */
+export function formatRenderPipelineDetail(input: {
+ captureMode?: string;
+ browserGpuMode?: BrowserGpuMode | string;
+ streamingEncode?: boolean;
+ stages: Record<string, number | undefined>;
+}): string | undefined {
+ const parts: string[] = [];
+ if (input.captureMode) parts.push(`${input.captureMode} capture`);
+ if (input.browserGpuMode) parts.push(`${input.browserGpuMode} gpu`);
+ for (const [key, stageLabel] of PIPELINE_STAGES) {
+ const ms = input.stages[key];
+ if (ms == null) continue;
+ const label =
+ key === "encodeMs" && input.streamingEncode ? "encode (during capture)" : stageLabel;
+ parts.push(`${label} ${formatDuration(ms)}`);
+ }
+ return parts.length > 0 ? parts.join(" · ") : undefined;
+}
+
+/**
+ * Why a Linux auto render stayed on screenshot after BeginFrame was requested.
+ * Silent when software was requested (--docker, --no-browser-gpu) or off Linux.
+ */
+export function formatScreenshotFallbackHint(input: {
+ captureMode?: string;
+ browserGpuMode?: BrowserGpuMode | string;
+ requestedGpuMode?: BrowserGpuMode;
+ platform: NodeJS.Platform;
+}): string | undefined {
+ if (input.platform !== "linux" || input.requestedGpuMode !== "auto") return undefined;
+ if (input.captureMode !== "screenshot" || input.browserGpuMode !== "software") return undefined;
+ return (
+ "Screenshot capture (slower): BeginFrame did not run. Needs chrome-headless-shell and no " +
+ "--resolution upscale. Heavy compositions can stall on software GL."
+ );
+}
+
export function label(name: string, value: string): string {
const pad = 14 - name.length;
return ` ${c.dim(name)}${" ".repeat(Math.max(1, pad))}${c.bold(value)}`;
diff --git a/packages/lint/src/rules/gsap.test.ts b/packages/lint/src/rules/gsap.test.ts
index 687b36d2e6..e4a0798cd2 100644
--- a/packages/lint/src/rules/gsap.test.ts
+++ b/packages/lint/src/rules/gsap.test.ts
@@ -1557,164 +1557,6 @@ describe("GSAP rules", () => {
expect(finding).toBeUndefined();
});
- it("warns when an opacity exit ends at a clip start boundary without a hard kill", async () => {
- const html = `
-<html><body>
- <div data-composition-id="c1" data-width="1920" data-height="1080" data-start="0" data-duration="6">
- <div id="scene-a" class="clip" data-start="0" data-duration="3" data-track-index="0">
- <h1 id="headline">First beat</h1>
- </div>
- <div id="scene-b" class="clip" data-start="3" data-duration="3" data-track-index="0">
- <h1>Second beat</h1>
- </div>
- </div>
- <script src="https://cdn.jsdelivr.net/npm/gsap@3/dist/gsap.min.js"></script>
- <script>
- window.__timelines = window.__timelines || {};
- const tl = gsap.timeline({ paused: true });
- tl.to("#headline", { opacity: 0, duration: 0.3 }, 2.7);
- window.__timelines["c1"] = tl;
- </script>
-</body></html>`;
- const result = await lintHyperframeHtml(html);
- const finding = result.findings.find((f) => f.code === "gsap_exit_missing_hard_kill");
- expect(finding).toBeDefined();
- expect(finding?.severity).toBe("error");
- expect(finding?.selector).toBe("#headline");
- expect(finding?.message).toContain("3.00s");
- });
-
- it("gsap_exit_missing_hard_kill points at the inner-wrapper pattern when the exiting selector is a clip element", async () => {
- // Regression: a tl.set hard kill on a clip-classed selector is exactly what
- // gsap_animates_clip_element then errors on — the two rules must not give
- // contradictory advice for a crossfading scene that is itself class="clip".
- const html = `
-<html><body>
- <div data-composition-id="c1" data-width="1920" data-height="1080" data-start="0" data-duration="6">
- <div id="scene-a" class="clip" data-start="0" data-duration="3" data-track-index="0"></div>
- <div id="scene-b" class="clip" data-start="3" data-duration="3" data-track-index="0"></div>
- </div>
- <script src="https://cdn.jsdelivr.net/npm/gsap@3/dist/gsap.min.js"></script>
- <script>
- window.__timelines = window.__timelines || {};
- const tl = gsap.timeline({ paused: true });
- tl.to("#scene-a", { opacity: 0, duration: 0.3 }, 2.7);
- window.__timelines["c1"] = tl;
- </script>
-</body></html>`;
- const result = await lintHyperframeHtml(html);
- const finding = result.findings.find((f) => f.code === "gsap_exit_missing_hard_kill");
- expect(finding).toBeDefined();
- expect(finding?.fixHint).toContain("clip element");
- expect(finding?.fixHint).toContain("inner");
- expect(finding?.fixHint).not.toContain('tl.set("#scene-a"');
- });
-
- it("does NOT report gsap_exit_missing_hard_kill for an unresolved-target boundary exit", async () => {
- // The exit tween targets an element via a value the parser cannot resolve (a helper
- // call), so it collapses to the `__unresolved__` sentinel. You cannot assert a missing
- // hard kill on an unknown element, and a `tl.set("__unresolved__", ...)` hint is
- // meaningless. The resolved-target exit in the same timeline is still flagged.
- const html = `
-<html><body>
- <div data-composition-id="c1" data-width="1920" data-height="1080" data-start="0" data-duration="6">
- <div id="scene-a" class="clip" data-start="0" data-duration="3" data-track-index="0">
- <h1 id="headline">First beat</h1>
- </div>
- <div id="scene-b" class="clip" data-start="3" data-duration="3" data-track-index="0">
- <h1>Second beat</h1>
- </div>
- </div>
- <script src="https://cdn.jsdelivr.net/npm/gsap@3/dist/gsap.min.js"></script>
- <script>
- window.__timelines = window.__timelines || {};
- const tl = gsap.timeline({ paused: true });
- const el = pickWord(0);
- tl.to(el, { opacity: 0, duration: 0.3 }, 2.7);
- tl.to("#headline", { opacity: 0, duration: 0.3 }, 2.7);
- window.__timelines["c1"] = tl;
- </script>
-</body></html>`;
- const result = await lintHyperframeHtml(html);
- const exitFindings = result.findings.filter((f) => f.code === "gsap_exit_missing_hard_kill");
- expect(exitFindings).toHaveLength(1);
- expect(exitFindings[0]?.selector).toBe("#headline");
- });
-
- it("does not warn when a boundary exit has a matching hard kill", async () => {
- const html = `
-<html><body>
- <div data-composition-id="c1" data-width="1920" data-height="1080" data-start="0" data-duration="6">
- <div id="scene-a" class="clip" data-start="0" data-duration="3" data-track-index="0">
- <h1 id="headline">First beat</h1>
- </div>
- <div id="scene-b" class="clip" data-start="3" data-duration="3" data-track-index="0">
- <h1>Second beat</h1>
- </div>
- </div>
- <script src="https://cdn.jsdelivr.net/npm/gsap@3/dist/gsap.min.js"></script>
- <script>
- window.__timelines = window.__timelines || {};
- const tl = gsap.timeline({ paused: true });
- tl.to("#headline", { opacity: 0, duration: 0.3 }, 2.7);
- tl.set("#headline", { opacity: 0, visibility: "hidden" }, 3);
- window.__timelines["c1"] = tl;
- </script>
-</body></html>`;
- const result = await lintHyperframeHtml(html);
- const finding = result.findings.find((f) => f.code === "gsap_exit_missing_hard_kill");
- expect(finding).toBeUndefined();
- });
-
- it("does not match sub-composition exits against root clip boundaries", async () => {
- const html = `
-<html><body>
- <div data-composition-id="root" data-width="1920" data-height="1080" data-start="0" data-duration="6">
- <div id="root-a" class="clip" data-start="0" data-duration="3" data-track-index="0"></div>
- <div id="root-b" class="clip" data-start="3" data-duration="3" data-track-index="0"></div>
- </div>
- <div data-composition-id="sub" data-width="1920" data-height="1080" data-start="0" data-duration="4">
- <div id="sub-a" class="clip" data-start="0" data-duration="2" data-track-index="0">
- <h1 id="sub-title">Sub scene</h1>
- </div>
- <div id="sub-b" class="clip" data-start="2" data-duration="2" data-track-index="0"></div>
- </div>
- <script>
- window.__timelines = window.__timelines || {};
- const tl = gsap.timeline({ paused: true });
- tl.to("#sub-title", { opacity: 0, duration: 0.3 }, 2.7);
- window.__timelines["sub"] = tl;
- </script>
-</body></html>`;
- const result = await lintHyperframeHtml(html);
- const finding = result.findings.find((f) => f.code === "gsap_exit_missing_hard_kill");
- expect(finding).toBeUndefined();
- });
-
- it("uses the authored hidden property in hard-kill fix hints", async () => {
- const html = `
-<html><body>
- <div data-composition-id="c1" data-width="1920" data-height="1080" data-start="0" data-duration="6">
- <div id="scene-a" class="clip" data-start="0" data-duration="3" data-track-index="0">
- <h1 id="headline">First beat</h1>
- </div>
- <div id="scene-b" class="clip" data-start="3" data-duration="3" data-track-index="0">
- <h1>Second beat</h1>
- </div>
- </div>
- <script src="https://cdn.jsdelivr.net/npm/gsap@3/dist/gsap.min.js"></script>
- <script>
- window.__timelines = window.__timelines || {};
- const tl = gsap.timeline({ paused: true });
- tl.to("#headline", { autoAlpha: 0, duration: 0.3 }, 2.7);
- window.__timelines["c1"] = tl;
- </script>
-</body></html>`;
- const result = await lintHyperframeHtml(html);
- const finding = result.findings.find((f) => f.code === "gsap_exit_missing_hard_kill");
- expect(finding?.fixHint).toContain("{ autoAlpha: 0 }");
- });
-
it("does not false-positive on repeat: -10 (invalid GSAP but not infinite)", async () => {
const html = `
<html><body>
diff --git a/packages/lint/src/rules/gsap.ts b/packages/lint/src/rules/gsap.ts
index e1abb94f6a..3549d79042 100644
--- a/packages/lint/src/rules/gsap.ts
+++ b/packages/lint/src/rules/gsap.ts
@@ -64,12 +64,6 @@ type GsapWindow = {
raw: string;
};
-type CompositionRange = {
- id: string;
- start: number;
- end: number;
-};
-
const SCENE_BOUNDARY_EPSILON_SECONDS = 0.05;
// Sentinel the GSAP parser assigns to a tween whose target it cannot statically
@@ -90,11 +84,6 @@ function targetHasNoStableIdentity(selector: string, identity?: string): boolean
// ── GSAP parsing utilities ─────────────────────────────────────────────────
-function readRegisteredTimelineCompositionId(script: string): string | null {
- const match = script.match(WINDOW_TIMELINE_ASSIGN_PATTERN);
- return match?.[1] || match?.[2] || null;
-}
-
/** Strip a `__raw:` prefix the parser adds to unresolvable values. */
function unwrapRaw(value: unknown): string | number | undefined {
if (typeof value === "number") return value;
@@ -317,29 +306,6 @@ function makesOverlayVisible(win: GsapWindow): boolean {
return isVisibleGsapState(win.propertyValues);
}
-function isSceneBoundaryExit(win: GsapWindow): boolean {
- if (win.end <= win.position) return false;
- if (win.method !== "to" && win.method !== "fromTo") return false;
- return isHiddenGsapState(win.propertyValues);
-}
-
-function isHardKillSet(win: GsapWindow, selector: string, boundary: number): boolean {
- return (
- win.method === "set" &&
- win.targetSelector === selector &&
- Math.abs(win.position - boundary) <= SCENE_BOUNDARY_EPSILON_SECONDS &&
- isHiddenGsapState(win.propertyValues)
- );
-}
-
-function hiddenStateLiteral(values: Record<string, string | number>): string {
- if (zeroValue(values.autoAlpha)) return "{ autoAlpha: 0 }";
- if (zeroValue(values.opacity)) return "{ opacity: 0 }";
- if (stringValue(values.visibility)?.toLowerCase() === "hidden") return '{ visibility: "hidden" }';
- if (stringValue(values.display)?.toLowerCase() === "none") return '{ display: "none" }';
- return "{ opacity: 0 }";
-}
-
function findTagEnd(source: string, tag: OpenTag): number {
const escapedTagName = tag.name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
const pattern = new RegExp(`<\\/?${escapedTagName}\\b[^>]*>`, "gi");
@@ -359,29 +325,6 @@ function findTagEnd(source: string, tag: OpenTag): number {
return source.length;
}
-function collectCompositionRanges(source: string, tags: OpenTag[]): CompositionRange[] {
- return tags
- .map((tag) => {
- const id = readDecodedAttr(tag.raw, "data-composition-id");
- if (!id) return null;
- return {
- id,
- start: tag.index,
- end: findTagEnd(source, tag),
- };
- })
- .filter((range) => range !== null);
-}
-
-function findContainingCompositionId(tag: OpenTag, ranges: CompositionRange[]): string | null {
- let match: CompositionRange | null = null;
- for (const range of ranges) {
- if (tag.index < range.start || tag.index >= range.end) continue;
- if (!match || range.start >= match.start) match = range;
- }
- return match?.id || null;
-}
-
// A tag's `class` attribute, split into tokens, but only when it carries the
// `clip` marker class — the common "is this a clip element?" filter used by
// several rules that walk every tag looking for clips.
@@ -393,39 +336,6 @@ function getClipTagClasses(tag: OpenTag): ClipTagClasses | null {
return classes.includes("clip") ? { classAttr, classes } : null;
}
-function collectClipStartBoundariesByComposition(
- source: string,
- tags: OpenTag[],
-): Map<string, number[]> {
- const ranges = collectCompositionRanges(source, tags);
- const boundaries = new Map<string, Set<number>>();
-
- for (const tag of tags) {
- if (!getClipTagClasses(tag)) continue;
- const compositionId = findContainingCompositionId(tag, ranges);
- if (!compositionId) continue;
- const start = numberValue(readAttr(tag.raw, "data-start") ?? undefined);
- if (start == null || start <= 0) continue;
- const compositionBoundaries = boundaries.get(compositionId) ?? new Set<number>();
- compositionBoundaries.add(start);
- boundaries.set(compositionId, compositionBoundaries);
- }
-
- return new Map(
- [...boundaries.entries()].map(([compositionId, values]) => [
- compositionId,
- [...values].sort((a, b) => a - b),
- ]),
- );
-}
-
-function findMatchingSceneBoundary(time: number, boundaries: number[]): number | null {
- for (const boundary of boundaries) {
- if (Math.abs(time - boundary) <= SCENE_BOUNDARY_EPSILON_SECONDS) return boundary;
- }
- return null;
-}
-
function readStyleProperty(style: string, property: string): string | null {
const escapedProperty = property.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
const match = style.match(new RegExp(`(?:^|;)\\s*${escapedProperty}\\s*:\\s*([^;]+)`, "i"));
@@ -1128,7 +1038,7 @@ export const gsapRules: LintRule<LintContext>[] = [
// overlapping_gsap_tweens + gsap_animates_clip_element
// fallow-ignore-next-line complexity
- async ({ source, tags, scripts, styles, rootCompositionId }) => {
+ async ({ tags, scripts, styles }) => {
const findings: HyperframeLintFinding[] = [];
const authoredHiddenSelectors = new Set(
scripts.flatMap((script) => [...extractStandaloneHiddenSelectors(script.content)]),
@@ -1153,15 +1063,11 @@ export const gsapRules: LintRule<LintContext>[] = [
}
}
- const clipStartBoundariesByComposition = collectClipStartBoundariesByComposition(source, tags);
const styleRules = collectSimpleStyleRules(styles);
const reportedVisibleOverlayKeys = new Set<string>();
for (const script of scripts) {
- const localTimelineCompId = readRegisteredTimelineCompositionId(script.content);
const gsapWindows = await cachedExtractGsapWindows(script.content);
- const clipStartBoundaries =
- clipStartBoundariesByComposition.get(localTimelineCompId || rootCompositionId || "") ?? [];
// overlapping_gsap_tweens
for (let i = 0; i < gsapWindows.length; i++) {
@@ -1244,47 +1150,6 @@ export const gsapRules: LintRule<LintContext>[] = [
});
}
- // gsap_exit_missing_hard_kill
- if (clipStartBoundaries.length > 0) {
- for (const win of gsapWindows) {
- // Unresolved targets are unknown elements: you cannot assert a missing
- // hard kill on one, and a `tl.set("__unresolved__", ...)` hint is meaningless.
- if (win.targetSelector === UNRESOLVED_TARGET) continue;
- if (!isSceneBoundaryExit(win)) continue;
- const boundary = findMatchingSceneBoundary(win.end, clipStartBoundaries);
- if (boundary == null) continue;
- const hasHardKill = gsapWindows.some((candidate) =>
- isHardKillSet(candidate, win.targetSelector, boundary),
- );
- if (hasHardKill) continue;
-
- // A tl.set hard kill on the exiting selector itself is the fix — unless
- // that selector IS a clip element, in which case gsap_animates_clip_element
- // (below) errors on that exact tl.set: the framework already owns
- // visibility/display on clip elements. Point at the inner-wrapper
- // pattern instead so the two rules' advice doesn't contradict.
- const exitClipInfo =
- clipIds.get(win.targetSelector) || clipClasses.get(win.targetSelector);
- const fixHint = exitClipInfo
- ? `"${win.targetSelector}" is a clip element — the framework already manages its visibility. ` +
- "Wrap the scene's content in an inner non-clip <div>, move the exit tween and the hard kill " +
- `(\`tl.set("<inner-selector>", ${hiddenStateLiteral(win.propertyValues)}, ${boundary.toFixed(2)})\`) onto that wrapper instead.`
- : `Add \`tl.set("${win.targetSelector}", ${hiddenStateLiteral(win.propertyValues)}, ${boundary.toFixed(2)})\` ` +
- "after the exit tween.";
-
- findings.push({
- code: "gsap_exit_missing_hard_kill",
- severity: "error",
- message:
- `GSAP exit on "${win.targetSelector}" ends at the ${boundary.toFixed(2)}s clip start boundary ` +
- "without a matching tl.set hard kill. Non-linear seeking can land after the fade and leave stale visibility state.",
- selector: win.targetSelector,
- fixHint,
- snippet: truncateSnippet(win.raw),
- });
- }
- }
-
// gsap_fullscreen_overlay_starts_visible
for (const tag of tags) {
const selectors = tagSimpleSelectors(tag);
diff --git a/packages/lint/src/utils.ts b/packages/lint/src/utils.ts
index ef24a3a09f..7a350e6cc9 100644
--- a/packages/lint/src/utils.ts
+++ b/packages/lint/src/utils.ts
@@ -34,9 +34,8 @@ export const TIMELINE_REGISTRY_ASSIGN_PATTERN =
// missed `window.__timelines[spec.id] = tl`, a pattern the shipped
// code-particle-assemble/code-3d-extrude registry blocks actually use,
// making gsap_timeline_not_registered false-fire on correctly registered
-// timelines. The computed-key alternative is deliberately non-capturing:
-// its text isn't a literal composition id, so callers reading group 1/2
-// (readRegisteredTimelineCompositionId) must keep falling back to null for it.
+// timelines. The computed-key alternative is non-capturing; remaining
+// callers only `.test()` this pattern.
export const WINDOW_TIMELINE_ASSIGN_PATTERN =
/window\.__timelines(?:\[\s*(?:["']([^"']+)["']|[A-Za-z_$][\w$.]*)\s*\]|\.\s*([A-Za-z_$][\w$]*))\s*=\s*([A-Za-z_$][\w$]*)/i;
export const INVALID_SCRIPT_CLOSE_PATTERN = /<script[^>]*>[\s\S]*?<\s*\/\s*script(?!>)/i;
diff --git a/skills-manifest.json b/skills-manifest.json
index 46b2d55d57..b97145e191 100644
--- a/skills-manifest.json
+++ b/skills-manifest.json
@@ -30,11 +30,11 @@
"files": 7
},
"hyperframes-cli": {
- "hash": "f1593f498b988a0c",
+ "hash": "bafd44ef2c17c02b",
"files": 11
},
"hyperframes-core": {
- "hash": "d9c1fae7818d5ba8",
+ "hash": "dffc4485ca8cff24",
"files": 11
},
"hyperframes-creative": {
@@ -58,7 +58,7 @@
"files": 23
},
"music-to-video": {
- "hash": "82039f8aa152a904",
+ "hash": "8feb5e48038f49bc",
"files": 132
},
"pr-to-video": {
diff --git a/skills/hyperframes-cli/SKILL.md b/skills/hyperframes-cli/SKILL.md
index 16830df307..e02b6c8bd1 100644
--- a/skills/hyperframes-cli/SKILL.md
+++ b/skills/hyperframes-cli/SKILL.md
@@ -15,15 +15,15 @@ Run commands as `npx hyperframes ...` unless project instructions provide a wrap
## Development loop
-1. **Scaffold:** `npx hyperframes init <project>` or capture a site. In non-TTY mode, pass `--non-interactive --example=<name>`.
+1. **Scaffold:** `npx hyperframes init <project>` (centered blank). Or capture a site. Pass `--example=<name>` only to start from a named example.
2. **Find the move:** before authoring motion by hand, search for a primitive that already does it: `npx hyperframes catalog --query "reveal a headline one line at a time"`. Ask for the effect you want rather than the mechanism you have in mind. Install with `npx hyperframes add <name>` (see `/hyperframes-registry`). Author by hand only once nothing fits.
3. **Author:** write the composition using `/hyperframes-core`.
4. **Get fast feedback while editing:** run `npx hyperframes lint` after the first HTML pass and after structural changes.
5. **Run the final gate:** run `npx hyperframes check`; it reruns lint before opening the browser. Do not prepend a redundant standalone lint invocation. Add `--snapshots` for annotated overview frames and finding crops.
6. **Inspect sub-compositions:** when `index.html` mounts `data-composition-src`, capture midpoint snapshots and inspect each mounted scene.
7. **Open the final Studio preview:** run `npx hyperframes preview --background`, verify the URL returns HTTP 200, hand the timeline project URL to the user, and ask whether to revise or render. Keep it alive until review ends.
-8. **Render only after approval:** use draft quality for iteration and high quality for delivery.
-9. **Verify the output:** confirm the file exists, is non-empty, and has a plausible duration.
+8. **Render only after approval:** use `--quality draft` while iterating, `--quality looks` for the first real encode (the CLI default), and `--quality delivery` for final delivery.
+9. **Verify the output:** confirm the file exists and is non-empty. Read the render summary's second line (`beginframe` vs `screenshot`, GPU, stage timings). `screenshot` + `software gpu` on Linux is the slow path. `ffprobe -v error -show_format -show_streams` and compare duration (and fps if the brief set it) to the root `data-duration`.
## Mandatory creator-edit cross-references
@@ -46,9 +46,9 @@ npx hyperframes lint
# Required final gate; includes lint.
npx hyperframes check
npx hyperframes preview --background
-npx hyperframes render --quality high --output out.mp4
+npx hyperframes render --quality looks --output out.mp4
test -s out.mp4
-ffprobe -v error -show_format out.mp4
+ffprobe -v error -show_format -show_streams out.mp4
```
`check` runs lint first, then uses one browser session and one seek pass to audit runtime errors, failed requests, layout, `*.motion.json` assertions, and WCAG contrast. Persistent findings gate the exit code; transient entrance or exit findings are informational. Use `--strict` to gate warnings. `validate`, `inspect`, and `layout` remain aliases for compatibility but must not appear in new instructions or scripts.
@@ -90,7 +90,7 @@ Treat tiny unstyled content, canvas-sized icons, missing hero elements, or timel
npx hyperframes doctor --json | jq -e '.ok' >/dev/null
```
-- Non-TTY mode is automatic. `init` requires `--example` there; use `--non-interactive` to force deterministic behavior on a TTY.
+- Non-TTY mode is automatic and scaffolds the centered blank. Pass `--example` only to start from a named example. Use `--non-interactive` to force flag-only mode on a TTY.
- Use one `HYPERFRAMES_RUN_ID` for all commands in the same verification loop.
- Use `--strict`, `--strict-all`, and `--strict-variables` when the corresponding warnings, variables, or CI conditions must gate the render.
- JSON paths redact the home directory as `$HOME`; do not try to reverse the redaction.
@@ -112,7 +112,8 @@ Use `selection.target.hfId` when available, otherwise its selector and source fi
| Need | Command |
| ---------------------------------------- | ----------------------------------------------------------------------------- |
| Fast local iteration | `npx hyperframes render --quality draft` |
-| Final local delivery | `npx hyperframes render --quality high --output out.mp4` |
+| First real encode | `npx hyperframes render --quality looks --output out.mp4` |
+| Final local delivery | `npx hyperframes render --quality delivery --output out.mp4` |
| Reproducible container render | `npx hyperframes render --docker --strict --output out.mp4` |
| Local variable-driven batch render | `npx hyperframes render --batch rows.json --output "renders/{name}.mp4"` |
| HeyGen-hosted zero-infrastructure render | `npx hyperframes cloud render` |
diff --git a/skills/hyperframes-cli/references/init-and-scaffold.md b/skills/hyperframes-cli/references/init-and-scaffold.md
index 0e4c85d2a8..3291ad4f06 100644
--- a/skills/hyperframes-cli/references/init-and-scaffold.md
+++ b/skills/hyperframes-cli/references/init-and-scaffold.md
@@ -7,18 +7,18 @@ Scaffolding commands. Use these instead of creating files by hand — they set u
## init
```bash
-npx hyperframes init my-video # TTY: interactive wizard
+npx hyperframes init my-video # centered blank (TTY: wizard)
npx hyperframes init my-video --example warm-grain # pick an example
-npx hyperframes init my-video --example blank --resolution portrait
+npx hyperframes init my-video --resolution portrait
npx hyperframes init my-video --video clip.mp4 # with video file
npx hyperframes init my-video --audio track.mp3 # with audio file
-npx hyperframes init my-video --example blank --tailwind # Tailwind v4 browser runtime
-npx hyperframes init my-video --non-interactive --example blank # CI/agents — flag-only
+npx hyperframes init my-video --tailwind # Tailwind v4 browser runtime
+npx hyperframes init my-video --non-interactive # CI — flag-only, same blank
```
-**Default depends on TTY**: in a terminal, the CLI prompts for example/options. Outside a TTY (CI, agents, piped output) it auto-switches to non-interactive and **requires `--example`** (the CLI errors with a usage example if missing). Pass `--non-interactive` to force flag-only mode even on a TTY.
+**Default depends on TTY**: in a terminal, the CLI prompts for example/options (default: centered blank). Outside a TTY (CI, agents, piped output) it auto-switches to non-interactive and scaffolds that blank. Pass `--example` only to start from a named example. Pass `--non-interactive` to force flag-only mode on a TTY.
-Templates: `blank`, `warm-grain`, `play-mode`, `swiss-grid`, `vignelli`, `decision-tree`, `kinetic-type`, `product-promo`, `nyt-graph`, `vscode-theme-visualizer`. (The closed set of `hyperframes:example` items in `registry/registry.json`. `hyperframes catalog` does not list examples — its `--type` takes only `block` or `component` — so this list has no live equivalent and is checked by `bun run lint:skills`.)
+Templates: `blank`, `warm-grain`, `play-mode`, `swiss-grid`, `vignelli`, `decision-tree`, `kinetic-type`, `product-promo`, `nyt-graph`, `vscode-theme-visualizer`. (The closed set of `hyperframes:example` items in `registry/registry.json` plus the bundled `blank` template. `hyperframes catalog` does not list examples — its `--type` takes only `block` or `component` — so this list has no live equivalent and is checked by `bun run lint:skills`.)
Other useful flags:
diff --git a/skills/hyperframes-cli/references/preview-render.md b/skills/hyperframes-cli/references/preview-render.md
index b106d1de18..60e1a87889 100644
--- a/skills/hyperframes-cli/references/preview-render.md
+++ b/skills/hyperframes-cli/references/preview-render.md
@@ -109,7 +109,8 @@ npx hyperframes render ./my-video --output ./out.mp4 # render from outside the
npx hyperframes render --output final.mp4 # named output (no timestamp)
npx hyperframes render -c compositions/intro.html -o intro.mp4 # render a specific sub-composition file
npx hyperframes render --quality draft # fast iteration
-npx hyperframes render --fps 60 --quality high # final delivery
+npx hyperframes render --quality looks # first real encode (default)
+npx hyperframes render --fps 60 --quality delivery # final delivery
npx hyperframes render --format webm # transparent WebM
npx hyperframes render --docker # byte-identical
```
@@ -122,7 +123,7 @@ npx hyperframes render --docker # byte-identical
| `--composition`, `-c` | path to composition file | `index.html` | Render a specific composition file (e.g. `compositions/intro.html`) instead of the project's `index.html`. |
| `--output`, `-o` | path | `renders/<project>_<ts>.<ext>` | Output path. Default is timestamped (`<project-name>_YYYY-MM-DD_HH-MM-SS.<ext>`). |
| `--fps` | 24, 30, 60 | 30 | 60fps doubles render time |
-| `--quality` | draft, standard, high | standard | draft for iterating |
+| `--quality` | draft, looks, delivery, standard, high | looks | `looks` is CRF 16 on the standard preset. `delivery` is `high`. draft for iterating |
| `--format` | mp4, webm, mov, gif, png-sequence | mp4 | WebM/MOV render with transparency; gif for inline autoplay in GitHub PRs/READMEs/docs (two-pass palette encode, fps capped at 30 — prefer `--fps 15` — no audio, 1-bit transparency only, HDR falls back to SDR); png-sequence writes RGBA frames to a directory (AE/Nuke/Fusion ingest) |
| `--gif-loop` | 0-65535 | 0 | GIF loop count; `0` loops forever. Only with `--format gif`. |
| `--resolution` | landscape, portrait, landscape-4k, portrait-4k, square, square-4k (+ aliases `1080p`, `4k`, `uhd`) | — | Supersample via Chrome `deviceScaleFactor`. Aspect ratio must match composition; scale must be an integer. Not with `--hdr`. |
@@ -142,7 +143,9 @@ npx hyperframes render --docker # byte-identical
| `--variables-file` | path | — | JSON file with variable values (alternative to `--variables`) |
| `--strict-variables` | flag | off | Fail render on undeclared keys or type mismatches in `--variables` |
-**Quality guidance:** `draft` while iterating, `standard` for review, `high` for final delivery.
+**Quality guidance:** `draft` while iterating, `looks` (the default) for the first real encode, `delivery` for final delivery. `standard` and `high` still work.
+
+**Read the summary's second line.** After the output path and size, `render` prints the capture path, GPU mode, and per-stage timings, e.g. `beginframe capture · software gpu · compile 0.7s · setup 1.1s · capture 8.1s · encode 5.8s`. `capture` is the frame loop and `setup` is calibration plus session init; the capture path reads `a|b` when parallel workers diverged, and `encode (during capture)` means the streaming encoder overlapped the loop, so do not add it to the wall time. Local GPU `auto` (the default) requests BeginFrame. If the line still says `screenshot capture` with `software gpu` on Linux, a hint under it says BeginFrame did not run (needs chrome-headless-shell, no `--resolution` upscale). It only appears when the GPU was auto-probed, never under `--docker` or `--no-browser-gpu`, where software GL is the point. Heavy compositions can stall on software GL. Do not reach for `--debug` just to learn which path ran.
**Parametrized renders:** the composition declares its variables on the `<html>` root with **`data-composition-variables`** — a JSON **array of declarations** (`{id, type, label, default}` per entry) that defines the schema. Scripts inside read the resolved values via `window.__hyperframes.getVariables()`. The CLI `--variables '{"title":"Q4 Report"}'` is a JSON **object keyed by id** that overrides those declared defaults for one render; missing keys fall through, so the same composition runs unchanged in dev preview and in production. Sub-comp hosts can also override per-instance with `data-variable-values`. See the `hyperframes-core` skill for the full pattern.
diff --git a/skills/hyperframes-core/SKILL.md b/skills/hyperframes-core/SKILL.md
index e3fa58fcbb..0ffe812706 100644
--- a/skills/hyperframes-core/SKILL.md
+++ b/skills/hyperframes-core/SKILL.md
@@ -5,6 +5,13 @@ description: The HyperFrames composition contract — build one renderable proje
# HyperFrames Core
+**Agent pitfalls (read first):**
+
+- Center with flex/`inset`, not CSS `transform: translate(-50%,-50%)` on a node you then GSAP `x`/`y`. Lint: `gsap_css_transform_conflict`. Use `fromTo` or `xPercent`/`yPercent`.
+- Do not add a scene-exit `tl.set(..., {visibility:"hidden"})`. The runtime already hides timed clips. Opacity fades on inner nodes (or `opacity` on `.clip`) are enough. Caption hard-kills are a different rule.
+- `window.__timelines["id"]` must match the root `data-composition-id`.
+- After `render`, read the summary's second line: `beginframe` vs `screenshot`, GPU mode, stage timings. `screenshot` + `software gpu` on Linux is the slow path.
+
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.
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. Process docs (brief, storyboard, review, production, dispatch, frame-worker) live in `/hyperframes` → `references/`. Other concerns live in the sibling domain skills — `hyperframes-animation`, `hyperframes-creative`, `media-use`, `hyperframes-cli`, `hyperframes-registry`. The capability map in `/hyperframes` says what each one covers.
diff --git a/skills/music-to-video/references/montage.md b/skills/music-to-video/references/montage.md
index 2ed3af840b..b6a1763d87 100644
--- a/skills/music-to-video/references/montage.md
+++ b/skills/music-to-video/references/montage.md
@@ -16,9 +16,7 @@ The asset-driven analogue of a per-onset typographic group: cut to a new clip on
(the frame's beats/onsets from the audiomap). Each clip is a `class="clip"` element
(`<img>` for a photo, **muted** `<video>` for a motion clip) placed at its anchor with
`data-start`/`data-duration`/`data-track-index` per the core clip contract. Between clips,
-crossfade the outgoing content to `opacity:0` ending **at** the next anchor, then immediately
-**hard-kill** with a `tl.set(..., {opacity:0}, anchor)` — this pair is required (the
-`gsap_exit_missing_hard_kill` lint rule; non-linear seeking otherwise bleeds stale frames).
+crossfade the outgoing content to `opacity:0` ending **at** the next anchor.
Cut on the **strong** anchors; land a hero clip on a `key_moment`/downbeat.
### `ken_burns` — slow push on one clip (fits a `phrase_flow` frame)
diff --git a/skills/music-to-video/sub-agents/frame-worker.md b/skills/music-to-video/sub-agents/frame-worker.md
index 7fbc108422..84d93082ee 100644
--- a/skills/music-to-video/sub-agents/frame-worker.md
+++ b/skills/music-to-video/sub-agents/frame-worker.md
@@ -45,5 +45,5 @@ If your dispatch carries `lint` / `check` feedback from a prior pass, address ea
- Each group's text / palette match its block's `params` / `copy`, drawn from `frame.md`.
- `phrase_flow` frames pace by phrase / energy.
- Seek-safe per `hyperframes-core/determinism-rules.md` (derive variation from indices; swap text / numbers with `tl.set`).
-- Asset clips: muted `<video>`, direct children of `#stage`, with `data-start` / `data-duration` / `data-track-index` and the crossfade hard-kill `tl.set`.
+- Asset clips: muted `<video>`, direct children of `#stage`, with `data-start` / `data-duration` / `data-track-index`. Crossfade outgoing clips to `opacity:0` ending at the next anchor.
- Final frame is intentional; hero text is readable and clear of the edges.