video-hyperframes
Hyperframes / Remotion compatible continuous frame animation with autoplay support
1How It Works & Mechanism
This skill is not an executable program, but rather a "template" for html-anything: a directory (SKILL.md + example.html[/example.md]) scanned and read from disk at runtime by loader.ts—adding a new template simply means adding a directory, without modifying any TypeScript code.
Adding a template = adding a folder. No TS code change required; the API
The frontmatter provides metadata for the selector/API (zh_name/en_name/emoji/description/category/scenario/aspect_hint/featured/recommended/tags), mapped into SkillMeta via fmToMeta(); the body following the frontmatter constitutes the actual specification delivered to the model.
zhName: fm.zh_name ?? fm.name ?? id,
During generation, this template body acts as the prompt body: /api/convert uses assemblePrompt() to concatenate "global design directives + this template body + user content" into a single prompt, which is fed to the host's local agent CLI, streaming HTML back via stdout.
prompt = assemblePrompt({ body: skill.body, content, format });
Above the template body lies a block of global prepended instructions (SHARED_DESIGN_DIRECTIVES), uniformly enforcing technical and content rules across all templates—the CDN and Google Fonts external links commonly seen in example HTML files originate here (injected by the host shell, not requested by the template itself).
通过 CDN 引入 Tailwind v3 Play (https://cdn.tailwindcss.com) 与所需的 Google Fonts。
Artifacts are returned as text via stdout: global directives explicitly prohibit the agent from accessing the file system, leaving disk writing to the frontend—meaning the template directory possesses neither scripts nor disk-writing capabilities.
**禁止使用 Write / Edit / MultiEdit / Bash / Create / 任何文件系统工具**。
example.html serves as a pre-rendered bundle example: /api/templates/<id>/preview returns it verbatim as text/html to an iframe (for inline selector preview), while /api/templates/<id>/example returns both example.md and example.html together.
return new Response(skill.exampleHtml, {
The body defines "frames" as machine-readable continuous <section class="frame"> elements (1920×1080), with frame count determined by content density rather than a fixed number—starting from 6–10 frames for short scripts, with each frame hosting only a single shot/concept.
- 输出 N 个连续 `<section class="frame">`, 每个 `w-[1920px] h-[1080px]`; N 由【用户内容】信息密度决定
Each frame embeds a hidden comment marker at the bottom: `<!-- frame:N duration:3000 transition:fade -->`, followed by a `<!-- HYPERFRAMES_META: ... -->` JSON block (duration/transition/sceneSummary) at the end of the file for subsequent Remotion rendering scripts to consume.
- 每帧底部隐藏标记 `<!-- frame:N duration:3000 transition:fade -->` 供后续 Remotion / Hyperframes 渲染脚本读取。
Autoplay is a strict requirement of the template body: a JavaScript block at the top switches frames every 3 seconds, supports click and arrow key navigation, and displays a progress bar in the corner.
- 顶部加一段 JavaScript 自动播放: 每 3 秒切换到下一帧, 也支持点击 / 方向键控制; 角落显示进度条。
Narrative structure is codified into the template: Frame 1 is the hook (a metric, counter-intuitive insight, or provocative question), Frames 2 through N provide arguments, and the final frame delivers the conclusion + CTA, rendered in massive typography in a single concise sentence.
- 第 1 帧是 hook (一个数据 / 一个反常识 / 一个问题), 第 2-N 是论证, 最后是结论 + CTA。
The application host actively consumes this convention: upon detecting the frame structure, export-menu.tsx provides an additional Remotion zip export option (parseHyperframes → exportRemotionZip).
await exportRemotionZip(hyperframes, hyperframes.title, {
On the CLI side, there is a direct keyword matching channel: skills-matcher.ts directly maps keywords in user content to this template id; a match grants confidence = matches × 2 + 3, and hitting a threshold of 3 triggers the local rule directly without relying on model-based template selection.
[["视频", "video", "帧动画", "hyperframes", "remotion", "mp4", "片头"], "video-hyperframes"],
Threshold constants for CLI fallback matching: content length must exceed 60 characters before enabling AI summary matching, and the strong signal threshold is set to 3.
const MIN_CONTENT_LENGTH_FOR_AI = 60;
The host shell renders examples and artifacts using an iframe configured with sandbox="allow-scripts allow-same-origin" (allowing scripts and same-origin)—this is an architectural tradeoff of the product shell noted under risks, and does not affect the safety grading of this skill.
sandbox="allow-scripts allow-same-origin"
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| network | Tailwind CDN(示例 HTML 引用) |
| network | Google Fonts(Inter Tight / Noto Sans SC / JetBrains Mono) |
| network | 上游项目(frontmatter 元数据,非运行依赖) |
4Recommended Governance & Evidence
- SKILL.md: Pure prompt directives and rule text, devoid of script execution or external impact
5Second-Pass Verification
- [ok] skill 目录文件清单 — find 得 SKILL.md + example.html + example.md,无 scripts/references。
- [ok] 外部端点只出现在示例/元数据 — SKILL.md 正文无 URL;URL 分别位于 frontmatter example_source_url 与示例的 Tailwind CDN / Google Fonts。
- [ok] HYPERFRAMES_META 是否真实存在 — example.html 含 <!-- HYPERFRAMES_META: {"frames":[ … ]} --> 共 8 条(i/duration/transition/scene),与示例 8 个 section.frame 一一对应。
- [discrepancy] 行内 frame 标记是否在示例中 — grep 'frame:' example.html = 0 命中;SKILL.md 要求的 `<!-- frame:N duration:3000 transition:fade -->` 在示例中未出现,时长改由 data-duration 承载。宿主解析器 parseInlineMarker + 兜底注释表明两条路径都被支持,故为约定演示缺口而非能力缺口。
- [ok] 宿主是否真消费该约定 — next/src/lib/hyperframes.ts 存在 FRAME_RE/META_RE/parseInlineMarker 实现(注释「Pull duration / transition out of the inline …marker the skill plants at the bottom of each section」);export-menu.tsx 提供 hyperframes-remotion-zip 动作;e2e/ui/export-menu.test.ts 以 templateId "video-hyperframes" 造样本。
- [ok] CLI 匹配器路由 — cli/src/skills-matcher.ts 存在 [["视频", "video", "帧动画", "hyperframes", "remotion", "mp4", "片头"], "video-hyperframes"] 行。
- [ok] 判级 green 自证 — 目录零脚本文件(示例内联 JS 属产物示例)、零凭证、零写盘;正文只规定 HTML 结构与注释标记,未点名运行时接口 → green。
- [ok] official_desc 逐字 — meta.official_desc 取自 frontmatter description 原文「Hyperframes / Remotion 兼容的连续帧动画, 可自动播放」。
6Verdict & Scenarios
f8c23c688123a19b…