Communitygithub.com

Video-Editor

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

Video-Editor 是什么?

这项技能是 HyperFrames 合成合约的官方指南,HyperFrames 是一个将 HTML 文档渲染为视频的框架。它定义了构建单个可渲染项目的完整技术规范,包括如何使用 `data-*` 时序属性、`class="clip"` 标记、轨道、子合成、变量以及框架管理的媒体播放。该技能涵盖了所有关键方面:两种根形式(独立式和子合成)、注册暂停时间线、第一遍 lint 检查的常见陷阱、不可协商的确定性规则(如禁止运行时时钟和不可重复的动画)、以及现有合成的编辑和验证方法。它面向需要在 HyperFrames 中编写合成的开发人员,支持所有平台(独立或作为 HyperFrames 插件的一部分),并提供清晰的参考文件索引供按需查阅。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/DansiDanutz/Video-Editor/tree/HEAD/.claude/skills/hyperframes-core

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

插件安装: 在执行设置或 freshness 命令之前,当此技能位于 HyperFrames 插件内部时,请遵循 插件执行规则。独立安装则保留下面的更新说明。

HyperFrames 核心

代理陷阱(请先阅读):

  • 使用 flex/inset 居中,不要在对节点使用 GSAP x/y 的同时使用 CSS transform: translate(-50%,-50%)。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选择单体式还是模块化;构建模块化 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。

根节点必须设置大小(静默布局 Bug)

独立式根节点设置 width/height: 100%。画布大小由 data-width/data-height 指定。运行时将这些像素值设置到合成根节点上。不要在 #root 上硬编码 1920px/1080px。骨架 → references/minimal-composition.md。

一个暂停的时间线

每个合成在 window.__timelines["<id>"](键 = 根节点 data-composition-id)上注册恰好一个 gsap.timeline({ paused: true })。在异步回调(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 错误。

不可协商的规则(自动化门可能遗漏的静默 Bug)

在此列出;完整理由在链接的参考中。不要违反:

  • 没有运行时时钟 / 未播种的 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> 或包装器内)寻址和解码它们。一个硬限制:如果带有 data-start 的 <video> 位于另一个也带有 data-start 的普通元素内,lint 会报错,并且失败是真实的(错误的源帧,然后剪辑在中间槽消失),因此请将时间放在包装器或视频上,而不是两者。子合成宿主是豁免的:子合成内的媒体可以正确渲染。另一个注意事项是时间线,而不是放置位置:子 comp 时间线不能动画化宿主根元素。→ variables-and-media.md
  • 保持每个 id 在组装后的页面中唯一(使用合成 id 为子 comp 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 13 individual skills — each has its own dedicated page.

DansiDanutz/Video-Editor

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.

DansiDanutz/Video-Editor

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.

DansiDanutz/Video-Editor

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

DansiDanutz/Video-Editor

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

DansiDanutz/Video-Editor

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

DansiDanutz/Video-Editor

Use when a HyperFrames composition needs a punch-in, punch-out, zoom, reframe, Ken Burns treatment, camera move, visual match/whip handoff, or other seek-safe 2D/3D keyframes; also for GSAP, CSS keyframes, Anime.js, WAAPI, FLIP, paths, masks, SVG morph/draw, text trails, 3D depth, or `hyperframes keyframes` diagnostics. Don't use for broad scene strategy, brand design, media sourcing, captions, or general video planning.

DansiDanutz/Video-Editor

Search, install, and wire registry blocks and components into HyperFrames compositions. Use BEFORE hand-building any named visual — whenever a brief, a user, or a storyboard names a look, effect, treatment, or transition such as CRT scanlines, glitch, chromatic aberration, film grain, a shimmer sweep, a chart, a code or terminal window, a map, or a confetti burst — because roughly 400 hosted items already cover many of them and the search ranks all of them with nothing installed, no project, and no account. Also use when running hyperframes add or hyperframes catalog, installing one item or every block matching a tag, wiring an installed item into index.html, or working with hyperframes.json. Covers discovery, install locations, block sub-composition wiring, component snippet merging, and authoring a new block or component to contribute upstream (idea → scaffold → validate → PR).

DansiDanutz/Video-Editor

Mandatory entry point: read this first for any request to make, create, edit, animate, or render a video, animation, or motion graphic, including a promo, explainer, captioned clip, title card, overlay, slideshow or interactive deck, Remotion port, or any HyperFrames HTML composition. Also use it to inspect, diagnose, validate, preview, publish, or batch-render an existing HyperFrames project. Inputs may be a website URL, GitHub PR, Figma design or URL, text or brief, existing footage, or music. It resumes project state, captures intent when applicable, selects and installs the owning workflow, and routes domain capabilities. HyperFrames is the default output framework unless the user explicitly chooses another framework for the deliverable or asks only to record a browser session.

DansiDanutz/Video-Editor

Use when building or editing a HyperFrames project that people open in Studio: how the timeline should be laid out so it reads well (one caption track, one element kind per track, every scene a sub-composition) and where captions and key content may sit (safe zones). Don't use for how to perform an individual edit (split, trim, retime, volume, copy, swap): that is `creator-editing-recipes.md` in `/hyperframes-core`.

DansiDanutz/Video-Editor

Agent Media OS, the single skill for every media need in a HyperFrames project. Resolve BGM, SFX, image, icon, brand logo, voice, color grade, or LUT into a frozen local file or paste-ready block + ledger record (one verb, `resolve`); generate via TTS / music / image models when the catalog misses; produce voiceover, transcription, captions, and background removal through one shared audio engine; operate on media (cut / reframe / transform); and reuse assets across projects. Also use for vague feedback that real footage looks dark, flat, boring, should feel retro/camcorder/print/ASCII, needs privacy, or needs a media reveal.

DansiDanutz/Video-Editor

Turn a product or marketing URL, pasted script, or brief into a product launch / promo video — SaaS promos, feature reveals, product demos, app and company launches. Use when the user wants to market, launch, promote, or reveal a product; the default for any commercial URL. Site tours / showcases of a website route here too — the brief carries the show-it-as-is intent. Unclear → /hyperframes.

DansiDanutz/Video-Editor

Divide a finished story/script into filmable scenes with per-scene image and animation prompts. Use when building a scene outline or shot list, deciding scene boundaries, durations, or what each visual must show.

DansiDanutz/Video-Editor

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

相关技能