Short

From daiki-beppu/youtube-automation · View interactive version

Short is an AI agent skill from the GitHub repository daiki-beppu/youtube-automation. Use when collection 型(BGM テイスター)または release 型(楽曲リリース)のチャンネルでショートを生成するとき。「ショート作って」「shorts」「BGM 切り抜き」「リリースショート」「サビ抽出」「ショートサムネ」で発動。content_model.type から手順を自動判定し、--thumbnail で 9:16 素材を生成する

How to use this skill

Skill file

前後工程

成果物

Overview

チャンネル設定の config.youtube.content_model.type を入口で一度だけ読み、利用者に型やフラグを指定させず手順を自動分岐する。

| content_model.type | 実行内容 | 手順 |

|---|---|---|

| collection | CC 公開後にショートを既定 3 本前後生成し、全 supported language にローカライズして投稿 | references/collection.md |

| release | 本編のサビを抽出し、JP+EN の 9:16 クリップを生成 | references/release.md |

collection / release 以外は設定エラーとして停止する。これは config から自動判定できる分岐であり、手動 mode や選択フラグは設けない。

モード判定

$ARGUMENTS から --thumbnail の個数を最初に数える。

| mode | 読む reference |

|---|---|

| --thumbnail | references/thumbnail.md |

--thumbnail は型を選ぶフラグではない。release 型では対象外として停止し、collection 型の素材生成だけを明示実行する。

完了条件

Subagent Contract

subagent は workflow-state.json を更新せず、ユーザー確認を行わない。完了報告は status: success | failure、成果物の絶対パス一覧、エラーを返す。

設定読み込みゲート

  1. load_config() で config/channel/shorts.json と config.youtube.content_model.type を読む
  2. .claude/skills/short/config.default.yaml と、存在する場合だけ config/skills/short.yaml を load_skill_config("short") で deep-merge する。override は勝手に作成しない
  3. 判定した型と同名の collection / release 節だけを生成パラメータとして使う

旧 short-release の skill-config owner や override は読まない。チャンネル固有値は必ず上記 config 経由で解決する。

from youtube_automation.configuration import load_config
from youtube_automation.configuration.skills import load_skill_config

cfg = load_config()
assert cfg.shorts.enabled, "config/channel/shorts.json で shorts.enabled=true にしてください"
content_type = cfg.youtube.content_model.type
assert content_type in {"collection", "release"}, f"未対応の content_model.type: {content_type}"
generation = load_skill_config("short")[content_type]

前提

いずれか欠ける場合は早期に止めて該当 skill / config 更新を案内する(/setup --import / /setup / /publish --upload)。

Quick Reference

| コマンド | 説明 |

|---|---|

| bash .claude/skills/short/references/generate-shorts.sh <target-path> | config の型に従いショートを生成 |

| bash .claude/skills/short/references/generate-shorts.sh <release-path> -s 30 -t 40 | release 型でサビ位置・尺を指定 |

| bash .claude/skills/short/references/test-crop-positions.sh <master> 30 | collection の loop-mp4 素材でクロップ候補を確認 |

| uv run yt-upload-shorts <collection-path> --short-num <short-num> --plan | 生成物の番号を指定して投稿内容を API なしで確認 |

| uv run yt-upload-shorts <collection-path> --short-num <short-num> | 指定番号のショートを 1 本投稿し、結果の action を確認 |

| uv run yt-shorts-bulk-update-loc --dry-run | 投稿済み collection Shorts の localization 更新を確認 |

| uv run yt-generate-image --aspect-ratio "9:16" --prompt "<text>" --output <collection>/10-assets/short.png -y | --thumbnail の 9:16 画像生成 |

| uv run yt-generate-shorts-loop <collection-path> [--engine veo\|fal] -y | short.png の 9:16 ループ動画化 |

Instructions

Step 1: 型を判定する

設定読み込みゲートを実行し、content_type を一度だけ確定する。型をユーザーへ質問せず、フラグでも上書きしない。

--thumbnail が指定された場合は content_type == "collection" を確認し、references/thumbnail.md だけを実行して終了する。

Step 2: 型別手順を実行する

両手順とも生成コマンドは同じ references/generate-shorts.sh を使う。このスクリプトも load_config() の content_model.type を読み、別 skill や手動型フラグへ分岐を委ねない。

想定 API call 数

| API | call 数 / 実行 | 変動要因 |

|---|---|---|

| videos.insert(1,600 units / 本) | collection 型の投稿本数 | shorts.collection.default_count。release 型は 0 |

| thumbnails.set(50 units / 本) | collection 型の投稿本数 | release 型は 0 |

| videos.update(50 units) | yt-shorts-bulk-update-loc の対象 Shorts 数 | --dry-run は 0 |

| Vertex AI Gemini | --thumbnail の short.png 生成で 1 call | 再生成回数 |

| Vertex AI Veo 3.1 / fal.ai | --thumbnail のループ動画化で選択 engine に 1 call | ループ不要なら 0 |

設定

| 配置 | 責務 |

|---|---|

| config/channel/shorts.json | enabled、公開時刻、collection の本数・間隔、release の言語・開始秒・尺 |

| .claude/skills/short/config.default.yaml | collection / release の生成側既定値 |

| config/skills/short.yaml | 生成設定のチャンネル上書き |

| config/localizations.json | collection 型の言語別タイトル・説明テンプレート |

所要時間と完了報告

ffmpeg 生成は通常 1〜3 分。/tmp/short-$(date +%s).log へ redirect し、終了後に生成物の絶対パスを報告する。失敗時は ffmpeg のエラー行と未生成の対象を報告する。

Next Step

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.