Communitygithub.com

1345AbhishekKumar/starter-supabase

為說話人物影片添加字幕。一個包含 32 種視覺風格的目錄 (CATALOG.md),由兩種引擎驅動:列流(字幕合成至場景中——遮罩混合 + 混合模式)與主題構成。根據風格而非模式路由。

starter-supabase 是什麼?

這個技能為開發人員和 AI 代理提供了一個強大的框架,可為說話人物影片產生專業級的字幕,並具有 32 種不同的視覺風格。它包含一個全面的目錄 (CATALOG.md),其中包含經典的列流引擎(如奶油色、墨水色、新聞編輯、霓虹燈)和沉浸式主題構成(如 ordnance, neonsign, stardust),允許通過單個身份選擇進行精確的風格路由。字幕模型區分三種字幕類型:丟棄(填充詞)、軌道(預設的逐字下方三分之一)和嵌入(精選的、合成在主體後方的強調詞),確保可讀性並防止常見的過度嵌入錯誤。管道包括使用 hyperframes 進行背景去除、通過 Whisper 進行轉錄、用於創意決策的 JSON 編寫以及 ffmpeg 合成,所有這些都通過自動化腳本和閘門(用於時機、遮罩和溢位檢查)進行協調。該技能支援 Cursor 和 Claude Code 等平台,提供詳細的編譯、預覽和渲染工作流程,以確保將字幕完美地整合到場景中,同時保持主體影片不受觸動。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/1345AbhishekKumar/starter-supabase/tree/HEAD/.agents/skills/embedded-captions

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

嵌入字幕

一個目錄,預先選定 (CATALOG.md — 17 種身份;其背後的三種引擎是後端細節)。 標準 (預設) 建立一個乾淨的逐字 軌道 (承載大部分文字的底部三分之一字幕) + 一個在場景中合成於主體後方的 嵌入 高潮。電影式 是純嵌入 — 沒有軌道,每個字幕都合成在主體後方 (英雄字體、累積、遮罩作為效果)。主題 是一個完整的主題構成 — 主體範例 × 英雄場景 × 前景效果 × 底板反應,由註冊表 (themes/README.md) 組成:ordnance terminal neonsign stardust stomp。大多數解說 / 畫外音都是 標準;嵌入是稀有、通過努力獲得的高潮 — 嵌入每個單詞是常見的錯誤;主題適用於 VFX 級別的要求 ("炸", "特效", "像 AE 做的")。


操作流程 (TL;DR)

下方的手藝散文很長;然而管道本身很短 — 且所有確定性內容都是計算或編譯的,從不手寫:

  1. 決策閘門 (拒絕不良片段) → 從 CATALOG.md 中 選擇一個身份 (17 種身份;引擎/編譯器通過查表推導 — 永遠不詢問模式/分類問題)
  2. hyperframes init (如果專案目錄已存在,且影片已在其中,則跳過此步 — matte.cjs/transcribe.cjs 會將目錄中的任何影片作為 source.mp4) → bash scripts/prepare.sh <project> (平行執行 matte ∥ transcribe ∥ audio-envelope,然後使用場景調色板/光學/照明執行 safe-zones v2 — 一個命令,無遺漏)
  3. 編寫一個小的 JSON 創造性選擇 (先閱讀 safe-zones.json): 電影式 → plan.json → fill-timings.cjs → fit-fonts.cjs → make-composition.cjs; 主題 → theme.json → make-theme.cjs (軌道/面板/詩/接管範例;anchor 是安靜的軌道預設值)
  4. 視覺 QA:node scripts/preview-frames.cjs <project> → 約 2 秒/幀的逼真合成預覽 (無需渲染)。在支付渲染費用之前,請參閱 § 視覺 QA。
  5. render-and-composite.sh → 閘門 (時機 / 遮罩+英雄 / 溢位 / 交接) → final.mp4

人們容易錯過的關鍵規則:

  • 軌道 (預設) + 嵌入 (提升)。 drop (填充詞,不顯示) / rail (逐字底部三分之一字幕,在前方,承載大部分文字) / embed (一個合成在主體後方的高潮詞)。標準模式同時執行兩者,僅嵌入高潮 (們)。請參閱 § 字幕模型。
  • 影片以未經修改的方式交付 (標準/電影式;主題模式的底板預算是唯一被批准的例外 — 按主題 DNA 定義的、由註冊表控制的反應節拍 (電荷變暗、衝擊、震動、顆粒),並且在遮罩合成後應用,以便主體+文字+底板作為一個幀移動) — 僅添加字幕;遮罩只是讓主體遮擋嵌入軌道。切勿對素材進行調色/重新著色/掃描線。
  • 兩本規則手冊:軌道 → references/rail.md (薄),嵌入工藝 → references/composition-craft.md (豐富,僅嵌入)。按需瀏覽。

字幕模型 — 軌道 + 嵌入

每個口語短語都是以下三種情況之一:

什麼如何顯示
drop填充詞 — 嗯/呃,口吃,自我糾正不顯示
rail預設 — 普通口語內容 (逐字)乾淨的底部三分之一字幕,在前方,可讀。一個關鍵詞可以在行內獲得 emphasis 高亮 (強調色 / 活動詞彈出) — 它仍停留在軌道上。
embed被提升的高潮 — 頭條節拍一個合成 在主體後方 的大詞 (遮罩遮擋),設計好的進入 + 退出

軌道承載大部分文字;嵌入是稀有、通過努力獲得的高潮。 稀缺性是 每個節拍/區塊,而非每個片段:每個區塊 (想法) ≤1 個英雄詞,永遠不會有兩個同時可見,英雄窗口之間需要 ≥ 一個節拍的間隔 (編譯器會對低於 0.6 秒的情況發出警告)。一個短片段 → 通常 1–2 個;一個長的解說 → 大約每個部分一個。在多個英雄詞中,最大的那個是頂點 (它獨自獲得完整的鎖定嵌入 + 寬度適應提升);較小的則是 次要高峰,它們作為前景中放大的強調行 (前景,阻尼運動) 騎乘其列 — 並不是每個節拍都需要遮罩展示,這正是使頂點成為一個事件的原因。嵌入每個單詞仍然是常見的錯誤。

軌道表面身份正是構建這樣的效果 (軌道 = rail.html,嵌入 = index.html 中的高潮)。列流身份會放棄軌道,使所有內容都變成嵌入風格 — 僅在需要氛圍勝過逐字的情況下推薦使用,絕不用於文字必須可讀的解說 / 畫外音 (CATALOG.md 按身份編碼了這一點)。


步驟 0 — 從 CATALOG 中選擇一個身份

一個前端,三個引擎在背後。 使用者從 CATALOG.md 中選擇一個 身份 (17 個條目:12 個經典 + 5 個主題);引擎、編譯器和編寫文件通過從目錄行查表獲得。永遠不要將 "標準 vs 電影式 vs 主題" 作為問題提出 — 這些是後端名稱 (一個產品即使有幾個引擎也應有一個用戶體驗)。目錄編碼了路由所需的所有內容:閱讀表面、風格、推薦場景、場景需求、以及真正相似對 (loud↔ordnance, neon↔neonsign, cream↔stardust) 的相鄰註記。

過程:探查片段 → 從目錄中篩選 2–3 個身份 → 使用一行原因推薦 一個 → 使用者選擇 → 編寫該身份的文件。身份與引擎鎖定 (無交叉組合;打開一個身份是一個驗證事件 — 參見 dna/README.md)。

在編寫之前,始終先提出您的推薦並讓使用者選擇。 不要默默地使用預設值。

(完整的身份表位於 CATALOG.md — 路由的單一事實來源。下面的引擎文檔描述了每個後端的編寫合約。)

推薦啟發式:使用 CATALOG.md 中的 "篩選啟發式" — 它們是身份級別的 (例如 "炸" 篩選出 ordnance/stomp/terminal/loud 並根據應該爆炸的內容來選擇),永遠不是類別級別的。不確定 → anchor。

  • 電影式 → 為鎖定的模板編寫 plan.json,由 make-composition.cjs 編譯。
  • 主題 → 閱讀 themes/README.md,編寫 theme.json,執行 scripts/render-theme.sh (編譯 + 渲染 + 底板反應 → final_fx.mp4)。

決策閘門 — 首先執行

在兩種模式之前,探查影片並對場景進行分類。

ffprobe <video.mp4>                    # 規格
ffmpeg -ss <t> -i <video.mp4> -vframes 1 sample.png   # 在 20/50/80% 處

閱讀樣本。在以下情況下拒絕:

  • 多個說話者 / 硬切 (拆分並渲染每個鏡頭,或拒絕)
  • 沒有人類主體 (此技能適用於說話人物影片)
  • 少於 3 秒,沒有語音,或臉部從未清晰可見 — transcribe.cjs 會在音頻接近靜音時發出警告 (Whisper 可能會在靜音上幻覺出像 "Thank you." 這樣的單詞);注意它並拒絕,而不是為虛構的單詞添加字幕
  • 來源素材已經有燒錄的字幕 / 副標題 / 厚重的文字圖形 — 添加第二個字幕系統會造成衝突,並且素材以未經修改的方式交付 (不進行覆蓋/修復)。燒錄的文字通常只在片段中間出現:取樣一個 1fps 的聯繫表 (ffmpeg -i in.mp4 -vf "fps=1,scale=160:-1,tile=10x5" sheet.png),不要相信 3 個隨機的畫面。
  • 轉錄稿是垃圾 — 非母語/帶有濃重口音的語音可能被自信地轉錄成胡言亂語。在編寫之前理智檢查 transcript.json;如果它無法解析為語言,嘗試一次 WHISPER_MODEL=medium,否則拒絕 (一個逐字但虛構的軌道比沒有字幕更糟)。
  • 手持攝影忙碌且快速移動 (遮罩會閃爍)

預檢探測 (不花費成本,防止最糟糕的失敗)

  1. 鏡頭切換探測。 在 20%、50%、80% 處取樣畫面。如果出現不同的主體/場景,修剪片段到切斷點之前。
  2. 信箱 / 柱箱探測。 第一個畫面上有黑條嗎?計算安全的內容矩形並將字幕放置約束在其內。
  3. 亮度探測。 對字幕區域的平均亮度進行取樣 — 低於 60 → 淺色文字可直接閱讀,60-180 → 添加字形襯底,180+ → 不透明文字 + 襯底 (永遠不要使用裸露的淺色文字)。電影式模板是奶油色+screen 並且已鎖定 — 使用此探測來 選擇一個合適的身份 (明亮的場景 → ink,或具有不透明軌道的 anchor 主題),永遠不要重新著色一個身份。
  4. 按語氣推薦身份 (您推薦;使用者選擇 — 參見步驟 0 + CATALOG.md)。 解說 / 訪談 / 必須閱讀的文字 → 軌道/面板表面身份;詩意 / 社交 / "電影感" → 按風格使用列流身份;"炸 / 特效 / VFX" / 命名的世界 → 主題身份。當不確定時 → anchor (文字可讀,場景安全) — 但提出一個短名單並讓使用者選擇。

管道 — 5 個步驟

1. hyperframes init <project> --non-interactive --video <video.mp4>
2. bash scripts/prepare.sh <project>       # 平行執行 matte ∥ transcribe → safe-zones。一個命令。
                                           #   → frames_fg/ transcript.json safe-zones.json
3. [代理步驟 — 唯一的創造性步驟] 編寫一個小的 JSON;參見下方按模式分類
   電影式:編寫 plan.json → node scripts/fill-timings.cjs → fit-fonts.cjs → make-composition.cjs
   主題:   編寫 theme.json → bash scripts/render-theme.sh <project>   (編譯 + 渲染 + 底板效果)
4. node scripts/preview-frames.cjs <project>   # 約 2 秒/幀合成預覽 → § 視覺 QA (在渲染之前)
5. bash scripts/render-and-composite.sh <project>  # 閘門 → final.mp4 + history/ 快照
   (主題模式:跳過步驟 3b/5 — render-theme.sh 已經執行編譯 + render-and-composite
    + _postfx.sh;交付物是 final_fx.mp4,final.mp4 是底板反應前的版本)

步驟 1 的 init 會根據 GitHub 上的最新版本檢查已安裝的技能,並在有任何技能過期時更新全局集合。

步驟 3 因模式而異:

步驟 3 — 電影式模式 (純嵌入)

  1. 首先閱讀 safe-zones.json。 敘述平面位於 zones.hugLeft/hugRight — 與剪影接壤的乾淨條帶 (遠離身體的文字看起來像是漂浮的,而不是嵌入的;遠角是備用方案,而不是預設值)。英雄文字預設為 heroAnchor/heroBands.best (居中在主體上,約 30–55% 被遮擋)。recommendation:"fg" 為了可讀性將 敘述 移到前方;只要 heroBands.feasible,英雄文字就會保持嵌入 — 英雄文字前景是最後的手段。
  2. DNA 是您在步驟 0 中選擇的身份 (CATALOG.md) — 不要在此處重新打開選擇。根據場景對其進行理智檢查 (明亮的英雄帶亮度 > 150 想要 ink;完整的選擇指南在目錄中,涵蓋所有十種包括 neon / glitch / chrome / velocity)。陳述您的選擇 + 原因;使用者決定。DNA 鎖定字體/調色板/混合/運動 + 英雄三幕;safe-zones v2 (palette/optics/lighting) 為 此 場景自動參數化它。
  3. 編寫 <project>/cinematic.json — "dna": "<name>" + 思想的 BLOCKS,不是原始分組:每個 block = 單詞行 (在從句邊界處分組 2–5 個) + 它堆疊的平面 + 每行 css (僅尺寸/粗細/樣式 — 無位置) + 最多 一行 標記為 "hero": true (被提升的單詞;使用 "text" 作為顯示形式)。模式:scripts/make-cinematic.cjs 頭部。
  4. 編譯:node scripts/make-cinematic.cjs <project> — 將 blocks 降低為 plan.json → index.html。為您生成:按轉錄順序的時序、區塊內累積、區塊間翻頁、英雄鎖定 (英雄區塊的前文、英雄和後文堆疊成一個以主體為中心的粘合組合 — 閱讀順序從上到下 = 口頭順序;前文在前景中浮動,而英雄嵌入在後方 = 深度夾層;一個質量規則確保英雄主導其前文/後文)、頂點/次要英雄分割、按建構的閱讀順序、按安全區的前景備用方案。然後像往常一樣執行閘門。 (直接手寫 plan.json 仍然可能,適用於 blocks 無法表達的設計 — 然後自己執行 fill-timings.cjs + fit-fonts.cjs + make-composition.cjs。)

步驟 3 — 主題模式 (主題構成)

首先閱讀 themes/README.md — 範例/場景註冊表、連結、硬性規則以及精確的 theme.json 模式。

  1. 根據內容風格選擇一個主題 DNA (每個 themes/<name>.json 都有 voice + when)。陳述您的選擇 + 原因;使用者決定。
  2. 編寫 <project>/theme.json — dna, lines (逐字,按轉錄順序;每個 1–5 個單詞 — 對於 takeover,每行是一張 CARD), minors (強調詞), hero:{match} (高潮詞/短語;將其從 lines 中取出以獲得嵌入場景,為內聯場景和面板+刪節則保留在內)。
  3. 渲染:bash scripts/render-theme.sh <project> — 編譯 (在編譯時進行逐字完整性檢查)、渲染兩層、合成、應用底板反應 → final_fx.mp4。在編譯和渲染之間使用 preview-frames.cjs 進行視覺 QA。

視覺 QA — 在渲染之前預覽

node scripts/preview-frames.cjs <project> [t…] 在約 2 秒內合成 逼真的預覽畫面 (在搜索時間截取字幕層截圖 + 真實影片幀 + 遮罩遮擋 + 軌道疊加 = 最終合成在那一刻的樣子)。預設樣本 = 每個組/高潮窗口。完整的渲染需要數分鐘 — 永遠不要用它來 發現 佈局問題。

檢查預覽 (<project>/preview/sheet.png) 是否符合……” (原文截斷)

Individual skills in this repo

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

1345AbhishekKumar/starter-supabase

The fallback workflow for authoring custom HyperFrames video compositions at any length or format — longer or multi-scene pieces, brand / sizzle reels, montages, title cards, static loops, and freeform compositions. Input- and length-agnostic. If a specialized workflow clearly fits the input — a marketed product, a website, a topic explainer, a GitHub PR, existing footage, a short motion graphic, or a Remotion port — prefer it (see /hyperframes); use this only as the general fallback when none fit.

1345AbhishekKumar/starter-supabase

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.

1345AbhishekKumar/starter-supabase

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

1345AbhishekKumar/starter-supabase

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.

1345AbhishekKumar/starter-supabase

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

1345AbhishekKumar/starter-supabase

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.

1345AbhishekKumar/starter-supabase

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

1345AbhishekKumar/starter-supabase

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.

1345AbhishekKumar/starter-supabase

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.

1345AbhishekKumar/starter-supabase

turn a product or marketing URL, pasted script, or brief into a product launch video, including SaaS promos, feature reveals, app launches, company promos, and product marketing videos. Use this skill when the user wants to market, launch, promote, or reveal a product. Do not use it for general non-launch website tours, non-product topic explainers, GitHub pull requests, captioning existing footage, or short unnarrated motion graphics. If the intent is unclear, route through /hyperframes first. This is the new shot-sequence architecture: every visual frame is authored as a time-coded shot sequence picked from a menu of golden blueprints, so frames develop over their full duration instead of freezing after entrance.

1345AbhishekKumar/starter-supabase

turn a GitHub pull request (a PR URL like github.com/<owner>/<repo>/pull/<N>, an <owner>/<repo>#<N> ref, or 'this PR' in a checked-out repo) into a code-change explainer video, up to ~3 min (sweet spot 30-90s) — changelog, feature reveal, fix, or refactor walkthrough, rendered from the diff / commits / files. The input is a CODE CHANGE read via the gh CLI; there is no website capture. Use this skill for a GitHub PR. Do not use it for a product launch/promo (use /product-launch-video), a tour of a real website (use /website-to-video), a topic explainer with no PR (use /faceless-explainer), captions on existing footage (use /embedded-captions), or a short unnarrated motion graphic (use /motion-graphics). If the intent is unclear, route through /hyperframes first.

1345AbhishekKumar/starter-supabase

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.

1345AbhishekKumar/starter-supabase

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.

相關技能