Skip to content

Claude Code skill that makes launch videos, ads and music videos from one line: idea, script, visuals, voice, music, edit and review, then a review room where your notes make the next take

Runs without Python or bc, the Mac graphics setting only on a Mac, docs name the skill folder

Tal Siach4627d596e532
diff --git a/SKILL.md b/SKILL.md
index 79f4807..64eff6a 100644
--- a/SKILL.md
+++ b/SKILL.md
@@ -118,7 +118,7 @@ For a brand, a product or a launch, the look comes from the brand (step 1b) and
**The gallery shows only our own renders, never frames from other people's videos** (reference videos are kept in a study folder outside the skill). Every card carries the one-story preview pack: THE PAPER BOAT, the same two frames (A: setting out at first light, boat lower-left heading right; B: the storm peak, one big diagonal wave from upper right) rendered by us in that style. Sources live in assets/previews-src/<id>/boat.html with the shared brief at assets/previews-src/BOAT-BRIEF.md and renderer snap.mjs (needs a node_modules symlink beside it with playwright-core, see .gitignore). When adding a style: write the style file, add the card, render the two boat frames from the brief before the card ships; the render doubles as the style file's proof that it works.
```bash
-open ~/.claude/skills/take-one/assets/gallery.html
+open <skill>/assets/gallery.html # macOS; on Windows use start, on Linux xdg-open
```
| Style | File | Best for |
@@ -212,6 +212,8 @@ Put the MP4 somewhere obvious (Desktop or Downloads), named plainly (`<name>.mp4
## Files
+`<skill>` in a command, here and in `references/`, is the folder that holds this file. In Claude Code that is usually `~/.claude/skills/take-one`; another agent keeps it somewhere else.
+
- `assets/gallery.html` + `assets/previews/` : the style menu
- `assets/logo/` : the Take One mark (a film slate, arm lifted, a 1) and the logo with its name, as vector files: `take-one-mark.svg`, `take-one-logo.svg` (name beside the mark) and `take-one-logo-stacked.svg` (name under it), each with an `-on-light` twin. The plain files are for dark grounds. The review room and the README use them; use these files wherever the skill's own name appears and never redraw the mark
- `references/styles/*.md` : one file per style
diff --git a/references/pipeline.md b/references/pipeline.md
index 58974f3..4e84384 100644
--- a/references/pipeline.md
+++ b/references/pipeline.md
@@ -2,10 +2,12 @@
The watercolor style uses the Claude Animation Base's own `render.mjs`. The other styles use this skill's scripts.
+In the commands below `<skill>` is the folder that holds `SKILL.md` (in Claude Code usually `~/.claude/skills/take-one`).
+
## New project
```bash
-bash ~/.claude/skills/take-one/scripts/new-canvas-project.sh ~/my-video
+bash <skill>/scripts/new-canvas-project.sh ~/my-video
```
Creates the folder, copies `serve.mjs`, `frames.mjs`, `export.mjs` and `springs.js`, installs `playwright-core` (uses the installed Google Chrome, no browser download), and writes a starter `film.html` with the contract below, already loading the springs.
@@ -34,24 +36,24 @@ Read the PNGs and `sheet.png` with the Read tool. Console errors are printed (a
## Quality gate (before showing anything rendered)
```bash
-node ~/.claude/skills/take-one/scripts/gate.mjs film.html # 1 determinism + 2 contract scan
-node ~/.claude/skills/take-one/scripts/gate.mjs film.html --mp4 out.mp4 --holds "12-14" --cuts "4.5,9" # + 3 dead air, 4 pops
-node ~/.claude/skills/take-one/scripts/gate.mjs --self-test # prove the gate itself still catches bugs
+node <skill>/scripts/gate.mjs film.html # 1 determinism + 2 contract scan
+node <skill>/scripts/gate.mjs film.html --mp4 out.mp4 --holds "12-14" --cuts "4.5,9" # + 3 dead air, 4 pops
+node <skill>/scripts/gate.mjs --self-test # prove the gate itself still catches bugs
```
The stillness checks compare frames 1/30 s apart, so a film gets the same answer at 30 and at 60 fps. A clip that plays inside the film at a lower frame rate than the film (a 30 fps video in a 60 fps film) holds each of its frames for two of ours, so every new clip frame reads as a pop: declare it on the page, `window.FOOTAGE = [[from, to, fps]]`, or with `--footage "13-18.5@30"`, and the gate measures that stretch once per clip frame. Cuts inside the clip are still found and still need declaring. Words that land whole on a beat are pops too: give each a three or four frame fade, and declare only the real hits. The burst on a music hit and any deliberate dip to black are declared (`--cuts` for the first, `--holds` for the second) rather than softened. Run it twice per film: checks 1-2 right after the first shots draw (a stale cache or a `Math.random` found now costs minutes, found after a 9-minute export costs the render), and all three on the exported MP4 before the user sees a single frame or contact sheet. It samples ~12 frames cold-forward vs warmed-reverse (md5, PSNR > 45 dB fallback) and on a mismatch names the poisoning frame ("ORDER-DEPENDENT: drawing frame X first changes frame Y" = a cache key missing a term or leaked ctx state). Deliberate stills go in `--holds`. Check 4 (pops) lists every frame whose difference from the last is over 3x its six neighbours': each one is either an intentional hard cut, declared with `--cuts` (or `window.CUTS`), or a bug to fix (an element appearing with no ease, a flood clearing too fast so it reads as a flash). It resolves playwright-core via the `node_modules` symlink beside it in `scripts/` (or `PLAYWRIGHT_NODE_MODULES=/path/to/node_modules`); it only reads the MP4, never writes to the project. Adapted from anidoodle (Apache-2.0).
## Footage inside a frame (a screen in a player, a strip of an earlier film)
```bash
-python3 ~/.claude/skills/take-one/scripts/content-box.py capture.mp4 12.0 2.5 --rest --keep 160-900 # where the content sits, and the crop to use
+python3 <skill>/scripts/content-box.py capture.mp4 12.0 2.5 --rest --keep 160-900 # where the content sits, and the crop to use
```
Measure before cropping: the script finds the box of everything that is not ground in that stretch and prints an ffmpeg `crop` and `scale` that keep a clear margin round it for the space the film gives it (`--fit 1344x598`). When the content is wider than the space the strip comes out shorter: centre it, do not cut it. Blank what you leave out (a header row, a caption) with `drawbox` before the crop, and draw a dark strip `lighten` over the player's dark ground so the two grounds are one. Declare the footage's frame rate (`window.FOOTAGE`) for the gate.
## Text audit (what the words on screen actually do)
```bash
-node ~/.claude/skills/take-one/scripts/text-audit.mjs # film.html in this folder
-node ~/.claude/skills/take-one/scripts/text-audit.mjs cut.html --step 0.05 --ignore "lorem|^\\d+$" --json text.json
+node <skill>/scripts/text-audit.mjs # film.html in this folder
+node <skill>/scripts/text-audit.mjs cut.html --step 0.05 --ignore "lorem|^\\d+$" --json text.json
```
Run it at the stills gate and again before the reviewer. It draws the film frame by frame, records every `fillText` and `strokeText` (the text, its size on screen, where it sits, how opaque), joins the samples into "this text was up from A to B", and reports:
- **SMALL**: held 0.6 s or more and under 3.3 % of the frame height (FAIL) or under 4.3 % (WARN). At 1920x1080 that is 36 and 46 px: about 6.5 and 8.5 px on a phone.
@@ -85,8 +87,8 @@ SUB=8 node export.mjs 60 master.mp4 # final master only; review ex
One browser draws about 4 to 8 frames a second at 1080p, so a 75 s film at 60 fps takes ten minutes or more in one process. Render it in pieces instead:
```bash
-bash ~/.claude/skills/take-one/scripts/render-parallel.sh 60 78.6 out/master.mp4 # fps, duration in seconds, output; 3 workers
-bash ~/.claude/skills/take-one/scripts/render-parallel.sh 30 78.6 out/draft.mp4 3 12 # review draft: 30 fps, 3 workers, 12 s pieces
+bash <skill>/scripts/render-parallel.sh 60 78.6 out/master.mp4 # fps, duration in seconds, output; 3 workers
+bash <skill>/scripts/render-parallel.sh 30 78.6 out/draft.mp4 3 12 # review draft: 30 fps, 3 workers, 12 s pieces
```
- Run it from the project folder. It writes the picture only; add the sound with `mux-audio.sh` (or one ffmpeg call).
- **Three workers on a laptop.** Each worker is a whole Chrome. Six at once ran a 16 GB machine out of memory in the middle of a film; three finished without trouble.
diff --git a/references/quality-checklist.md b/references/quality-checklist.md
index c89da22..8cd6a3a 100644
--- a/references/quality-checklist.md
+++ b/references/quality-checklist.md
@@ -75,7 +75,7 @@ A part that fails the first two reads as a template however polished it is. Name
- [ ] Brand pass done: real typeface, colors, logo files, headline and CTA from the live site (`brand-pass.md`).
**Technical**
-- [ ] The quality gate passes (`node ~/.claude/skills/take-one/scripts/gate.mjs film.html`, add `--mp4 out.mp4 --holds "a-b"` once exported). Run it before showing the user anything rendered — frames or MP4 — not after: it proves determinism by machine (cold-forward vs warmed-reverse hashes, and it names the frame that poisons a stale cache), scans the source for clocks/`Math.random`/filters, and measures dead air on the export. "Looks deterministic" is not a claim; a green gate is.
+- [ ] The quality gate passes (`node <skill>/scripts/gate.mjs film.html`, add `--mp4 out.mp4 --holds "a-b"` once exported). Run it before showing the user anything rendered — frames or MP4 — not after: it proves determinism by machine (cold-forward vs warmed-reverse hashes, and it names the frame that poisons a stale cache), scans the source for clocks/`Math.random`/filters, and measures dead air on the export. "Looks deterministic" is not a claim; a green gate is.
- [ ] Gate check 4 (pops) is green: every frame-difference spike is a declared cut (`--cuts`), the rest fixed.
- [ ] The master is exported with `SUB=8` for smooth-motion styles (kinetic, explainer, title, chrome, mono); never for stepped art (pipeline.md).
- [ ] No console errors; `renderFrame(t)` deterministic (same t, same pixels, any order).
diff --git a/scripts/audit-faces.mjs b/scripts/audit-faces.mjs
index 8645d5b..24938b7 100644
--- a/scripts/audit-faces.mjs
+++ b/scripts/audit-faces.mjs
@@ -7,7 +7,9 @@ const portrait = process.argv[2] === '1', step = Number(process.argv[3] || 0.125
const FILM = process.env.FILM || 'film.html';
const W = portrait ? 1080 : 1920, H = portrait ? 1920 : 1080;
const { srv, url } = await serve('.');
-const browser = await chromium.launch({ channel: 'chrome', headless: true, args: ['--use-angle=metal', '--ignore-gpu-blocklist'] });
+// Metal is the Mac's graphics engine: ask for it on a Mac only, every other system keeps Chrome's own choice
+const GPU = process.platform === 'darwin' ? ['--use-angle=metal', '--ignore-gpu-blocklist'] : ['--ignore-gpu-blocklist'];
+const browser = await chromium.launch({ channel: 'chrome', headless: true, args: GPU });
const page = await browser.newPage({ viewport: { width: W, height: H } });
await page.goto(url + '/' + FILM + (portrait ? '?portrait=1' : ''));
await page.waitForFunction(() => typeof window.renderFrame === 'function' && window.READY === true, null, { timeout: 120000 });
diff --git a/scripts/contact-sheet.sh b/scripts/contact-sheet.sh
index 2d3c77c..a971df6 100755
--- a/scripts/contact-sheet.sh
+++ b/scripts/contact-sheet.sh
@@ -2,8 +2,8 @@
# Reverse-engineer a reference video: a 6x4 contact sheet across its whole length + 3 full frames.
# Usage: contact-sheet.sh <video> [outdir]
v="$1"; o="${2:-./ref-$(basename "${v%.*}")}"; mkdir -p "$o"
-d=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$v")
+d=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$v" | tr -d '\r')
ffmpeg -y -v error -i "$v" -vf "fps=24/$d,scale=480:-1,tile=6x4:padding=4" -frames:v 1 "$o/sheet.png"
-for f in 0.15 0.5 0.8; do t=$(python3 -c "print($d*$f)"); ffmpeg -y -v error -ss "$t" -i "$v" -frames:v 1 -vf scale=1280:-1 "$o/frame-$f.png"; done
+for f in 0.15 0.5 0.8; do t=$(LC_ALL=C awk -v d="$d" -v f="$f" 'BEGIN { printf "%.3f\n", d * f }'); ffmpeg -y -v error -ss "$t" -i "$v" -frames:v 1 -vf scale=1280:-1 "$o/frame-$f.png"; done
ffprobe -v error -show_entries stream=width,height,r_frame_rate:format=duration -of default=nw=1 "$v"
echo "wrote $o/sheet.png and 3 frames"
diff --git a/scripts/export.mjs b/scripts/export.mjs
index b33c5bd..26ab395 100644
--- a/scripts/export.mjs
+++ b/scripts/export.mjs
@@ -14,7 +14,9 @@ const W = Number(process.env.W || 1920), H = Number(process.env.H || 1080), SLOW
const SUB = Math.max(1, Math.round(Number(process.env.SUB || 1)));
const FILM = process.env.FILM || 'film.html';
const { srv, url } = await serve('.');
-const browser = await chromium.launch({ channel: 'chrome', headless: true, args: ['--use-angle=metal', '--ignore-gpu-blocklist'] });
+// Metal is the Mac's graphics engine: ask for it on a Mac only, every other system keeps Chrome's own choice
+const GPU = process.platform === 'darwin' ? ['--use-angle=metal', '--ignore-gpu-blocklist'] : ['--ignore-gpu-blocklist'];
+const browser = await chromium.launch({ channel: 'chrome', headless: true, args: GPU });
const page = await browser.newPage({ viewport: { width: W, height: H } });
await page.goto(url + '/' + FILM + (H > W ? '?portrait=1' : ''));
await page.waitForFunction(() => typeof window.renderFrame === 'function' && window.READY === true, null, { timeout: 120000 });
diff --git a/scripts/frames.mjs b/scripts/frames.mjs
index 52efd11..0a8809a 100644
--- a/scripts/frames.mjs
+++ b/scripts/frames.mjs
@@ -11,7 +11,9 @@ const W = Number(process.env.W || (portrait ? 1080 : 1920)), H = Number(process.
const dir = (FILM === 'film.html' ? 'review/' : 'review-' + FILM.replace('.html', '') + '/') + (portrait ? 'portrait' : 'square');
fs.mkdirSync(dir, { recursive: true });
const { srv, url } = await serve('.');
-const browser = await chromium.launch({ channel: 'chrome', headless: true, args: ['--use-angle=metal', '--ignore-gpu-blocklist'] });
+// Metal is the Mac's graphics engine: ask for it on a Mac only, every other system keeps Chrome's own choice
+const GPU = process.platform === 'darwin' ? ['--use-angle=metal', '--ignore-gpu-blocklist'] : ['--ignore-gpu-blocklist'];
+const browser = await chromium.launch({ channel: 'chrome', headless: true, args: GPU });
const page = await browser.newPage({ viewport: { width: W, height: H } });
const errs = []; page.on('pageerror', e => errs.push(e.message)); page.on('console', m => { if (m.type() === 'error') errs.push(m.text()); });
await page.goto(url + '/' + FILM + (portrait ? '?portrait=1' : ''));
diff --git a/scripts/gate.mjs b/scripts/gate.mjs
index b73cfc8..ae8b89c 100644
--- a/scripts/gate.mjs
+++ b/scripts/gate.mjs
@@ -60,6 +60,8 @@ for (let i = 2; i < process.argv.length; i++) { const a = process.argv[i]; if (a
const W = Number(process.env.W || 1920), H = Number(process.env.H || 1080);
const SAMPLES = Math.max(4, Number(opt.samples ?? 12));
const TMP = path.join(process.env.GATE_TMP || os.tmpdir(), `gate-${process.pid}`);
+// Metal is the Mac's graphics engine: ask for it on a Mac only, every other system keeps Chrome's own choice
+const GPU = process.platform === 'darwin' ? ['--use-angle=metal', '--ignore-gpu-blocklist'] : ['--ignore-gpu-blocklist'];
let fails = 0, checks = 0;
const say = (ok, label, detail = '') => { checks++; if (!ok) fails++; console.log(` ${ok ? 'PASS' : 'FAIL'} ${label}${detail ? ' ' + detail : ''}`); };
@@ -295,7 +297,7 @@ const run = async () => {
console.log(`QUALITY GATE ${filmPath} viewport ${W}x${H}`);
const chromium = loadChromium();
const { srv, url } = await serve(path.dirname(filmPath));
- const browser = await chromium.launch({ channel: 'chrome', headless: true, args: ['--use-angle=metal', '--ignore-gpu-blocklist'] });
+ const browser = await chromium.launch({ channel: 'chrome', headless: true, args: GPU });
try {
const { pageHolds, pageCuts, pageFootage } = await determinism(browser, url, path.basename(filmPath));
contractScan(filmPath);
diff --git a/scripts/render-parallel.sh b/scripts/render-parallel.sh
index 18dbfb6..cd71545 100755
--- a/scripts/render-parallel.sh
+++ b/scripts/render-parallel.sh
@@ -12,9 +12,11 @@
set -u
fps=${1:?fps}; dur=${2:?duration in seconds}; out=${3:?output mp4}; workers=${4:-3}; piece=${5:-12}
work="$(dirname "$out")/.pieces-$(basename "$out" .mp4)"; rm -rf "$work"; mkdir -p "$work"
-starts=(); t=0; while [ "$(echo "$t < $dur" | bc)" = 1 ]; do starts+=("$t"); t=$((t + piece)); done
+# sums with fractions are done in awk, which every system with bash has (bc is missing on Windows and on a bare Linux)
+lt() { LC_ALL=C awk -v a="$1" -v b="$2" 'BEGIN { exit !(a + 0 < b + 0) }'; }
+starts=(); t=0; while lt "$t" "$dur"; do starts+=("$t"); t=$((t + piece)); done
n=${#starts[@]}
-run_piece() { local i=$1 s=${starts[$1]} e; e=$(echo "if (${starts[$1]} + $piece < $dur) ${starts[$1]} + $piece else $dur" | bc)
+run_piece() { local i=$1 s=${starts[$1]} e; e=$(LC_ALL=C awk -v s="${starts[$1]}" -v p="$piece" -v d="$dur" 'BEGIN { e = s + p; if (e < d + 0) print e; else print d }')
START=$s END=$e node export.mjs "$fps" "$work/p$i.mp4" > "$work/p$i.log" 2>&1 & echo $! > "$work/p$i.pid"; }
next=0; running=()
while [ $next -lt $n ] || [ ${#running[@]} -gt 0 ]; do
@@ -34,6 +36,6 @@ for i in $(seq 0 $((n - 1))); do
echo "file 'p$i.mp4'" >> "$work/list.txt"
done
ffmpeg -v error -y -f concat -safe 0 -i "$work/list.txt" -c copy "$out" || exit 1
-got=$(ffprobe -v error -count_packets -select_streams v -show_entries stream=nb_read_packets -of csv=p=0 "$out"); want=$(echo "$dur * $fps / 1" | bc)
+got=$(ffprobe -v error -count_packets -select_streams v -show_entries stream=nb_read_packets -of csv=p=0 "$out" | tr -d '\r'); want=$(LC_ALL=C awk -v d="$dur" -v f="$fps" 'BEGIN { printf "%d\n", d * f + 0.000001 }')
echo "wrote $out: $got frames (expected about $want)"; [ "$got" -ge $((want - 2)) ] || { echo "frame count is short: a piece stopped early, read its log in $work"; exit 1; }
rm -rf "$work"
diff --git a/scripts/review-pack.sh b/scripts/review-pack.sh
index 7b36dab..22886b4 100755
--- a/scripts/review-pack.sh
+++ b/scripts/review-pack.sh
@@ -24,14 +24,15 @@ ok "$strips" "$num-$num" || { echo "--strips takes ranges in seconds, like 9.2-1
# the pack folder is emptied only when it is new, empty, or a pack this script made before
if [ -e "$P" ] && [ -n "$(ls -A "$P" 2>/dev/null)" ] && [ ! -f "$P/WORDS-AND-SOUND.md" ]; then echo "$P holds other files; give a new folder for the pack"; exit 2; fi
rm -rf "$P"; mkdir -p "$P"; T=$(mktemp -d)
-dur=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$V"); D=${dur%.*}
+dur=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$V" | tr -d '\r'); D=${dur%.*}
k=0; s=0; while [ $s -lt "$D" ]; do k=$((k + 1)); ffmpeg -v error -y -ss $s -t 39.9 -i "$V" -vf "fps=1,scale=400:-1,tile=8x5:padding=4:color=gray" -frames:v 1 "$P/sheet_1fps_part$k.png"; s=$((s + 40)); done
-if [ -z "$beats" ]; then beats=$(python3 -c "import sys; d=float(sys.argv[1]); print(','.join(f'{d*i/35.5:.1f}' for i in range(36)))" "$dur"); fi
+# the sums are done in awk, which every system with bash has, so the pack needs nothing beyond ffmpeg
+if [ -z "$beats" ]; then beats=$(LC_ALL=C awk -v d="$dur" 'BEGIN { for (i = 0; i < 36; i++) printf "%s%.1f", (i ? "," : ""), d * i / 35.5; print "" }'); fi
IFS=',' read -ra B <<< "$beats"; i=0
for t in "${B[@]}"; do ffmpeg -v error -y -ss "$t" -i "$V" -frames:v 1 -vf scale=640:-1 "$T/b$(printf %03d $i).png"; [ $((i % 5)) -eq 0 ] && ffmpeg -v error -y -ss "$t" -i "$V" -frames:v 1 "$P/full_t$t.png"; i=$((i + 1)); done
g=0; j=0; while [ $j -lt ${#B[@]} ]; do g=$((g + 1)); ffmpeg -v error -y -start_number $j -i "$T/b%03d.png" -frames:v 9 -vf "tile=3x3" -frames:v 1 "$P/beats_grid$g.png" 2>/dev/null; j=$((j + 9)); done
IFS=',' read -ra S <<< "$strips"
-for r in "${S[@]:-}"; do [ -z "$r" ] && continue; a=${r%-*}; b=${r#*-}; len=$(python3 -c "import sys; print(float(sys.argv[2])-float(sys.argv[1]))" "$a" "$b"); ffmpeg -v error -y -ss "$a" -t "$len" -i "$V" -vf "fps=12/$len,scale=480:-1,tile=4x3:padding=3:color=gray" -frames:v 1 "$P/strip_$a-$b.png"; done
+for r in "${S[@]:-}"; do [ -z "$r" ] && continue; a=${r%-*}; b=${r#*-}; len=$(LC_ALL=C awk -v a="$a" -v b="$b" 'BEGIN { printf "%.3f\n", b - a }'); ffmpeg -v error -y -ss "$a" -t "$len" -i "$V" -vf "fps=12/$len,scale=480:-1,tile=4x3:padding=3:color=gray" -frames:v 1 "$P/strip_$a-$b.png"; done
[ -z "$text" ] && text=$beats; IFS=',' read -ra X <<< "$text"; i=0
for t in "${X[@]}"; do [ $i -ge 20 ] && break; ffmpeg -v error -y -ss "$t" -i "$V" -frames:v 1 -vf scale=360:-1 "$T/p$(printf %03d $i).png"; i=$((i + 1)); done
ffmpeg -v error -y -i "$T/p%03d.png" -vf "tile=5x$(( (i + 4) / 5 ))" -frames:v 1 "$P/phone_360px.png" 2>/dev/null