Communitygithub.com

long-video-clips

將起始和結束幀圖片轉換為每個場景的影片片段。詢問使用者是否需要 AI 影片片段或僅使用圖片(如此則跳過此階段)。如果需要片段,會尋找可用的影片產生器(MCP、API、本地工具或瀏覽器如 Higgsfield),或詢問使用者提供,並產生片段;或者提供使用者一個資料夾、每個場景的詳細專業提示詞、片段檔案名稱以及起始和結束圖片名稱,讓使用者自行製作片段。在 long-video-keyframes 之後使用,或當使用者要求影片片段、圖轉影片提示詞或動畫場景時使用。

long-video-clips 是什麼?

此技能為長影片工作流程的第六階段,負責將每個場景的起始與結束幀圖片轉換成影片片段。它會先詢問使用者是否想要 AI 生成的影片片段,還是僅使用圖片(若僅使用圖片則跳過此階段)。如果選擇 AI 生成,技能會自動尋找可用的影片產生工具(例如 MCP 伺服器、API、本地工具或瀏覽器網站),並根據工具能力調整提示詞,然後依序生成每個場景的片段,並檢查時長、解析度和視覺效果。如果使用者選擇自行製作,技能會提供每個場景的詳細專業提示詞、片段檔案名稱及相關圖片路徑,讓使用者手動生成。此技能支援多種平台,包括 Claude Code、Cursor、Codex 等 AI 代理工具,並遵循嚴格的規則,如未經使用者同意不產生片段、不要求 API 金鑰或處理驗證碼。最終會更新專案狀態檔案,並準備好進入下一階段(語音旁白或角色配音)。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/samanfirouzi/long-video-skill/tree/HEAD/skills/long-video-clips

在你喜歡的 AI 中提問

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

說明文件

長影片片段

長影片工作流程的第 6 階段。輸出:每個場景的影片片段,或決定僅使用圖片。

一個場景指劇本的一個片段(一個鏡頭,最多 10 秒),按影片順序編號,如同 long-video-keyframes。

開始之前

  1. 在 ~/.long-video/projects/<slug>/ 中找到專案。需要 video-script.md 且狀態為 status: approved,以及 film-style.md。
  2. 檢查 frames/ 和 frame-prompts/index.md。起始和結束幀圖片是片段的輸入。如果缺少,請告知並提議執行 long-video-keyframes。某些工具可以處理沒有起始圖片的純文字片段,但結果較不一致。僅在使用者同意時才繼續該方式。
  3. 載入專案設定:長寬比、解析度、片段限制、影片提供者、核准等級、預算。
  4. 如果 clips/ 或 clip-prompts/ 已存在,請詢問:繼續(列出已完成項目)或重新開始。

步驟 1:詢問使用者想要什麼

詢問:「您想要 AI 為場景生成影片片段,還是影片僅使用您的圖片?」

  • 建立影片片段。 繼續執行步驟 2。
  • 僅使用圖片。 跳過此階段。在 project.json 中設定 "clips_mode": "images-only" 和 "stage": "clips-skipped"。告知使用者後續的組裝階段會根據劇本中的鏡頭移動(推近、平移、視差)為圖片製作動畫。如果有的話,提供下一個階段。停止。
  • 部分場景使用片段。 詢問哪些場景使用片段(一個清單或範圍,或一個規則,例如「僅動作場景」)。其他場景僅使用圖片。將清單儲存在 project.json 的 clips_scenes 中。

步驟 2:誰來製作片段

詢問:「應該由 Claude 生成片段,還是您自己製作?」

  • Claude 生成。 前往步驟 3。
  • 我自己製作。 前往步驟 5(為使用者準備提示詞)。
  • 兩者都做。 撰寫所有提示詞(步驟 5),同時也使用 Claude 生成(步驟 3)。使用者可以選擇他們偏好的結果。

步驟 3:尋找影片產生器

閱讀 references/video-generation.md。簡而言之:

  1. 如果設定檔(providers.video)中已儲存方法,則使用該方法。測試它。
  2. 在此工作階段中尋找已連接且能生成影片的工具(MCP 伺服器或技能),包括 Higgsfield、Runway、Kling、Veo、Luma、Pika、Sora 或類似工具。
  3. 檢查裝置上的 API 金鑰環境變數。僅印出「已設定」或「未設定」,絕不顯示值。
  4. 檢查本地產生器和 GPU。
  5. 如果找不到任何工具,告知使用者並詢問:他們是否有 API 金鑰(作為環境變數,絕不在聊天中貼上)、要連接的 MCP 伺服器或技能,或是他們在瀏覽器中使用的影片網站(例如 Higgsfield)?或者選擇「我自己製作」並前往步驟 5。

記錄所選工具的能力,因為這會影響提示詞:

  • 接受起始影像
  • 接受結束影像(首尾幀控制)
  • 接受角色參考影像
  • 片段長度及最大值
  • 解析度和長寬比
  • 是否自行產生音訊或語音
  • 提示詞長度限制
  • 每段片段的成本

以簡短清單告知使用者的發現結果。如果工具無法接受結束影像,請說明:結束幀提示詞將僅作為動作描述指南使用。

步驟 4:生成片段

遵循 references/video-generation.md 中的順序、檢查和瀏覽器規則。關鍵點:

  1. 先撰寫提示詞(步驟 5),因為產生器需要它們。
  2. 告知使用者片段數量、總秒數以及粗略成本或時間。在開始前詢問。提議從某個範圍開始,例如場景 1 到 10。
  3. 測試片段。 僅生成 scene-001。從中顯示幀圖片。詢問動作、風格和角色是否正確。在繼續之前修正提示詞。
  4. 依場景順序生成。對於連續場景,如果前一片段的實際最後一幀偏離了計畫的結束幀,則使用該最後一幀作為起始影像(請參閱參考文件中的 ffmpeg 指令)。
  5. 每個片段生成後,檢查時長、解析度和外觀。每個場景最多重試 2 次,之後標記為 needs-manual。切勿在未通知的情況下重複執行生成呼叫,因為每次呼叫都可能花費點數。
  6. 將每個片段儲存為 clips/scene-<number>_clip.<ext>。將重拍版本保留為 scene-<number>_clip_take2.<ext>。未經詢問,絕不覆寫檔案。
  7. 瀏覽器生成:首先獲得關於數量、時間、網站和下載資料夾的明確確認。使用者需自行登入。絕不輸入密碼或解決 CAPTCHA。
  8. 一次全部生成或逐個生成:詢問使用者。逐個生成會顯示每個片段的幀圖片並等待核准。

如果生成失敗或使用者拒絕,對於剩餘場景,回退到步驟 5。

步驟 5:為使用者準備提示詞

  1. 在專案資料夾中建立 clips/(用於完成的影片)和 clip-prompts/(用於提示詞)。顯示完整路徑。
  2. 閱讀 references/clip-prompt-templates.md。以每批 20 個場景的批次檔案(scenes-001-020.md)為每個場景撰寫一個提示詞,並加上 clip-prompts/index.md。
  3. 每個提示詞的標頭都包含以下資訊,以確保不遺漏:
    • 要儲存的片段檔案名稱:clips/scene-007_clip.mp4
    • 起始影像:frames/scene-007_start.png
    • 結束影像:frames/scene-007_end.png
    • 時長、長寬比和解析度
  4. 詢問:一次全部處理,還是逐個處理。
    • 一次全部處理。 顯示資料夾路徑和一個範例提示詞。使用者自行處理批次檔案。
    • 逐個處理。 顯示第一個提示詞及其檔案名稱、起始影像和結束影像。等待使用者告知片段已儲存。檢查檔案是否存在於 clips/ 中且名稱正確(並使用 ffprobe 檢查時長)。然後顯示下一個提示詞。如果使用者說「停止」,將進度儲存在 clips/status.md 中。
  5. 隨時提議檢查資料夾:將檔案與索引進行比對,並列出缺少、命名錯誤或時長錯誤的片段。

提示詞品質

提示詞必須專業且詳細。每個提示詞涵蓋:

  • 鏡頭:景別、角度、鏡頭、帶有方向和速度的移動以及結束位置
  • 動作:主體在片段秒數內逐拍進行的行為
  • 燈光:類型、方向、顏色、片段期間的任何變化
  • 風格:鎖定的藝術風格區塊和電影風格行
  • 不得改變的內容:角色外觀、場景、色調
  • 負面詞彙、時長、長寬比

遵循範本。不要將提示詞縮短為幾個字。

步驟 6:狀態與完成

  1. 保持 clips/status.md 為最新狀態:
| 場景 | 檔案 | 狀態 | 時長 | 備註 |
|-------|------|--------|----------|------|
| 001 | scene-001_clip.mp4 | 完成 | 6.0 秒 | |
| 002 | scene-002_clip.mp4 | 需手動處理 | | 偏移兩次 |

狀態值:pending、done、needs-manual、skipped。

  1. 更新 project.json:提示詞儲存後設定 "stage": "clips-prompts-done",當所有想要的片段都存在且使用者核准整組片段時設定 "stage": "clips-done"。
  2. 告知使用者 clips/ 和 clip-prompts/ 的路徑,以及缺少的內容。
  3. 提議將正在使用的產生器儲存在設定檔中(providers.video),僅儲存方法名稱。
  4. 提議繼續執行 long-video-voice(旁白和角色配音)。僅在使用者同意時才啟動它。除非使用者要求且該階段存在,否則不要啟動任何其他後續階段。

儲存提示詞前的自我檢查

  • 每個想要的場景都有一個提示詞,其標頭中包含片段名稱、起始影像、結束影像、時長、長寬比和解析度。
  • 提示詞時長與劇本相符,並尊重工具允許的長度和 10 秒限制。
  • 鏡頭、燈光和風格與 film-style.md 及劇本鏡頭相符。
  • 風格區塊和負面詞彙完全照搬。
  • 如果語音模式為角色或混合,則提示詞中需說明對話處理方式(請參閱範本)。
  • 片段檔案名稱嚴格遵循規則。

規則

  • 未經核准的劇本,絕不開始。
  • 絕不跳過步驟 1。如果使用者想要僅使用圖片,跳過此階段並說明。
  • 在使用者同意數量和成本之前,絕不生成。
  • 絕不在聊天中要求 API 金鑰。絕不在瀏覽器中輸入密碼或解決 CAPTCHA。
  • 提示詞核准後,絕不重新命名提示詞檔案名稱或片段名稱。
  • 保持聊天訊息簡短。將完整的提示詞文字放在檔案中,僅顯示範例或當前提示詞。

Individual skills in this repo

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

long-video-assets

Video and animation skill. Build the visual foundation for a long video from an approved story. Extracts the recurring characters, environments and key objects, helps the user choose one art style from suggested options (10 at a time, more on request), then writes image generation prompts for every character (portrait plus character sheet), environment and object, all sharing one locked style. Can also generate the images (installed tool, API, MCP or browser) or hand the user a folder and file names to fill. Use after lon

long-video-director

Turn an approved story into a shot-by-shot video script, acting as the director. Asks whether the video uses a narrator or characters who speak (or both), suggests professional filming choices (camera type, lenses, camera movement, lighting, color, pacing), saves them as a separate film style file, then writes a script that matches the project config. Outputs film-style.md and video-script.md. Use after long-video-story (and long-video-assets) are done, or when the user asks for the video script, shot list, camera style or lighting plan.

long-video-keyframes

Create the start and end frame image for every scene (clip) of the approved video script. Writes one image prompt per frame with a fixed file name that holds the scene number and start or end, makes a folder for the images, and can generate the images with an available image tool, or hand the prompts to the user all at once or one by one. Use after long-video-director, or when the user asks for start frames, end frames, keyframes or scene images.

long-video-niche-discovery

Find a differentiated video niche and a first video topic by applying seven discovery lenses (subject migration, angle inversion, hidden sub-niche, adjacent audience, format transplantation, perspective shift, cross-niche combination) to a niche, channel or video the user already likes. Returns the 10 strongest candidates, then episode topics for the chosen one. Called by long-video-story when the user picks the "niche" story style; also usable on its own.

long-video-publish

Prepare the YouTube packaging for the finished video: title options, a full description with chapters and credits, tags and hashtags, and thumbnail concepts with image prompts (made or handed over like the earlier image stages). Checks the text against YouTube limits and saves everything for the user to paste in. Use after long-video-render has produced the final video, or when the user asks for a YouTube title, description, tags, chapters or thumbnail.

long-video-render

Assemble the finished video and run the review loop. Builds the edit from the clips (or images with camera moves), voice, sound stems and captions, renders a low quality review version with scene numbers and time burned in so a client can review it, collects and applies changes (re-rendering reviews as often as needed), and when the user approves, renders the high quality final video. Uses a video editor with a CLI or MCP (FilmCraft, EffectCraft or another) if one is available and the user wants it, otherwise the bundled ffmpeg renderer. Use after long-video-sound, or when the user asks to render, assemble, export, preview or finalize the video.

long-video-sound

Video and animation skill. Create the sound effects, ambience and background music for the video and place them on the timeline. Plans the sound design from the approved script, sources or makes each sound (Openverse for openly licensed recordings and music, Earshot to make sounds from words and to listen to and judge sounds, Clipwing real-sfx to place real sounds on exact frames), records licences and credits, and mixes separate stems (effects, ambience, music) with the music ducked under speech. Or gives the user a fold

long-video-story

Agree on the story for a long video. The user either supplies a story or asks Claude to write one. When Claude writes, it first asks which story style to use (for example niche discovery, or a provocative-questions narration), runs that style's skill, and revises until the user approves. Use after long-video-setup, or when the user says "story for my video", "give me an idea", or wants to change an unapproved story. Ends only when the user explicitly approves the story.

long-video-voice

Create the spoken audio (narration and character voices) for the approved video script. First decides whether the video needs speech and asks the user to confirm. If yes, builds a voice cast (narrator plus each speaking character), makes a short sample of each voice with an available tool such as an ElevenLabs MCP and asks the user to approve the voices, then generates one audio file per spoken line with a name that holds the scene number and speaker. Or gives the user the lines, file names and folder to record or generate themselves. Use after long-video-clips (or long-video-keyframes), or when the user asks for narration, voiceover, voices or dialogue audio.

相關技能