qiaomu-cut
Verified把一句话需求转成可复现、可验收视频工程的乔木智能剪辑导演。Use when the user asks to create, plan, edit, remix, explain, narrate, subtitle, animate, composite, or render a video—including one-line requests such as “制作一个科普视频:介绍 LLM 中的 RL”. Builds English-learning movie mixes, person profiles, explainers, code-drawn motion graphics (UI morph loops, showreels, kinetic-type promos, line-art/pixel/Three.js animation, lyric MVs), product launch videos, cinematic shorts, social clips, course/PPT videos, AI image/video/TTS/music-assisted stories, stock-footage stories, or multi-source montage. Routes across 33台词, ClipSeek/open media, local files, ListenHub, image generation, HTML/SVG/Canvas motion graphics with beat-grid storyboards and determinism probes, Manim, ffmpeg-full, captions, sound design, frame-0 video covers with YouTube thumbnails, and release checks.
scripts/complete_sentence.js
View on GitHub#!/usr/bin/env node
'use strict';
const TERMINAL = /[.!?。!?][”’"']?\s*$/;
const DANGLING = /(?:\b(?:and|but|because|so|if|when|that|to)|[,;:,;:—-])\s*$/i;
const LEADING_PUNCTUATION = /^(?:\.{2,}|…|[,;:,;:—-])/;
function cueText(cue) {
return String((cue && (cue.text ?? cue.content)) || '').trim();
}
function leadingFragment(cue) {
const text = cueText(cue).replace(/^[“”"'‘’\s]+/, '');
if (!text) return true;
// Subtitle providers commonly preserve lowercase when a cue starts inside a
// sentence. This caught real paid-cut failures such as "that says...",
// "when we do it again" and "taking a shower..." before remote creation.
return LEADING_PUNCTUATION.test(text) || /^[a-z]/.test(text);
}
function cueSequence(hit) {
const before = Array.isArray(hit.before) ? hit.before : [];
const after = Array.isArray(hit.after) ? hit.after : [];
const cues = [...before];
if (hit.previous) cues.push(hit.previous);
const currentIndex = cues.length;
cues.push(hit.current || hit);
if (hit.next) cues.push(hit.next);
cues.push(...after);
return { cues: cues.filter(Boolean), currentIndex };
}
function completeRange(hit, options = {}) {
const cues = [hit.previous, hit.current || hit, hit.next].filter(Boolean);
const currentIndex = hit.previous ? 1 : 0;
let first = currentIndex, last = currentIndex;
while (first > 0 && !TERMINAL.test(cueText(cues[first - 1]))) first--;
while (last < cues.length - 1 && (!TERMINAL.test(cueText(cues[last])) || DANGLING.test(cueText(cues[last])))) last++;
const startPad = Number(options.startPad ?? 0.45);
const endPad = Number(options.endPad ?? 0.75);
return { in: Math.max(0, Number(cues[first].start) - startPad), out: Number(cues[last].end) + endPad, cueStart: first, cueEnd: last, complete: TERMINAL.test(cueText(cues[last])) && !DANGLING.test(cueText(cues[last])) };
}
function completeContextRange(hit, options = {}) {
const { cues, currentIndex } = cueSequence(hit);
const contextBefore = Math.max(0, Math.round(Number(options.contextBefore ?? 1)));
const contextAfter = Math.max(0, Math.round(Number(options.contextAfter ?? 0)));
let first = Math.max(0, currentIndex - contextBefore);
let last = Math.min(cues.length - 1, currentIndex + contextAfter);
while (first > 0 && leadingFragment(cues[first])) first--;
while (last < cues.length - 1 && (!TERMINAL.test(cueText(cues[last])) || DANGLING.test(cueText(cues[last])))) last++;
const selectedContext = first < currentIndex;
const needsMoreBefore = selectedContext && first === 0 && leadingFragment(cues[first]);
const needsMoreAfter = !TERMINAL.test(cueText(cues[last])) || DANGLING.test(cueText(cues[last]));
const startPad = Number(options.startPad ?? 0.45);
const endPad = Number(options.endPad ?? 0.75);
return {
in: Math.max(0, Number(cues[first].start) - startPad),
out: Number(cues[last].end) + endPad,
cueStart: first,
cueEnd: last,
complete: !needsMoreBefore && !needsMoreAfter,
needsMoreBefore,
needsMoreAfter,
selectedText: cues.slice(first, last + 1).map(cueText)
};
}
function assertComplete(hit, options) {
const range = completeRange(hit, options);
if (!range.complete) throw new Error('No complete sentence boundary found; fetch more subtitle context or use ASR/manual listening before render.');
return range;
}
function assertCompleteContext(hit, options) {
const range = completeContextRange(hit, options);
if (range.needsMoreBefore) {
throw new Error('Selected setup cue begins inside a sentence; fetch more subtitle context before creating a paid cut task.');
}
if (range.needsMoreAfter) {
throw new Error('No complete sentence ending found; fetch more subtitle context or use ASR/manual listening before creating a paid cut task.');
}
return range;
}
module.exports = { completeRange, completeContextRange, assertComplete, assertCompleteContext, leadingFragment };
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |