Skip to content

JimLiu/baocut / skills/baocut

baocut

Flagged

用 BaoCut 处理视频与音频:转录、字幕、翻译、配音、剪口播、切短视频、分章、总结写稿、从链接下载、压缩转码、导出成片,或从零做一条成片。有媒体文件、视频链接、字幕文件或 BaoCut 视频时用;只翻译纯文本、与视频无关的写作或作图、别的剪辑器与 FFmpeg 的用法、BaoCut 源码开发不用。

FileKindSize
SKILL.mdskill md46.5 KB
built-in-skills/README.mdmarkdown9.6 KB
references/catalog/editing.mdmarkdown24.4 KB
references/catalog/export.mdmarkdown6.6 KB
references/catalog/media.mdmarkdown45.1 KB
references/catalog/models.mdmarkdown7.9 KB
references/catalog/music.mdmarkdown17.1 KB
references/catalog/subtitles.mdmarkdown20.8 KB
references/catalog/system.mdmarkdown9.6 KB
references/catalog/voice-gemini-tts.mdmarkdown2.6 KB
references/catalog/voice-language-rates.mdmarkdown6.5 KB
references/catalog/voice.mdmarkdown12.3 KB
references/catalog/web.mdmarkdown10.9 KB
references/conventions.mdmarkdown16.1 KB
references/craft/.gitkeepother0 B
references/craft/README.mdmarkdown480 B
references/craft/character-animation.mdmarkdown6.8 KB
references/craft/character-animation/examples/mini-film/art.example.jsonconfig918 B
references/craft/character-animation/examples/mini-film/index.htmlother628 B
references/craft/character-animation/examples/mini-film/scene.jsscript2.1 KB
references/craft/character-animation/references/art.mdmarkdown4.6 KB
references/craft/character-animation/references/checks.mdmarkdown2.6 KB
references/craft/character-animation/references/rig.mdmarkdown5.3 KB
references/craft/character-animation/references/style-and-story.mdmarkdown5.0 KB
references/craft/character-animation/references/timing-and-sound.mdmarkdown3.1 KB
references/craft/character-animation/rig-kit/rig-kit.jsscript33.0 KB
references/craft/character-animation/scripts/cutout.mjsscript26.9 KB
references/craft/character-animation/scripts/jump-scan.mjsscript3.2 KB
references/craft/character-animation/scripts/place-sfx.mjsscript5.1 KB
references/craft/character-animation/scripts/rig-check.mjsscript8.9 KB
references/craft/clip-montage.mdmarkdown11.5 KB
references/craft/clip-montage/references/assembly.mdmarkdown5.0 KB
references/craft/clip-montage/references/sourcing.mdmarkdown6.3 KB
references/craft/clip-montage/references/structure.mdmarkdown3.8 KB
references/craft/cover-and-title.mdmarkdown5.6 KB
references/craft/cross-video-qa.mdmarkdown5.8 KB
references/craft/design-system.mdmarkdown18.5 KB
references/craft/design-system/references/cover.mdmarkdown6.9 KB
references/craft/design-system/references/craft.mdmarkdown8.8 KB
references/craft/design-system/references/demo.jsonconfig161.1 KB
references/craft/design-system/references/format.mdmarkdown18.6 KB
references/craft/design-system/references/from-code.mdmarkdown11.5 KB
references/craft/design-system/references/from-design-tool.mdmarkdown16.2 KB
references/craft/design-system/references/sample-seazar-tokens.jsonconfig11.0 KB
references/craft/design.mdmarkdown19.3 KB
references/craft/design/references/brand-colors.mdmarkdown2.4 KB
references/craft/design/references/brand-typography.mdmarkdown1.7 KB
references/craft/design/references/craft.mdmarkdown15.4 KB
references/craft/design/references/design-system-components.mdmarkdown11.8 KB
references/craft/design/references/diagrams.mdmarkdown10.1 KB
references/craft/design/references/format.mdmarkdown11.8 KB
references/craft/design/references/print.mdmarkdown5.6 KB
references/craft/design/references/questions.mdmarkdown4.7 KB
references/craft/design/references/view-state.mdmarkdown5.7 KB
references/craft/docs.mdmarkdown19.9 KB
references/craft/docs/references/comments.mdmarkdown4.4 KB
references/craft/docs/references/editing.mdmarkdown12.9 KB
references/craft/docs/references/tabs.mdmarkdown4.7 KB
references/craft/docs/references/uploads.mdmarkdown1.7 KB
references/craft/explainer-video.mdmarkdown23.4 KB
references/craft/explainer-video/references/3d.mdmarkdown5.9 KB
references/craft/explainer-video/references/footage.mdmarkdown9.6 KB
references/craft/explainer-video/references/length-and-pace.mdmarkdown6.7 KB
references/craft/explainer-video/references/script.mdmarkdown14.7 KB
references/craft/explainer-video/references/subject.mdmarkdown12.5 KB
references/craft/history-video.mdmarkdown20.6 KB
references/craft/history-video/references/brief.mdmarkdown5.1 KB
references/craft/history-video/references/forms.mdmarkdown11.2 KB
references/craft/history-video/references/old-recordings.mdmarkdown12.4 KB
references/craft/history-video/references/self-check.mdmarkdown5.3 KB
references/craft/history-video/references/sources.mdmarkdown5.9 KB
references/craft/motion-graphics.mdmarkdown17.3 KB
references/craft/motion-graphics/exemplars/big-number/16x9.htmlother11.4 KB
references/craft/motion-graphics/exemplars/big-number/9x16.htmlother11.5 KB
references/craft/motion-graphics/exemplars/callout-pin/16x9.htmlother11.6 KB
references/craft/motion-graphics/exemplars/callout-pin/9x16.htmlother11.6 KB
references/craft/motion-graphics/exemplars/keyword-caption/16x9.htmlother11.3 KB
references/craft/motion-graphics/exemplars/keyword-caption/9x16.htmlother11.3 KB
references/craft/motion-graphics/exemplars/logo-sting/16x9.htmlother12.1 KB
references/craft/motion-graphics/exemplars/logo-sting/9x16.htmlother12.1 KB
references/craft/motion-graphics/exemplars/lower-third/16x9.htmlother11.2 KB
references/craft/motion-graphics/exemplars/lower-third/9x16.htmlother11.2 KB
references/craft/motion-graphics/references/audio-backdrop.mdmarkdown22.9 KB
references/craft/motion-graphics/references/grammar.mdmarkdown11.1 KB
references/craft/motion-graphics/scaffold.htmlother9.0 KB
references/craft/motion-graphics/scripts/build-bundle.mjsscript25.2 KB
references/craft/narration.mdmarkdown11.1 KB
references/craft/polish-transcript.mdmarkdown13.8 KB
references/craft/production-scripts.mdmarkdown15.7 KB
references/craft/production-scripts/references/pipeline.mdmarkdown37.8 KB
references/craft/production-scripts/scene-kit/geo110.jsscript27.3 KB
references/craft/production-scripts/scene-kit/scene-kit.jsscript38.3 KB
references/craft/production-scripts/scripts/align.mjsscript11.6 KB
references/craft/production-scripts/scripts/assemble.mjsscript26.4 KB
references/craft/production-scripts/scripts/build.mjsscript18.1 KB
references/craft/production-scripts/scripts/captions.mjsscript18.6 KB
references/craft/production-scripts/scripts/clips.example.jsonconfig3.2 KB
references/craft/production-scripts/scripts/coverage.mjsscript10.0 KB
references/craft/production-scripts/scripts/envelope.mjsscript2.9 KB
references/craft/production-scripts/scripts/explainer.example.jsonconfig2.2 KB
references/craft/production-scripts/scripts/fonts.mjsscript7.0 KB
references/craft/production-scripts/scripts/frames.mjsscript7.7 KB
references/craft/production-scripts/scripts/gaps.mjsscript11.3 KB
references/craft/production-scripts/scripts/host.mjsscript14.8 KB
references/craft/production-scripts/scripts/legibility.mjsscript5.7 KB
references/craft/production-scripts/scripts/level.mjsscript9.2 KB
references/craft/production-scripts/scripts/lib.mjsscript19.3 KB
references/craft/production-scripts/scripts/overlay.mjsscript34.7 KB
references/craft/production-scripts/scripts/preview.mjsscript4.6 KB
references/craft/production-scripts/scripts/quotes.mjsscript7.4 KB
references/craft/production-scripts/scripts/sources.mjsscript6.2 KB
references/craft/production-scripts/scripts/srt.mjsscript5.8 KB
references/craft/production-scripts/scripts/voice.mjsscript7.7 KB
references/craft/shorts-segments.mdmarkdown30.8 KB
references/craft/slides.mdmarkdown13.8 KB
references/craft/slides/references/design-system.mdmarkdown6.3 KB
references/craft/slides/references/design.mdmarkdown9.3 KB
references/craft/slides/references/format.mdmarkdown12.2 KB
references/craft/slides/references/images.mdmarkdown4.2 KB
references/craft/speaker-labeling.mdmarkdown6.6 KB
references/craft/subtitle-workflow.mdmarkdown13.1 KB
references/craft/talking-head-cut.mdmarkdown9.3 KB
references/craft/talking-head-cut/references/picture-and-sound.mdmarkdown10.1 KB
references/craft/titles-and-description.mdmarkdown5.2 KB
references/craft/titles-and-description/references/description.mdmarkdown5.1 KB
references/craft/titles-and-description/references/titles.mdmarkdown5.5 KB
references/craft/titles-and-description/references/writing-baseline.mdmarkdown11.9 KB
references/craft/translate-subtitles.mdmarkdown13.4 KB
references/craft/video-blog.mdmarkdown17.1 KB
references/craft/video-blog/references/writing-baseline.mdmarkdown11.9 KB
references/craft/video-chapters.mdmarkdown9.7 KB
references/craft/video-production.mdmarkdown31.9 KB
references/craft/video-production/examples/bundle-preview.htmlother17.7 KB
references/craft/video-production/examples/post-fx.jsscript7.5 KB
references/craft/video-production/references/code-scenes.mdmarkdown31.9 KB
references/craft/video-production/references/shot-plan.mdmarkdown5.1 KB
references/craft/video-production/references/sound-design.mdmarkdown4.4 KB
references/craft/video-production/references/visuals.mdmarkdown19.7 KB
references/craft/video-summary.mdmarkdown22.8 KB
references/craft/video-summary/references/writing-baseline.mdmarkdown11.9 KB
references/craft/virtual-host.mdmarkdown14.9 KB
references/craft/virtual-host/examples/character-partmap.example.jsonconfig600 B
references/craft/virtual-host/examples/character.example.jsonconfig336 B
references/craft/virtual-host/references/art.mdmarkdown22.1 KB
references/craft/virtual-host/references/hosts.mdmarkdown4.4 KB
references/craft/virtual-host/references/lipsync.mdmarkdown10.1 KB
references/craft/virtual-host/scripts/lipsync.mjsscript39.8 KB
references/craft/virtual-host/scripts/pinyin-table.mjsscript83.2 KB
references/craft/virtual-host/scripts/puppet-build.mjsscript48.6 KB
references/craft/virtual-host/scripts/puppet-mask.mjsscript3.0 KB
references/craft/virtual-host/scripts/puppet/align.mjsscript4.1 KB
references/craft/virtual-host/scripts/puppet/brows.mjsscript17.2 KB
references/craft/virtual-host/scripts/puppet/edits.mjsscript4.3 KB
references/craft/virtual-host/scripts/puppet/expression-labels.jsonconfig1.1 KB
references/craft/virtual-host/scripts/puppet/expreyes.mjsscript35.9 KB
references/craft/virtual-host/scripts/puppet/eyes.mjsscript8.6 KB
references/craft/virtual-host/scripts/puppet/fill.mjsscript10.5 KB
references/craft/virtual-host/scripts/puppet/layers.mjsscript5.7 KB
references/craft/virtual-host/scripts/puppet/mapbuild.mjsscript50.4 KB
references/craft/virtual-host/scripts/puppet/ops.mjsscript7.4 KB
references/craft/virtual-host/scripts/puppet/pack.mjsscript10.2 KB
references/craft/virtual-host/scripts/puppet/partmap.mjsscript8.5 KB
references/craft/virtual-host/scripts/puppet/parts.mjsscript7.0 KB
references/craft/virtual-host/scripts/puppet/png.mjsscript5.8 KB
references/craft/virtual-host/scripts/puppet/seg.mjsscript21.6 KB
references/craft/virtual-host/scripts/puppet/segment.mjsscript26.6 KB
references/craft/virtual-host/scripts/puppet/zip.mjsscript2.0 KB
references/craft/virtual-host/scripts/visemes.mjsscript21.4 KB
references/craft/vlog-from-clips.mdmarkdown13.2 KB
references/craft/vlog-from-clips/references/footage-log.mdmarkdown3.3 KB
references/mcp.mdmarkdown8.9 KB
references/start.mdmarkdown6.3 KB
references/workflows.mdmarkdown29.8 KB

references/craft/production-scripts/scripts/gaps.mjs

View on GitHub
#!/usr/bin/env node
// i18n-ignore-file: 给智能体拷走用的独立脚本,日志与报错写英文
// 配音之后改旁白里的空白,两件事,可以只做一件:
// 1. 留白:让带原声的实拍片段(当事人原话、现场声音)单独放。clips.json 里 gap 为 true 的片段,
//    在 seg 段第 line 句(从 0 数;等于句数时放在段尾)之前插一段静音,长度 = 片段长 + pad,后面的句子整体往后挪。
//    几个留白片段给同一个 line 时,按 clips.json 里的先后背靠背连着放(中间不插旁白,也不回到代码画面),共用一段静音。
// 2. 压停顿:给了 voice.maxPause(或 --max-pause 秒数)时,句与句之间长于它的静音压到这么长(前后各留一半),
//    句内的停顿(逗号)不动,留白的那个接缝不压。固定口播的段(fixedLines)不压。
// 3. 停一拍:旁白稿里单独一行 `@beat`(或 `@beat 0.6`,秒,缺省 0.6)写在哪两句之间,那里的静音就调到这么长:
//    长了压到这么长,短了在静音中间补上,不随 maxPause 一起压。揭晓、让观众先猜之前用;同一处有留白片段时以留白为准。
//   node tools/gaps.mjs [id …] [--max-pause 0.3]   不给 id 就处理有留白片段的段、要压停顿或停一拍的段,以及以前处理过、现在要还原的段
// 输入是 voice.mjs 的配音与 align.mjs 的 timing/<id>.json;第一次处理时把它们存成 timing/<id>.voice.json,之后都从这份算,可以反复跑。
// 输出:audio/<id>.gaps.<格式>(改好空白的旁白),timing/<id>.json 改成挪过的时间,并带上
//   gaps: [{ clip, line, at, dur }](at 是片段在段内的起点)、tightened: [{ line, at, cut }](压掉的静音)、
//   beats: [{ line, at, pause, was }](停一拍:第 line 句之前的静音从 was 秒调到 pause 秒,at 是静音的起点)与 gapAudio(上面那个文件,预览页与 assemble.mjs 用它)。
//   三件事都不用做的段还原成原始对齐。重新配音、重新对齐之后要再跑一次。
import fs from 'node:fs';
import { execFileSync } from 'node:child_process';
import { loadConfig, parseArgs, readJson, writeJson, scriptBeats } from './lib.mjs';

const cfg = loadConfig();
const { ids, flags } = parseArgs(process.argv, ['max-pause']);
const cl = readJson(cfg.abs(cfg.footage?.clips || 'clips.json'), { clips: [] });
const voice = readJson(cfg.abs(cfg.dirs.audio, 'voice.json'), {});
const PAD_BEFORE = 0.25, PAD_AFTER = 0.35;   // 上一句说完停一下再进片段(用原音频里本来的停顿);片段完了停一下再接旁白
const maxPause = flags['max-pause'] != null ? +flags['max-pause'] : cfg.voice.maxPause ?? 0;
if (!(maxPause >= 0)) throw new Error(`max pause must be a number of seconds, got ${flags['max-pause'] ?? cfg.voice.maxPause}`);
const RATE = 16000, WIN = 0.01, SILENT = 0.012;   // 检测静音:16 kHz 单声道,10 ms 一个窗口,RMS 低于约 -38 dBFS 算静音
const bySeg = {};
for (const c of cl.clips) if (c.gap) (bySeg[c.seg] ||= []).push(c);
const tighten = id => maxPause > 0 && !cfg.fixedLines[id];
const beats = fs.existsSync(cfg.abs(cfg.script.path)) ? scriptBeats(cfg) : {};
const beatsOf = id => beats[id] || {};
const hasBeats = id => Object.keys(beatsOf(id)).length > 0;
const timingOf = id => readJson(cfg.abs(cfg.dirs.timing, `${id}.json`));
const todo = ids.length ? ids : cfg.order.filter(id => bySeg[id] || ((tighten(id) || hasBeats(id)) && timingOf(id)) || timingOf(id)?.gapAudio);
if (!todo.length) { console.log('no clips with gap: true, no voice.maxPause and no @beat; nothing to do'); process.exit(0); }

// 每 10 ms 一个窗口是不是静音
function quietWindows(file) {
  const pcm = execFileSync('ffmpeg', ['-v', 'error', '-i', file, '-ac', '1', '-ar', String(RATE), '-f', 's16le', '-'], { maxBuffer: 1 << 30 });
  const n = pcm.length >> 1, win = Math.round(WIN * RATE), out = [];
  for (let s = 0; s < n; s += win) {
    let acc = 0, k = 0;
    for (let j = s; j < Math.min(n, s + win); j++, k++) { const v = pcm.readInt16LE(j * 2) / 32768; acc += v * v; }
    out.push(Math.sqrt(acc / k) < SILENT);
  }
  return out;
}

for (const id of todo) {
  const tf = cfg.abs(cfg.dirs.timing, `${id}.json`), rawTf = cfg.abs(cfg.dirs.timing, `${id}.voice.json`);
  const cur = readJson(tf);
  if (!cur) throw new Error(`timing/${id}.json missing; run align.mjs ${id}`);
  if (!cur.gapAudio) writeJson(rawTf, cur);   // fresh from align.mjs: this is the raw timing
  const raw = readJson(rawTf);
  const audioRel = voice[id]?.file || `${cfg.dirs.audio}/${id}.${cfg.voice.format || 'wav'}`;
  const clips = (bySeg[id] || []).slice().sort((a, b) => a.line - b.line);
  if (!clips.length && !tighten(id) && !hasBeats(id)) { writeJson(tf, raw); console.log(`${id}: no gap clips, pause limit or beats, timing restored`); continue; }
  const n = raw.lines.length;
  // 留白:插在原音频的哪一刻、插多长
  const groups = [];
  for (const c of clips) {
    if (!(c.line >= 0 && c.line <= n)) throw new Error(`${c.id}: line ${c.line} out of range (segment has ${n} lines)`);
    const g = groups.at(-1);
    if (g && g.c.line === c.line) g.all.push(c); else groups.push({ c, all: [c] });
  }
  const inserts = groups.map(({ c, all }) => {
    const prevEnd = c.line > 0 ? raw.lines[c.line - 1].end : 0, next = c.line < n ? raw.lines[c.line].start : raw.audio;
    const p = c.line === 0 ? 0 : Math.min(prevEnd + PAD_BEFORE, next);
    return { line: c.line, all, p, dur: +(all.reduce((s, x) => s + x.to - x.from, 0) + PAD_AFTER).toFixed(3) };
  });
  // 压停顿与停一拍:第 i 句与第 i + 1 句之间最长的一段静音(对齐的句首句尾不一定准,前后各放宽一点找),
  // 有 @beat 的调到拍子的长度(长了压、短了在中间补静音),其余长于 maxPause 的压到 maxPause
  const cuts = [], pads = [], beatLog = [];
  const want = beatsOf(id);
  for (const k of Object.keys(want).map(Number)) {
    if (k < 1 || k >= n) console.warn(`${id}: @beat before line ${k} ignored: a beat sits between two lines (segment has ${n}; use hold to stay longer at the end)`);
    else if (inserts.some(x => x.line === k)) console.warn(`${id}: @beat before line ${k} ignored: a gap clip already opens a pause there`);
  }
  if (tighten(id) || hasBeats(id)) {
    const quiet = quietWindows(cfg.abs(audioRel));
    for (let i = 0; i + 1 < n; i++) {
      if (inserts.some(k => k.line === i + 1)) continue;
      const beat = want[i + 1];
      if (beat === undefined && !tighten(id)) continue;
      const a = Math.max(0, Math.floor((raw.lines[i].end - 0.3) / WIN)), b = Math.ceil((raw.lines[i + 1].start + 0.25) / WIN);
      let best = null, run = null;
      for (let w = a; w <= b && w < quiet.length; w++) {
        if (!quiet[w]) { run = null; continue; }
        run = run ? [run[0], w + 1] : [w, w + 1];
        if (!best || run[1] - run[0] > best[1] - best[0]) best = run;
      }
      const len = best ? (best[1] - best[0]) * WIN : 0, limit = beat ?? maxPause;
      if (len > limit + 0.02) cuts.push({ line: i + 1, from: +(best[0] * WIN + limit / 2).toFixed(3), to: +(best[1] * WIN - limit / 2).toFixed(3) });
      else if (beat !== undefined && len < beat - 0.02) {
        const p = best ? (best[0] + best[1]) / 2 * WIN : (raw.lines[i].end + raw.lines[i + 1].start) / 2;
        pads.push({ line: i + 1, p: +p.toFixed(3), dur: +(beat - len).toFixed(3) });
      }
      if (beat !== undefined) beatLog.push({ line: i + 1, from: best ? best[0] * WIN : raw.lines[i].end, pause: beat, was: +len.toFixed(2) });
    }
  }
  // 时间换算:压掉的那段里的时刻落到它的起点;第 i 句及之后加上它前面插的留白与补的拍子(按句号算,不按时刻,句尾正好碰到插入点时不会挪错)
  const cutBefore = t => cuts.reduce((s, c) => s + (t >= c.to ? c.to - c.from : t > c.from ? t - c.from : 0), 0);
  const addBefore = i => [...inserts, ...pads].reduce((s, k) => s + (i >= k.line ? k.dur : 0), 0);
  const map = (t, i) => +(t - cutBefore(t) + addBefore(i)).toFixed(3);
  const lines = raw.lines.map((l, i) => ({ ...l, start: map(l.start, i), end: map(l.end, i), chars: l.chars?.map(x => map(x, i)) }));
  let before = 0;
  const gaps = inserts.flatMap(k => {
    let off = 0;
    const base = k.p - cutBefore(k.p) + before + pads.reduce((s, x) => s + (x.line < k.line ? x.dur : 0), 0);
    const out = k.all.map((x, i) => {
      const len = x.to - x.from, g = { clip: x.id, line: x.line, at: +(base + off).toFixed(3), dur: +(len + (i === k.all.length - 1 ? PAD_AFTER : 0)).toFixed(3) };
      off += len;
      return g;
    });
    before += k.dur;
    return out;
  });
  const added = [...inserts, ...pads].reduce((s, k) => s + k.dur, 0), removed = cuts.reduce((s, c) => s + c.to - c.from, 0);
  // 音频:按原音频的时刻依次拼原段、静音,跳过压掉的部分
  const info = execFileSync('ffprobe', ['-v', 'error', '-select_streams', 'a:0', '-show_entries', 'stream=sample_rate,channels', '-of', 'csv=p=0', cfg.abs(audioRel)], { encoding: 'utf8' }).trim().split(',');
  const [sr, ch] = [+info[0], +info[1]];
  const ops = [...[...inserts, ...pads].map(k => ({ at: k.p, add: k.dur })), ...cuts.map(c => ({ at: c.from, skipTo: c.to }))].sort((x, y) => x.at - y.at);
  const parts = [], labels = [];
  let from = 0;
  ops.forEach((o, i) => {
    if (o.at > from) { parts.push(`[0:a]atrim=${from}:${o.at},asetpts=PTS-STARTPTS[a${i}]`); labels.push(`[a${i}]`); }
    if (o.add) { parts.push(`anullsrc=r=${sr}:cl=${ch === 1 ? 'mono' : 'stereo'},atrim=0:${o.add}[s${i}]`); labels.push(`[s${i}]`); from = Math.max(from, o.at); }
    else from = o.skipTo;
  });
  parts.push(`[0:a]atrim=${from},asetpts=PTS-STARTPTS[z]`); labels.push('[z]');
  const outRel = `${cfg.dirs.audio}/${id}.gaps.${cfg.voice.format || 'wav'}`;
  execFileSync('ffmpeg', ['-y', '-v', 'error', '-i', cfg.abs(audioRel), '-filter_complex', `${parts.join(';')};${labels.join('')}concat=n=${labels.length}:v=0:a=1[o]`, '-map', '[o]', cfg.abs(outRel)]);
  const dur = Math.ceil((raw.dur + added - removed) * cfg.fps) / cfg.fps;
  const tightened = cuts.map(c => ({ line: c.line, at: +(c.from - cutBefore(c.from) + addBefore(c.line)).toFixed(3), cut: +(c.to - c.from).toFixed(3) }));
  const beatsOut = beatLog.map(x => ({ line: x.line, at: +(x.from - cutBefore(x.from) + addBefore(x.line - 1)).toFixed(3), pause: x.pause, was: x.was }));
  writeJson(tf, { ...raw, dur, audio: +(raw.audio + added - removed).toFixed(3), lines, ...(gaps.length ? { gaps } : {}), ...(tightened.length ? { tightened } : {}), ...(beatsOut.length ? { beats: beatsOut } : {}), gapAudio: outRel });
  const pauses = lines.slice(1).filter((l, i) => !inserts.some(k => k.line === i + 1) && want[i + 1] === undefined).map(l => l.start - lines[lines.indexOf(l) - 1].end), longest = pauses.length ? Math.max(...pauses) : 0;
  console.log(`${id}: ${gaps.map(g => `${g.clip} @${g.at.toFixed(2)} +${g.dur.toFixed(2)}`).join(', ') || 'no gap clips'}` +
    `${cuts.length ? `  pauses -${removed.toFixed(2)}s in ${cuts.length} cuts` : ''}` +
    `${beatsOut.length ? `  beats ${beatsOut.map(x => `before line ${x.line} ${x.was.toFixed(2)}→${x.pause.toFixed(2)}s`).join(', ')}` : ''}  → ${dur.toFixed(2)}s (raw ${raw.dur.toFixed(2)}s)` +
    `${tighten(id) && longest > maxPause + 0.5 ? `  longest pause between aligned lines ${longest.toFixed(2)}s (no silence found there)` : ''}`);
}
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall