Short vertical cut-paper explainer reels, made by your coding agent. Nine Agent Skills plus a Remotion library. Works with Claude Code, OpenCode, Codex, Gemini CLI, Cursor, Copilot and more.
TypeScript agent-skillsagents-mdclaude-codeclaude-code-skillscodexexplainer-videosgemini-cliopencodepapercutremotiontext-to-speechvideo-generation
# Regenerate the two catalogs agents read instead of source code:
# audio/CATALOG.md every SFX (from the "// @sfx" header line of audio/sfx/*.js) + every bed preset
# papercut/CATALOG.md every export of papercut/kit/** with its doc comment and props, one line each, plus the Backdrops table
# Run after adding or changing anything in the library: python3 $PAPERCUT_LIB/tools/catalog.py (paths are relative to this file, so $PAPERCUT_LIB is not read)
import glob, json, os, re
LIB = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
# ---------- audio ----------
rows = []
for p in sorted(glob.glob(f"{LIB}/audio/sfx/*.js")):
head = open(p, encoding="utf-8").readline()
m = re.match(r"// @sfx (\S+) \| ([^|]+)\| ([^|]+)\| ([^|]+)\|?(.*)", head)
if not m: rows.append((os.path.basename(p)[:-3], "?", "?", "MISSING @sfx HEADER", "")); continue
rows.append(tuple(x.strip() for x in m.groups()))
groups = {}
for name, tags, dur, desc, src in rows: groups.setdefault(tags.split(",")[0].strip(), []).append((name, tags, dur, desc))
out = ["# Audio library catalog (generated by tools/catalog.py; do not edit)", "",
"Pick SFX by name in `tools/cue_sheet.d/<Scene>.json` as `[word, nth, sfx, offsetFrames]`. Build the cue list with `tools/cues.py`, render with `node $PAPERCUT_LIB/audio/render.mjs`.",
"Add a new effect as `audio/sfx/<name>.js` with a `// @sfx name | tags | seconds | description | origin` first line and",
"`SFX['name'] = (K, t) => { ... }` using K.noise / K.tone / K.pop / K.chime / K.pluck / K.hz / K.R, then rerun catalog.py.", "",
f"## SFX ({len(rows)})", "", "| name | sec | tags | sounds like |", "|---|---|---|---|"]
for g in sorted(groups):
for name, tags, dur, desc in groups[g]: out.append(f"| `{name}` | {dur} | {tags} | {desc} |")
out += ["", "## Music beds (`episode.json` \"bed\", or `--bed <name>`)", "", "| preset | bpm | mood | description |", "|---|---|---|---|"]
for p in sorted(glob.glob(f"{LIB}/audio/beds/*.json")):
b = json.load(open(p, encoding="utf-8")); out.append(f"| `{os.path.basename(p)[:-5]}` | {b['bpm']} | {b.get('mood', '')} | {b.get('desc', '')} |")
out += ["", "A new bed = a new JSON preset (bpm, instrument marimba|kalimba, prog [[rootMidi, [4 chord notes]] ×4], pattern, skip, sub, pad, perc clap|snap, plips, outro). No code."]
open(f"{LIB}/audio/CATALOG.md", "w", encoding="utf-8").write("\n".join(out) + "\n")
print("audio:", len(rows), "sfx,", len(glob.glob(f"{LIB}/audio/beds/*.json")), "beds")
# ---------- papercut kit ----------
def squash(s, n=230):
s = re.sub(r"\s+", " ", s).strip()
return s if len(s) <= n else s[: n - 1] + "…"
out = ["# Papercut kit catalog (generated by tools/catalog.py; do not edit)", "",
"The kit is synced into each project at `src/lib/` (`papercut/sync_kit.sh`). Scenes import it as `../lib/<file>`.",
"Read this file instead of the kit source. Open a source file only when you need a detail that isn't here.",
"If a scene needs something the kit lacks, build it in your scene file. The lead promotes reusable pieces into the kit after the episode (HARVEST.md).", ""]
count = 0
for p in sorted(glob.glob(f"{LIB}/papercut/kit/**/*.ts*", recursive=True)):
rel = os.path.relpath(p, f"{LIB}/papercut/kit"); src = open(p, encoding="utf-8").read(); lines = src.splitlines()
head = []
for ln in lines:
if ln.startswith("//"): head.append(ln[2:].strip())
else: break
out += [f"## `{rel}` (import from `'../lib/{rel.rsplit('.', 1)[0]}'`)", ""]
if head: out += ["> " + " ".join(head)[:400], ""]
for i, ln in enumerate(lines):
m = re.match(r"export (const|function|type) (\w+)", ln)
if not m: continue
kind, name = m.groups(); doc = []
j = i - 1
while j >= 0 and lines[j].strip().startswith("//"): doc.insert(0, lines[j].strip()[2:].strip()); j -= 1
if "React.FC<" in ln:
k = src.index(ln); a = src.index("React.FC<", k) + 9; depth, e = 0, a
while e < len(src):
c = src[e]; depth += c in "<{(["; depth -= c in ">})]"
if depth < 0: break
e += 1
sig = f"`<{name} {squash(src[a:e].strip().lstrip('{').rstrip('}'), 260)}>`"
else:
sig = f"`{squash(ln.replace('export ', ''), 160)}`"
out.append(f"- {sig}" + (f": {squash(' '.join(doc), 240)}" if doc else "")); count += 1
out.append("")
# generated backdrops: one row per entry of public/bg/backdrops/backdrops.json (written by whoever adds a backdrop)
bdj = f"{LIB}/papercut/public/bg/backdrops/backdrops.json"
if os.path.exists(bdj):
bd = json.load(open(bdj, encoding="utf-8"))
out += [f"## Backdrops ({len(bd)} generated sets, `<Backdrop name=\"...\" />` from `'../lib/paper/backdrops'`)", "",
"Full-frame 1080x1920 paper-diorama rooms and outdoor sets: use one in place of `<Room>`. Each follows the layout contract: floor line near y 1420,",
"calm middle band for props, calm top for the banner, plain bottom for captions. Stand props and critters on that backdrop's `floorY`.",
"Optional `tint` (multiply colour) and `dim` (0-1 darkening) shift a set's mood. No people or text are baked in.", "",
"| name | floorY | mood | desc | bestFor |", "|---|---|---|---|---|"]
for b in bd: out.append(f"| `{b['name']}` | {b['floorY']} | {b['mood']} | {b['desc']} | {b['bestFor']} |")
out.append("")
open(f"{LIB}/papercut/CATALOG.md", "w", encoding="utf-8").write("\n".join(out) + "\n")
print("papercut:", count, "exports")