Communitygithub.com

HyperFrames 核心元件

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

HyperFrames 核心元件 是什麼?

這項技能定義了 HyperFrames 合成合約,這是一個基於 HTML 的影片渲染框架。它規定如何建立一個 HyperFrames 專案:一個使用 `data-*` 屬性宣告時間、具有可搜尋動畫執行環境、且媒體播放由框架擁有的 HTML 合成檔案。此技能作為技術合約與建置指南,涵蓋最小化可渲染合成骨架、合成模式(獨立 vs. 子合成)、`data-*` 時間屬性、時間軸與剪輯、子合成配線、變數與媒體播放、確定性渲染規則(禁止非確定性行為),以及完整螢幕動作等主題。它支援獨立與子合成兩種形式,在渲染、時間軸與媒體播放方面有不可談判的規則,以防止 `lint`/`validate`/`inspect` 工具無法捕捉的無聲錯誤。它還引用了一套參考文件和同領域技能(如 `hyperframes-animation`、`hyperframes-creative`、`hyperframes-media`、`hyperframes-cli`、`hyperframes-registry`),以提供動畫執行環境(GSAP、Lottie、Three.js 等)和 CLI 作業(渲染、預覽、快照、lint、驗證、檢查)的具體細節。

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

在你喜歡的 AI 中提問

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

說明文件

HyperFrames 核心元件 是做什麼的?

HyperFrames 可從 HTML 渲染影片。一個合成是一個 HTML 檔案,其 DOM 使用 data-* 屬性宣告時間,其動畫執行環境是可搜尋的,且媒體播放由框架擁有。

此技能是技術合約 — 如何建立一個 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/<執行環境>.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 <中點> 並目視檢查每個幀
  • 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-nextjs

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-nextjs

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-nextjs

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-nextjs

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-nextjs

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-nextjs

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-nextjs

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-nextjs

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-nextjs

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-nextjs

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-nextjs

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-nextjs

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-nextjs

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.

相關技能