Communitygithub.com

Alemoterani/auto-edit-hyperframes

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

auto-edit-hyperframes 是什麼?

此技能定義了 HyperFrames 合成合約,這是一份技術規範,詳細說明了如何建立可渲染的影片專案。它涵蓋了撰寫合成 HTML 的核心規則,包括使用 `data-*` 屬性進行時間設定、正確的結構形式(獨立或模板化子合成)、以及需要避免的常見陷阱(例如 GSAP 與 CSS 變換衝突、或將 `.clip` 元素動畫化)。該技能解釋了渲染引擎如何運作:每個合成註冊一個暫停的 GSAP 時間軸,框架擁有剪輯的可見性和媒體播放,且渲染長度由根元素的 `data-duration` 屬性決定。它也詳細說明了`lint` 工具會捕捉(例如媒體缺少 ID)和不會捕捉(例如在時間軸中使用未種子的 `Math.random()`)的規則,並提供建立確定性、可搜尋時間軸的指導。支援的平台包括 HyperFrames CLI(用於檢查、預覽和渲染),並且該技能文件本身是開發者需要用來理解「hyperframes-core」領域的主指南。強烈建議在撰寫任何合成 HTML 之前先閱讀此技能,以避免常犯的錯誤並確保正確的框架行為。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Alemoterani/auto-edit-hyperframes/tree/HEAD/vendor/hyperframes/skills/hyperframes-core

在你喜歡的 AI 中提問

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

說明文件

插件安裝: 在執行設定或更新命令前,若此技能位於 HyperFrames 插件內,請遵循插件執行規則。獨立安裝則保留下方的更新說明。

HyperFrames 核心

代理陷阱(請先閱讀):

  • 使用 flex/inset 置中,不要對一個節點使用 CSS transform: translate(-50%,-50%) 後再用 GSAP 的 x/y 進行動畫。Lint 檢查:gsap_css_transform_conflict。請改用 fromTo 或 xPercent/yPercent。
  • 不要添加場景退出的 tl.set(..., {visibility:"hidden"})。運行時環境已會自動隱藏定時剪輯。對內部節點使用不透明度淡入(或在 .clip 上使用 opacity)就已足夠。字幕的強制銷毀是另一個規則。
  • window.__timelines["id"] 必須與根元素的 data-composition-id 相符。
  • 執行 render 後,請閱讀摘要的第二行:beginframe 與 screenshot、GPU 模式、階段時間。在 Linux 上的 screenshot + 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> 永遠不會被混音器拾取,因此渲染將會是靜音的。
  • 永遠不要對 .clip 使用 autoAlpha 或 visibility 進行補間動畫 — 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 只能在有限的根元素 data-duration 下使用(匯出剪輯到其中 — 否則請使用有限次數)。→ determinism-rules.md
  • 永遠不要在 .clip 元素上對 display、visibility 或 autoAlpha 進行補間動畫。框架擁有剪輯的可見性,lint 會拒絕它(gsap_animates_clip_element)。請對子元素進行動畫。→ determinism-rules.md
  • 正文文字中沒有 <br>;已變換的元素必須是區塊級別並設定大小;脈動的絕對定位裝飾元素需要間距餘裕。→ determinism-rules.md
  • <video>/<audio> 是透過平面文件查詢找到的,因此框架會在任何巢狀深度處(包括在子合成的 <template> 或包裝器內部)尋找並解碼它們。一個硬限制:如果一個帶有 data-start 的 <video> 位於另一個也帶有 data-start 的普通元素內部,lint 會報錯,且失敗是真實的(錯誤的來源幀,然後剪輯在中間消失),因此請將時間放在包裝器或影片上,切勿兩者皆放。子合成主機不受此限:子合成內部的媒體會正確渲染。另一個注意事項是時間軸,而非位置:子合成時間軸無法對主機根元素進行動畫。→ variables-and-media.md
  • 保持每個 id 在組裝後的頁面上是唯一的(為子合成 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、運行時、佈局、動態和對比度方面均無發現問題)
  • 含有子合成的專案:執行 npx hyperframes snapshot --at <midpoints> 並目測檢查每一幀
  • 執行 npx hyperframes preview --background 以供審閱(使用者可以在 Studio 的時間軸中編輯任何內容,且伺服器在執行命令後仍保持運行)
  • 僅在使用者批准後才執行 npx hyperframes render

Individual skills in this repo

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

Alemoterani/auto-edit-hyperframes

Overlay doctrine for the embedded-captions workflow — the caption MODEL (drop / rail / embed) and the rule that captions are an OVERLAY composited on top of the film, never a reserved bottom band you shift content up to avoid. Load when adding captions/subtitles to a talking-head or launch video, when deciding whether a phrase should be dropped, ride the verbatim rail, or be promoted to a scarce embedded climax, when laying out a composition that will carry captions (do NOT reserve a keep-out band), or when centering a composition on the true frame center under captions. Quotes the rail+embed model from embedded-captions and constraint #13 (captions overlay, keep-out band retired) from the product-launch-video scene agent. Applies ON TOP of embedded-captions.

Alemoterani/auto-edit-hyperframes

Turn a weekly changelog .md into a finished branded changelog video (square 1080, ~45-60s, Annie VO, animated brand background, mock-UI visualizations, lowkey captions). Use when the user provides a changelog/digest markdown and wants the weekly video, or says "changelog video". Self-contained — fonts, background, lexicon, and scripts ship in this skill.

Alemoterani/auto-edit-hyperframes

The technique catalog: five velocity-matched SEAMS (zoom-through, INVERSE zoom-through, cut-the-curve, waterfall cut, rack-focus blur-cut) plus the two in-scene techniques — waterfall ENTRY (staggered arrival cascades for title cards / segment openers) and the nudge curve (slow-fast-slow three-phase group slides). Covers partial-travel (~12% of frame) velocity matching via mirrored power4 eases, the Z scale-sign rule, size-scaled blur (10px text / 18-20px full-frame), word-by-word staggered cuts, cascade pacing by element weight, and the 10/65/25 slide ratio. Read before authoring any transition, text-beat handoff, kinetic text entry, or group reposition. [depth, zoom, inverse-zoom, scale-sign, mirrored-zoom, rack-focus, pacing, velocity, cut-the-curve, waterfall, stagger, cascade, kinetic-text, title-card, segment-opener, nudge, slide, easing, group-motion, z-depth, motion-graphics, cinematic, transition, blur, directional-continuity]

Alemoterani/auto-edit-hyperframes

GATEWAY — load FIRST before composing any HyperFrames animation or video. The high-level motion law that makes a multi-scene video feel like ONE continuous camera move instead of a stack of independently-animated slides. Covers the vector law (how you exit determines how you enter, incl. the Z scale-sign rule), the film's current, carrier elements, causal motion, the Seam Gate (build-gate enforcement), the ban on idle wobble (motion must PERFORM, not breathe), stillness-before-climax, and the sustained-motion routes. Routes to the low-level technique skills (cut-the-curve — the full catalog incl. waterfall entry + nudge curve, oversized-cursor, seam-craft). These rules SUPERSEDE generic / upstream motion guidance. [continuity, direction, vector, momentum, seam, transition, ease, performance, idle-motion, narrative-motion, film-grammar]

Alemoterani/auto-edit-hyperframes

House-style oversized macOS cursor technique for HyperFrames launch videos. Load whenever a scene involves cursors or a pointer-led action, when kicking off a UI scene, when igniting a morph/transition/typing run with a click, or when a scene reads as static, dead, or stale and needs a cheap high-yield source of motion to carry the viewer's eye and segment them out of the stale state. Covers cursor size/look (incl. brand-motif cursors), the off-screen entry law, tip-targeting and the click tap, click-ignites-the-next-beat, and exit / cross-scene handoff.

Alemoterani/auto-edit-hyperframes

Render-correctness doctrine for scene-to-scene seams in HyperFrames launch videos — the prerequisites that make transitions composite correctly on the master timeline. Load when assembling the master timeline / index.html, when a white flash appears at a cut or crossfade seam (especially on dark films), when reasoning about why a transition opacity dip shows through, or when verifying the render-side mechanics of how overlapping scene wrappers blend. Covers the opaque stage-ground (#root background) white-flash guard and how the injector overlaps wrappers, holds final frames, ping-pongs tracks, and stamps lint-clean template code onto the master timeline. Does NOT contain the per-transition catalog — see the transition registry for individual transition entries.

Alemoterani/auto-edit-hyperframes

Leaves sweep through the frame and part to reveal the headline. HyperFrames block, 1920×1080, 12s, 11 variables.

Alemoterani/auto-edit-hyperframes

A tiled headline surface flips cell by cell under a sweeping depth field to reveal the rear headline. HyperFrames block, 1920×1080, 8s, 18 variables.

Alemoterani/auto-edit-hyperframes

A chain of bevelled cuboids rides a travelling wave as a content carousel. HyperFrames block, 1920×1080, 6.666666666666667s, 40 variables.

Alemoterani/auto-edit-hyperframes

An orbiting camera follows an ice logo as it breaks apart, reforms into two text moments, and fades. HyperFrames block, 1920×1080, 22.5s, 216 variables.

Alemoterani/auto-edit-hyperframes

Glass shards fly in through fog and tile themselves into the headline. HyperFrames block, 1920×1080, 12.16s, 19 variables.

Alemoterani/auto-edit-hyperframes

A single feature card orbits a dot sphere on approved Blender camera motion. HyperFrames block, 1920×1080, 10s, 4 variables.

Alemoterani/auto-edit-hyperframes

A wireframe portal bursts open, the title comes through, then its letters swap into a second phrase. HyperFrames block, 1920×1080, 8s, 9 variables.

Alemoterani/auto-edit-hyperframes

Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet `anchor` rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.

Alemoterani/auto-edit-hyperframes

Turn arbitrary text — an article, notes, a topic, a brief — into a faceless explainer video: there is no site or footage to capture, so the visuals are invented per scene (typography, abstract graphics, diagrams, data-viz). Use for topic explainers, concept breakdowns, how-tos, listicles. Not a video built from a website (/product-launch-video — promo or tour). Unclear → /hyperframes.

Alemoterani/auto-edit-hyperframes

Import Figma content into a HyperFrames composition — rendered assets, brand tokens, components, storyboard sections → reconstructed motion (frames read as states, not slides) (REST/CLI), connector-assisted motion when available, and shaders from a connector or native export. Use when the user pastes a figma.com link or asks to bring a Figma design, frame, logo, brand, or animation into a video/composition.

Alemoterani/auto-edit-hyperframes

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.

Alemoterani/auto-edit-hyperframes

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.

Alemoterani/auto-edit-hyperframes

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

Alemoterani/auto-edit-hyperframes

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.

相關技能