Communitygithub.com

9018/mychat

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

mychat 是什么?

这是一个针对 HyperFrames 框架的核心技术技能,它定义了如何使用 HTML 构建视频合成的完整契约。该技能主要面向开发者,详细说明了如何创建独立合成和子合成,重点强调了根元素必须使用 `data-composition-id` 属性声明,且子合成必须包裹在 `<template>` 标签内等关键规则。技能支持通过 GSAP、Lottie、Three.js 等运行时进行动画,强调渲染过程必须是确定性的,禁止使用运行时时钟、未播种的随机数和网络请求等。此外,该技能提供了全面的参考文档索引,涵盖最小合成、数据属性、轨道与剪辑、子合成、变量与媒体、确定性规则、全屏动画、故事板格式和脚本格式等主题。通过 CLI 工具进行验证和渲染是工作流的关键部分。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/9018/mychat/tree/HEAD/OpenMontage/.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选择整体式与模块式;构建模块化 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。

根元素必须设置尺寸(无声布局错误)

独立根元素需要显式 定义尺寸的盒子(width/height 使用 px),并且每个祖先元素直到 height:100% 元素都必须具有已解析的高度 —— 否则 flex/100% 子元素会折叠到约 0,内容堆叠到左上角。lint/validate/inspect 不会 捕获此问题。框架 → references/minimal-composition.md。

一个暂停的时间线

每个合成都注册 恰好一个 gsap.timeline({ paused: true }) 于 window.__timelines["<id>"](键 = 根元素 data-composition-id),在页面加载时 同步 构建。渲染时长 = 根元素 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 20 individual skills — each has its own dedicated page.

9018/mychat

Generate AI videos from text prompts using multiple provider gateways. Use when: (1) Generating videos from text descriptions, (2) Creating AI-generated video clips for content production, (3) Image-to-video generation with a reference image, (4) Choosing between video generation providers (VEO, Kling, Sora, Runway, Seedance, MiniMax, Gemini Omni). Supports gateways: HeyGen API, fal.ai API, Kling official direct API, and the Gemini API (Gemini Omni Flash).

9018/mychat

Create AI avatar videos with precise control over avatars, voices, scripts, scenes, and backgrounds using HeyGen's v2 API. Use when: (1) Choosing a specific avatar and voice for a video, (2) Writing exact scripts for an avatar to speak, (3) Building multi-scene videos with different backgrounds per scene, (4) Creating transparent WebM videos for compositing, (5) Using talking photos as video presenters, (6) Integrating HeyGen avatars with Remotion, (7) Batch video generation with exact specs, (8) Brand-consistent production videos with precise control.

9018/mychat

Use p5.js/canvas for local procedural character effects: particles, weather, squash/stretch, walk cycles, and environmental motion.

9018/mychat

Review local character animation with schema checks, Playwright browser previews, frame sampling, and FFmpeg/ffprobe final output checks.

9018/mychat

Create videos from a text prompt using HeyGen's Video Agent. Use when: (1) Creating a video from a description or idea, (2) Generating explainer, demo, or marketing videos from a prompt, (3) Making a video without specifying exact avatars, voices, or scenes, (4) Quick video prototyping or drafts, (5) One-shot prompt-to-video generation, (6) User says "make me a video" or "create a video about X".

9018/mychat

Generate Mandarin and multilingual narration with Volcengine Doubao Speech 2.0. Use when creating Chinese voiceovers, when the user prefers Doubao/Volcengine/火山引擎/豆包 TTS, or when narration needs character-level timestamp metadata for subtitles.

9018/mychat

Video and audio processing with FFmpeg. Use for format conversion, resizing, compression, audio extraction, and preparing assets for Remotion. Triggers include converting GIF to MP4, resizing video, extracting audio, compressing files, or any media transformation task.

9018/mychat

Use when implementing Disney's 12 animation principles with Framer Motion in React applications

9018/mychat

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.

9018/mychat

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

9018/mychat

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

9018/mychat

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.

9018/mychat

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

9018/mychat

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.

9018/mychat

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.

9018/mychat

Toolkit-specific Remotion patterns — custom transitions, shared components, and project conventions. For core Remotion framework knowledge (hooks, animations, rendering, etc.), see the `remotion-official` skill.

9018/mychat

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.

9018/mychat

Animate SVG character rigs with GSAP, CSS transforms, Remotion frame control, and HyperFrames-compatible browser previews.

9018/mychat

Three.js animation - keyframe animation, skeletal animation, morph targets, animation mixing. Use when animating objects, playing GLTF animations, creating procedural motion, or blending animations.

9018/mychat

Download video and audio from YouTube and 1000+ sites using yt-dlp. No API keys needed. Use when: (1) Downloading a video from YouTube or other sites, (2) Extracting audio from a video URL, (3) Downloading subtitles/captions from a video, (4) Getting video metadata without downloading.

相关技能