Communitygithub.com

sandeshrajbhandari/hyperframes-instruct

用于 HyperFrames 合成中的推近、拉远、缩放、重构图、Ken Burns 效果、镜头运动、视觉匹配/甩镜头过渡以及其他支持 seek 安全的 2D/3D 关键帧操作;也适用于 GSAP、CSS 关键帧、Anime.js、WAAPI、FLIP、路径、遮罩、SVG 变形/绘制、文字轨迹、3D 深度或 `hyperframes keyframes` 诊断。不用于宏观场景策略、品牌设计、素材搜索、字幕或一般视频规划。

hyperframes-instruct 是什么?

HyperFrames Keyframes 技能专注于在 HyperFrames 框架内为单个视觉元素定义精确的逐帧动画。它提供了一套严格的协议(契约)来确保关键帧动画的确定性、可验证性和时间线安全性,尤其适用于复杂的镜头运动、转场和视觉效果。该技能明确区分了视觉运动(由关键帧控制)与时间线剪辑(由 hyperframes-core 处理),并提供了针对 GSAP、CSS、Anime.js 和 WAAPI 等不同动画引擎的运行规则和代码骨架。开发者可以通过 CLI 命令(如 `hyperframes keyframes`)进行严格的测试和验证,以确保动画行为与预期一致。该技能的核心价值在于为复杂的视觉动画提供可靠、可复现且可测试的工作流,避免依赖不可预测的定时器或随机数,适合需要精确运动控制的场景。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/sandeshrajbhandari/hyperframes-instruct/tree/HEAD/.agents/skills/hyperframes-keyframes

在你喜欢的 AI 中提问

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

文档

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

HyperFrames 关键帧

关键帧是一种姿态契约:可见状态、连续主体身份、seek 安全运行时、已验证的像素。

使用 hyperframes-animation 处理宏观场景策略。使用 hyperframes- cli 获取完整命令文档。仅在需要选择实现机制而非视觉风格时,才使用 references/keyframe-patterns.md。

创作者编辑边界

关键帧负责视觉运动,而非剪辑组装。源范围内的硬切、修剪、拼接和重新排序属于 /hyperframes-core:每个保留范围应编写一个媒体元素,使用 data-start 和 data-duration 放置,并使用 data-media-start 选择其源偏移量。相邻的范围形成硬切换。交叉淡入淡出通过不同轨道上的重叠剪辑加上视觉不透明度关键帧实现;声音淡入淡出使用 /hyperframes-audio。

创作者请求真实的实现机制
推近 / 拉远在剪辑内部的非时间性视觉/裁剪包装器上,对 scale 以及 x/y 或百分比平移设置关键帧。使用一个设置/简短补间实现硬推,使用补间实现平滑移动。
平滑多状态缩放或重构图保持一个主体包装器活跃,并将多个缩放/重构状态编写为一个姿态阶梯,每个片段带有各自的缓动。
平移、重构图或 Ken Burns 镜头运动动画包装器的平移加缩放。几何形状是编写出来的;这不是面部追踪或自动语义重构图。
链式镜头运动在一个已注册的 seek 安全时间线上链接标记的变换节拍。
匹配剪辑或甩镜头/hyperframes-animation 掌管视觉交接;/hyperframes-registry 提供原语;关键帧保留编写的几何形状、方向和速度。没有自动匹配帧发现。
裁剪和遮罩重构图在内部视觉包装器上插值 clip-path 或遮罩以裁剪/重构图,无需更改源时间。多边形关键帧可以形成多边形/遮罩过渡。
定向擦除剪辑或虹膜/揭示剪辑在重叠的视觉剪辑上动画遮罩/裁剪边界;/hyperframes-animation 掌管交接编排。
分屏交接保留核心放置的两个视觉剪辑,然后对其内部裁剪/遮罩包装器和分割线几何形状设置关键帧。
恒定源变速/hyperframes-core 拥有标准化的 data-playback-rate(0.1..10),实现渲染安全的图像和保持音调的声音。它对整个媒体元素是恒定的。
源速度渐变在 <video>/<audio> 上的 data-automation 中使用 rate 通道(t 为剪辑秒数,v 为 0.1..10,对数插值);它覆盖恒定速率。
冻结 / 保持一个视觉姿势、最终源帧或完成的子合成可以保持。不支持任意的源中间冻结;预处理一个静态/派生片段,将其作为自己的剪辑放置,然后使用另一个源范围继续。

当同时处理画面和声音时,加载 /hyperframes-core、本技能用于视觉运动,以及 /hyperframes-audio 用于淡入淡出、交叉淡入淡出、音量自动化、闪避/挖空或对已放置轨道的效果。

视觉过渡或裁剪处理不是时间上的源修剪或拼接。/hyperframes-core 掌管时间线、剪辑时序和源范围;关键帧仅动画化这些剪辑内部包装器上的可见交接或裁剪。对于可复制的组合画面/声音方案,请使用 /hyperframes-core → references/creator-editing-recipes.md。

步骤

  1. 确定动画主体、可见状态、最终状态和运行时间。
  2. 选择能证明提示的最小机制。仅在机制不明确时阅读 references/keyframe-patterns.md。
  3. 在声明的运行时中编写 seek 安全的关键帧。仅在构建完成后注册运行时实例;在 document.fonts.ready 内部构建是可以的。
  4. 使用 hyperframes check(运行 lint)、hyperframes keyframes、一个聚焦的 --shot 以及在证明时间点的快照进行验证。
  5. 如果证明失败,修复源关键帧并在渲染前重新运行最小的失败诊断。

契约

  • 命名运动主体。
  • 命名证明预期运动所需的姿势,包括最终状态。
  • 对可见通道设置关键帧,而不是隐藏的辅助状态。
  • 当连续性重要时,保持对象身份。
  • 仅当预期运动是替换或溶解时使用交叉淡入淡出。
  • 保持可读或语义状态足够长的时间以被看清。
  • 最终帧是动画的一部分,而不是清理。
  • 除非被要求,否则不要重置为静止状态。
  • 除非被要求,否则不要以黑色结束。
  • 如果编辑初始场景,除非被要求重新设计,否则请保留布局、文案、资源、颜色和最终状态。

运行时规则

GSAP:

  • 在页面加载时或 document.fonts.ready 内部构建,并且仅在构建完成后注册
  • 使用 gsap.timeline({ paused: true })
  • 注册为 window.__timelines[compositionId]
  • 注册键必须匹配 data-composition-id
  • 不要为渲染关键的运动调用 tl.play()
  • 保持重复次数有限

CSS 关键帧:

  • 有限的持续时间和迭代次数
  • 确定性的延迟
  • animation-fill-mode: both
  • 当时序属于一个剪辑时使用 data-start

Anime.js:

  • 同步创建
  • autoplay: false
  • 有限的持续时间和循环
  • 将每个实例推送到 window.__hfAnime

WAAPI:

  • 有限的 duration
  • fill: "both"
  • 确定性的构建
  • 文字表面不列出 WAAPI;使用 --shot(它会寻找 WAAPI)和快照进行验证

切勿用于渲染关键的运动:

  • Date.now()
  • performance.now()
  • 未种子化的 Math.random()
  • 悬停/滚动触发器
  • 定时器
  • 在其异步构建完成之前注册的时间线
  • 未注册的 requestAnimationFrame
  • 无限循环

GSAP 骨架

const root = document.querySelector("[data-composition-id]");
const compositionId = root.dataset.compositionId;
const tl = gsap.timeline({ paused: true });

tl.addLabel("state-a", 0);
tl.to(".subject", {
  keyframes: [
    { x: 0, opacity: 1, duration: 0.2 },
    { x: 120, opacity: 1, duration: 0.4, ease: "power2.out" },
    { x: 100, opacity: 1, duration: 0.2, ease: "power2.inOut" },
  ],
  ease: "none",
});

window.__timelines = window.__timelines || {};
window.__timelines[compositionId] = tl;

使用标签表示语义状态。使用位置参数而不是链式延迟。为稍后操作同一属性的 from()/fromTo() 补间使用 immediateRender: false。

关键帧形式

  • 数组关键帧:带有每步持续时间/缓动的姿态阶梯。
  • 百分比关键帧:一个补间内的精确时序。
  • 属性数组:紧凑的多停止点变化。
  • 当每个停止点带有自己的缓动时,父级使用 ease: "none"。
  • 当每个片段应有相同感觉时使用 easeEach。

不要从示例中复制数字距离或时序。根据实际合成几何和持续时间推导它们。

对于一个在两个框之间移动的主体,优先使用一个连续的变换补间或 FLIP。只有当观众应该感觉到不同的节拍时才将 x/y/scale 拆分为多个缓动关键帧;每个片段都会改变速度,可能被视为卡顿。

通道

优先使用合成器/视觉通道:x/y/z、xPercent/yPercent、scale、rotationX/Y/Z、skew、transformOrigin、svgOrigin、opacity、autoAlpha、clip-path、遮罩、CSS 变量、SVG 路径/描边值、摄像机变换、着色器统一变量。

避免布局/生命周期通道:top/left/right/bottom、width/height、margin/padding、display、visibility、后期 DOM 创建、执行主体运动的辅助叠加层。

对于可见性变化,使用已注册的可寻址 GSAP 时间线上的 autoAlpha,或在显式边界处使用零持续时间的 tl.set()。仅针对非剪辑元素或剪辑内部的包装器;切勿针对 .clip 本身。切勿对原始 visibility 进行持续时间补间,并且切勿对 display 进行补间。

机制选择

选择能证明提示的最小机制:

需求机制
同一主体改变盒子或层次结构共享元素 / FLIP
主体沿可见路径移动路径旅行
描边增长或追踪描边绘制
形状变为另一种形状形状插值
揭示边界可见剪辑、遮罩或着色器统一变量
许多元素按顺序移动交错 / 索引延迟
文本自身移动行、单词、字符或带状细分
表面弯曲、拉伸或裁剪父/子反向变换
UI 有状态显式状态机
场景有深度DOM 3D、Three.js 或 WebGL 相机/对象关键帧

机制可以组合,但每个机制必须阐明想法。装饰不是证明。

时序

  • 仅当它阐明原因或方向时才使用预备动作。
  • 加速离开静止状态。
  • 峰值证明明确无误地展示机制。
  • 跟随动作体现能量和方向。
  • 仅当主体应感觉有弹性或触感时使用过冲。
  • 恒定速度路径旅行通常需要 ease: "none"。
  • 离散 UI 状态通常需要锐利的缓动输出。
  • 重复元素需要有序偏移,而不是相同的时序。
  • 最终锁定需要比过渡姿势更长的保持时间。
  • 平滑度意味着同一主体上的连续速度。
  • 除非重叠是有意的且已验证,否则不要重叠写入相同变换属性的补间。
  • 避免在同一主表面也在缩放或移动时动画化大型 clip-path/遮罩更改;在主移动稳定后使用嵌套揭示。

文本

保留行盒、字间距、可读性和最终适配。如果文本内部移动,则移动字形或遮罩带,而不仅仅是文本周围的装饰。对可读帧进行快照。

SVG

对于描边增长,优先使用 DrawSVGPlugin,然后使用 stroke-dasharray/stroke-dashoffset。对于形状插值,优先使用 MorphSVGPlugin;必要时将基本图形转换为路径,并将复杂轮廓拆分为更简单的部分。

3D

单独缩放是假深度。在稳定父级上使用透视、transform-style: preserve-3d、z 轴移动、旋转、相机/世界运动、遮挡以及当对象交叉时的图层顺序。

使用一到两个能暴露深度关系的诊断角度。如果带角度的证明显示没有深度交叉,改善 z/相机/遮挡。

Canvas / WebGL

通过确定性状态对相机位置、相机目标、对象变换、材质不透明度、着色器统一变量和后处理强度设置关键帧。从 HyperFrames 时间渲染。使用 --ghost,因为标记框无法看到内部 canvas 运动。

CLI 证明

npx hyperframes check
npx hyperframes keyframes .
npx hyperframes keyframes . --json
npx hyperframes keyframes . --runtime all
npx hyperframes keyframes . --selector "<selector>" --shot "<file>" --samples <n>
npx hyperframes keyframes . --selector "<selector>" --shot "<file>" --layout strip --from <t0> --to <t1>
npx hyperframes keyframes . --shot "<file>" --ghost --angle <angle>
npx hyperframes snapshot . --at <times>

为真实的动画主体选择 <selector>。为第一帧、证明姿势、最终减去保持以及精确最终选择 <times>。仅在必须证明深度时选择 <angle>。

工具证明什么
keyframes目标、显式停止点、路径、轨迹、组合的父/子运动、CSS 停止点、Anime 注册
--shot重影、路径形状、时间间隔、DOM 3D 投影、聚焦的选择器证明
--layout strip原地运动、重叠、接触、细微缩放/不透明度、文字波动
--ghostCanvas、WebGL、着色器运动、渲染的 3D
snapshot --at遮罩

Individual skills in this repo

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

sandeshrajbhandari/hyperframes-instruct

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.

sandeshrajbhandari/hyperframes-instruct

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.

sandeshrajbhandari/hyperframes-instruct

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

sandeshrajbhandari/hyperframes-instruct

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.

sandeshrajbhandari/hyperframes-instruct

The HyperFrames composition contract — build one renderable project. Use for composition structure, the `data-*` timing attributes, `class="clip"`, tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.

sandeshrajbhandari/hyperframes-instruct

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

sandeshrajbhandari/hyperframes-instruct

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

sandeshrajbhandari/hyperframes-instruct

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.

sandeshrajbhandari/hyperframes-instruct

Use when working with a person on a HyperFrames project in Studio: first, whether their message asks for a change at all (questions, loose ideas and "don't change anything" get an answer and a plan, not an edit); for a new film, the plan, storyboard and build order that the HyperFrames launch films follow; and 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`.

sandeshrajbhandari/hyperframes-instruct

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.

sandeshrajbhandari/hyperframes-instruct

A short, design-led motion graphic where motion is the message — kinetic typography, stat count-up, chart/data-viz hit, logo sting / brand lockup, lower-third / callout / social overlay, animated map (highlight regions, connect places, zoom to a location), animated tweet / news-article / headline, webpage / UI animation (scroll, cursor, callouts), or fusing a real image's geometry into a chart. Usually under 10s (up to ~30s), no narration or live-action subject; renders to MP4 or transparent overlay. Longer / narrated / multi-scene → /general-video. Unclear → /hyperframes.

相关技能