Communitygithub.com

HyperFrames 核心技術契約

構建 HyperFrames 可渲染專案的組合合約。用於組合結構、`data-*` 時間屬性、`class=

HyperFrames 核心技術契約 是什麼?

此技能定義了 HyperFrames 的核心技術契約,這是一個透過 HTML 結構驅動影片渲染的框架。它詳細說明了如何建立一個組合(composition):一個使用 `data-*` 屬性宣告時間軸的可播放 HTML 檔案。其核心設計理念是「確定性渲染」(deterministic rendering),禁止使用執行時期時鐘、未種子化的亂數、網路請求或無限循環,以確保時間軸可定位且可重複。此技能涵蓋了組合的兩種根形式(獨立與子組合)、同步建立的暫停時間軸(通常使用 GSAP)、非協商性規則(例如媒體元素必須是宿主根的直接子元素且 ID 必須唯一),以及透過 `hyperframes-cli` 進行的驗證流程。對於動畫執行時期(如 GSAP API)的細節,則屬於 `hyperframes-animation` 技能的範疇。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/1345AbhishekKumar/starter-supabase/tree/HEAD/.agents/skills/hyperframes-core

在你喜歡的 AI 中提問

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

說明文件

HyperFrames 核心技術契約 是做什麼的?

HyperFrames 透過 HTML 渲染影片。一個組合就是一個 HTML 檔案,其 DOM 透過 data-* 屬性宣告時間,其動畫執行時期是可定位的(seekable),且媒體播放由框架所擁有。

此技能是技術合約 — 說明如何建立一個 hyperframes 專案。以下內容為建置指南;各主題的詳細資訊位於 references/ 目錄(請見下方索引),請按需閱讀。其他相關事項則屬於同領域的其他技能 — hyperframes-animation、hyperframes-creative、hyperframes-media、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,相對於另一個片段進行時間設定
references/sub-compositions.md連接子組合(宿主屬性、<template>、每個實例的變數)並在其中製作動畫
references/variables-and-media.md宣告變數;放置 <video>/<audio>,設定音量,修剪
references/determinism-rules.md建立可定位時間軸;確定性禁止事項;可動畫屬性白名單;佈局 / 文字適應
references/full-screen-motion.md使用共享背景建立全幀動作
references/storyboard-format.md撰寫 STORYBOARD.md 計畫(+ 解析後的操作清單)
references/script-format.md撰寫可選的 SCRIPT.md 鎖定旁白
references/subagent-dispatch.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> 包裝(包裝它會隱藏所有內容並中斷渲染)。
  • 子組合(透過 data-composition-src 載入)— 根必須包在 <template> 中。

⚠ 傳輸規則:執行時期只會複製 <template> 的內容;外部的所有內容(包含 <head> 中的樣式/腳本)都會被丟棄 — 請將 <style>/<script> 放在模板內部。 ⚠ 宿主 ID 規則:宿主插槽的 data-composition-id 必須完全等於內部模板的 data-composition-id 以及 window.__timelines["<id>"] 鍵 — 不能有 -mount/-slot/-host 後綴。

檔案結構、宿主接線以及預渲染檢查清單 → references/sub-compositions.md。

根必須設定尺寸(無聲的版面錯誤)

獨立的根需要一個明確的尺寸盒子(以 px 為單位的 width/height),並且直到一個 height:100% 元素為止的每個祖先都必須具有已解析的高度 — 否則 flex / 100% 的子元素會收縮到接近 0,導致內容堆疊在左上角。lint/validate/inspect 不會捕捉到這個問題。骨架 → references/minimal-composition.md。

一個暫停的時間軸

每個組合在 window.__timelines["<id>"](鍵 = 根的 data-composition-id)註冊剛好一個 gsap.timeline({ paused: true }),並在頁面載入時同步建立。渲染持續時間 = 根的 data-duration,而不是時間軸長度。請勿手動將子時間軸巢狀嵌入到宿主中。完整合約(包含非 GSAP 執行時期)→ references/determinism-rules.md + hyperframes-animation/adapters/。

不可協商的規則(lint/validate/inspect 不會捕捉的無聲錯誤)

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

  • 無渲染時間時鐘 / 未種子化的 Math.random / 網路 / 輸入狀態;無 repeat: -1(請使用有限次數)。→ determinism-rules.md
  • 只對視覺屬性白名單進行動畫;永遠不要使用 display/visibility;不要在後續場景的片段上使用 gsap.set。→ determinism-rules.md
  • 正文中無 <br>;被轉換的元素必須是區塊級別且已設定尺寸;脈動的絕對定位裝飾元素需要頂峯間距。→ determinism-rules.md
  • <video>/<audio> 必須是宿主根的直接子元素(永遠不要在子組合 <template>/包裝器內部);框架擁有播放控制權。→ variables-and-media.md
  • 每個 id 在組合後的頁面中必須是唯一的;在子組合內部,請為 id 加上組合 id 前綴(#<id>-hero)。重複的 <video>/<img> id 會渲染為空白 — 產生器透過 getElementById 插入幀,而跨檔案的重複會繞過 lint。→ composition-patterns.md
  • 全螢幕場景填充應放在一個全出血的子元素上(position:absolute; inset:0),永遠不要放在組合根本身 — 產生器的幀合成可能會丟棄根元素自身的 background(該幀會渲染為黑色),即使預覽/snapshot 顯示正確。→ composition-patterns.md

編輯現有組合

  • 先閱讀檔案。保留無關的時間、軌道、ID、變數、媒體路徑。
  • 匹配現有的組合 ID 和時間軸鍵。
  • 新增片段:選擇一個不重疊的 data-track-index,或者有目的地調整周圍時間。
  • 新增子組合:在連接宿主之前,驗證其內部的 data-composition-id。

驗證

使用 hyperframes-cli 取得指令詳細資訊

  • npx hyperframes lint 通過(0 錯誤)
  • npx hyperframes validate 通過(0 主控台錯誤)
  • npx hyperframes inspect 通過(0 錯誤)
  • 包含子組合的專案:執行 npx hyperframes snapshot --at <midpoints> 然後目測每個幀
  • 執行 npx hyperframes preview 進行審查(使用者可以在 Studio 的時間軸中編輯任何內容)
  • 僅在使用者批准後才執行 npx hyperframes render

Individual skills in this repo

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

1345AbhishekKumar/starter-supabase

Add captions to a talking-head video. ONE catalog (CATALOG.md) of 32 visual identities behind two engines: column-flow (captions composited INTO the scene — matte occlusion + mix-blend; cream/ink/editorial/keynote/documentary/loud/neon/glitch/chrome/velocity) and themed constitutions (anchor/ordnance/terminal/neonsign/stardust/stomp/scoreboard/transit/vhs/arcade/dossier/laser/thunder/hologram/biolume/aurora/spectrum/papercut/popup/chalkboard/graffiti/brush/inkwater/ransom/lastpage/nightcity — e.g. a glyph-decode climax, a neon sign WRITTEN stroke by stroke, or the quiet `anchor` rail default). Route by identity, never by mode. Trigger on "captions/subtitles", "embed/cinematic captions", "VFX captions", "炸/特效/酷炫字幕", a named identity, or top-tier motion-graphics asks. Embedding every word is wrong for most talking-head content — `anchor` is the verbatim default. Pipeline: transcription → hyperframes remove-background matting → HTML render → ffmpeg overlay. Requires hyperframes and a single-subject clip.

1345AbhishekKumar/starter-supabase

The fallback workflow for authoring custom HyperFrames video compositions at any length or format — longer or multi-scene pieces, brand / sizzle reels, montages, title cards, static loops, and freeform compositions. Input- and length-agnostic. If a specialized workflow clearly fits the input — a marketed product, a website, a topic explainer, a GitHub PR, existing footage, a short motion graphic, or a Remotion port — prefer it (see /hyperframes); use this only as the general fallback when none fit.

1345AbhishekKumar/starter-supabase

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.

1345AbhishekKumar/starter-supabase

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`).

1345AbhishekKumar/starter-supabase

Non-animation creative direction for HyperFrames videos. Use for design spec (frame.md / design.md) handling, palettes, typography, narration, beat planning, audio-reactive visuals, composition patterns, and brand / style decisions. For atomic motion patterns and scene blueprints, use `hyperframes-animation`.

1345AbhishekKumar/starter-supabase

Audio and media assets for HyperFrames compositions, produced by one shared audio engine (`scripts/audio.mjs`) — multi-provider TTS (HeyGen / ElevenLabs / Kokoro local), background music + sound effects (HeyGen audio-library retrieval by default, with local Lyria / MusicGen BGM generation and a bundled SFX library as the no-credential fallback), Whisper transcription, background removal, and caption authoring. Use for voiceover / TTS, BGM, SFX / sound effects, transcription, captions / subtitles / lyrics / karaoke / per-word styling, voice + provider selection, and music-mood prompting.

1345AbhishekKumar/starter-supabase

Install and wire registry blocks and components into HyperFrames compositions. Use when running hyperframes add, installing a block or component, wiring an installed item into index.html, or working with hyperframes.json. Covers the add command, install locations, block sub-composition wiring, component snippet merging, registry discovery, and authoring a new block or component to contribute upstream (idea → scaffold → validate → PR).

1345AbhishekKumar/starter-supabase

Use when the user wants a short, design-led motion graphic where motion is the message: kinetic typography, stat or number count-up, chart/data-viz hit, logo sting, brand lockup, lower-third, callout, social overlay, animated headline/tweet/news item, motion poster, or quick captured-page highlight. Usually under 10s and up to ~30s, with no narration arc, voice-over, or live-action subject. Can render to MP4 or transparent overlay. Not for longer, multi-scene, narrated, or brand-reel pieces (use general-video), narrated website videos (website-to-video), topic explainers (faceless-explainer), product promos (product-launch-video), PR videos (pr-to-video), or captions on existing footage (embedded-captions). When unsure whether it's a quick motion-first piece or a longer / narrated treatment, see /hyperframes.

1345AbhishekKumar/starter-supabase

Use when the user has a music track (an audio file, or a video to pull audio from) and wants a beat-synced HyperFrames video, calm to hard-hitting. The music drives everything: one analyzer reads it once, the orchestrator lays out the frames and fills a per-frame plan, and one sub-agent builds each frame. Typography and templates are the floor — a complete video needs zero assets — but any images or videos the user supplies are cut into the frames on the same beat grid (beat-cut / ken-burns). The genre (lyric video, slideshow, kinetic promo) falls out of the per-frame choices; the pipeline never branches on it.

1345AbhishekKumar/starter-supabase

turn a product or marketing URL, pasted script, or brief into a product launch video, including SaaS promos, feature reveals, app launches, company promos, and product marketing videos. Use this skill when the user wants to market, launch, promote, or reveal a product. Do not use it for general non-launch website tours, non-product topic explainers, GitHub pull requests, captioning existing footage, or short unnarrated motion graphics. If the intent is unclear, route through /hyperframes first. This is the new shot-sequence architecture: every visual frame is authored as a time-coded shot sequence picked from a menu of golden blueprints, so frames develop over their full duration instead of freezing after entrance.

1345AbhishekKumar/starter-supabase

turn a GitHub pull request (a PR URL like github.com/<owner>/<repo>/pull/<N>, an <owner>/<repo>#<N> ref, or 'this PR' in a checked-out repo) into a code-change explainer video, up to ~3 min (sweet spot 30-90s) — changelog, feature reveal, fix, or refactor walkthrough, rendered from the diff / commits / files. The input is a CODE CHANGE read via the gh CLI; there is no website capture. Use this skill for a GitHub PR. Do not use it for a product launch/promo (use /product-launch-video), a tour of a real website (use /website-to-video), a topic explainer with no PR (use /faceless-explainer), 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.

1345AbhishekKumar/starter-supabase

Port an existing Remotion (React) composition to HyperFrames HTML. Use ONLY when the user explicitly asks to port/convert/migrate/translate a Remotion source. Do NOT use: (a) authoring a new HyperFrames composition; (b) Remotion mentioned in passing; (c) Remotion code shared as reference only; (d) "same video as my Remotion one" without explicit migrate request — treat as fresh build. Doubt → `/general-video`. One-way, Remotion-only: no reverse export (HyperFrames→Remotion or any framework), no non-Remotion source (After Effects, Framer Motion, plain React/CSS) → out of scope, re-create via `/general-video`. Flags unsupported patterns (useState, useEffect, async calculateMetadata, third-party React libs, `@remotion/lambda`) and recommends runtime interop over lossy translation. Unsure whether to port vs. build fresh, or only a passing Remotion mention? → /hyperframes.

1345AbhishekKumar/starter-supabase

Capture a general website/URL and turn it into a HyperFrames video (site tour, showcase, or social clip from the site's own visuals). Uses headless Chrome screenshots + brand assets. Use when intent is general — portfolio/blog/landing-page showcase or social clip from the site. NOT for: product/SaaS launch or promo (→ /product-launch-video, even from a URL); topic explainer with no site (→ /faceless-explainer); GitHub PR (→ /pr-to-video); adding captions to existing video (→ /embedded-captions); short unnarrated page-highlight motion graphic (→ /motion-graphics). Unclear launch-vs-general-site? Ask one question or start at /hyperframes.

相關技能