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
Ask for the scene-agent model: --claude-model / --opencode-model, generated agent copies
sanata41e14c4ec8b
diff --git a/README.md b/README.mdindex ec656d0..83223b7 100644--- a/README.md+++ b/README.md@@ -81,6 +81,8 @@ Non-interactive and scoped installs:By default skills are symlinked into `~/.claude/skills` and `~/.config/opencode/skills` (pass `--target claude` or `--target opencode` for only one) and the subagent into the sibling `agents` folders (`~/.claude/agents`, `~/.config/opencode/agents`; opencode also discovers the `.claude` paths), so a `git pull` updates them. The installer writes `~/.config/papercut-explainer/config.env` with `PAPERCUT_LIB` and the Python paths it created; the library scripts and the skills read it. It never installs system packages (it prints the `brew` or `apt` line instead), replaces an identical existing skill folder (such as one from `npx skills add`) and moves a different one to `~/.config/papercut-explainer/backups/` instead of the skills folder, and does not touch your shell profile.+The scene-builder subagent is written as a copy (not a link) with the model you pick: `--claude-model sonnet|opus|haiku|inherit|<id>` (default `sonnet`) and `--opencode-model inherit|<provider/model-id>` (default `inherit`, the session's model). Rerun the installer to change it; `papercut-setup` asks.+Opencode-only minimal install:```bashdiff --git a/install.sh b/install.shindex e71fd4b..bde5076 100755--- a/install.sh+++ b/install.sh@@ -21,6 +21,9 @@# the subagent goes in the sibling folder DIR/../agents# --project DIR install skills into DIR/.claude/skills and DIR/.opencode/skills# instead (one project only; --target filters which of the two)+# --claude-model M model for the papercut-scene subagent in Claude Code:+# sonnet (default) | opus | haiku | inherit (use the session model) | a full model id+# --opencode-model M model for it in opencode: inherit (default, session model) | provider/model-id# --copy copy the skills instead of symlinking them (no live updates from this checkout)# --tts-model 1.7B|0.6B model size for the voice step (default 1.7B)# --with-clone also download the voice-cloning model@@ -38,6 +41,7 @@ export PAPERCUT_LIB="$LIB" # this checkout wins over a stale path left in an oMODE=""; COMPONENTS=""; TARGET="all"; TARGET_EXPLICIT=0; SKILLS_DIR=""; SKILLS_DIR_EXPLICIT=0; PROJECT_DIR=""COPY=0; YES=0; DRY=0+CLAUDE_MODEL=sonnet; OPENCODE_MODEL=inheritTTS_MODEL=1.7B; WITH_CLONE=0; DOCTOR=0; UNINSTALL=0while [ $# -gt 0 ]; docase "$1" in@@ -47,6 +51,8 @@ while [ $# -gt 0 ]; do--skills-dir) SKILLS_DIR=${2:?--skills-dir needs a value}; SKILLS_DIR_EXPLICIT=1; shift 2 ;;--project) [ -d "${2:?--project needs a folder}" ] || { echo "--project: $2 is not a folder" >&2; exit 2; }PROJECT_DIR="$(cd "$2" && pwd)"; shift 2 ;;+ --claude-model) CLAUDE_MODEL=${2:?--claude-model needs sonnet, opus, haiku, inherit or a model id}; shift 2 ;;+ --opencode-model) OPENCODE_MODEL=${2:?--opencode-model needs inherit or provider/model-id}; shift 2 ;;--copy) COPY=1; shift ;;--tts-model) TTS_MODEL=${2:?--tts-model needs 1.7B or 0.6B}; shift 2 ;;--with-clone) WITH_CLONE=1; shift ;;@@ -64,6 +70,15 @@ case "$TARGET" in*) echo "--target needs claude, opencode or all (got: $TARGET)" >&2; exit 2 ;;esac+case "$CLAUDE_MODEL" in+ ""|*[!A-Za-z0-9._:-]*) echo "--claude-model needs sonnet, opus, haiku, inherit or a model id (got: $CLAUDE_MODEL)" >&2; exit 2 ;;+esac+case "$OPENCODE_MODEL" in+ inherit) ;;+ */*) case "$OPENCODE_MODEL" in *[!A-Za-z0-9._:/-]*|/*|*/) echo "--opencode-model needs inherit or provider/model-id (got: $OPENCODE_MODEL)" >&2; exit 2 ;; esac ;;+ *) echo "--opencode-model needs inherit or provider/model-id, e.g. anthropic/claude-sonnet-5-5 (got: $OPENCODE_MODEL)" >&2; exit 2 ;;+esac+# Skill destinations. One entry per agent target, so both Claude Code and# opencode pick the skills up (opencode also reads ~/.claude/skills, but the# native path keeps discovery explicit and survives config changes).@@ -105,6 +120,18 @@ confirm() { # confirm "question" default(y|n)SKILL_NAMES() { for d in "$ROOT"/skills/*/; do [ -f "${d}SKILL.md" ] && basename "$d"; done; }ver_ge() { [ "$(printf '%s\n%s\n' "$2" "$1" | sort -V | head -1)" = "$2" ]; } # ver_ge have need+# The scene agent is written as a copy so the model is the user's choice. Claude Code and opencode name+# models differently, so the source file carries no model line; this adds one (or none for "inherit").+agent_with_model() { # agent_with_model SRC MODEL+ awk -v model="$2" '+ NR == 1 && $0 == "---" { fm = 1; print; next }+ fm == 1 && /^model:/ { next }+ fm == 1 && /^name:/ { print; if (model != "inherit") print "model: " model; next }+ fm == 1 && $0 == "---" { fm = 2; print; print "<!-- papercut-explainer install.sh (generated): rerun the installer to change the model -->"; next }+ { print }+ ' "$1"+}+# ---------------------------------------------------------------- doctordoctor() {say "papercut-explainer: status (target: $TARGET)"@@ -158,7 +185,7 @@ uninstall() {if [ -L "$p" ]; thencase "$(readlink "$p")" in "$ROOT"/*) run rm "$p"; ok "removed $p" ;; *) miss "kept $p (link points elsewhere)" ;; esacelif [ -d "$p" ] && [ -f "$p/.papercut-installed" ]; then run rm -rf "$p"; ok "removed $p"- elif [ -f "$p" ] && [ -f "$ROOT/agents/$(basename "$p")" ] && cmp -s "$p" "$ROOT/agents/$(basename "$p")"; then run rm "$p"; ok "removed $p"+ elif [ -f "$p" ] && [ -f "$ROOT/agents/$(basename "$p")" ] && { cmp -s "$p" "$ROOT/agents/$(basename "$p")" || grep -q 'papercut-explainer install.sh (generated)' "$p"; }; then run rm "$p"; ok "removed $p"elif [ -e "$p" ]; then miss "kept $p (not an unmodified copy from this installer)"; fidone < "$rec"run rm -f "$rec"@@ -272,19 +299,23 @@ step_skills() {# ~/.claude/agents, ~/.config/opencode/agents, or <project>/.claude|opencode/agentsadir="$(dirname "$onedir")/agents"run mkdir -p "$adir"+ local akind=claude amodel="$CLAUDE_MODEL" agen+ case "$onedir" in */.opencode/skills|*/opencode/skills) akind=opencode; amodel="$OPENCODE_MODEL" ;; esacfor a in "$ROOT"/agents/*.md; do[ -f "$a" ] || continuelocal adst="$adir/$(basename "$a")"+ agen="$(mktemp)"; agent_with_model "$a" "$amodel" > "$agen"if [ -L "$adst" ]; then run rm "$adst"elif [ -e "$adst" ]; then- if cmp -s "$a" "$adst"; then run rm "$adst" # identical copy: refresh it+ if cmp -s "$agen" "$adst" || cmp -s "$a" "$adst"; then run rm "$adst" # identical copy: refresh it+ elif grep -q 'papercut-explainer install.sh (generated)' "$adst" 2>/dev/null; then run rm "$adst" # an earlier run with another modelelif confirm "$adst exists and differs from this checkout. Back it up and replace?" y; thenrun mkdir -p "$CFG_DIR/backups"; run mv "$adst" "$CFG_DIR/backups/$(basename "$a" .md).$ts.md"; miss "backed up to $CFG_DIR/backups"- else miss "kept existing agent $(basename "$a")"; continue; fi+ else miss "kept existing agent $(basename "$a")"; rm -f "$agen"; continue; fifi- if [ "$COPY" = 1 ]; then run cp "$a" "$adst"; else run ln -s "$a" "$adst"; fi+ run cp "$agen" "$adst"; rm -f "$agen"[ "$DRY" = 1 ] || echo "$adst" >> "$CFG_DIR/installed.txt"- ok "agent $(basename "$a" .md) ($adir)"+ ok "agent $(basename "$a" .md) ($akind, model: $amodel) -> $adir"donedone[ "$DRY" = 1 ] || [ ! -f "$CFG_DIR/installed.txt" ] || sort -u "$CFG_DIR/installed.txt" -o "$CFG_DIR/installed.txt"diff --git a/skills/papercut-setup/SKILL.md b/skills/papercut-setup/SKILL.mdindex ab188e9..77e314a 100644--- a/skills/papercut-setup/SKILL.md+++ b/skills/papercut-setup/SKILL.md@@ -38,6 +38,8 @@ Ask only what is still open, in one call (AskUserQuestion in Claude Code, the qu| Which agent? | Both (default, `--target all`), Claude Code only (`--target claude`) or opencode only (`--target opencode`). || Where do the skills go? | User-wide (the default) or one project (`--project DIR`). || Copy or link? | Symlink (default, updates with `git pull`) or `--copy` (a snapshot). |+| Scene-agent model, Claude Code? (skip if `--target opencode`) | **Sonnet** (default: cheapest, what the scene agents were tuned on) · **Opus** (strongest; every parallel scene agent bills at Opus rates) · **Haiku** (cheapest, weakest) · **Inherit** (whatever model the session runs). Maps to `--claude-model sonnet\|opus\|haiku\|inherit\|<model id>`. |+| Scene-agent model, opencode? (skip if `--target claude`) | **Inherit** (default: the session's model) or a specific `provider/model-id` in the form opencode's model picker shows, for example `anthropic/claude-sonnet-5-5`. Maps to `--opencode-model inherit\|<provider/model-id>`. Free open-source models work but are untested here; a weaker model costs QA rounds. || TTS model size (Full) | 1.7B, better prosody, ~4.2 GB (default). 0.6B, lighter and faster, ~2.3 GB. || Voice-clone model (Full) | No (default), or `--with-clone`: the Base model of the same size again. |@@ -46,18 +48,19 @@ Confirm before any multi-GB download. On a machine with no GPU (not Apple Silico## 3. Install```-./install.sh --mode <minimal|standard|full> --yes [--target claude|opencode|all] [--skills-dir DIR | --project DIR] [--copy] [--tts-model 1.7B|0.6B] [--with-clone]+./install.sh --mode <minimal|standard|full> --yes [--target claude|opencode|all] [--claude-model M] [--opencode-model M] [--skills-dir DIR | --project DIR] [--copy] [--tts-model 1.7B|0.6B] [--with-clone]./install.sh --mode custom --components skills,deps,remotion-skills,pytools,tts,verify --yes```- Add `--dry-run` first if the user wants to see the plan; it changes nothing.+- The scene-builder agent is written as a **copy** per agent folder with the chosen `model:` line (Claude Code and opencode name models differently, so the repo's file carries none). Skills stay symlinks. To change the model later: `./install.sh --mode custom --components skills --claude-model opus --yes` (or `--opencode-model ...`).- Standard and Full take minutes (npm install, Remotion's Chrome, venvs, model download). Run them in the background and check the output; do not hold a foreground call.- What each mode does: Minimal links the skills and the scene-builder agent (into the Claude and opencode skill/agent folders, unless `--target` says otherwise). Standard adds a dependency check, the Remotion agent skills (`npx skills add remotion-dev/skills -g -y -a claude-code` plus `-a opencode`, installed user-wide, so say so when you confirm the plan), a Python venv with numpy, Pillow and soundfile, and a self-test render. Full adds `library/voice/setup_tts.sh`: a voice venv with Qwen3-TTS, an ASR backend (mlx-whisper on Apple Silicon, faster-whisper elsewhere), the model download and a one-line smoke test.- The installer writes `PAPERCUT_HOME`, `PAPERCUT_LIB`, `PAPERCUT_PY`, `QWEN_TTS_PY` and `ASR_PY` into `~/.config/papercut-explainer/config.env`. An existing skill folder that differs from this checkout is backed up to `~/.config/papercut-explainer/backups/` (not into the skills folder, so it is not loaded twice); an identical copy, such as one from `npx skills add`, is just replaced.## 4. Verify and report-Run `./install.sh --doctor` again with the same `--project`, `--skills-dir` or `--target`. Report what is installed, what failed (the installer prints `needs attention:` with component names), and the fix. A new Claude Code session picks up newly linked skills (restart it); opencode reloads configuration automatically. Then suggest: "make a papercut explainer about <link>", or one stage at a time ("write a hook for...", "storyboard this script", "set up the voice").+Run `./install.sh --doctor` again with the same `--project`, `--skills-dir` or `--target`. Report what is installed, which scene-agent model each agent got, what failed (the installer prints `needs attention:` with component names), and the fix. A new Claude Code session picks up newly linked skills (restart it); opencode reloads configuration automatically. Then suggest: "make a papercut explainer about <link>", or one stage at a time ("write a hook for...", "storyboard this script", "set up the voice").## Troubleshooting@@ -71,6 +74,7 @@ Run `./install.sh --doctor` again with the same `--project`, `--skills-dir` or `| Self-test fails | Run `library/tools/selftest.sh` directly to see the failing step. || Skills don't show (Claude Code) | Start a new session. Check `ls ~/.claude/skills` (or `<project>/.claude/skills`). || Skills don't show (opencode) | Config reloads automatically. Check `ls ~/.config/opencode/skills` (or `<project>/.opencode/skills`); opencode also reads the `.claude` paths. |+| Scene agents cost too much, or run on the wrong model | Rerun the skills step with another model: `./install.sh --mode custom --components skills --claude-model sonnet --yes` (or `--opencode-model inherit`). `inherit` means the session model. || Move from Minimal to Standard | `./install.sh --mode custom --components deps,remotion-skills,pytools,verify --yes` || Add the voice later | `./install.sh --mode custom --components tts --yes [--tts-model 0.6B] [--with-clone]` || Remove it | `./install.sh --uninstall` removes the links it recorded. It leaves `config.env`, the venvs under `~/.local/share/papercut-explainer` and the Hugging Face cache; delete those by hand for the space. |