40 perso-ai
clip Skill
把视频切成短视频片段(高光/shorts)——可直接按给定时间码剪切,或从 Perso AI STT 项目中挑选最佳时刻。支持 16:9→9:16 画面重构。字幕由 srt skill 单独添加。
安装方式:把技能目录放入 ~/.claude/skills/(Claude Code)或在 claude.ai 设置中启用;也可复制右侧安装命令一键添加。
技能指令原文(SKILL.md)
/clip
Cut a video into short clips + reframe. Subtitles are not this skill's job — after cutting, the srt skill styles them (see the handoff below).
Entry points
- Explicit timecodes ("cut 2:00–3:00 of this video") → cut the local file directly:
--video "" --ranges "2:00-3:00,...". No STT, no key, no credits. - AI highlight selection on an STT project →
--planthen--clips(the flow below). Needs the project's transcript + word timestamps. - Raw video, "find the good moments" (no timecodes given) → you can't pick highlights without a transcript, so ask the user which they want:
- STT (proper selection, uses credits): run the
srtskill's STT first to create the project, then clip it with--plan/--clips. - Free (no STT): the user gives the timecodes and you cut them with
--video --ranges.
Proceed with their choice — don't run STT (which bills credits) without asking.
Core rules
- Only the worker sees the raw key — never open, echo, or pass it as an argument.
- The key gate applies only to
--project/--plan/--clips.--video --rangesand--sidecarsare fully offline — never run a key check/registration for them. - Run in the background — encoding takes time.
- This skill shares the dubbing skill's libraries: the
dubbingfolder must be installed next toclip.
Flow
Phase 1 — plan. node scripts/clip.mjs --project --plan prints the summary's section map (topic guide) plus the full sentence transcript, each line as order [start-end] text.
Phase 2 — pick, then cut. Read the transcript and choose clips, each { "title": "...", "start_order": N, "end_order": M }. Rubric:
- Hook first — start on a sentence that grabs attention (question, bold claim, funny/surprising line).
- End where the moment resolves, not at the first complete sentence. Ride the beat to its end — the whole reaction, follow-through, and any secondary punchline. Read a few sentences past the apparent ending; keep them if still the same reaction.
- Cut at the transition — end just before the energy drops or the tone shifts (excited reaction → calm narration).
- Peak — favour funny / surprising / emotional / quotable moments; the high point often sits a sentence or two after the literal reveal.
- Length 30–90s — the worker warns when outside; prefer the full arc over a premature cut.
- Title — describes the moment; becomes the file name (
01_.mp4</code>).</li> </ul> <p> Sections are chapter-length — use the section map only as a guide, then tighten to a hook. </p> <p> Run: <code>node scripts/clip.mjs --project <seq> --clips '<json>' [--out folder]</code> (<code>--clips</code> also accepts <code>@path</code>). Landscape (16:9) sources are reframed to 9:16 (drama-shorts letterbox); portrait sources are kept. The worker writes the clips plus a <code>clips.json</code> manifest (records each clip + the transcript slice needed for subtitles later). Relay <code>[progress]</code>; deliver the files from <code>[clips-output]</code>. </p> <h2>Subtitles → hand off to the srt skill</h2> <p> Subtitles are off by default. After cutting, tell the user clips are ready and <strong>ask whether to add subtitles</strong>. If they want subtitles, <strong>show the presets first — never jump straight to one</strong>, exactly as the srt skill's styling flow does: the interactive <strong>gallery</strong> (select + Apply) in the Claude app, or the static <code>../srt/assets/style_presets.png</code> + <code>node ../srt/scripts/style.mjs --list-presets</code> menu elsewhere. Let the user pick a preset or describe a style (short-form presets like <code>karaoke</code>/<code>bold-punch</code> suit clips). Only after they pick: </p> <ol> <li>Write the sidecars: <code>node scripts/clip.mjs --sidecars "<out>/clips.json"</code> — add <code>--karaoke</code> <strong>only</strong> for a karaoke preset (it also writes <code><clip>.timestamps.json</code> for measured word timing; a plain preset needs just the <code>.srt</code>).</li> <li>Style each clip with the <strong>srt</strong> skill: <code>node ../srt/scripts/style.mjs "<clip>.mp4" "<clip>.srt" --preset <id></code> (append <code>--word-timestamps "<clip>.timestamps.json"</code> for karaoke). See the srt skill's "Style & burn subtitles" section.</li> </ol> <p> Add <code>--host <runtime></code> for telemetry (silent), same as the other workers. </p> <h2>Config (env)</h2> <p> Same as <code>/dubbing</code> / <code>/srt</code> (<code>PERSO_API_BASE</code>/<code>PERSO_MEDIA_BASE</code> — https <code>perso.ai</code> hosts only, <code>PERSO_SPACE_SEQ</code>, <code>XP_API_KEY</code>, <code>PERSO_NO_TELEMETRY</code>, …). </p>