Communitygithub.com

Conz-Wilts/ai-editor

將一部長影片或播客(本地檔案或 YouTube 連結)轉換為 3-5 個最佳短直式剪輯,每個剪輯都根據使用者個人風格進行剪裁和風格編輯。

ai-editor 是什麼?

此技能專為 AI 助理(如 Claude Code、Cursor 或 Codex)設計,用於從長影片或播客中自動提取並製作多個簡短的垂直式剪輯。使用者只需提供一個超過約 3 分鐘的影片或播客連結,或直接拖入本地檔案,即可獲得 3-5 個精選片段。技能會先對原始內容進行一次性語音辨識轉錄,然後在設定的時間長度內,以句子為單位自動生成所有潛在剪輯候選。每個候選剪輯會根據語速、音量、笑聲、提及的數字和名稱等多項特徵進行程式化評分,並將前 8 個不重疊的候選顯示在一個可互動的 HTML 網頁上,供使用者預覽和挑選。最後,針對使用者選中的每個剪輯,系統會獨立進行精確修剪、切割和風格化編輯,產出符合使用者個人化風格的成品。此技能支援 macOS、Linux 和 Windows 平台,需要 Python 環境並依賴 Whisper 或 Scribe 等轉錄引擎。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Conz-Wilts/ai-editor/tree/HEAD/.claude/skills/clips

在你喜歡的 AI 中提問

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

說明文件

Clips

路徑:${CLAUDE_SKILL_DIR} 代表此 SKILL.md 所在的資料夾,${CLAUDE_SKILL_DIR}/../.. 代表編輯器資料夾(此儲存庫的 .claude/),位於其上方兩層。

首先閱讀 ${CLAUDE_SKILL_DIR}/../../PRINCIPLES.md:每個影片都必須遵循的規則(提問、看起來真實、動態、故事與構圖、隱私、成本)。

每個對使用者的問題都必須使用問題框:呼叫 AskUserQuestion 工具(提供 2-4 個選項,建議選項排第一)。僅在當代理程式沒有該工具時,才以文字形式提出編號問題。

輸入一個長影片。輸出數個最佳的短片段,每個都是使用者風格的完整直式編輯成品。

clips/<name>/
  source.mp4          長影片(若是本機檔案則為符號連結;絕不修改原始檔)
  source.mp3, cover.jpg  若是純音訊 podcast,則為其音訊與節目的封面藝術
  words.raw.json      完整轉錄稿(絕對不要讀取)
  candidates.json     每個候選片段及其特徵(絕對不要讀取)
  shortlist.md        前 8 個不重疊的片段,約 1,500 個 token:唯一需要讀取的檔案
  shortlist.json      同上,供頁面使用
  picks.html          使用者挑選片段的頁面
edits/<name>-clip<N>/ 每個選擇的片段對應一個編輯:source.mp4、words.raw.json(重新對時)、clip.json

在 Mac 和 Linux 上使用 python3 執行腳本,在 Windows 上使用 py。 PY="${CLAUDE_SKILL_DIR}/../../lib/ai_editor/run.py";使用 python3 "$PY"(在 Windows 上使用 py "$PY")來執行編輯器的 venv Python。 如果缺少此檔案,請先執行 setup 技能。K="${CLAUDE_SKILL_DIR}/scripts/clips.py", C="${CLAUDE_SKILL_DIR}/../../skills/cut/scripts",S="${CLAUDE_SKILL_DIR}/../../skills/style-edit/scripts"。

0. 提問,一次

首先讀取設定檔與品味(python3 "${CLAUDE_SKILL_DIR}/../../lib/ai_editor/profile.py" show, python3 "${CLAUDE_SKILL_DIR}/../../skills/taste/scripts/taste.py" show)。如果還沒有設定檔:先執行 start 技能的風格輸入,這樣產出的片段才會符合使用者的風格。

然後進行一次問題框呼叫,建議選項排第一:

問題選項
要幾個片段?3(建議)/ 5 / 1
每個片段要多長?20-40 秒(建議)/ 40-60 秒 / 60-90 秒
影片中有幾個人說話?一人(建議)/ 兩人(podcast 或訪談)

跳過使用者已經回答的問題。這些問題替代了剪輯技能的「先剪輯還是全部一起處理」問題:片段會直接依序處理,使用者會核准挑選結果和靜態圖表單。

1. 影片

本機檔案(同一磁碟機上的硬連結,否則為符號連結,複製僅作為最後手段):

python3 "${CLAUDE_SKILL_DIR}/../../skills/clips/scripts/clips.py" link "<絕對路徑>" clips/<name>

連結:

python3 "${CLAUDE_SKILL_DIR}/../../lib/ai_editor/links.py" fetch "<網址>" clips/<name> --max-height 1080

它會使用 venv 的 yt-dlp(setup 會安裝在那裡,而非 PATH 上),將下載限制在 1080p(一個 1080x1920 的片段不需要 4K;一個 20 分鐘的 4K 演講影片會有好幾 GB)並列印檔案路徑: clips/<name>/source.mp4。退出碼 3:網站需要登入(YouTube 的「確認你不是機器人」)。先在問題框中詢問,然後使用 --cookies-from-browser chrome(或使用者的瀏覽器)重新執行。 Podcast(RSS 摘要或 Apple Podcasts 節目連結):route 會將其最新集數列為 ask 選項;在問題框中詢問要選擇哪一集(最新的優先),然後使用 fetch "<選項網址>" clips/<選項名稱> --direct --cover "<選項圖片>":音訊會存放為 source.mp3(或其原始副檔名),節目的封面藝術則存放為 cover.jpg。 僅下載使用者有權重複使用的內容:他們自己的影片,或他們獲得許可的影片。如果連結是其他人的內容,請說明一次。

2. 轉錄,一次

python3 "$PY" "$C/transcribe.py" clips/<name>/source.mp4 clips/<name>/words.raw.json   # fetch 列印的檔案:音訊請使用 source.mp3

先告知時間:Whisper 在筆記型電腦上需要每 3 分鐘的影片花費 1-4 分鐘(免費),Scribe 對於 13 分鐘的影片約需 20 秒。與剪輯技能使用相同的引擎。Scribe 會加入笑聲和其他音訊事件,這些會被分數使用。 每個片段都會重複使用此轉錄稿:不會轉錄兩次。

3. 候選片段與入圍名單

python3 "$K" candidates clips/<name> --min 20 --max 40 [--speakers 2] [--style creator-teardowns/<handle>/style.json]

傳入使用者選擇的長度。--style 是設定檔的第一個創作者:在那裡測量到的「有效手法」會列在入圍名單中。程式碼會將轉錄稿分割成句子,並將長度範圍內的每個連續完整句子組合(絕不從「嗯哼」開始或在中間結束)生成為候選片段,測量每個片段,根據特徵進行排序,並寫入 shortlist.md。

僅讀取 shortlist.md。每個條目包含鉤子、每個中間句子的開頭詞、最後一個句子以及測量到的特徵。根據四個問題判斷每個條目:鉤子是否能獨立運作、陌生人是否能理解、是否有回報、是否有具體的主張、數字或故事。

絕對不要讀取 words.raw.json 或 candidates.json。從入圍名單中挑選使用者數量的片段,最好的優先。無論分數高低,都刪除:

  • 廣告朗讀、贊助商段落、開場或結尾;
  • 依賴於前後文的鉤子(「如我所說」、「這就是為什麼」、「這個」);
  • 其重點是過時主張的片段(「在我錄製這段時,它是第 40 名」),而該主張後來已經改變:即時擷取當前頁面會與之矛盾。

4. 挑選頁面,然後是問題框

python3 "$K" page clips/<name> --recommend c12,c40,c7
open clips/<name>/picks.html    # Windows: start "" ...,Linux: xdg-open ...

一個頁面:每個入選的片段都有 360 px 的預覽、其轉錄稿(鉤子以粗體顯示)、分數細項以及測量到的特徵,你挑選的片段會標記出來。然後在問題框中提問(多選):你的挑選優先,每個都標有其時間和鉤子,加上一個「從頁面中挑選不同的」。等待回覆。

5. 每個選擇的片段

python3 "$K" trim clips/<name> c12 c40 c7          # -> edits/<name>-clip1, -clip2, -clip3

每個編輯資料夾都會取得 source.mp4(影格精確,已填充而不會截到下一個詞)和重新對時到該片段的 words.raw.json。純音訊來源(source.mp3)沒有畫面:trim 會為每個片段產生 source.mp4,使用 podcast 自己的封面(封面模糊並調暗以填滿 1080x1920,尖銳的封面位於字幕上方;如果沒有封面藝術則為黑色)作為背景的音訊,而 clip.json 會標示 audio_only。有封面時,渲染會將其移動:對封面進行緩慢推近、背景與之相對漂移、每個句子開頭進行小幅度縮放。對於這些,不要詢問佈局:覆疊、不重新構圖、無去背、字幕開啟(profile.py style 會保持開啟)。說明一次每個片段是音訊疊加在節目的封面上,並加上說話者的詞語作為字幕。在片段執行之前,為所有片段一次設定好音樂(style-edit references/plan.md「音樂」;風格決定,除非使用者設定了 sound.music)。

同時處理所有片段(Claude Code,或任何具有子代理程式的代理程式):為每個片段啟動一個 clip-editor 代理程式(clip-editor),全部放在同一則訊息中,這樣它們會同時執行。為每個代理程式提供 EDIT(片段的資料夾,絕對路徑)、ROOT(${CLAUDE_SKILL_DIR}/../..)、PY 行,以及答案:長寬比、佈局、音樂、轉錄引擎,以及是否重新構圖(是,適用於寬螢幕來源,除非平台是 YouTube)或否,以及來源是否有內嵌字幕。每個代理程式會將片段從剪輯和風格編輯一路處理到靜態圖表單,並返回一個簡短的 JSON:status、cut_s、verify、cut_page、sheet、error。合併這些結果;絕對不要打開片段的轉錄稿或紙上編輯。然後在所有 ready 片段的表單上同時執行 stills-critic 代理程式,同樣全部放在同一則訊息中,並修復它們失敗的部分(針對該片段重新規劃和靜態圖)。失敗的片段:手動執行,如下所述。

逐一處理(無子代理程式),按順序對每個片段:

  1. 從寬螢幕影片轉為直式: python3 "$PY" "$K" reframe edits/<name>-clip<N> 會裁切為 9:16,裁切會逐個鏡頭跟隨說話者的頭部(使用 ffmpeg 找到的相機剪輯點)。當設定檔的平台是 YouTube 或來源已經是直式時,跳過此步驟。
  2. 剪輯: 從剪輯技能的步驟 2(retakes.py propose)開始:轉錄稿已經存在。然後按照該技能的說明進行建置、渲染、驗證和剪輯頁面。語音下的音樂會按每個檔案測量:build_timeline.py 僅在單詞之間進行修剪。
  3. 風格: python3 "${CLAUDE_SKILL_DIR}/../../lib/ai_editor/profile.py" style edits/<name>-clip<N>,然後從風格編輯技能的步驟 2 開始。如果來源已經有內嵌字幕,請在該編輯的 style.json 中設定 "captions": {"present": false},否則字幕會疊加。

無論哪種方式,打開每個片段的 cut-check.html,同時顯示所有靜態圖表單以進行一次核准,一次詢問所有片段的渲染問題,然後進行渲染。核准後,執行 python3 "${CLAUDE_SKILL_DIR}/../../skills/cut/scripts/judge_cut.py" score 對每個片段的資料夾進行(剪輯 references/judge.md)。在一個審查頁面上交付所有渲染結果,每個片段一個分頁(start 從片段 1 開始,其餘使用 alt,資料夾 clips/<name>;請參閱 ${CLAUDE_SKILL_DIR}/../../skills/style-edit/references/review.md),然後在背景執行 serve 和 wait。

如果腳本停止

訊息處理方式
no run of whole sentences lasts <lo>-<hi> s在問題框中詢問更寬的長度,重新執行 candidates
no candidate <id>使用 shortlist.md 中的 ID
links.py fetch 退出碼 3(需要登入或「確認你不是機器人」)詢問後使用 --cookies-from-browser <browser> 重新執行
任何剪輯或風格編輯訊息該技能的「如果腳本停止」表格

規則

  1. 螢幕上的每個詞語、數字和名稱都來自該片段自己的詞語。不來自影片的其餘部分,也不包括說話者沒有說過的內容。
  2. 無 AI 痕跡外觀:${CLAUDE_SKILL_DIR}/../../skills/style-edit/references/ai-tells.md 適用於每個片段。
  3. 特寫 podcast 影格沒有多餘空間:沒有卡片或標誌放在頭部之上。較少的視覺效果是正確的;字幕和縮放來承載。
  4. 絕不將片段從句子中間截斷。比要求的短或長,勝過打斷思路。

每個長影片的成本

根據一個 13 分鐘的雙人 podcast 和一個 12 分鐘的 talking-head 影片測量(2026-10):

  • 轉錄:Scribe 耗時 16-18 秒;Whisper 免費但較慢。每個長影片一次。
  • 候選片段與特徵:程式碼耗時 4-6 秒,成本 $0。
  • Claude 讀取 shortlist.md(約 1,500 個 token),絕不讀取轉錄稿(約 20,000 個)。
  • 挑選頁面:為 8 個預覽進行 ffmpeg 處理耗時 30-40 秒,大小 7-9 MB。
  • 然後每個片段的成本等同於一次剪輯和一次風格編輯的成本。

自我檢查

python3 "$K" demo

檔案

  • scripts/clips.py:候選片段、頁面、修剪、重新構圖以及離線範例(合成轉錄稿)。僅使用標準函式庫,除了 reframe(透過 venv 使用 OpenCV)。
  • ${CLAUDE_SKILL_DIR}/../../agents/clip-editor.md:將一個片段從剪輯和風格編輯一路處理到其靜態圖表單。

Individual skills in this repo

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

Conz-Wilts/ai-editor

Reverse-engineers a short-form creator's video format from their real numbers. Pulls a TikTok or YouTube Shorts profile (or pasted links, Instagram reels too) with view, like and save counts, transcribes the top videos word for word, measures pace, pauses and fillers, maps each video into timed beats, and writes a teardown.md someone can film from, a teardown.html page of their graphics, motion and sound, and the style.json the style-edit skill edits from (on its own it can write an edit plan as a table and .srt). Use when the user wants to analyse, break down or study a creator ("analyse @handle", "tear down @handle", "teardown of @handle", "break down this creator", "what makes this creator's videos work"), pastes TikTok, YouTube or Instagram links and asks what the pattern is, or asks to set up creator-teardown. Not for editing the user's own video like a creator (that is start), not for researching a topic, and not for cutting raw footage.

Conz-Wilts/ai-editor

Cuts raw talking-head footage into a clean jump cut. Takes one take or several joined (mp4 or mov, any aspect, 4K phone footage is fine), transcribes it word by word, removes retakes, false starts, fillers and dead pauses, and renders cut.mp4 at the source resolution plus words.json timed to the cut. The user approves the cut on a page with the whole transcript and every removed word struck through. Use when the user says "cut my video", "just cut it", "remove my mistakes", "cut out the retakes", "remove the pauses", "clean up this take", "jump cut this", "tighten this clip", or asks only for the cut of a raw take; start calls it for a full edit. Runs before style-edit. Not for a general request to edit a video or to make it look like a creator (that is start), not for adding captions, zooms or cards (style-edit), and not for analysing someone else's videos (creator-teardown).

Conz-Wilts/ai-editor

Generates new footage with Higgsfield and puts it on the edit's timeline. Prices every generation first, asks the user with the dollar amount (and, for their own footage, whether it may be uploaded to Higgsfield), then submits, waits, downloads into the edit's generated/ folder and adds the result to the timeline's Generated track. Covers motion transfer on a clip of the user's video (their moves onto a character or styled look), b-roll from a sentence (text to video), a still brought to life (image to video) and stills for cards (text to image). Use when the user says "generate b-roll", "make a shot of", "AI b-roll", "generate a clip", "use Higgsfield", "motion transfer", "put my moves on", "restyle this part with AI", or asks for footage they did not film. Not for animated diagrams or motion graphics (motion), not for real screenshots and logos (overlays, logo-pack), and not for the cut (cut).

Conz-Wilts/ai-editor

For the editor's maintainers. Turns what users corrected into lasting fixes in this repo, for every user, enforced by code and tests rather than notes. Reads the suggestions users marked "would help everyone" (~/.ai-video-editor/suggestions.jsonl), taste rules said twice (taste.py report), preview corrections (edits/*/corrections.jsonl), review-page notes (*/review.json) and open GitHub issues labelled feedback; groups repeats; for each item the maintainer accepts, writes the general rule into PRINCIPLES.md and the skill that owns it, adds or tightens the check that enforces it, adds a test that fails before and passes after, and runs the full test set. Use when the maintainer says "improve the editor", "turn feedback into fixes", "process suggestions", "what are users complaining about", "go through the feedback issues". Not for one user's own preferences (that is taste), and not for editing a video.

相關技能