Skip to content

andyhuo520/vibe-knowledge / skills/ai-teardown

ai-teardown

Unverified

「AI 拆机课」系列课工作室:输入一个主题(AI 产品、开源项目/书、人物历史、软件教程),产出由浅入深、每句话有出处的中文讲解视频系列 + 每节互动版 + 课程总页。流水线:收集资料 → 确认对象与课时 → 大纲 → 逐节旁白(MiMo 克隆音色 + 逐字对齐)→ scenes.json 画面编排(Notion 极简手绘引擎 / 马卡龙模板引擎,IconPark 图标与插画、Noto 动态 emoji、AntV X6 流程图、像素讲解小人、截图圈注、终端录屏)或 film.js 代码成片(cine 引擎:Three.js、粒子、着色器、真片段叠加、曲库配乐)→ Hyperframes / 无头 GPU 逐帧 1080p 渲染 → Artifact 发布 → 课程总页 + 导学视频。触发:做系列课 / 做课程视频 / 把某本书或某个开源项目做成课 / 科普讲解视频 / 教学视频 / 课程地图 / 导学视频 / 互动课件 / 「拆机课」「上手课」「实战课」「编排课」/ 王炸讲解片 / 用真实会话和成片教人做视频。不用于:单支宣传片(用 promo-video)、单张信息图、纯文章写作。

FileKindSize
SKILL.mdskill md8.9 KB
engine/assets/fonts/Geist-VF.ttfbinary165.1 KB
engine/assets/fonts/GeistMono-VF.ttfbinary167.9 KB
engine/assets/fonts/LXGWWenKai-Medium.ttfbinary24.2 MB
engine/assets/fonts/LXGWWenKai-Regular.ttfbinary24.4 MB
engine/assets/fonts/NotoSansSC-VF.ttfbinary16.9 MB
engine/assets/iconsets/README.mdmarkdown834 B
engine/assets/iconsets/icon-park-outline.jsonconfig984.1 KB
engine/assets/iconsets/icon-park-solid.jsonconfig946.0 KB
engine/assets/iconsets/icon-park-twotone.jsonconfig991.3 KB
engine/assets/iconsets/icon-park.jsonconfig1.5 MB
engine/assets/iconsets/iconoir.jsonconfig648.2 KB
engine/assets/iconsets/lucide.jsonconfig563.5 KB
engine/assets/iconsets/tabler.jsonconfig2.0 MB
engine/assets/illustrations/iconpark/_sheet.htmlother9.8 KB
engine/assets/illustrations/iconpark/a1-1.svgother7.7 KB
engine/assets/illustrations/iconpark/a1-2.svgother5.7 KB
engine/assets/illustrations/iconpark/a1-3.svgother12.8 KB
engine/assets/illustrations/iconpark/a1-4.svgother7.8 KB
engine/assets/illustrations/iconpark/a10-120.svgother18.7 KB
engine/assets/illustrations/iconpark/a10-121.svgother19.6 KB
engine/assets/illustrations/iconpark/a10-122.svgother28.3 KB
engine/assets/illustrations/iconpark/a10-123.svgother33.1 KB
engine/assets/illustrations/iconpark/a11-136.svgother7.9 KB
engine/assets/illustrations/iconpark/a11-137.svgother5.2 KB
engine/assets/illustrations/iconpark/a11-138.svgother6.5 KB
engine/assets/illustrations/iconpark/a11-139.svgother7.8 KB
engine/assets/illustrations/iconpark/a12-152.svgother12.7 KB
engine/assets/illustrations/iconpark/a12-153.svgother13.7 KB
engine/assets/illustrations/iconpark/a12-154.svgother21.2 KB
engine/assets/illustrations/iconpark/a12-155.svgother9.3 KB
engine/assets/illustrations/iconpark/a13-167.svgother5.0 KB
engine/assets/illustrations/iconpark/a13-168.svgother5.0 KB
engine/assets/illustrations/iconpark/a13-169.svgother3.5 KB
engine/assets/illustrations/iconpark/a13-170.svgother4.6 KB
engine/assets/illustrations/iconpark/a14-184.svgother17.4 KB
engine/assets/illustrations/iconpark/a14-185.svgother27.5 KB
engine/assets/illustrations/iconpark/a14-186.svgother35.2 KB
engine/assets/illustrations/iconpark/a14-187.svgother34.1 KB
engine/assets/illustrations/iconpark/a15-200.svgother19.8 KB
engine/assets/illustrations/iconpark/a15-201.svgother20.3 KB
engine/assets/illustrations/iconpark/a15-202.svgother19.2 KB
engine/assets/illustrations/iconpark/a15-203.svgother24.3 KB
engine/assets/illustrations/iconpark/a16-215.svgother10.1 KB
engine/assets/illustrations/iconpark/a16-216.svgother16.5 KB
engine/assets/illustrations/iconpark/a16-217.svgother10.2 KB
engine/assets/illustrations/iconpark/a16-218.svgother15.2 KB
engine/assets/illustrations/iconpark/a17-230.svgother7.0 KB
engine/assets/illustrations/iconpark/a17-231.svgother6.8 KB
engine/assets/illustrations/iconpark/a17-232.svgother8.6 KB
engine/assets/illustrations/iconpark/a17-233.svgother5.5 KB
engine/assets/illustrations/iconpark/a18-245.svgother15.2 KB
engine/assets/illustrations/iconpark/a18-246.svgother14.1 KB
engine/assets/illustrations/iconpark/a18-247.svgother8.9 KB
engine/assets/illustrations/iconpark/a18-248.svgother8.7 KB
engine/assets/illustrations/iconpark/a19-265.svgother9.4 KB
engine/assets/illustrations/iconpark/a19-266.svgother11.5 KB
engine/assets/illustrations/iconpark/a19-267.svgother6.6 KB
engine/assets/illustrations/iconpark/a19-268.svgother5.5 KB
engine/assets/illustrations/iconpark/a2-11.svgother8.8 KB
engine/assets/illustrations/iconpark/a2-12.svgother10.7 KB
engine/assets/illustrations/iconpark/a2-13.svgother116.5 KB
engine/assets/illustrations/iconpark/a2-14.svgother35.3 KB
engine/assets/illustrations/iconpark/a20-280.svgother10.4 KB
engine/assets/illustrations/iconpark/a20-281.svgother17.7 KB
engine/assets/illustrations/iconpark/a20-282.svgother12.5 KB
engine/assets/illustrations/iconpark/a20-283.svgother13.1 KB
engine/assets/illustrations/iconpark/a21-295.svgother10.4 KB
engine/assets/illustrations/iconpark/a21-296.svgother21.2 KB
engine/assets/illustrations/iconpark/a21-297.svgother8.3 KB
engine/assets/illustrations/iconpark/a21-298.svgother17.5 KB
engine/assets/illustrations/iconpark/a22-327.svgother10.6 KB
engine/assets/illustrations/iconpark/a22-328.svgother12.4 KB
engine/assets/illustrations/iconpark/a22-329.svgother5.4 KB
engine/assets/illustrations/iconpark/a22-330.svgother10.5 KB
engine/assets/illustrations/iconpark/a3-19.svgother8.0 KB
engine/assets/illustrations/iconpark/a3-20.svgother8.4 KB
engine/assets/illustrations/iconpark/a3-21.svgother10.1 KB
engine/assets/illustrations/iconpark/a3-22.svgother10.4 KB
engine/assets/illustrations/iconpark/a4-31.svgother2.7 KB
engine/assets/illustrations/iconpark/a4-32.svgother1.7 KB
engine/assets/illustrations/iconpark/a4-33.svgother1.7 KB
engine/assets/illustrations/iconpark/a4-34.svgother1.5 KB
engine/assets/illustrations/iconpark/a5-46.svgother21.5 KB
engine/assets/illustrations/iconpark/a5-47.svgother15.0 KB
engine/assets/illustrations/iconpark/a5-48.svgother11.8 KB
engine/assets/illustrations/iconpark/a5-49.svgother19.8 KB
engine/assets/illustrations/iconpark/a6-52.svgother15.5 KB
engine/assets/illustrations/iconpark/a6-53.svgother2.9 KB
engine/assets/illustrations/iconpark/a6-54.svgother3.6 KB
engine/assets/illustrations/iconpark/a6-55.svgother4.1 KB
engine/assets/illustrations/iconpark/a7-67.svgother6.0 KB
engine/assets/illustrations/iconpark/a7-68.svgother14.1 KB
engine/assets/illustrations/iconpark/a7-71.svgother10.8 KB
engine/assets/illustrations/iconpark/a7-72.svgother21.6 KB
engine/assets/illustrations/iconpark/a8-87.svgother3.3 KB
engine/assets/illustrations/iconpark/a8-88.svgother2.6 KB
engine/assets/illustrations/iconpark/a8-89.svgother2.6 KB
engine/assets/illustrations/iconpark/a8-90.svgother2.5 KB
engine/assets/illustrations/iconpark/a9-101.svgother4.7 KB
engine/assets/illustrations/iconpark/a9-102.svgother5.3 KB
engine/assets/illustrations/iconpark/a9-103.svgother5.2 KB
engine/assets/illustrations/iconpark/a9-104.svgother8.9 KB
engine/assets/illustrations/iconpark/catalog.jsonconfig19.7 KB
engine/cine/audio/sfx/README.mdmarkdown404 B
engine/cine/audio/sfx/key-1.wavbinary14.7 KB
engine/cine/audio/sfx/key-2.wavbinary14.7 KB
engine/cine/audio/sfx/key-3.wavbinary14.7 KB
engine/cine/audio/sfx/key-4.wavbinary14.7 KB
engine/cine/audio/sfx/key-5.wavbinary14.7 KB
engine/cine/audio/sfx/key-6.wavbinary14.7 KB
engine/cine/audio/sfx/key-7.wavbinary14.7 KB
engine/cine/audio/sfx/key-8.wavbinary14.7 KB
engine/cine/audio/sfx/key-space.wavbinary14.7 KB
engine/cine/audio/timeline.jsonconfig38.4 KB
engine/cine/audio/tools/bed.pyscript37.0 KB
engine/cine/audio/tools/score.pyscript93.0 KB
engine/cine/engine/core.jsscript4.4 KB
engine/cine/engine/glsl.jsscript2.6 KB
engine/cine/engine/narr.jsscript2.7 KB
engine/cine/engine/post.jsscript7.4 KB
engine/cine/engine/scenes/bars.jsscript4.8 KB
engine/cine/engine/scenes/clock.jsscript8.2 KB
engine/cine/engine/scenes/liquid.jsscript4.1 KB
engine/cine/engine/scenes/particles.jsscript9.5 KB
engine/cine/engine/scenes/showroom.jsscript5.0 KB
engine/cine/engine/scenes/tunnel.jsscript4.3 KB
engine/cine/engine/ui.jsscript9.2 KB
engine/cine/engine/util.jsscript2.8 KB
engine/cine/index.htmlother1.4 KB
engine/cine/tools/browser.pyscript802 B
engine/cine/tools/clips.pyscript3.1 KB
engine/cine/tools/deliver.shexecutablescript1.3 KB
engine/cine/tools/finish.pyscript9.3 KB
engine/cine/tools/loopbed.pyscript2.3 KB
engine/cine/tools/queue.shexecutablescript1.7 KB
engine/cine/tools/record.pyscript2.8 KB
engine/cine/tools/retail.pyscript1.8 KB
engine/cine/tools/stills.pyscript2.4 KB
engine/primitives/cards.jsscript13.5 KB
engine/primitives/floaties.jsscript2.5 KB
engine/primitives/loop.jsscript8.2 KB
engine/primitives/mascot.jsscript6.8 KB
engine/primitives/mindmap.jsscript6.7 KB
engine/primitives/morph.jsscript9.2 KB
engine/primitives/motion.jsscript22.5 KB
engine/primitives/portrait.jsscript4.9 KB
engine/primitives/practice.jsscript8.6 KB
engine/primitives/sandbox.jsscript7.4 KB
engine/primitives/scribble.jsscript6.7 KB
engine/primitives/sketch.jsscript23.1 KB
engine/primitives/story.jsscript21.9 KB
engine/primitives/systemmap.jsscript11.4 KB
engine/primitives/terminal.jsscript8.5 KB
engine/primitives/timeline.jsscript7.1 KB
engine/primitives/typer.jsscript9.9 KB
engine/runtime/dom.jsscript4.1 KB
engine/runtime/ease.jsscript2.1 KB
engine/runtime/hosts/player.jsscript11.4 KB
engine/runtime/iconify.jsscript3.1 KB
engine/runtime/lesson.jsscript25.6 KB
engine/runtime/overlays.jsscript13.6 KB
engine/runtime/sketch.jsscript60.8 KB
engine/runtime/spring.jsscript2.8 KB
engine/runtime/stage.jsscript6.6 KB
engine/runtime/theme.jsscript6.5 KB
engine/runtime/typing.jsscript4.4 KB
engine/schemas/brief.schema.jsonconfig2.8 KB
engine/schemas/concepts.schema.jsonconfig3.8 KB
engine/schemas/facts.schema.jsonconfig2.4 KB
engine/schemas/lesson.schema.jsonconfig7.0 KB
engine/schemas/sources.schema.jsonconfig1.8 KB
engine/scripts/check.pyscript13.7 KB
engine/scripts/check_scenes.pyscript3.7 KB
engine/scripts/course_page.pyscript24.5 KB
engine/scripts/emoji.pyscript2.5 KB
engine/scripts/export_cues.pyscript975 B
engine/scripts/facts_js.pyscript1.6 KB
engine/scripts/fetch_images.pyscript4.6 KB
engine/scripts/fx_render.pyscript7.8 KB
engine/scripts/hf_host.pyscript4.8 KB
engine/scripts/icons.pyscript1.7 KB
engine/scripts/illus.pyscript852 B
engine/scripts/ledger.pyscript1.1 KB
engine/scripts/make_lesson.pyscript11.5 KB
engine/scripts/mark_live.pyscript1.0 KB
engine/scripts/mix.pyscript4.4 KB
engine/scripts/new_series.pyscript5.1 KB
engine/scripts/noto_emoji.pyscript3.2 KB
engine/scripts/outline.pyscript4.4 KB
engine/scripts/publish_lesson.pyscript6.3 KB
engine/scripts/rec_scan.pyscript1.2 KB
engine/scripts/render_queue.shexecutablescript770 B
engine/scripts/review_page.pyscript6.9 KB
engine/scripts/serve_range.pyscript1.4 KB
engine/scripts/sketch_publish_files.pyscript2.1 KB
engine/scripts/speed.pyscript1.8 KB
engine/scripts/stills.pyscript2.2 KB
engine/scripts/term_cut.pyscript1.1 KB
engine/scripts/term_frames.pyscript7.8 KB

engine/scripts/make_lesson.py

View on GitHub
#!/usr/bin/env python3
"""一节课一条命令:配音 → 按 scenes.json 编排 → 抽帧自查 → 混音 → 渲染 → 课程页用的压缩版与互动版。

用法:
    python3 scripts/make_lesson.py <课目录> voice     # 取图 + MiMo 配音(并行、按文字缓存)+ 逐字对齐 + ASR 回读
    python3 scripts/make_lesson.py <课目录> build     # 按 scenes.json 编排、打包,出一张每个场景一帧的接触表
    python3 scripts/make_lesson.py <课目录> final     # 混音、1080p 渲染、720p 压缩、互动版目录、更新 series.json
    python3 scripts/make_lesson.py <课目录> all       # 以上三步连着跑

课目录(如 examples/ai-intro/lessons/02)里要有:narration.json(旁白与 [[cue]])、scenes.json(场景模板清单,见 runtime/lesson.js),
可选 images.spec.json(要用的 Wikimedia Commons 图片)、research/(核查账本,互动版「点图看出处」用)。
系列目录(课目录的上两级)里要有 series.json 和 assets/img/。
"""
import json
import re
import shutil
import subprocess
import sys
import time
from pathlib import Path

ROOT = Path(__file__).resolve().parent.parent
NPX = Path.home() / ".npm/_npx/702923228c2ce1e6/node_modules"
ESBUILD = NPX / ".bin/esbuild"
HF = ["node", str(NPX / "hyperframes/dist/cli.js")]
MUSIC = Path.home() / ".claude/skills/promo-video/assets/music"
BGM = ["mixkit-813-magical-moment.mp3", "mixkit-839-tears-of-joy.mp3", "mixkit-587-discover.mp3", "mixkit-173-better-times-are-coming.mp3"]


def run(cmd, **kw):
    print("  $", " ".join(str(c) for c in cmd)[:160])
    subprocess.run([str(c) for c in cmd], check=True, **kw)


def step(name):
    print(f"\n== {name}({time.strftime('%H:%M:%S')})")


def main():
    if len(sys.argv) < 3:
        sys.exit(__doc__)
    L = Path(sys.argv[1]).resolve()
    what = sys.argv[2]
    series_dir = L.parent.parent
    img_dir = series_dir / "assets/img"
    build = L / "build"
    build.mkdir(exist_ok=True)
    nn = L.name
    t0 = time.time()

    if what in ("voice", "all"):
        if (L / "images.spec.json").exists():
            step("取图")
            run(["python3", ROOT / "scripts/fetch_images.py", L / "images.spec.json", img_dir])
        step("配音")
        run(["python3", ROOT / "scripts/tts_mimo.py", L / "narration.json", build, "--gap", "0.8", "--lead", "0.6", "--qa", "--jobs", "2"])

    if what in ("build", "all"):
        sp = json.loads((L / "scenes.json").read_text(encoding="utf-8")).get("speed")
        if sp or (build / "timings.orig.json").exists():
            step("配音变速")
            run(["python3", ROOT / "scripts/speed.py", L, str(sp or 1)])
        step("编排与打包")
        recs = sorted((L / "rec").glob("*.frames.json")) if (L / "rec").exists() else []
        (build / "recs.gen.js").write_text("".join(f'import r{i} from "../rec/{r.name}";\n' for i, r in enumerate(recs))
            + "export default {" + ", ".join(f'"{r.name[:-len(".frames.json")]}": r{i}' for i, r in enumerate(recs)) + "};\n", encoding="utf-8")
        rel = lambda p: Path(*[".."] * (len(build.relative_to(ROOT).parts))) / p
        ex = [("lottie", f) for f in sorted((L / "lottie").glob("*.json"))] + [("data", f) for f in sorted((L / "data").glob("*.json"))] + [("illus", f) for f in sorted((L / "illus").glob("*.svg"))]
        fxm = series_dir / "assets/fx/fx.json"   # 视频贴纸清单(scripts/fx_render.py 生成):时长、尺寸、封面
        (build / "extra.gen.js").write_text("".join(f'import x{i} from "../{k}/{f.name}";\n' for i, (k, f) in enumerate(ex))
            + ('import fxm from "../../../assets/fx/fx.json";\n' if fxm.exists() else "")
            + "export default {" + ", ".join(f'{k}: {{' + ", ".join(f'"{f.stem}": x{i}' for i, (kk, f) in enumerate(ex) if kk == k) + "}" for k in ("lottie", "data", "illus"))
            + (", fx: fxm" if fxm.exists() else "") + "};\n", encoding="utf-8")
        engine = json.loads((L / "scenes.json").read_text(encoding="utf-8")).get("engine", "lesson")   # "sketch" = 手账风(runtime/sketch.js)
        (build / "entry.gen.js").write_text(f"""import {{ buildLesson }} from "{rel(f'runtime/{engine}.js').as_posix()}";
import {{ mountPlayer }} from "{rel('runtime/hosts/player.js').as_posix()}";
import {{ registerIcons }} from "{rel('runtime/iconify.js').as_posix()}";
import timings from "./timings.json";
import images from "../../../assets/img/images.json";
import spec from "../scenes.json";
import icons from "./icons.json";
import recs from "./recs.gen.js";
import extra from "./extra.gen.js";
registerIcons(icons);
window.AT = {{
  timings, images, spec, mountPlayer,
  async start(root, opts = {{}}) {{
    await Promise.all(["400", "500", "600", "650", "700", "750", "800"].flatMap((w) => [
      document.fonts.load(`${{w}} 40px "Noto Sans SC"`, "测试"), document.fonts.load(`${{w}} 40px "Geist"`, "AI 1950"),
      document.fonts.load(`${{w}} 40px "LXGW WenKai"`, "测试 AI")]));
    const stage = buildLesson(root, {{ spec, timings, images, recs, extra, ...opts }});
    await Promise.all([...root.querySelectorAll("img")].map((im) => im.decode().catch(() => {{}})));
    stage.seek(stage.t);
    return stage;
  }},
}};
""", encoding="utf-8")
        fonts = Path(*[".."] * len(L.relative_to(ROOT).parts)) / "assets/fonts"
        (L / "preview.html").write_text(f"""<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><title>{nn} preview</title><style>
@font-face{{font-family:"Noto Sans SC";src:url("{fonts.as_posix()}/NotoSansSC-VF.ttf") format("truetype");font-weight:100 900}}
@font-face{{font-family:"Geist";src:url("{fonts.as_posix()}/Geist-VF.ttf") format("truetype");font-weight:100 900}}
@font-face{{font-family:"Geist Mono";src:url("{fonts.as_posix()}/GeistMono-VF.ttf") format("truetype");font-weight:100 900}}
@font-face{{font-family:"LXGW WenKai";src:url("{fonts.as_posix()}/LXGWWenKai-Regular.ttf") format("truetype");font-weight:100 450}}
@font-face{{font-family:"LXGW WenKai";src:url("{fonts.as_posix()}/LXGWWenKai-Medium.ttf") format("truetype");font-weight:451 900}}
html,body{{margin:0;background:#000}}</style></head><body><div id="root"></div><script src="build/film.js"></script>
<script>window.__ready = AT.start(document.getElementById("root")).then((s) => (window.__stage = s));</script></body></html>
""", encoding="utf-8")
        run(["python3", ROOT / "scripts/icons.py", build / "icons.json", L / "scenes.json", ROOT / "runtime/lesson.js", ROOT / "primitives"])
        run([ESBUILD, build / "entry.gen.js", "--bundle", "--loader:.svg=text", "--format=iife", "--target=chrome120", f"--outfile={build / 'film.js'}", "--log-level=warning"])
        # 接触表:每个场景两帧
        step("抽帧自查")
        probe = subprocess.run(["node", "-e", f"""
const t = require("{(build / 'timings.json').as_posix()}"), s = require("{(L / 'scenes.json').as_posix()}");
const T = t.beats; const out = [];
for (const sc of s.scenes) {{
  const m = /^(B\\d+)(?:\\.([a-z0-9_]+(?:-[a-z][a-z0-9_]*)*)|@([^+]+?))?([+-]\\d+(?:\\.\\d+)?)?$/.exec(sc.at);
  const b = T[m[1]]; let v = m[2] === "end" ? b.end : m[2] ? b.cues[m[2]] : m[3] ? b.chars[b.text.indexOf(m[3])] : b.start;
  out.push(v + (m[4] ? parseFloat(m[4]) / (t.speed || 1) : 0));
}}
// 每个场景两帧:进场后 2.5 秒、场景的 70% 处(元素基本出齐)
const ts = [];
out.forEach((v, i) => {{ const end = i + 1 < out.length ? out[i + 1] : t.total; ts.push((v + 2.5).toFixed(2), (v + (end - v) * 0.7).toFixed(2)); }});
console.log(ts.join(" "));
process.exit(0);
console.log(out.join(" "));
"""], capture_output=True, text=True, check=True).stdout.split()
        run(["python3", ROOT / "scripts/stills.py", L / "preview.html", build / "stills/scenes.png", *probe, "--cols", "6"])

    if what in ("final", "all"):
        step("混音")
        run(["python3", ROOT / "scripts/export_cues.py", L / "preview.html", build / "cues.json"])
        run(["python3", ROOT / "scripts/mix.py", build / "narration.wav", build / "cues.json", build / "mix.wav",
             "--bgm", ",".join(str(MUSIC / b) for b in BGM), "--bgm-gain", "-24"])
        run(["ffmpeg", "-v", "error", "-y", "-i", build / "mix.wav", "-ac", "1", "-b:a", "96k", build / "mix.mp3"])
        step("渲染 1080p")
        cid = f"{series_dir.name}-l{nn}"
        bg = {"mint": "#F0FAF6", "night": "#1D1A2C", "editorial": "#ECEAE6", "paper": "#FBF7EE"}.get(json.loads((L / "scenes.json").read_text(encoding="utf-8")).get("theme"), "#FFF8F2")
        if json.loads((L / "scenes.json").read_text(encoding="utf-8")).get("skin") == "notion":
            bg = "#FFFFFF"
        run(["python3", ROOT / "scripts/hf_host.py", build / "film.js", build / "mix.wav", build / "timings.json", L / "hf", "--id", cid, "--images", img_dir, "--bg", bg,
             "--videos", build / "cues.json", "--vdir", series_dir / "assets/fx"])
        mp4 = L / "hf/renders" / f"lesson{nn}.mp4"
        run([*HF, "render", "--quality", "high", "--output", f"renders/lesson{nn}.mp4"], cwd=L / "hf")
        step("课程页压缩版与互动版")
        pub = series_dir / "publish/course"
        pub.mkdir(parents=True, exist_ok=True)   # 新系列第一次出片时还没有课程页目录
        run(["ffmpeg", "-v", "error", "-y", "-i", mp4, "-vf", "scale=1280:720:flags=lanczos", "-c:v", "libx264", "-preset", "slow", "-crf", "28",
             "-tune", "animation", "-pix_fmt", "yuv420p", "-c:a", "aac", "-b:a", "64k", "-ac", "1", "-movflags", "+faststart", pub / f"lesson{nn}.mp4"])
        run(["ffmpeg", "-v", "error", "-y", "-ss", "20", "-i", mp4, "-frames:v", "1", "-vf", "scale=1280:-1", "-q:v", "3", pub / f"lesson{nn}.jpg"])
        spec = json.loads((L / "scenes.json").read_text(encoding="utf-8"))
        if spec.get("videoOnly"):   # 只要成片(如英文版):不做互动版、不动课程页
            print(f"\n成片:{mp4}\n压缩版:{pub / f'lesson{nn}.mp4'}")
            print(f"\n完成「{what}」,用时 {(time.time() - t0) / 60:.1f} 分钟")
            return
        facts = []
        if (L / "research/facts.json").exists():
            run(["python3", ROOT / "scripts/facts_js.py", L / "research", build / "facts.js", "--images", img_dir / "images.json"])
            facts = ["--facts", build / "facts.js"]
        spec = json.loads((L / "scenes.json").read_text(encoding="utf-8"))
        run(["python3", ROOT / "scripts/publish_lesson.py", build / "film.js", build / "mix.mp3", series_dir / f"publish/lesson{nn}", *facts, "--light", "--images", img_dir,
             "--videos", build / "cues.json", "--vdir", series_dir / "assets/fx",
             "--title", spec.get("title", nn), "--subtitle", f"{spec.get('series', 'AI 入门课')} · 第 {spec.get('n', nn)} 节 · 暂停后可以点图看原文出处"])
        # 课程页数据:挂上这一节的视频
        total = json.loads((build / "timings.json").read_text(encoding="utf-8"))["total"]
        sj = series_dir / "series.json"
        S = json.loads(sj.read_text(encoding="utf-8"))
        les = next(l for l in S["lessons"] if int(l.get("n", 0)) == int(nn))   # 按课号找(第二季有第 0 节课程地图)
        les.update({"video": f"lesson{nn}.mp4", "poster": f"lesson{nn}.jpg", "length": f"{int(total // 60)} 分 {int(total % 60)} 秒"})
        les.pop("state", None)
        sj.write_text(json.dumps(S, ensure_ascii=False, indent=1), encoding="utf-8")
        run(["python3", ROOT / "scripts/course_page.py", sj, pub])
        print(f"\n成片:{mp4}\n课程页压缩版:{pub / f'lesson{nn}.mp4'}\n互动版目录:{series_dir / f'publish/lesson{nn}'}")

    print(f"\n完成「{what}」,用时 {(time.time() - t0) / 60:.1f} 分钟")


if __name__ == "__main__":
    main()
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