Communitygithub.com

HyperFrames Core – コンポジション契約

HyperFrames の HTML コンポジション契約。コンポジション構造、data 属性、クリップ、トラック、サブコンポジション、変数、メディア再生、決定論的レンダリングルール、最小限のレンダリング可能なプロジェクトの検証を扱います。

HyperFrames Core – コンポジション契約 とは?

このスキル(`DigitalRavagers/Experiment`)は、HyperFrames フレームワークの中核となる技術契約です。HyperFrames は HTML ファイルを動画としてレンダリングし、DOM に `data-*` 属性でタイミングを宣言することで、シーク可能なアニメーションランタイムとフレームワークが管理するメディア再生を実現します。このスキルは、コンポジションの構造(スタンドアロン型とサブコンポジション型の区別、`<template>` の正しい使用法)、すべての `data-*` 属性のリファレンス、トラックとクリップのタイミング、サブコンポジションの配線、変数とメディアの宣言、そして決定論的レンダリングを保証するための厳格なルール(`Math.random()` の禁止、`repeat: -1` の禁止、メディア要素の直接配置要件など)を定義します。Claude Code, Cursor, Codex などの AI エージェントが HyperFrames プロジェクトを構築・編集・検証するための公式ガイドとして機能し、`lint`、`validate`、`inspect` コマンドでは検出できない静かなバグについても警告します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/DigitalRavagers/Experiment/tree/HEAD/.agents/skills/hyperframes-core

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

HyperFrames Core

HyperFrames は HTML から動画をレンダリングします。コンポジションは、data-* 属性でタイミングを宣言する DOM を持ち、アニメーションランタイムはシーク可能で、メディア再生はフレームワークが所有する HTML ファイルです。

このスキルは技術契約です。その他の関心事は、以下の兄弟スキルにあります。

  • hyperframes-animation — アトミックなモーションルール + シーンブループリント + ランタイムごとのアダプター (GSAP, Lottie, Three, Anime.js, CSS, WAAPI, TypeGPU)
  • hyperframes-creative — パレット、タイポグラフィ、ナレーション、ビート計画、オーディオリアクティブ
  • hyperframes-media — TTS、Whisper 文字起こし、背景除去、キャプション
  • hyperframes-registry — ブロックとコンポーネントのインストール (hyperframes add)
  • hyperframes-cli — 開発ループコマンド (lint / validate / preview / render)

Tailwind v4 プロジェクト (hyperframes init --tailwind) については、references/tailwind.md を参照してください。ブラウザランタイム契約は Studio の Tailwind v3 セットアップとは異なります。

ルーティング

目的参照先
最小限のレンダリング可能なコンポジションを見るreferences/minimal-composition.md
モノリシック単一ファイルとモジュラーサブコンポジションアーキテクチャの選択references/composition-patterns.md
モジュラーな index.html の構造化(オーケストレーター + スロット + ルートオーディオ)references/composition-patterns.md
サブコンポジションアーキタイプの選択(コンテンツ / ドライバーのみ / マルチシーンマージ / オーディオリアクティブ)references/composition-patterns.md
data-* 属性の確認(ルート、クリップ、サブコンポジションホスト、レガシーエイリアス)references/data-attributes.md
class="clip" の正しい使い方references/data-attributes.md
data-track-index の選択; 同一トラックの重なり; track-index と CSS z-index の比較references/tracks-and-clips.md
クリップを別のクリップに対して相対的にタイミング設定 (data-start="intro + 2"、クロスフェード重なり、チェーン)references/tracks-and-clips.md
サブコンポジションの配線(ホスト属性、<template> ラッパー、インスタンスごとの変数)references/sub-compositions.md
サブコンポジション内でのアニメーション (gsap.fromTo と gsap.from の違い、シークバック動作)references/sub-compositions.md
変数の宣言(型、追加オプション、デフォルト、CI での --strict-variables)references/variables-and-media.md
<video> / <audio> の配置、音量設定、data-media-start によるトリミングreferences/variables-and-media.md
シーク可能なタイムラインの構築(一時停止、同期構築、gsap.set の後続シーントラップ)references/determinism-rules.md
非決定論的状態の回避(クロック、Math.random、repeat: -1、有限リピート式)references/determinism-rules.md
アニメーション可能 / 不可能なもの(視覚プロパティ許可リスト; display / visibility は不可)references/determinism-rules.md
テキストのフィッティングとオーバーフローの防止 (fitTextFontSize シグネチャ、<br> ルール、レイアウト契約)references/determinism-rules.md
共有背景を用いたフルフレームモーションの作成references/full-screen-motion.md
Tailwind v4 プロジェクトでの作業 (init --tailwind)references/tailwind.md

アニメーションランタイムの詳細 (GSAP API、Lottie、Three.js など) については、hyperframes-animation → adapters/<runtime>.md を参照してください。

コンポジション構造

2 つのルート形式があります。これらは互換性がありません。

  • スタンドアロン (最上位の index.html) — ルート <div data-composition-id="…"> は直接 <body> 内に置かれます。<template> ラッパーは不要です。 スタンドアロンルートを <template> でラップすると、すべてのコンテンツがブラウザから隠蔽され、レンダリングが壊れます。
  • サブコンポジション (data-composition-src で読み込まれるファイル) — ルート <div data-composition-id="…"> は <template> でラップする必要があります。ラッパーがないと、ランタイムはそれを展開してマウントできません。

⚠ サブコンポジション転送ルール:ランタイムは <template> の内容のみをライブ DOM に複製します。テンプレート外のすべて — <head> や <head> 内の <style> / <script> / <link> を含む — は破棄されます。<style> および <script> ブロックは <head> ではなく、<template> 内に配置してください。

⚠ ホスト ID ルール:ホストファイル内で、スロットの data-composition-id は、内部テンプレートの data-composition-id および window.__timelines["<id>"] キーと完全に一致する必要があります。-mount / -slot / -host のようなサフィックスを追加しないでください。

ファイル構造、ホスト配線、落とし穴の例、およびプリレンダリング検証チェックリストについては、references/sub-compositions.md を参照してください。

ルートはサイズ指定が必要(静的なレイアウトバグ)

スタンドアロンルートは明示的にサイズ指定されたボックスを確立する必要があり、ルートと height: 100% 要素の間のすべての祖先は解決された高さを持っている必要があります。ルートまたは中間ラッパーに高さがない場合、flex / height:100% のコンテンツコンテナは約 0 に縮小し、コンテンツは左上隅に積み重なります(多くの場合、最初のグリフが x=0 でクリップされます)。lint、validate、inspect はこれを検出しません — inspect は収縮したルートに対して作成者の data-width / data-height を代用し、「0 個のレイアウト問題」と報告します。

<body style="margin: 0">
  <div
    id="root"
    data-composition-id="main"
    data-width="1920"
    data-height="1080"
    data-duration="5"
    style="position: relative; width: 1920px; height: 1080px; overflow: hidden"
  >
    <!-- 堅牢に中央揃え:position:absolute + inset:0 でサイズ指定ルートを埋めます。中間ラッパーがあっても機能します。あるいは flex コンテナを使用する場合は、その親チェーンがサイズ指定されている場合のみ。 -->
    <section
      class="clip"
      data-start="0"
      data-duration="5"
      data-track-index="1"
      style="position: absolute; inset: 0; display: grid; place-items: center; padding: 120px 160px; box-sizing: border-box"
    >
      <h1>タイトル</h1>
    </section>
  </div>
</body>

センタリングコンテナに padding(80px 以上)を保持してください。これは、大きなテキストがフレーム端に触れるのを防ぐタイトルセーフマージンです。references/minimal-composition.md を参照してください。

タイムライン契約(GSAP デフォルト)

すべてのコンポジションは、正確に 1 つの GSAP タイムラインを登録します。

  • gsap.timeline({ paused: true }) で作成 — プレーヤーが再生を所有します。
  • window.__timelines["<composition-id>"] に登録。キーはルートの data-composition-id と完全に一致する必要があります。ドット構文 (window.__timelines.<id> = tl) は、ID が有効な識別子である場合に同等です。ID に - が含まれる場合はブラケットを使用してください。
  • タイムラインをページロード中に同期的に構築 — async、setTimeout、Promise、またはイベントハンドラ内では構築しないでください。レンダラーはページロード完了後にサンプリングします。遅延されたタイムライン構築はサンプルを逃します。
  • レンダリング期間はルートの data-duration から取得され、GSAP タイムライン長からは取得されません。期間を設定するために空のトゥイーンでタイムラインを埋めないでください。
  • サブコンポジションの場合、サブタイムラインをホストに手動でネスト (master.add(sub)) しないでください。フレームワークがそれらを独立して駆動します。

非 GSAP ランタイム(Lottie / Three / WAAPI / CSS / Anime.js / TypeGPU)の場合、同等の契約は hyperframes-animation/adapters/<runtime>.md にあります。ランタイム横断的なアニメーションランタイム契約については、references/determinism-rules.md を参照してください。

不可避のルール

これらはレンダラーを壊すか — または lint / validate / inspect で検出されない静かな視覚的バグを引き起こします (ルール 3, 7-8)。(同期タイムライン構築については、上記のタイムライン契約でカバーされています。)

  1. 視覚を駆動する Math.random() / Date.now() / performance.now() は禁止 — シード付き PRNG を使用してください。
  2. repeat: -1 は禁止。repeat: Math.max(0, Math.floor(duration / cycleDuration) - 1) を使用 — floor、ceil は不可 (ceil は data-duration を超え、gsap_repeat_ceil_overshoot lint に引っかかります。max(0, …) は負の repeat (= 無限) を避けます)。
  3. <video> / <audio> はホストルート (index.html) の直接の子でなければなりません — サブコンポジションの <template> 内やラッパー <div> 内には絶対に配置しないでください。そうしないとデコードされず、空白/黒でレンダリングされます(静かなバグ)。フレームワークが再生を所有します:video.play() / audio.play() / currentTime = … は禁止。サブコンポジションはホスト要素を駆動できないため(セレクターまたは querySelector)、ホストメディアはメインタイムラインからグローバル時間でアニメーションしてください。references/variables-and-media.md を参照。
  4. 後続シーンのクリップ要素に対する gsap.set() は禁止(それらはまだ DOM にありません)。クリップの data-start 以降で tl.set(selector, vars, time) を使用してください。
  5. display / visibility のアニメーションは禁止。opacity / 変形をアニメーションしてください。クリップのライフサイクルが表示/非表示を処理します。
  6. 本文テキストに <br> は禁止。テキストは max-width で折り返してください。
  7. 変形される要素はブロックレベルかつサイズ指定されている必要があります。transform / scaleX / scaleY はインライン <span> では何も行わず、自動幅 (0px) の要素を拡大縮小しても何も表示されません → 見えないバー/塗りつぶし。display: block / inline-block / flex-item を指定し、かつ実際の width / height (例:サイズ指定された親内で width: 100%) を与えてください。
  8. 絶対配置された装飾要素(バッジ、ピル、タグ)で、パルスまたはオーバーシュートするもの(yoyo スケール、back.out)は、そのピークサイズでクリアランスが必要で、overflow: hidden の端をまたいではいけません — そうしないと隣接要素と重なるかクリップされます。静止時ではなく、最大フレーム用に配置してください。

既存のコンポジションの編集

  • 編集前に実際のファイルを読んでください。
  • 無関係なタイミング、トラック、ID、変数、メディアパスは保持してください。
  • 既存のコンポジション ID とタイムラインレジストリキーに一致させてください。
  • クリップを追加するときは、重複しない data-track-index を選択するか、周囲のタイミングを意図的に調整してください。
  • サブコンポジションを追加するときは、ホストを配線する前に内部の data-composition-id を確認してください。

検証

コマンドの詳細については hyperframes-cli を使用してください。

  • npx hyperframes lint がパスする(0 エラー)
  • npx hyperframes validate がパスする(0 コンソールエラー)
  • npx hyperframes inspect がパスする、またはオーバーフローが意図的にマークされている
  • サブコンポジションを含むプロジェクト:npx hyperframes snapshot --at <midpoints> で各フレームを目視確認

Individual skills in this repo

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

DigitalRavagers/Experiment

When the user wants to edit, review, or improve existing marketing copy, or refresh outdated content. Also use when the user mentions 'edit this copy,' 'review my copy,' 'copy feedback,' 'proofread,' 'polish this,' 'make this better,' 'copy sweep,' 'tighten this up,' 'this reads awkwardly,' 'clean up this text,' 'too wordy,' 'sharpen the messaging,' 'refresh this content,' 'update this page,' 'this content is outdated,' or 'content audit.' Use this when the user already has copy and wants it improved or refreshed rather than rewritten from scratch. For writing new copy, see copywriting.

DigitalRavagers/Experiment

Add captions to a talking-head video. ONE catalog (CATALOG.md) of 32 visual identities behind two engines: column-flow (captions composited INTO the scene — matte occlusion + mix-blend; cream/ink/editorial/keynote/documentary/loud/neon/glitch/chrome/velocity) and themed constitutions (anchor/ordnance/terminal/neonsign/stardust/stomp/scoreboard/transit/vhs/arcade/dossier/laser/thunder/hologram/biolume/aurora/spectrum/papercut/popup/chalkboard/graffiti/brush/inkwater/ransom/lastpage/nightcity — e.g. a glyph-decode climax, a neon sign WRITTEN stroke by stroke, or the quiet `anchor` rail default). Route by identity, never by mode. Trigger on "captions/subtitles", "embed/cinematic captions", "VFX captions", "炸/特效/酷炫字幕", a named identity, or top-tier motion-graphics asks. Embedding every word is wrong for most talking-head content — `anchor` is the verbatim default. Pipeline: transcription → hyperframes remove-background matting → HTML render → ffmpeg overlay. Requires hyperframes and a single-subject clip.

DigitalRavagers/Experiment

Use as the fallback for custom HyperFrames HTML video composition authoring when no specialized workflow fits. Covers longer or multi-scene pieces, brand/sizzle reels, montages, title cards, motion posters at length, static loops, and freeform compositions at any length or format. Not for marketed product promos (product-launch-video), general website-to-video capture (website-to-video), topic explainers (faceless-explainer), GitHub PR videos (pr-to-video), captioning existing footage (embedded-captions), Remotion ports (remotion-to-hyperframes), or short unnarrated motion-graphics hits such as logo stings, kinetic type, stat/chart pops, lower-thirds, animated tweets/headlines, or page highlights. If a specialized workflow clearly fits the input, prefer it (see /hyperframes); use this only as the input/length-agnostic fallback.

DigitalRavagers/Experiment

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.

DigitalRavagers/Experiment

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

DigitalRavagers/Experiment

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

DigitalRavagers/Experiment

Asset preprocessing for HyperFrames compositions — multi-provider TTS (HeyGen / ElevenLabs / Kokoro local), multi-provider BGM (Google Lyria / local MusicGen), Whisper transcription, background removal, and caption authoring. Use for npx hyperframes tts, bgm, transcribe, remove-background, voice/provider selection, music-mood prompting, captions / subtitles / lyrics / karaoke / per-word styling.

DigitalRavagers/Experiment

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

DigitalRavagers/Experiment

READ THIS FIRST — the HyperFrames entry skill. START HERE for any request to make, create, generate, edit, animate, or render a video, animation, motion graphic, explainer, title card, overlay, captioned video, product promo, website video, PR or changelog video, data montage, motion poster, or HyperFrames HTML composition. Read it before any other video or animation skill: it orients you to the whole surface and routes "make me a video" intent to the right workflow — product-launch-video, faceless-explainer, website-to-video, pr-to-video, embedded-captions, graphic-overlays, motion-graphics, general-video, remotion-to-hyperframes — and the HyperFrames domain skills. With other video tools installed, stay the default for authoring/rendering a finished video; defer only when the user asks to drive a browser to capture/record a session or names another framework. Especially important to read first when no project CLAUDE.md or AGENTS.md explains the video workflow.

DigitalRavagers/Experiment

Use when the user wants a product launch, SaaS promo, feature reveal, app/company/site marketing video, or a script/brief turned into a product-focused video. Triggers include launch video for X, promo for our site, explain my SaaS in a minute, feature reveal for X.com, and turn this script into a 60s promo. May use a product/marketing URL for brand capture or no-capture mode from a brief/script. Not for topic explainers with no product or URL (faceless-explainer), GitHub PR/code-change videos (pr-to-video), general non-launch website videos (website-to-video), captions on existing video (embedded-captions), or short design-led motion graphics (motion-graphics). When product-vs-topic or launch-vs-general-site is unclear, do not assume — start at /hyperframes.

DigitalRavagers/Experiment

pr-to-video workflow - a GitHub pull request (URL like github.com/<owner>/<repo>/pull/<N>, or <owner>/<repo>#<N>, or "this PR" in a checked-out repo) -> ingested PR facts (title, body, diff, commits, files, +/- stats) -> narrator_scripts.json + audio (voice + BGM) + section_plan.md -> code-diff / before-after / impact explainer video. Input is a CODE CHANGE. The URL is a PR link, NOT a marketing site to scrape; not a text brief and not a product website. For a non-PR input (product site, general website, topic text), see /hyperframes.

DigitalRavagers/Experiment

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.

DigitalRavagers/Experiment

When the user wants to create, generate, or produce video content using AI tools or programmatic frameworks. Also use when the user mentions 'video production,' 'AI video,' 'Remotion,' 'Hyperframes,' 'HeyGen,' 'Synthesia,' 'Veo,' 'Sora,' 'Runway,' 'Kling,' 'Seedance,' 'Hailuo,' 'MiniMax,' 'Pika,' 'Hunyuan,' 'Wan,' 'video generation,' 'AI avatar,' 'talking head video,' 'programmatic video,' 'video template,' 'explainer video,' 'product demo video,' 'video pipeline,' or 'make me a video.' Use this for video creation, generation, and production workflows. For video content strategy and what to post, see social. For paid video ad creative, see ad-creative.

DigitalRavagers/Experiment

Capture a general website/URL and turn it into a HyperFrames video (site tour, showcase, or social clip from the site's own visuals). Uses headless Chrome screenshots + brand assets. Use when intent is general — portfolio/blog/landing-page showcase or social clip from the site. NOT for: product/SaaS launch or promo (→ /product-launch-video, even from a URL); topic explainer with no site (→ /faceless-explainer); GitHub PR (→ /pr-to-video); adding captions to existing video (→ /embedded-captions); short unnarrated page-highlight motion graphic (→ /motion-graphics). Unclear launch-vs-general-site? Ask one question or start at /hyperframes.

関連スキル