Communitygithub.com

rajsaksham377-bot/youtube-shorts-ai-editor

AI動画編集パイプラインのステップ1 — トーキングヘッド映像をクリーンなマスターカットに仕上げます。cutteraw, raw footage, remove filler等のユーザー要求に応答し、撮影映像を編集可能な状態にします。

youtube-shorts-ai-editor とは?

このスキルは、AIエージェント(Claude Code等)が生のトーキングヘッド動画をクリーンなマスターカットに変換するための包括的なパイプラインです。AssemblyAIによる文字起こし、音声抽出、cutter.jsonの作成(keep/cut/fluffの分類)、カットポリシー(コンテンツ積極型・ポーズ自然型)、QA・レビュー文書作成、ローカルカットエディタUI、タイト/ナチュラルプレビュー、最終4K60レンダリング、そしてedited-transcript.jsonの生成をカバーします。文字起こしの時間的誤差をRMSエンベロープでクロスチェックし、ゴーストスピーチやクリップされた単語を検出する検証ツールが組み込まれています。プラットフォームは主にClaude Code向けで、projects/ディレクトリ構造を前提としています。ユーザーはコードエディタとブラウザで動作するローカルサーバーを通じてカットをレビュー・調整できます。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/raisaksham377-bot/youtube-shorts-ai-editor/tree/HEAD/.claude/skills/clean-cut

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

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

ドキュメント

clean-cut — ステップ1 カットパイプライン

プロジェクトの生クリップ(videos/video-N/DJI_*.MP4)をクリーンマスター+ edited-transcript.json (後続のすべてのステップが基準とする単語レベルのタイミングスパイン)に変換します。唯一の信頼できる情報源は videos/video-N/work/analysis/cuts.json — ClaudeとエディタUIで共有されます。すべてのツールは tools/ にあり、プロジェクトディレクトリを最初の引数として受け取ります。

Claudeがトランスクリプトを読んでカットを作成します。 別のLLM呼び出しは不要です。ツールはオーディオ、エンコード、QA、エディタを処理し、判断 — どのテイクがリテイクか、誤スタートか、フィラーか、フラフか — はClaudeに委ねられます。

パイプライン(順序通りに実行)

P = プロジェクト(例:video-1)。クリップ id = 短いハンドル(0233)。すべてのクリップのアーティファクトはそのidで命名されます(0233.wav、0233.json)。生のMP4パスは、cuts.jsonにfileとしてクリップごとに保存されます。

  1. クリップごとに16kHzモノラルWAVを抽出 → P/work/audio/<id>.wav(文字起こし+RMSノイズフロア/スナップ・トゥ・オーディオ・テールに使用)。スクリプト化されていません — クリップごとにffmpegを実行します: ffmpeg -i videos/video-1/DJI_...0233_D.MP4 -vn -ac 1 -ar 16000 videos/video-1/work/audio/0233.wav

  2. この動画のキータームをドラフト → P/work/keyterms.txt(文字起こしの前にこれを行います)。キータームは、認識器をこの動画の固有名詞/製品/技術名に偏らせ、誤認識を防ぎます(例:「Seedream」を「sea dream」としない、「Cloudflare」を「cloud flare」としない)。ここの精度は非常に重要です:トランスクリプトテキストはカット判断を駆動し、かつ /make-tsx がフレーズを検索してビートのタイミングを合わせるため、誤った用語は両方を壊します。動画のトピック/タイトルから、ブランド名、ツール、技術、専門用語を約10〜40個、1行に1つリストします(空行と # コメントは無視されます)。これは動画ごとに行う — transcribe.py に用語をハードコードしてはいけません。 ファイルをスキップした場合、文字起こしは実行されますが(空のフォールバック)、専門用語にエラーが多くなります。フォーマットは以下の通り、1行に1つの用語:

    # 動画内で言及されるツール+ブランド
    Claude Code
    Remotion
    AssemblyAI
    ElevenLabs
    Cloudflare
    
  3. 文字起こし(.env に ASSEMBLYAI_API_KEY が必要;逐語的、フィラー保持;work/keyterms.txt を自動ロード): python tools/transcribe.py P → P/work/transcripts/<id>.json。1つのクリップのみの場合は --clips 0233、やり直す場合は --force。ロードしたキーターム数を出力します — 「none」行はキータームをドラフトしていないことを意味します。

  4. 分析用の読みやすいテイクビュー: python tools/format_transcript.py P → P/work/analysis/takes-<id>.txt(0.8秒以上のギャップでセグメント化、フィラーはインラインでタイムスタンプ付き)。

  5. cuts.json を作成(以下のスキーマ参照):takes-*.txt を読み取り、すべてのスパンをkeepまたはカテゴリ化されたcutとしてマークし、フラフの提案と判断保留フラグを追加します。

  6. QA+レビュー文書: python tools/analyze_cut.py P [--style tight] → qa-report.md(内部デッドエア、クリップテールリスク、小さな断片、フラフ、カット結合部でのハードエントリ、ゴーストスピーチ = keep内に乗っている文字起こしされていないエネルギー、低信頼度の保持トークン)。ゴースト/ハードエントリチェックが存在するのは、トランスクリプトの差分では 誤ったタイミングのトークン(クリップされた単語の立ち上がり)や、カットを生き延びた文字起こしされていない誤スタート(「and it—」)を検出できないためです — エネルギー対トークンのクロスチェックのみがそれらを捕捉します(これらのチェックが存在する前に、注意深いリスニングで両方が発見されました)。 python tools/make_review.py P → review.md(クリップごとのkeep/cutテーブル+スタイルごとの推定長さ)。

  7. エディタプロキシ(一度だけ): python tools/make_proxy.py P → P/work/editor/{proxy.mp4, waveform.png, manifest.json}(生クリップの720p連結+クリップごとのオフセット)。

  8. プレビュー(両方レンダリング、ユーザーが選択): python tools/render_cuts.py P --style tight --mode preview および --style natural → P/output/preview-<style>.mp4(720p h264_nvenc)。 8.5. レンダリングの機械検証(すべてのプレビューレンダリング後、ユーザーに表示する前に必須)。プレビューのWAVを抽出 → transcribe.py P --clips preview --force → python tools/verify_cut.py P → verify-report.md。レンダリングに対する2回目のASRパスにより、意図された保持トークンと比較:余分な単語 = 一緒に乗った文字起こしされていないゴースト(単語末尾に接着した誤スタート — 生のトランスクリプトには見えず、エネルギー推定では単語の開放と区別できない);欠落単語 = クリップ/ドロップ;さらに内部ポーズ異常と低信頼度レンダリングトークン。テストで発見:誤ったタイミングのASRトークンが単語の立ち上がりをクリップ('slash dot env' → '...env')、ゴースト 'and it—' がレンダリングまで生存;注意深いリスニングで両方発見、現在はこれらのツールがそれを行います。すべての発見を「ここを聴く」として扱います:それぞれを説明するか修正する — レポートに未説明の行があるままカットが良いと宣言してはいけません。

  9. ユーザー監査 — これはハードゲートであり、プランステップと同じです。エディタを開く: python tools/editor/server.py P → http://localhost:8765。ユーザーがkeep/cutエッジをドラッグし、カットを追加(I/O + C)、Rawと編集済み再生を比較;Saveでcuts.jsonを書き換え(work/analysis/backups/にバックアップ、changes.logに追記);Renderボタンでプレビューを再実行。承認されるまで反復します。

  10. 最終マスター: python tools/render_cuts.py P --style <chosen> --mode final → P/output/master-<style>.mp4(4K60 10ビット hevc_nvenc)。レンダリング後の必須ステップが2つ:

    • A/V デュレーションゲート: ffprobe -show_entries stream=duration を v:0 vs a:0 で実行 — これらは等しくなければなりません。verify_cut の A/V バジェットは時間軸に沿って拡大し(動画途中で±2秒)、実際の累積ドリフトを隠蔽します;デュレーション一致チェックがそれを決定的に検出します。(ドリフトに関する注意はノートの項を参照。)
    • 再生可能/ハンドオフトランスコード: 10ビットHEVCマスターはほとんどのプレーヤーやIDEプレビューで再生できず、HEVCファイナルは59.94fps映像にフレームを約0.1%速く刻みます。両方を修正する8ビットH.264を、真のCFRに再タイミングして生成: ffmpeg -r <src_fps> -i master-<style>.mp4 -c:v libx264 -crf 19 -pix_fmt yuv420p -c:a aac master-<style>-h264.mp4 — -i の前のソースfpsがすべてのフレームを再刻印するため(フレーム損失なし)、v:0==a:0になります。このファイルがユーザーがレビューするファイルであり、後続のステップが使用するコンポジションのネイティブソースです。
  11. ハンドオフスパイン — edited-transcript.json:最終マスタータイムライン内の単語時間。最もシンプルで堅牢なパス(video-1が使用した方法):マスターのWAVを抽出し transcribe.py で処理、そして {words:[{text,start,end}...]} をミリ秒単位に正規化します。(cuts.jsonのタイムリマッパーが代替案として計画されています。)このファイルは /make-tsx が読み取り、ビジュアルをスピーチに同期させるために使用します。

ステップ1〜4と7は一度だけ実行;カットが承認されるまで5→6→8→9をループ;その後10〜11を実行します。

cuts.jsonスキーマ(あなたが作成するもの)

{
  "project": "video-1",
  "clip_order": ["0232", "0233", "0234", "0235"],   // 連結順序(ファイル名順を想定)
  "clips": [{
    "id": "0233",
    "file": "DJI_20260707121304_0233_D.MP4",         // 生MP4、プロジェクトディレクトリからの相対パス
    "duration": 245.3,
    "keeps": [ { "s": 7.32, "e": 13.13, "text": "...", "gap": {"d":0.89,"t":"silence"} } ],
    "cuts":  [ { "s": 2.18, "e": 5.04, "cat": "retake", "text": "...", "note": "why" } ],
    "fluff_suggestions": [ { "s": 40.1, "e": 44.0, "text": "...", "crit": "restated-idea",
                            "note": "...", "status": "suggested" } ]   // または "auto_applied"
  }],
  "styles": { "tight": {…}, "natural": {…} },         // タイミングノブ、以下参照
  "flags":  [ { "id": 1, "clip": "0233", "at": "00:30", "issue": "...", "default": "keep both" } ]
}
  • cat ∈ retake | false_start | filler | long_pause | dead_air。時間はそのクリップ内の生の秒数。
  • Keepは決して削除されません。 status:"auto_applied" のフラフスパンは、それがカバーするkeepを隠すだけです(元に戻す = "suggested" に戻す)。auto_applied は確信度の高いフラフに予約;残りは "suggested"(提案のみ — レンダラーはsuggestedなフラフを決してドロップしません)。
  • flags = default 付きでユーザーに提示される判断保留呼び出し。

カットポリシー(判断方法)

手動で作成されたリファレンスカット(作成者自身のCapCut編集)に対して較正されています。目標ペーシング = コンテンツ積極型 + ポーズ自然型。 大きな保持レバーはフラフと冗長性をカットすることであり、無言を潰すことではありません — ラン間の自然な呼吸を約0.45〜0.5秒維持します。したがって:

  • まず話された編集指示を探す — それらはあなたの判断より優先されます。 作成者はカメラに向かって編集者に話しかけます。何かを決定する前に、すべてのクリップのトランスクリプトを other take / another take / repeat this section / remove this / not needed でgrepします。video-1では、これらが難しい呼び出しのほとんどを解決しました:"Other take." は後続のランが前のものを無効にすることを意味します;"I will repeat this section" はビートの最初のパス全体を削除しました;"There is no app or UI" ×3 に続く "Remove this sentence. Not needed." は4つすべてを削除することを意味します。スレートはセグメント内に隠れます — テイクビューは0.8秒ギャップで分割されるため、ポーズなしで話されたスレートはセグメント内に存在します("...open source pro— another take. Okay, since this project is...")そして単語レベルの分割が必要です。作成後、保持テキストにスレートフレーズがまだ含まれていないことを主張します。
  • 常にカット: リテイク/誤スタート(勝ちテイクを保持、残りをカット — どのテイクがどれを無効にするか注記)、つまずき、デッドエア、明確なフィラー。
  • 二重フレーズ: 最初のものをカット。 フレーズが連続して2回配信される場合 — "And what and what makes it so powerful?"、"it holds— it holds your decisions"、"doesn't reflect, doesn't contradict, doesn't contradict with chapter 1" — 作成者は前のものを削除したいと考えており、それがそうでなければ良いテイクの文の中間にある場合も含みます。video-1では、ユーザーから17の監査ノートがあり、そのすべてが「最初のものをカット」でした。プレビューを表示する前にこのパスを自分で行ってください:保持単語に対して、隣接する繰り返しランとemダッシュで終わるトークンをn-gramスキャンし、それらの間の静かなポイントで最初のランをカットします。唯一の例外はスクリプト化されたコメディです(video-1の "ready to get shocked— uh, sorry, I mean...")、なのでつまずきをカットする前に、スクリプトにも同じつまずきが含まれていないか確認します。
  • 提案、自動削除はしない(通常は): フラフ — ペイオフを遅らせる前置き、評価的な余談、言い換えたアイデア。それぞれを分類し(crit)、レビューでユーザーに決定させます。
  • ポーズ: 圧縮するが平坦化しない。両方のスタイルは自然な呼吸を目標とします;tight はフロー中のポーズをパンチィに、natural はより余裕を持たせます。セクション終了/削除されたリテイク後の箇所はソフトランディング(より多くのテール)で、呼吸を確保します。
  • デフォルトでは tight と natural の両方をレンダリングし、ユーザーに選択させます。

これがチャンネルのペーシングのグラウンドトゥルースです — フラフにはコンテンツ積極型、ポーズには自然型。

スタイルパラメータ(styles内、一般的なノブ — 動画ごとの定数はありません)

internal_gap(keepをスピーチランアトムに分割する、これ以上のポーズで) · min_tail/max_tail(単語後のスナップ・トゥ・オーディオ・テール範囲) · head(アトム前のリードイン) · margin(「減衰した」とみなすノイズフロア超えのdB) · soft_gap(これ以上の後続ギャップ = セクション終了 → ソフトランディング) · soft_max_tail/soft_margin(よりソフトなランディング)。リファレンスカットに一致したリファレンス値:tight {internal_gap:0.4, min_tail:0.14, max_tail:0.4, head:0.11, soft_gap:1.2, soft_max_tail:0.6, soft_margin:3.0};naturalは min_tail:0.26, max_tail:0.45, head:0.19 に増加。

head は話者に合わせて調整し、リファレンスを盲信しないでください。 head は話者の立ち上がりランプ — 単語の最初の可聴エネルギーとASRトークン開始の間の遅延 — を上回らなければなりません。そうでなければ、すべてのカットインが単語のアタックをクリップします。測定方法:実際のカット結合部の各アトム開始について、RMSエンベロープを遡り、フロア+6dB以下の最後のポイントを見つけます。video-1ではランプが0.18秒に集中していたため、tightの0.11では14のハードエントリで立ち上がりをクリップしましたが、0.15/0.17では0でした。analyze_cut のハードエントリ数に対して head をスイープし、ゼロに達する最小値を選択します — それ以上進むと実際のランタイムコストがかかります(0.19 → 0.42では、+1:39のリードインに対して3エントリ少ない)。

soft_max_tail は固定値ではなく上限 — snap_tail はクリーンな終了では早期に戻るため、引き上げると実際に長いリリースを必要とする単語にのみ影響します。動画の最後の単語がクリップする場合は引き上げてください:video-1の "...upcoming videos." は減衰に0.90秒必要であり、0.60では切れていました。

トランスクリプトはTIMEについて嘘をつく — 疑わしいスパンはすべてエンベロープとクロスチェックする

単語のテキストは通常正しいです;単語の時間は正しくなく、カットエンジンはそれらを完全に信頼します(split_atoms は各アトムの境界を単語時間から取得するため、cuts.jsonのkeepエッジ編集では誤ったタイミングのトークンを修正できません — トークンを修正する必要があります)。4つの障害モード、すべてvideo-1で確認され、すべて work/audio/<id>.wav 上のRMSウォークで発見されました:

症状カットへの影響現れ方
遅い開始(トークンが単語の後に始まる)カットインが単語に切り込むanalyze_cut ハードエントリ
膨張したスパン(単語が数秒の無言にわたってタイムスタンプされる)keep 内部にデッドエアが保持されるverify_cut 大きな内部ポーズ
マージされた繰り返し(1つのトークンに2つの発話)トランスクリプトに見えない二重化ユーザーが「2回ある」と言う、トランスクリプトは1回
ファントム(まったくオーディオがないトークン)境界を実際のスピーチにカットするクランプ後のハードエントリ

測定された最悪ケース:"post" が66.60→72.40にタイムスタンプされ、文中に5.24秒のデッドエアを隠蔽;"Connect" が0.44秒遅れ;二重化された "here's" が1つの1.03秒トークンにマージ;オーディオがない "this."。すべての修正を work/analysis/token-time-fixes.json に記録します — transcribe.py --force はそれらを消去します。

すべてのプレビューの前に実行する価値のある検出器:持続時間が約1.0秒を超える、または先頭/末尾の無言が0.35秒を超える保持単語にフラグを立てます。現実のものと誤検出を区別するには、生き残ったホットスパンがその単語を妥当に保持できるかどうかを尋ねます — 0.17秒に4音節は、検出器がソフトな立ち上がりに引っかかったことを意味し、実際の膨張ではありません。

ノート

  • カットエンジン(tools/cutlib.py)は、単語認識セグメンテーション、クリップごとの10パーセンタイルノイズフロア、スナップ・トゥ・オーディオ・テールを行い、単語のリリースがクリップされないようにします — テールパディングを手動で調整するのではなく、スタイルノブを調整します。
  • plan_clip は、そのクリップの cuts と keeps を取り、suggested フラフを内部ギャップにスライスする前に実際のレンダリング可能な表現を作成します。 これは単にギャップテキストを詰めるのではなく、keepスパンを結合し、カットを適用し、フラフの auto_applied ステータスをチェックします。
  • plan_clip の出力はクリップの rendered オブジェクトであり、これはスライス可能なアトムのリスト、タイムライン上の場所、および各アトムに適用されるスタイルパラメータを保持します。
  • カットエンジンのテストは tests/ にあり、pytest tests/ で実行します。
  • プロジェクトごとに .env ファイルが必要です。サンプルは .env.example にあります。

Individual skills in this repo

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

raisaksham377-bot/youtube-shorts-ai-editor

Makes this repo's videos look like YOUR channel instead of the house default — interviews you for palette, fonts, wordmark, motion energy, delivery specs and SFX taste, then rewrites brand.md + remotion/src/brand.ts + remotion/src/fonts.ts together and renders a proof card so you SEE it. Use whenever the user wants to set up or change their brand, rebrand the repo, "make it my colors/fonts", change the accent color, set their wordmark, adjust the motion feel, or asks why their videos look like someone else's. Run it once before the first video. Not for per-video art direction (that is /make-tsx) and not for thumbnails, which are deliberately louder than the brand (that is /packaging).

raisaksham377-bot/youtube-shorts-ai-editor

Build a split-frame vertical Short/Reel (1080x1920) from talking-head footage — real face cropped into the bottom half throughout, bespoke motion-graphic beats + word-by-word captions in the top half. Use when the user wants a "vertical short", "reel", "9:16 video", "split-frame" format, asks to keep their face on screen the whole time while graphics play above it, wants an in-context app/UI mockup moment (like clicking a button in a browser) without cutting away from their face, or hits caption-pill-covers-my-face / no-GPU-rendering / audio-duration-mismatch problems while building one. Covers the crop-offset technique for framing the face, the caption-pill safe zone, the top-half-only UI-mockup scene pattern, the full pipeline from raw footage to final SFX mix, and the environment gotchas (no NVIDIA GPU, AAC priming gap, comp-native transcode). Topic-agnostic — this is a layout/technique skill, not tied to any one video's content. Builds on /clean-cut, /make-tsx conventions, and /suggest-sfx; doesn't rep...

raisaksham377-bot/youtube-shorts-ai-editor

Voice/audio cleanup step of the AI Video Editor pipeline — diagnose a video's background noise, pick the right denoise method, and produce a cleaned master (voice isolated, levels preserved, video stream copied). Use when the user wants to "clean the audio / voice", "remove background noise", "denoise", "isolate voice", fix outdoor/room/water/hum/hiss noise, run ElevenLabs Voice Isolator or local RNNoise, A/B denoise methods, or produce a cleaned master for a video-N in this repo. Covers diagnosing the noise (spectrogram + levels), choosing eleven vs rnnoise by noise type, the sample A/B, tools/clean_voice.py, preserving levels (RMS-match, not LUFS), and rewiring the pipeline to the clean master. Not the SFX/music mix (that is /suggest-sfx + the final-mix step) and not the cut (that is /clean-cut).

raisaksham377-bot/youtube-shorts-ai-editor

Turn static SCREENSHOTS into a simulated screen recording (TSX) — a fake screencast with an animated cursor that eases to targets and clicks, a browser URL bar that updates per page, hard-cut navigations, in-page filter crossfades, smooth scroll, and a ken-burns zoom onto the payoff. Use when a beat needs to show a walkthrough of a web app / dashboard / settings page and you'd rather build it from screenshots than get (or ask for) a real screen recording — "fake a screen recording", "turn these screenshots into a screencast", "simulate clicking through the dashboard", "animate this UI walkthrough", "cursor moving through the app". Built on remotion/src/lib/screencast.tsx. This is a technique WITHIN step 2 (make-tsx): defer timeline/render/bake orchestration to make-tsx and raw crash-free TSX rules to vidtsx-2d-generator. Not for a single static page clone (use WebBrowserFrame directly) and not when the point is genuine proof of real speed/output (use a real recording).

raisaksham377-bot/youtube-shorts-ai-editor

Step 2 of the AI Video Editor pipeline — build the visual beats (Remotion TSX shots) over a project's master cut and bake a composited preview. Use when the user wants to add/edit overlays or full-screen animation segments, "make a shot / beat", implement an edit plan or a v2 update, retime a beat to the narration, re-render shots, or re-bake the video-N preview in this repo. Covers reading the plan + edited-transcript + brand + reusable kit, authoring shots library-first, syncing reveals to word times, updating timeline.json (cutaway vs overlay), rendering, verifying by screenshot, and baking with tools/bake.py. Defers raw TSX authoring rules to vidtsx-2d-generator and the cut itself to clean-cut.

raisaksham377-bot/youtube-shorts-ai-editor

Generates click-optimized YouTube packaging — 3 thumbnail bets under one fixed title, engineered for YouTube's built-in A/B/C thumbnail test, plus a value-forward description, then renders the thumbnails as real images. Use this whenever you want to package a long-form video or turn a video idea into titles and thumbnails. Triggers include how would you package this, title ideas for, thumbnail concept, package this video, A/B variations, and make this clickable. Calibrates to your channel's own CTR data if you have it. Long-form only, never Shorts. Not for non-YouTube copywriting.

raisaksham377-bot/youtube-shorts-ai-editor

Step 4 of the AI Video Editor pipeline — the SFX pass. Analyze a video's beats + narration and propose tasteful sound effects synced to them, drawing from (and growing) a shared, reusable SFX library, then render an SFX-mixed audition preview. Use when the user wants to "add SFX / sound effects", "suggest sfx", "score the transitions", "sound-design this beat", generate/source sound effects, build or extend the sfx library/catalog, author or audit a sfx-plan, or mix SFX over a video-N preview in this repo. Covers reading timeline + edited-transcript + brand §10, the library-first flow, generating misses with the ElevenLabs Sound Effects API, the per-video sfx-plan.json, the hard user-audit gate, and mixing with tools/mix_sfx.py (light voice ducking). Not the music bed (that is the final-mix step) and not the visual beats (that is /make-tsx).

raisaksham377-bot/youtube-shorts-ai-editor

Generate production-ready 2D TSX video files for VidTSX (Remotion-based) from a shot, scene, or video description. Use whenever the user wants to create or generate a VidTSX video, a 2D TSX shot or scene, an animated clip, title card, or rendered motion graphic — including when they describe a visual animation they want built, or say "make a shot", "build this scene", "generate the TSX", or "turn this into a video". Covers the mandatory file structure and composition config, dimension presets (horizontal/vertical/square), six style presets (minimalist, memphis, neo-brutalism, glassmorphism, neon, corporate), and the hard rules that keep renders from crashing, covering frame-based animation only (no useState/useEffect/setTimeout), strictly monotonic interpolate ranges, Easing.bezier not wrapper syntax, and the chroma-js and @remotion/paths import gotchas. Not for 3D/three.js compositions, general React work, or editing video files.

関連スキル