Communitygithub.com

Alemoterani/auto-edit-hyperframes

HyperFrames 合成契约——构建一个可渲染的项目。用于合成结构、`data-*` 时序属性、`class="clip"`、轨道、子合成、变量、框架自有的媒体播放、确定性渲染规则以及校验。在编写合成 HTML 前请先阅读。

auto-edit-hyperframes 是什么?

此技能(Alemoterani/auto-edit-hyperframes)定义了 HyperFrames 框架的核心技术契约,指导开发者构建基于 HTML 的视频渲染项目。其核心价值在于,它全面把控了合成项目的所有关键方面,包括:通过 `data-*` 属性声明 DOM 节点的时序、使用 `class="clip"` 定义剪辑片段、管理轨道与子合成、处理框架自有的媒体播放(视频/音频)、确保渲染的可确定性(禁止运行时时钟或未播种的随机数)、以及通过 `npx hyperframes check` 命令进行严格的校验。该技能支持独立合成和子合成两种形式,并广泛适用于所有基于 HyperFrames 的项目,帮助开发者避开常见的陷阱(如 CSS 变换与 GSAP 补间冲突、错误隐藏剪辑片段等),从而构建出精准、可预览、可渲染的合成。

兼容平台~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 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。

一条暂停的时间线

每个合成在 window.__timelines["<id>"] 处注册恰好一条 gsap.timeline({ paused: true })(键 = 根元素的 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 回读。没有抑制方法。
  • 切勿让一个 <video data-start> 有也携带 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 仅在有限的根元素 data-duration 下使用(导出剪辑到该根元素——否则使用有限次数)。→ determinism-rules.md
  • 切勿对 .clip 元素进行 display、visibility 或 autoAlpha 补间。框架拥有剪辑的可见性,lint 会拒绝它(gsap_animates_clip_element)。请对子元素进行动画。→ determinism-rules.md
  • 正文中无 <br>;变换后的元素必须是块级元素并具有尺寸;脉动绝对定位装饰元素需要有峰值间隙。→ determinism-rules.md
  • <video>/<audio> 通过平面文档查询找到,因此框架会在任何嵌套深度(包括在子合成 <template> 或包装器内部)定位和解码它们。一个硬性限制:如果 <video data-start> 位于也有 data-start 的另一个普通元素内部,lint 会报错,并且失败是真实的(错误的源帧,然后剪辑在中间位置消失),因此请将时间放在包装器上或视频上,切勿同时放两者。子合成宿主是豁免的:子合成内部的媒体会正确渲染。另一个注意事项是关于时间线,而不是位置:子合成时间线无法动画宿主根元素。→ 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 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.

相关技能