Communitygithub.com

AntlersSam/saas-launch-video-kit

HyperFrames 組合結構合約 — 建構一個可渲染的專案。用於組合結構、`data-*` 時序屬性、`class="clip"`、軌道、子組合、變數、框架擁有的媒體播放、確定性渲染規則及驗證。在撰寫組合 HTML 之前請先閱讀。

saas-launch-video-kit 是什麼?

此技能定義了 HyperFrames 的技術合約,這是一個從 HTML 渲染影片的框架。它詳細說明了如何建構一個可渲染的專案,包括使用 `data-*` 屬性宣告時序、透過 GSAP 建立可搜尋的時間軸,以及框架控制的媒體播放。此技能支援獨立組合和子組合,強調使用 `gsap.timeline({ paused: true })` 註冊單一暫停時間軸的重要性,並強制執行嚴格規則以防止常見陷阱,例如 CSS transform 衝突或媒體元素巢狀問題。它還整合了 `hyperframes-cli` 工具,用於透過 linting、快照和預覽進行驗證,確保在最終渲染影片之前輸出具有確定性且無錯誤。深度資訊則委託給專門的參考文件。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/AntlersSam/saas-launch-video-kit/tree/HEAD/skills/hyperframes-core

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

外掛安裝: 在執行設定或更新指令前,請先遵循外掛執行規則(當此技能位於 HyperFrames 外掛內時)。獨立安裝則保留下方的更新說明。

HyperFrames Core

代理陷阱(請先閱讀):

  • 使用 flex/inset 置中,不要在以 CSS transform: translate(-50%,-50%) 定位的節點上再使用 GSAP 的 x/y。靜態檢查:gsap_css_transform_conflict。請改用 fromTo 或 xPercent/yPercent。
  • 請勿添加場景退出的 tl.set(..., {visibility:"hidden"})。執行階段已會隱藏計時片段。在內部節點上使用透明度淡出(或對 .clip 使用 opacity)就已足夠。標題強制隱藏則適用不同規則。
  • window.__timelines["id"] 必須與根元素的 data-composition-id 相符。
  • 執行 render 後,請讀取摘要的第二行:beginframe vs screenshot、GPU 模式、階段時間。screenshot + Linux 上的 software gpu 是較慢的路徑。

HyperFrames 從 HTML 渲染影片。組合是一個 HTML 檔案,其 DOM 使用 data-* 屬性宣告時序,動畫執行階段是可搜尋的,媒體播放由框架控制。

此技能是技術合約 — 描述如何建構一個 hyperframes 專案。以下內容是建構指南;每個主題的詳細資訊位於 references/(下方索引),請按需閱讀。流程文件(簡報、分鏡、審查、製作、發佈、幀工作者)位於 /hyperframes → references/。其他關注點位於同領域技能中 — hyperframes-animation、hyperframes-creative、media-use、hyperframes-cli、hyperframes-registry。功能對應表位於 /hyperframes,說明每個技能的涵蓋範圍。

參考文件

檔案閱讀目的...
references/minimal-composition.md從最小的可渲染組合骨架開始
references/composition-patterns.md選擇整體式 vs 模組化;建構模組化 index.html;選擇子組合原型
references/data-attributes.md查詢任何 data-*(根/片段/子組合宿主/舊版別名);使用 class="clip"
references/tracks-and-clips.md了解 data-track-index 控制(和不控制)什麼、z-index、將一個片段相對於另一個計時;使用 npx hyperframes timeline 列出所有軌道和片段
references/creator-editing-recipes.md複製可靠的剪下/修剪/重排/重新計時/凍結/相機/遮罩/交叉淡入淡出/音訊編輯配方及其限制
references/sub-compositions.md接線子組合(宿主屬性、<template>、每個實例的變數)並在其中製作動畫
references/variables-and-media.md宣告變數;放置 <video>/<audio>、設定音量、修剪
references/determinism-rules.md建構可搜尋的時間軸;確定性禁止事項;版面/文字適應
references/full-screen-motion.md使用共享背景創作全幀動畫
references/tailwind.md在 Tailwind v4 專案中工作(init --tailwind;執行階段合約與 Studio 的 v3 不同)

有關動畫執行階段的具體資訊(GSAP API、Lottie、Three.js 等),請前往 hyperframes-animation → adapters/<runtime>.md。

建構一個組合

兩種根形式(不可互換)

  • 獨立(頂層 index.html):根 <div data-composition-id="…"> 直接位於 <body> 中,沒有 <template> 包裹。包裹獨立根會隱藏所有內容,lint 會拒絕(standalone_composition_wrapped_in_template,錯誤)。
  • 子組合(透過 data-composition-src 載入):將根包裹在 <template> 中。這是應撰寫的形式:載入器也接受普通的完整文件並回退至其 <body>,但範例和工具假設的是範本形式。

⚠ 傳輸規則:對於範本化的子組合,組裝器會丟棄檔案自身的 <head> <style>/<script>(位於 packages/core/src/compiler/compositionAssembly.ts,hasTemplate 閘),因此請將 <style>/<script> 放在範本內部。<link> 無論如何都會被提升。 ⚠ 宿主 ID 慣例:請為宿主插槽、內部範本和 window.__timelines["<id>"] 鍵使用相同的 ID。支援不同的本地 ID(組裝器會回退至檔案中的第一個根),但不匹配時會靜默失敗,因此除非有理由,否則請使其匹配。

檔案形狀、宿主接線和渲染前檢查清單 → references/sub-compositions.md。

根必須設定大小(靜默版面錯誤)

獨立根使用 width/height: 100%。畫布大小為 data-width/data-height。執行階段會將這些像素應用到組合根上。請勿在 #root 上硬編碼 1920px/1080px。骨架 → references/minimal-composition.md。

一個暫停的時間軸

每個組合註冊恰好一個 gsap.timeline({ paused: true }),位於 window.__timelines["<id>"](鍵 = 根元素的 data-composition-id)。在非同步回呼(document.fonts.ready)中建構它是可以的;重要的是你僅在建構完成後才註冊。渲染長度是根的 data-duration,而不是時間軸的長度:超過根持續時間的時間軸會被截斷,而提前結束的時間軸則會保持其最後一幀。省略根的 data-duration,則長度會改為推斷(時間軸、媒體視窗或適配器)。你不需要 window.__timelines = window.__timelines || {}:執行階段會在你的內嵌腳本執行前建立註冊表,lint 也不再要求它。請勿手動將子時間軸巢狀放入宿主;執行階段會自動巢狀化已註冊的子時間軸。完整合約(包括非 GSAP 執行階段)→ references/determinism-rules.md + hyperframes-animation/adapters/。

第一次 lint 常見問題(保證首次建構失敗)

lint 確實會捕捉的規則,但僅在事後。請在第一次就寫對:

  • 切勿將 CSS 初始 transform 與 GSAP 對相同屬性的補間配對 — CSS 值和補間的起始值會衝突,lint 會用 gsap_css_transform_conflict 拒絕。請在補間內部使用 gsap.fromTo(el, { x: -40 }, { x: 0 }) 來設定初始狀態,而不是使用 CSS transform: translateX(-40px)。
  • 切勿在 <video>/<audio> 上使用 crossorigin。lint 會無條件用 media_crossorigin_breaks_preview(錯誤)拒絕它,包括用於 canvas/WebGL/WebAudio 讀回。沒有抑制方法。
  • 切勿讓含有 data-start 的 <video> 其祖先也帶有 data-start。lint 會用 video_nested_in_timed_element(錯誤)拒絕。可以為包裹元素或影片設定時間,但不能同時設定。
  • 每個 <audio> 都需要一個 id。lint 會用 media_missing_id 拒絕,而且沒有 id 的 <audio> 永遠不會被混音器拾取,所以渲染結果會是無聲的。
  • 切勿使用 autoAlpha 或 visibility 對 .clip 進行補間 — lint 會用 gsap_animates_clip_element 拒絕。請改為對子元素製作動畫。
  • 命名的 CSS font-family 需要在檔案中有對應的 @font-face,指向已發布的本地檔案,否則 lint 會觸發 font_family_without_font_face。
  • 子組合的 #root 使用 width/height: 100%(或 inset: 0),而不是硬編碼的 1920px/1080px。畫布大小為 data-width/data-height。

lint 錯誤也會關閉版面與對比度審計:check 隨後會報告 0 sample(s) 和 0/0 text checks,這看起來像是一個乾淨的檔案,但實際上什麼都沒執行。在信任這些數字之前,請先清除 lint 錯誤。

不可協商的規則(自動化閘門可能遺漏的靜默錯誤)

在此列出;完整理由請參閱連結的參考文件。請勿違反:

  • 沒有渲染時鐘 / 未經種子的 Math.random / 網路 / 輸入狀態;沒有 repeat: -1(請使用有限次數)。→ determinism-rules.md
  • 切勿在 .clip 元素上對 display、visibility 或 autoAlpha 進行補間。框架擁有片段的可見性,lint 會拒絕(gsap_animates_clip_element)。請改為對子元素製作動畫。→ determinism-rules.md
  • 正文中沒有 <br>;被轉換的元素必須是區塊級且已設定大小;脈動的絕對定位裝飾元素需要頂部間距。→ determinism-rules.md
  • <video>/<audio> 是透過扁平的文件查詢找到的,因此框架可以在任何巢狀深度(包括在子組合 <template> 或包裹元素內部)尋找和解碼它們。一個硬性限制:lint 會錯誤報告位於另一個也具有 data-start 的普通元素內部的 <video data-start>,且此失敗是真實的(錯誤的來源幀,然後片段在插槽中間消失),因此請將時間放在包裹元素或影片上,切勿同時放在兩者上。子組合宿主是例外:子組合內部的媒體可以正確渲染。另一個注意事項是時間軸,而非位置:子組合時間軸無法動畫化宿主根元素。→ variables-and-media.md
  • 確保每個 id 在組合後的頁面中是唯一的(為子組合 ID 加上前綴,例如 #<id>-hero),以便你自己的 #id CSS 和 getElementById 調用能被解析。幀注入不再依賴於此:編譯器會在每個 video[src]/audio[src]/img[src] 上蓋上一個文檔唯一的 data-hf-render-id。使用 <source> 子元素而不是 src 屬性的媒體不會被蓋章,因此唯一 ID 在那裡仍然重要。→ composition-patterns.md
  • 在組合根上的全螢幕填充在正常渲染時是沒問題的。它僅在層合成路徑(HDR 內容,或使用著色器轉場的組合)上被丟棄,在這種情況下,引擎會強制每個組合根透明,以便底層能夠顯示出來。如果你的組合使用著色器轉場或 HDR 媒體,請將填充放在一個全出血的子元素上(position:absolute; inset:0)。→ composition-patterns.md

編輯現有組合

  • 先閱讀檔案。保留不相關的時序、軌道、ID、變數、媒體路徑。
  • 要了解專案時間軸上的內容(軌道、片段、開始、結束、播放內容),請執行 npx hyperframes timeline [--json],而不是讀取 index.html 和每個子組合檔案。
  • 匹配現有的組合 ID 和時間軸鍵。
  • 添加片段:有目的地根據周圍片段設定其 data-start/data-duration。data-track-index 是 Studio 的顯示通道,不是時間約束,因此不需要是空的。
  • 結束時間超過根 data-duration 的片段會被截斷:在同一編輯中將根的 data-duration 延伸到片段的結束時間(lint 會發出 clip_ends_past_root_duration 警告)。
  • 任何組合元素上的 data-hidden 會同時在預覽和渲染中隱藏它,覆蓋其時間窗口;它是非破壞性/可逆的,並由 Studio 時間軸的眼睛圖示切換。
  • 添加子組合:在接線宿主之前,請驗證其內部的 data-composition-id。

驗證

使用 hyperframes-cli 獲取命令詳細資訊

  • npx hyperframes check 通過(在 lint、執行階段、版面、動畫和對比度方面找到 0 個問題)
  • 具有子組合的專案:npx hyperframes snapshot --at <midpoints> 並肉眼檢查每一幀
  • npx hyperframes preview --background 用於審查(使用者可以在 Studio 的時間軸中編輯任何內容,且伺服器會在調用命令後持續運行)
  • 僅在使用者批准後才執行 npx hyperframes render

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

AntlersSam/saas-launch-video-kit

Author or edit a custom HyperFrames composition when no specialized workflow fits, or when BRIEF.md sets flow: companion. Use for longer or multi-scene pieces, brand and sizzle reels, montages, static loops, static title cards, footage remixes, and freeform builds. Use motion-graphics instead for a short unnarrated motion-first unit, including an animated title. Route fresh creation through hyperframes before using this skill.

AntlersSam/saas-launch-video-kit

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). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.

AntlersSam/saas-launch-video-kit

Use when audio already placed in a HyperFrames composition needs to be mixed: fade-in/fade-out, crossfade, track gain or volume, volume automation, ducking, a music bed that fights a voiceover (voiceover carve), effects on a track (EQ, compressor, limiter, gate, saturation, delay, reverb, chorus, phaser, bitcrush), automation envelopes drawn on a track's volume or any effect parameter, or one submix bus carrying a chain, a fader and an automation clock for several tracks at once (`<hf-audio-group>`). Don't use for sourcing or generating audio — finding BGM, SFX, or making a voiceover is `/media-use`. Don't use for clip timing or track layout, which is `/hyperframes-core`.

AntlersSam/saas-launch-video-kit

Use the HyperFrames CLI development loop: init, add, catalog, capture, lint, check, snapshot, compare, grade-compare, preview, play, present, beats, keyframes, single or batch render, publish, cloud, cloudrun, feedback, lambda, doctor, browser, info, upgrade, skills, compositions, timeline, history, clean, docs, benchmark, telemetry, transcribe, auth, tts, and remove-background. Also use when diagnosing build or render failures. validate, inspect, and layout are deprecated aliases; use check. Covers local, HeyGen-hosted cloud, AWS Lambda, and Google Cloud Run rendering.

相關技能