Communitygithub.com

film-build

製品プロモーションフィルムをコードで構築するためのスキル。決定論的な seek(t) Web ページとして実装し、静止画・ドラフトで確認後、60fps・モーションブラーでレンダリング、9:16 にも対応します。

film-build とは?

film-build は、製品ローンチやプロモーション用の動画フィルムを、コードベースで完全に決定論的に構築するための AI エージェントスキルです。このスキルは、実製品の UI や OS の実際のウィンドウ、キネティックテキスト、タイピングプロンプト、カーソル、モーフィング、カメラ移動などを含む、高品質な動画を生成します。主な特徴として、任意のフレーム(時刻 t)を再現可能な純粋関数として描画するエンジン、ショットごとの秒数指定、イージング関数、タイピングアニメーション、スプライト表示などのヘルパー関数、そして静止画コンタクトシートやドラフトレンダリングによるレビュー駆動開発サイクルを備えています。対応プラットフォームは、Claude Code などの AI エージェント環境です。`film/core.js` エンジンは、シーン管理、要素配置、カメラ制御を提供し、`scripts/render.mjs` で静止画・ドラフト・最終出力をレンダリングします。16:9 の画面を変更せずに 9:16 の縦長バージョンを生成する機能も組み込まれており、プロジェクトキット (`init.sh`, エンジン, レンダリング/同期/プローブ/シート/リグレッションツール) が同梱されます。このスキルは product-film スキルのステージ 3 と 6 に対応し、起動/プロモーションフィルムの構築、修正、レンダリング、またはその縦長バージョン作成時に使用します。

対応✓Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/aqeelshamz/product-film-skills/tree/HEAD/film-build

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

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

ドキュメント

フィルム構築

開始

sh ~/.claude/skills/film-build/kit/init.sh marketing/videos/<film>   # 空でないフォルダは拒否
cd marketing/videos/<film> && npm i && npx playwright install chromium   # NEXT と表示された場合

キットが提供するもの:

ファイル説明
film/core.jsエンジン: scene({name, from, to, build, run, after}) (時間は拍 = 秒 × 2), put(el, {o, css}), reg(el, base), C.W/C.H/C.FMT, C.start()
film/film.jsスターターファイル。以下のすべてのヘルパーと4つのショット例 (line, prompt, split, persona card) を含む。各ヘルパーのコメントには、それがどのリジェクションから生まれたかが書かれている。ショットを置き換え、ヘルパーは維持すること。
film/mock.jswindow.MOCK: 実際のUI部品 (ダッシュボード、ウィンドウ、電話画面) のHTML (画面ピクセル単位)
film/index.htmlassets/fonts/{display,ui}.woff2 からフォントをロード (ローカルのサンセリフ代替フォールバック付き)
scripts/render.mjs--sheet, --at t1,t2, --draft, --range a,b, --verify, final, --mux, --fmt 9x16, --all
scripts/sync.mjstimeline.json をページにコピー
scripts/review.pyレンダリングされたMP4からの批評キット: コンタクトシート、最速アクションストリップ、電話ビュー、9:16セーフゾーン、メトリクス
tools/probe.mjscuts (すべてのカットと各ショットの中間点、動画秒単位) または任意の式、例: "window.UNWARP(12.4)"
tools/sheet.py静止画をタイル状に並べ、ラベル付きの1枚のシートにする
tools/pack_grid.py4×3のキャラクターシート (透明または白背景) を sprite() 用の12セルストリップにカット;セルサイズを出力
tools/cut_cast.py一列のラインアップを個々の静止画キャラクターにカット
assets/characters/4つのサンプルキャラクター (創業者、開発者、営業、学生)、360pxセルの12フレームストリップ
tools/same.sh変更前後の静止画間のPSNR回帰テスト: save / check

スターターファイルのヘルパー (使用すること、再発明しないこと)

  • io (クインティック インアウト) カメラ移動とモーフィング用; oq (クィントアウト) エントランス用; back 小さなオーバーシュート用。
  • cam(e, s, fx, fy) は、1920×1080平面のフォーカスポイント (fx, fy) を、スケール s でフレーム中央に配置する。camD は平面の端を超えて表示しない (カバースケール; 9:16 で必須)。
  • posIn(e, root) は、移動する平面内での要素の位置を読み取る (カーソルターゲット、キャレット追従用)。
  • typed() は、単語を1文字ずつ行に表示する; keyed() は実際のキーボード風: 文字ごとに不規則なタイミング、スペースでの長い休止、点滅するキャレットを表示。
  • wordsHTML() は、すべての単語を最初のフレームから最終幅で配置し、タイミングが来るまで透明にすることで、行がリフローしないようにする (「テキストトランジションがまったくスムーズでない」問題対策)。
  • cursor()/putCursor()/bump(): 実際の矢印カーソル: 滑らかに移動し、早めに到着し、クリック時に15%沈む。
  • pop() 小アイテムの着地用。
  • sprite(parent, src, cellW, cellH, h) / putSprite(e, t, a, z, loops) 描かれたキャラクター用: a→z の12フレームをステップ、小さな呼吸 (完全静止しない) を加える。<img> 要素のため、エンジンは読み込みを待つ。
  • shot(name, t0, t1, build, run) は scene を秒単位でラップ。
  • ペーシングワープ (下部): SLOW (全体のストレッチ), EV ホールド (読むための瞬間停止) と挿入; window.CUTS と window.UNWARP は音声・ナレーション配置用の動画時間を提供。
  • PT / pk(a16, a9) 1つのファイルでフォーマットごとの値を選択。

エンジンのルール (決定論)

フィルムは t の純粋関数です。どのフレームも、最初にレンダリングしたときも、他のフレームの後でレンダリングしたときも、同じように描画されなければなりません。

  • 2D 変換のみ: translate3d, will-change, CSS トランジション, Math.random は使用不可 (代わりにインデックスのハッシュを使用)。
  • 初期状態で非表示の要素: reg(el, {o: 0}) を使用し、インラインの opacity:0 は禁止。
  • レイアウトの計測は after() または build 内で1回だけ; run 内では行わない (前のフレームを読み取ってしまう)。
  • 3Dビュー: 毎フレーム insertBefore(v, firstChild) で再挿入し、キャッシュされたラスターが残らないようにする。
  • 埋め込みCSSアニメーション (例: プロダクトウィジェットの内部アニメーション): 一時停止し、animation-delay: calc(-1s * var(--t)) を設定。
  • 画像とフォント (decode(), document.fonts.ready) の読み込みを最初のフレームの前に待つ。
  • プロダクトCSSは一意のルートクラスの下にスコープ; フィルム内では一意のクラス名を使用 (.w が一度リークした)。
  • classList.add を使用し、className = は禁止。
  • node scripts/render.mjs --verify は、レンダリングを送信する前に 12/12 と表示しなければなりません。

リアリズム: 画面を構築する前に references/realism.md を読むこと

簡略版: 実際のアプリは実際の密度で、実際のロゴはブランドの公式サイトから、実際のOSに存在するアプリのOSクローム、実際の壁紙、実際のランチャーグリッド上の実際のdpサイズの電話 (製品自身のレンダラーで描画)、予想以上にリッチな製品UI、ブランドマーク表示時の帰属表示行。

構築ループ (レビュー駆動)

  1. 承認されたストーリーボードからのショットリスト を film.js に、各 shot() として、引き継ぎ用に重なりを持たせて記述。
  2. まず静止画。 node tools/probe.mjs cuts → 各ショットの中間点と各引き継ぎ時点の静止画をレンダリング: node scripts/render.mjs --at … の後で python3 tools/sheet.py review/stills/16x9 review/sheet.jpg <times>。自分でシートを確認。修正。繰り返し。(完全レンダリングの25分以上に対して、約1~2分/ラウンド)
  3. レビュー提出前のQAパス: フィルムを≤ 1.5秒ステップおよびすべての引き継ぎ時点で再生 (各トランジション上の10~15fpsコンタクトシート)。references/qa.md を項目ごとにチェック: 重なり、クリッピング、空白フレーム、読み取り時間、テキストのスムーズさ、タイピング、ロゴ表示、OSリアリズム、電話サイズ。
  4. 静止画を送付 (シート) をオーナーに初回確認用。待つ。
  5. ドラフト: node scripts/render.mjs --draft (30fps, 約4分), python3 scripts/review.py 1 --draft、ストリップを確認。ドラフトMP4を送付。30fpsのブラーなしドラフトであることを明確に伝える (最終版より粗く見える)。
  6. 「最終レンダリング」: バックグラウンドで node scripts/render.mjs (60fps, モーションブラー; 60秒で約25~35分)。レンダリング中は film.js を編集しないこと: 作業を続ける必要がある場合は、まずプロジェクトをコピーすること。
  7. 承認ラウンドごとに フィルムコードとタイムラインをコミット。

ペース

初回カットはほぼ常に速すぎる。画面上のテキストは、単語あたり約0.3秒 + 完全な不透明度で1秒 (最低1.5秒) 必要。すべてのショットのタイミングを変更するよりも、ワープ (SLOW 1.1~1.25, 行に対する EV ホールド) を優先。ペース変更後は、音声とナレーションの位置が変わるため、probe.mjs cuts を再実行すること。

9:16: references/formats.md を読むこと

同じフィルムを1つのファイルで pk() を使ってリフレーム; tools/same.sh で16:9が変更されていないことを証明 (すべての静止画PSNR = inf); --verify --fmt 9x16; オーナー用の静止画シート; その後、バックグラウンドで --fmt 9x16 最終版、次に --mux --fmt 9x16。

Individual skills in this repo

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

film-sound

Add sound to a finished product-film picture with real recorded sound effects (CC0 packs such as Kenney's) placed only on real on-screen events, decide with the owner whether there's a music bed, mix to -14 LUFS and mux into the renders without re-rendering. Stage 4 of product-film. Use when a film's picture is approved and needs sound effects or music, or when the owner says the sounds feel fake, synthetic or "AI slop".

film-storyboard

Write the story of a product film as beats (what the viewer sees, the words on screen, the voice, the sound, why the beat exists, and where each claim is proven) and send it to the owner as a one-page storyboard with frames for review, with 2–4 directions when the story is open. Stage 2 of product-film, and the review format reused for the voiceover. Use when planning a launch/promo film's story, shot list, or script, or when the owner says "give me a storyboard", "give me directions", "I'll review and decide".

film-voiceover

Write, review, test and record the voiceover for a product film after its picture is approved, as a script on a storyboard of the film's real frames, with directions to choose from, an eyes-closed coherence check, a pronunciation test for the product name, TTS recording per section (Fish Audio), phrase placement on the film's timeline, mixing and muxing. Stage 5 of product-film. Use when a launch/promo film needs narration, or the owner says the voiceover sounds like AI, doesn't match the frames, or mispronounces the name.

product-film

Make a product launch / promo / explainer film that sells and does not look or sound AI-made, through review gates the owner signs off one at a time. Study a reference video for its grammar (never copy it), then storyboard, build the film in code, add sound, write and record the voiceover, and deliver 16:9 and 9:16. Use when someone wants a launch video, promo, product film, explainer, ad, "a video like this one" for their product, or says the last video looked like "AI slop" or "vibe coded". Entry point for the film-* skills (film-reference-study, film-storyboard, film-build, film-sound, film-voiceover).

関連スキル