Communitygithub.com

EyalZameret/Dudu-Director-Video-kit

Dudu(AIプロモーションビデオディレクター)が、ログイン済みのPlaywrightブラウザ内でGemini(Nano Banana画像、Veo動画)、ChatGPT(GPT Image)、Kling(画像から動画)を操作するために使用します。動作確認済みのクリックパス、アップロード・ダウンロード手順、および遭遇した障害の修正方法が含まれています。

Dudu-Director-Video-kit とは?

このスキルは、AIプロモーションビデオディレクターであるDuduが、Gemini、ChatGPT、Klingといった複数の生成AIサービスをPlaywrightブラウザ経由で自動操作するための統合ツールキットです。ユーザーが手動でログインしたブラウザ環境を利用し、画像生成(Gemini Nano Banana / ChatGPT GPT Image)、動画生成(Gemini Veo)、画像から動画への変換(Kling)をシームレスに実行します。各サービスのUI変更に強い設計で、セレクタが失敗した場合のスナップショット確認やルール更新手順がドキュメント化されています。また、ファイルはワークスペース内に配置する、結果を都度確認する、公式APIを代替案として提示するなどのグラウンドルールに従い、安定した自動化ワークフローを実現します。

対応~Claude Code✓Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/EyalZameret/Dudu-Director-Video-kit/tree/HEAD/.claude/skills/dudu-browser

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

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

ドキュメント

Dudu: PlaywrightでGemini、ChatGPT、Klingを操作する

.mcp.jsonのPlaywright MCPサーバーを使用します。以下のセレクタは2026-10にヘブライ語Gemini UIと英語Kling UIで検証済みです。ChatGPTの手順(セクション1b)は未検証です。Geminiのラベルはヘブライ語と英語の両方を受け入れる正規表現として記述されています。英語の文言は検証されていないため、別のUI言語で初回実行する際はbrowser_snapshotを取得し、実際のボタン名を確認してここの正規表現を修正してください。Web UIは変更されます。セレクタが失敗した場合は、スナップショット(browser_snapshotまたはbrowser_find)を取得し、新しいセレクタを見つけてこのファイルを更新してください。

0. グラウンドルール

  • オーナーがログインします。サイトを開き、オーナーに「Playwrightウィンドウにログインして、完了したら教えてください」と伝え、待機します。絶対に認証情報を入力しないでください。
  • コンシューマー向けWeb UIの自動化は、サイトの利用規約に抵触する可能性があります。オーナーに一度その旨を伝え、ボリュームは人間規模に抑え、代替案として公式APIを提案してください。
  • ファイルはワークスペース内に配置する必要があります(Playwright MCPは他のルートを拒否します)。オーナーが貼り付けた参照ファイルは、最初にproject/frames/にコピーしてください。
  • 各結果を確認してから次に進んでください(画像を読む、クリップのコンタクトシートを確認する)。

1. Gemini: 画像(Nano Banana)

順序が重要です。 最初に画像ツールを選択せずにプロンプトを送信すると、Geminiはテキストで応答し(「ここでは画像を生成できません」)、次の試行は5分以上ハングします。常に:新しいチャット、ツール、参照、プロンプトの順に進めてください。

以下に使用するラベル(ヘブライ語UIは検証済み、英語は未検証):

正規表現ヘブライ語UI英語UI(要確認)
TOOLSהעלאה וכליםUpload and tools
CREATE_IMAGEיצירת תמונהCreate image
DOWNLOAD_IMAGEהורדת תמונה בגודל מלאDownload full size image

ステップA、browser_run_code_unsafeを1回呼び出します(OSのファイル選択ダイアログを開く):

async (page) => {
  const TOOLS = /העלאה וכלים|Upload and tools/i,   // 部分一致、プレーンな文字列名のように
  const CREATE_IMAGE = /^(יצירת תמונה|Create images?)$/i;
  await page.goto('https://gemini.google.com/app'); await page.waitForTimeout(3000);
  await page.getByRole('button', { name: TOOLS }).first().click(); await page.waitForTimeout(1000);
  await page.getByText(CREATE_IMAGE).first().click(); await page.waitForTimeout(1500);
  await page.getByRole('button', { name: TOOLS }).first().click(); await page.waitForTimeout(1000);
  await page.locator('[data-test-id="local-images-files-uploader-button"]').click();
  return 'chooser';
}

ステップB:参照ファイル(1~4ファイル)の絶対パスを指定してbrowser_file_uploadを実行します。 ステップC、プロンプトとダウンロード:

async (page) => {
  await page.waitForTimeout(4000);
  const box = page.getByRole('textbox').first();
  await box.fill(PROMPT); await page.waitForTimeout(800); await box.press('Enter');
  const btn = page.getByRole('button', { name: /הורדת תמונה בגודל מלא|Download full[- ]size image/i });
  await btn.first().waitFor({ state: 'attached', timeout: 180000 }); await page.waitForTimeout(3000);
  const [d] = await Promise.all([page.waitForEvent('download', { timeout: 60000 }), btn.last().click({ force: true })]);
  await d.saveAs(OUT_PATH); return 'ok';
}

同じチャット内での編集(ロゴ削除、目の修正、追加要素の差し替え):チャットURLに移動し、ダウンロードボタンの数をカウントし、編集を送信し、カウントが増えるまで待機します:

await page.waitForFunction(n => document.querySelectorAll('button[aria-label="הורדת תמונה בגודל מלא"], button[aria-label="Download full size image"]').length > n, before, { timeout: 180000 });

典型的な所要時間:画像1枚あたり20~40秒。

落とし穴:

  • ファイル選択ダイアログが開いている間は、browser_run_code_unsafeを実行できません。上記のようにA/B/Cに分割してください。
  • 過去のチャットはコンテキストを保持します。新しいチャットを使用することで「同じ画像が返ってくる」問題を回避します。

1b. ChatGPT: 画像(GPT Image)、Geminiを使用しないオーナー向け

ステータス:未検証。 この手順は、chatgpt.comの一般的な構造から作成されたものであり、実際の記録された実行に基づくものではありません。初回実行時は、各ステップでbrowser_snapshotを取得し、実際のセレクタを使用して、以下の推測を実際に動作したもの(および日付)に置き換えてください。それまでは、長いスクリプト1つではなく、個別の小さなbrowser_*呼び出しを使用して、ステップバイステップで進めてください。

開始する前に、オーナーに一度伝えてください:OpenAIの規約では、自動化手段による出力の抽出を制限しています。ボリュームは人間規模に保つか、代わりにOpenAI Images APIを独自のキーで使用してください。

フロー(Geminiと同じ順序:新しいチャット、参照、プロンプト、待機、ダウンロード):

  1. browser_navigateでhttps://chatgpt.com/に移動します(毎回新しいチャットを使用することで「同じ画像が返ってくる」問題を回避します)。オーナーがログインします。
  2. 参照: 隠されたinput[type=file]を探し、絶対パス(1~4ファイル)を指定してsetInputFilesを使用します。存在しない場合は、添付ボタン(「+」またはクリップ;スナップショットを確認)をクリックし、ファイル選択ダイアログでbrowser_file_uploadを使用します。すべてのサムネイルのアップロードが完了するまで待機します。
  3. プロンプト: コンポーザーは通常、contenteditableボックス(多くの場合#prompt-textarea)です。テキストで応答されないように、プロンプトをCreate an image:で開始するか、スナップショットに表示されている場合は「+」メニューから画像ツールを選択します。その後、通常のプロンプト(参照、ショットライン、スタイル、ネガティブ)を入力します。
  4. アスペクト: ChatGPTは、正方形、ポートレート、ランドスケープ3:2(1536x1024)を提供し、16:9はありません。landscape 3:2を要求し、keep all important content inside the central 16:9 bandを追加します。tools/build_cut.pyで編集時に16:9にクロップします。
  5. 待機: 通常30~120秒。最後の回答に新しいimg(altテキストが「Generated image」であることが多い)が表示され、進行状況インジケータが消えるまで待機します。
  6. ダウンロード: 可能であれば、画像自体のダウンロードボタンを使用します(画像にホバー;スナップショットを確認します)。それ以外の場合は、新しいimgのsrcを読み取り、ブラウザのクッキーを使用して保存します:
    async (page) => {
      const src = await page.locator('img[alt*="Generated"]').last().getAttribute('src');
      const res = await page.request.get(src);
      require('fs').writeFileSync(OUT_PATH, await res.body()); return res.status();
    }
    
    browser_run_code_unsafeでrequireが使用できない場合は、ダウンロードボタンを使用するか、最終手段として画像要素のbrowser_take_screenshotを使用します(品質が低下します。その旨をオーナーに伝えてください)。
  7. 編集(ロゴの削除、目の修正):同じチャットに留まり、Edit only ...: ... Change nothing else.と記述します。ChatGPTは「領域選択」エディタを提供する場合もあります。どちらでも機能します。

GPT Imageで確認したこと(2026-10、キャラクターシート):

  • キャラクターと表情(年齢、緊張、乱れた髪)を最もよく捉え、非常に一貫したパネルを生成しました。
  • Nano Bananaよりも解像度が低く、滑らかで「クリーンすぎる」照明です。あるクローズアップでは、目が異なる方向を向いていました。natural skin texture, visible pores, unretouched, sharp focus, both eyes looking at the cameraを追加し、すべての顔の目をチェックしてください。
  • プランに関するクォータ:チャットプランでの画像生成には制限があり、変更される可能性があります。待機するように指示された場合は、再試行せずに停止してオーナーに伝えてください。

2. Gemini: 動画(Veo)

画像と同じですが、יצירת סרטון(英語UI:「Create video」)を選択し、キーフレームを添付します。הורדת הסרטוןボタン(英語UI:「Download video」)でダウンロードします。クリップあたり数分、720p、約8~10秒です。

3. Kling: 画像から動画へ

Klingには実際のinput[type=file]があるため、ファイル選択ダイアログは必要ありません。ショットごとに1回の呼び出し(各約70~80秒):

async (page) => {
  const seen = () => page.evaluate(() => performance.getEntriesByType('resource')
                       .map(e => e.name).filter(n => /-output\.mp4\?/.test(n)));
  const gen = () => page.locator('button').filter({ hasText: /Generate/ }).filter({ hasNotText: /Generated/ }).last();
  await page.goto('https://kling.ai/app/video/new?ac=7'); await page.waitForTimeout(5000);
  const before = new Set(await seen());
  await page.locator('input[type=file]').first().setInputFiles(KEYFRAME); await page.waitForTimeout(5000);
  await page.locator('[contenteditable="true"], textarea').first().click();
  await page.keyboard.type(PROMPT, { delay: 1 });
  let label = await gen().innerText();
  if (/60/.test(label)) { await page.getByText('Native Audio', { exact: true }).click(); label = await gen().innerText(); }
  if (!/40/.test(label)) return '予期しないコスト: ' + label;          // 停止してオーナーに問い合わせ
  await gen().click();
  const t0 = Date.now(); let url = null;
  while (Date.now() - t0 < 300000) { await page.waitForTimeout(8000); url = (await seen()).find(u => !before.has(u)); if (url) break; }
  return url;
}

その後、ブラウザ外でダウンロード:python tools/download.py "<url>" project/clips/shotNN.mp4

落とし穴:

  • getByText('Generate')は「1/1 Generated」ラベルにも一致します。上記のボタンフィルターを使用してください。
  • <video>はblob URLを使用し、fetchは失敗します。代わりにパフォーマンスエントリからCDN URLを取得してください。
  • 毎回Generateボタンの価格を確認してください。Native Audioはコストを追加します。

4. クリップのレビュー

ブラウザ内でレビューしないでください:<video>のシークは古いフレームを返します。代わりにpython tools/contact_sheet.pyとpython tools/motion_report.pyを使用してください。

Individual skills in this repo

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

EyalZameret/Dudu-Director-Video-kit

Used by Dudu (AI promo video director) for stage 7. Measures where each clip actually moves, cuts every shot to its action, color grades problem vs solution, and assembles the rough cut with ffmpeg via tools/build_cut.py.

EyalZameret/Dudu-Director-Video-kit

Used by Dudu (AI promo video director) for stage 6. Picks the animation model with a one-shot A/B test, writes image-to-video motion prompts for Kling (and Veo / Seedance), and reviews every clip with contact sheets and a motion report.

EyalZameret/Dudu-Director-Video-kit

Used by Dudu (AI promo video director) at every gate. Checks script claims against project/product.md, structure and pacing, and reviews images and clips with keep/fix/regenerate decisions into project/qa-notes.md.

EyalZameret/Dudu-Director-Video-kit

Used by Dudu (AI promo video director) for stages 1-2. Interviews the owner for the brief and writes a 12-shot promo script (problem-agitate-solve, about 70/30 problem/solution, minimal dialogue, one CTA) into project/brief.md and project/script.md.

EyalZameret/Dudu-Director-Video-kit

Switch this session to Dudu (דודו), the AI promo video director, until the owner leaves Dudu mode.

EyalZameret/Dudu-Director-Video-kit

Used by Dudu (AI promo video director) after the picture cut. Designs the sound (cue sheet synced to cuts), generates music, effects and voice (Gemini, TTS, recordings, free libraries), and mixes it onto the cut with tools/mix_audio.py into a finished film.

EyalZameret/Dudu-Director-Video-kit

Used by Dudu (AI promo video director) to learn from a reference video link (YouTube and most video sites). Downloads it for private analysis, detects every cut, reviews one frame per shot, writes a structured analysis into library/study/<id>/analysis.md and updates library/INDEX.md, then deletes the video. Use when the owner shares a link and says "learn from this", "study this", "do it like this", or asks for a style taken from an ad.

EyalZameret/Dudu-Director-Video-kit

Used by Dudu (AI promo video director) for stages 3-5. Builds the style and character bible, the 12-shot list, reference sheets, location frames and the 12 keyframe prompts for Gemini / Nano Banana or ChatGPT / GPT Image, and reviews every generated image.

関連スキル