Skip to content
Python

Add claude-reel-editor: the reel editing system as an installable skill

Charlie Hillsf62f41ba8e4b
diff --git a/README.md b/README.md
index d78265d..b9ad5f4 100644
--- a/README.md
+++ b/README.md
@@ -61,6 +61,7 @@ See each skill's `SKILL.md` for trigger phrases, inputs, and dependencies.
| [graphic-designer](skills/graphic-designer/) | Create HTML/CSS plus an inspected PNG when rendering is available, or a Gemini image prompt. |
| [post-scorer](skills/post-scorer/) | Review against your supplied history or authorised Apify results, with an editorial-only fallback. |
| [reels-scripting](skills/reels-scripting/) | Analyse a reference Reel via Apify + Gemini 2.5 Flash, or use supplied material. Draft and review a script in your voice. |
+| [claude-reel-editor](skills/claude-reel-editor/) | Turn one raw talking-head take into a finished Instagram reel with Claude Code: cut on silence, storyboard, one big 3D graphic per line, a frame check every 0.25s, render and export. Includes the engine, components, scripts and a test reel that renders end to end. |
| [youtube-thumbnail](skills/youtube-thumbnail/) | Turn a video title into a branded YouTube thumbnail prompt for Gemini. |
| [pinned-comment](skills/pinned-comment/) | Meme-style pinned comments with a matching image generation prompt. |
| [hook-generator](skills/hook-generator/) | 6 concise hook angles using supplied facts and genuine author experience. |
diff --git a/skills/claude-reel-editor/.gitignore b/skills/claude-reel-editor/.gitignore
new file mode 100644
index 0000000..2ffaaaf
--- /dev/null
+++ b/skills/claude-reel-editor/.gitignore
@@ -0,0 +1,12 @@
+node_modules/
+.DS_Store
+# made by the example run, regenerate with: npm run example
+example/raw.mp4
+example/music.wav
+example/cut-audio.wav
+example/page/frames/
+example/out/
+example/storyboard/
+example/check/
+example/gallery/storyboard/
+example/gallery/check/
diff --git a/skills/claude-reel-editor/LICENSE b/skills/claude-reel-editor/LICENSE
new file mode 100644
index 0000000..82feab7
--- /dev/null
+++ b/skills/claude-reel-editor/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 Charlie Hills
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/skills/claude-reel-editor/README.md b/skills/claude-reel-editor/README.md
new file mode 100644
index 0000000..4cde453
--- /dev/null
+++ b/skills/claude-reel-editor/README.md
@@ -0,0 +1,135 @@
+# Claude reel editor
+
+This is the system I use for my own reels.
+
+You film one raw take of yourself talking to camera. Claude cuts it, builds a graphic for every line you say, checks its own work and hands back a finished Instagram reel. I don't open an editing app.
+
+Here's how it works under the hood. The whole edit is one web page. Claude draws any moment of the reel on that page, then records it frame by frame in Chrome (with a free tool called Puppeteer) and joins the frames with ffmpeg.
+
+One honest note. The code here is the real engine, the real components and the real checks. Your notes on each version still do a lot of the work. My last reel took seven rounds.
+
+## What you need
+
+- **Claude Code.** It comes with the Claude Pro plan and above. Install it from Terminal: `curl -fsSL https://claude.ai/install.sh | bash`
+- **Node.js 18 or newer.** On a Mac: `brew install node`
+- **ffmpeg.** On a Mac: `brew install ffmpeg`
+- **Python 3** with numpy and Pillow, for cutting and checking: `pip3 install numpy pillow`
+- **Transcription.** On an Apple Silicon Mac, install uv (`brew install uv`) and the kit runs mlx-whisper for you. On Windows or Linux: `pip3 install faster-whisper`
+- **One raw take.** Film yourself in one go. Mistakes are fine.
+
+The head pop-out is optional. It needs PyTorch: `pip3 install torch torchvision`
+
+## Install
+
+```bash
+git clone https://github.com/charlie947/social-media-skills.git
+cp -R social-media-skills/skills/claude-reel-editor ~/.claude/skills/
+cd ~/.claude/skills/claude-reel-editor
+npm run setup
+```
+
+`npm run setup` installs Puppeteer and the copy of Chrome it drives.
+
+Check it works with the example reel. It makes test footage (a colour test pattern and tone bursts, no real face or voice), cuts it, builds the storyboard, checks every frame, renders and exports:
+
+```bash
+npm run example
+```
+
+You should see `NO FLAGS`, `DONE`, `PASS` and `0 FAIL`. The finished file is `example/out/reel-ig.mp4`.
+
+## Make it yours
+
+Every colour, font and card style lives in one file: `engine/brand.js`. Change the accent first. It's the one colour that does all the work.
+
+The default font is Inter, which is free. Change the font name and the Google Fonts link in the same file if you want another one.
+
+## The 8 steps
+
+Open Claude Code in a new folder with your raw take in it. Then go step by step. What you type is under each one.
+
+### 1. Cut the raw take
+
+```text
+Use the claude-reel-editor skill. My raw take is raw.mp4. Transcribe it, cut every pause and every take I fluffed, only in true silence. Show me the table of cuts before you go on.
+```
+
+Claude finds every stretch of speech between real silences, drops your bad takes and checks no join clips a word.
+
+### 2. Storyboard before any render
+
+```text
+Build me the storyboard. One still per line, with the time, my words, the layout and the one move. Wait for my yes.
+```
+
+You get one page. Click a card and that line plays with sound. Type your notes in the bar at the bottom and paste them back.
+
+### 3. One big graphic per line, on the word
+
+```text
+One big graphic per line. It fills the top half and I sit below. Each one acts out what I'm saying and changes on the exact word, using the timings from the cut. Cut to me full screen twice for a break.
+```
+
+### 4. Make it 3D and make it hit
+
+```text
+Make every graphic 3D. Each object slams in from deep on its word and lands with no bounce. When something leaves, it drops away into depth. No idle drifting.
+```
+
+### 5. Show real things, never stand-ins
+
+```text
+When I mention an app or a website, show the real thing. Real app icon, the real command, real screenshots. Never the same example twice.
+```
+
+You'll need to give Claude the real files, or tell it where to find them.
+
+### 6. The hook is the animation
+
+```text
+For the first 2 seconds, build my hook text as an animation on my first words: [YOUR HOOK]. Keep it inside Instagram's safe area.
+```
+
+### 7. Check every quarter of a second
+
+```text
+Before you show me anything, check the edit every quarter of a second and fix every flag.
+```
+
+It screenshots every 0.25 seconds and flags any text Instagram covers, anything cut off, any caption touching a graphic, any graphic too small for its panel, and any stretch where nothing moves. Claude only shows you the edit when it says `NO FLAGS`.
+
+### 8. Render, music and the Instagram export
+
+```text
+Render it. Add my music about 12 dB under my voice, level to the last frame. Export for Instagram and tell me the codec, colour range, length and loudness.
+```
+
+Use music you have the rights to. The export lands at -14 LUFS, H.264, 1080 by 1920, limited colour range.
+
+## Then it's one sentence per change
+
+Watch it and type one note at a time. "Make the staircase bigger." "Use the real screen here." "That card comes in too late." Each one comes back as a new version.
+
+## What's in the box
+
+| Folder | What it does |
+|---|---|
+| `SKILL.md` | The process Claude follows, step by step, with a check on every step |
+| `engine/` | `brand.js` (your look), `engine.js` (draws any moment), `motion.js` (3D moves), `ui.js` (cards, ticks, a code window) |
+| `components/` | The graphics: staircase, version carousel, drop zone, filmstrip and scanner, cut strip, progress ring, count-up, giant dial, code window demo, timeline hook, style transfer |
+| `scripts/cut/` | Probe, transcribe, find silences, check every join, check pauses, check words |
+| `scripts/` | Storyboard, the quarter-second check, render, matte, music check, export, QA, new reel |
+| `example/` | A 13 second reel that runs end to end, plus a gallery page of every component |
+
+## When something goes wrong
+
+- **A word is clipped at a join.** Say: "Re-cut that join in true silence and check it again."
+- **The graphics land late.** Say: "Transcribe the cut again and use those timings."
+- **A caption sits on a graphic.** Say: "Run the quarter-second check and fix every flag."
+- **The graphics feel weak.** Say: "One big 3D object per line that fills the panel and hits on the word."
+- **The music fades early.** Say: "Loop the music's own bars so it stays level to the last frame."
+- **Chrome is missing.** Run `npx puppeteer browsers install chrome`
+
+## Licence
+
+MIT. See `LICENSE`. The head pop-out downloads Robust Video Matting when you run it, which has its own GPL-3.0 licence.
diff --git a/skills/claude-reel-editor/SKILL.md b/skills/claude-reel-editor/SKILL.md
new file mode 100644
index 0000000..78133fe
--- /dev/null
+++ b/skills/claude-reel-editor/SKILL.md
@@ -0,0 +1,176 @@
+---
+name: claude-reel-editor
+description: >
+ Edit a raw talking-head video into a finished Instagram reel with motion graphics. Cuts on true silence, builds a storyboard for approval before any render, draws one big 3D graphic per spoken line that lands on the word, checks every quarter second, renders frame by frame in headless Chrome and exports for Instagram. Use when someone says "edit my reel", "edit this video", "cut this take", "make the graphics for my reel" or gives you a raw video to turn into a reel.
+---
+
+# Claude reel editor
+
+You are the video editor. The person gives you one raw take of themselves talking to camera. You hand back a finished 1080x1920 reel.
+
+The edit is one web page. `window.seek(t)` draws any moment of it. A renderer screenshots that page frame by frame in headless Chrome with Puppeteer, and ffmpeg joins the frames. No editing app is opened.
+
+`KIT` below means the folder this file is in (usually `~/.claude/skills/claude-reel-editor`).
+
+## The rules every step serves
+
+1. Cut only in true silence, never inside a word.
+2. Build every graphic on the CUT transcript's timings, never the raw take's.
+3. Show a storyboard and wait for a yes before any video render.
+4. One big 3D object per spoken line. It fills the top panel (x74 to 1006, y170 to 880). A denser list or a small card in an empty panel is a fail.
+5. Every hit lands on its spoken word. The payoff lands ON its word, not after the cut.
+6. Carry the object across a cut, or zoom through to the next graphic. A beat never opens on an empty object.
+7. Show real things: the real app, the real command, real screenshots. Never a stand-in. Never the same example twice in one reel.
+8. The hook is the opening animation, never a flat title card.
+9. Nothing moves after it lands (no drift, no bob). No strike lines or scribbles: a rejected item goes grey and lifts out.
+10. Never show the person a version that has not passed the checks.
+
+Every step below ends with a check that can fail. Do not move on until it passes. When a check is NOT RUN, say NOT RUN. Never report a result you did not get.
+
+## Step 0. Set up the reel folder (once per reel)
+
+```bash
+node KIT/scripts/new-reel.js ~/reels/my-reel # makes reel.config.json, page/reel.html, page/beats.js, page/lib/
+```
+
+Put the raw take in that folder as `raw.mp4`. Run `npm run setup` in `KIT` once per machine (Puppeteer and its Chrome).
+Ask for the brand once: background, text colour, ONE accent colour, font. Write them into `page/lib/brand.js` and nowhere else.
+
+Check: `ls ~/reels/my-reel/raw.mp4 ~/reels/my-reel/page/lib/brand.js` both exist.
+
+## Step 1. Probe the raw take
+
+```bash
+python3 KIT/scripts/cut/raw-probe.py raw.mp4
+```
+
+Check: exit 0. It fails on a second audio track (phones add a spatial one) and on sound that starts late against the picture. Fix those before any cut.
+
+## Step 2. Transcribe the raw take
+
+```bash
+python3 KIT/scripts/cut/transcribe.py raw.mp4 raw-words.json
+```
+
+On an Apple Silicon Mac this runs `mlx-whisper` (small.en) through `uvx`. Elsewhere it uses `faster-whisper`.
+
+Check: the word count is not zero and the text reads like what was said.
+
+## Step 3. Cut on true silence
+
+```bash
+python3 KIT/scripts/cut/silences.py raw.mp4 segs.json --words raw-words.json
+```
+
+It lists every island of speech between silences (under -52 dB for 0.25s), with the words inside it. Read the whole list, then run it again with `--drop` for every island to remove:
+- a fluffed or repeated take. Keep the LAST clean take of each line. Look at the end of the recording for a re-recorded hook.
+- a take rejected out loud ("scratch that", "let me start again"), even with no pause round it.
+- an aside that points at something off screen.
+
+Show the person a table of every cut: start, end, and the words either side. Then:
+
+```bash
+python3 KIT/scripts/cut/join-check.py raw.mp4 segs.json # no join clips a word (waveform, -48 dB)
+python3 KIT/scripts/cut/pause-check.py raw.mp4 segs.json # no pause over 0.25s left inside a segment
+```
+
+Check: both exit 0. A clipped join is fixed by moving that cut into true silence, never by hoping.
+
+## Step 4. Make the cut and transcribe it again
+
+```bash
+python3 KIT/scripts/cut/make-cut.py raw.mp4 segs.json cut-audio.wav # 30ms fades at each join
+python3 KIT/scripts/cut/transcribe.py cut-audio.wav cut-words.json
+python3 KIT/scripts/cut/words-check.py cut-words.json
+node KIT/scripts/make-data.js . # writes page/data.js
+```
+
+Check: `words-check.py` exits 0 (no um, no doubled word, no half word, no rejected take). Read the cut transcript end to end: nothing said twice, nothing that refers to something the viewer has not heard yet.
+
+## Step 5. Plan the beats
+
+Write `page/beats.js`. One beat per spoken line, `{ a, b, lay, still, move, draw }`. Read `KIT/example/page/beats.js` first, it shows every rule once.
+
+- `lay`: `split` (graphic top, face card below), `full` (graphic fills the frame) or `face` (full-frame face, a hard cut). Change layout every 3 to 5 seconds. Use `face` about twice per reel for a break.
+- Times come from `word('3D')` and `wordEnd('hour')`, never typed by hand. `word()` throws if the word is not in the cut, so a re-cut cannot silently break the timing.
+- Pick a component from `KIT/components/` for each line. Each file's top comment says what it acts out and which times it takes: staircase, carousel, dropZone, filmstripScan, cutStrip, progressRing, countUp, dial, codeDemo, timelineHook, styleTransfer.
+- Give a long beat two or three hits, each on its own word. Use `slam()` to enter and `crash()` to leave.
+- `carry: true` hands a beat's object to the next beat (draw it swinging away for the first 0.55s of the next beat). Without it, two graphic beats meet with a zoom-through. A face beat is always a hard cut.
+- Real assets: icons at 512px or more, pictures 1000px wide or more. Count every screen you will fill (phones, cards, covers) and fetch that many DIFFERENT real ones.
+- Captions are automatic from the cut words. Fix spellings and write spoken numbers as digits with `spell: { twenty: '20' }`.
+
+Check: `node --check page/beats.js` exits 0, and every line of the cut transcript is inside exactly one beat.
+
+## Step 6. Storyboard, then wait
+
+```bash
+node KIT/scripts/storyboard.js .
+```
+
+Open `storyboard/STORYBOARD.html` for the person. One card per beat: the still, the time, the exact words, the layout and the one move. Clicking a card plays that beat with sound. They leave notes in the bar at the bottom and paste them back to you.
+
+Check: the person has said yes to this storyboard. No yes, no render. Each round of notes: change the beats, run the storyboard again, show it again.
+
+## Step 7. Check every quarter of a second
+
+```bash
+node KIT/scripts/check-frames.js .
+```
+
+It screenshots every beat every 0.25s and flags: text in Instagram's hidden zones (top 210px, below y1520, right of x950 in the lower half), text cut off at the frame edge, the caption touching a graphic, a split beat whose graphic covers under 45% of the panel, and a graphic that does not change for 1.5s. Look at `check/sheet.jpg` yourself as well.
+
+Check: it prints `NO FLAGS` and exits 0. Fix every flag, then run it again. A font that did not load stops the check too.
+
+## Step 8. Render
+
+```bash
+node KIT/scripts/render.js .
+```
+
+It cuts the face frames from the raw take, renders 60fps in several Chrome workers, blends to 30fps and encodes H.264. Each frame's face comes from the TRUE raw time for that cut time, so lip sync never drifts across a join. The 13 second example renders in about 17 seconds with 4 workers on a 10-core Mac mini.
+
+Check: it prints `frames: N of N` and `DONE` with `h264 1080 1920 yuv420p tv`. A missing frame stops it before the encode.
+
+## Step 9. Head pop-out (optional)
+
+```bash
+python3 KIT/scripts/matte.py page/frames # needs torch. Cuts the person out of every face-card frame
+```
+
+Set `pop: true` in `REEL`. The head now breaks out over the top of the face card on split beats. Run Step 7 and Step 8 again. Run the matte again whenever the raw take or the crop changes.
+
+Check: `page/frames/cutout` holds as many files as `page/frames/split`.
+
+## Step 10. Music and the Instagram export
+
+```bash
+python3 KIT/scripts/music-steady.py music.wav
+bash KIT/scripts/export.sh out/reel.mp4 music.wav out/reel-ig.mp4
+```
+
+The music must be a track they have the rights to. It loops to the full length, sits 12 dB under the voice, and the mix gets one static gain to -14 LUFS with a limiter that never raises the level.
+
+Check: `music-steady.py` exits 0 and `export.sh` prints `PASS` with the codec, colour range, length and loudness.
+
+## Step 11. QA, then show it
+
+```bash
+python3 KIT/scripts/qa.py out/reel-ig.mp4
+```
+
+Check: `0 FAIL`. Then look at `out/reel-ig-qa/sheet.jpg` and `deadzone.jpg` tile by tile. Lip sync and taste print NOT RUN because a model cannot hear or judge them: tell the person to play it with sound and watch three joins.
+
+Report the ffprobe line, the loudness, the QA result, and the path to the file.
+
+## Then one sentence per change
+
+The person watches it and types one note at a time ("make it 3D", "use the real app screen", "I don't want to see the same example twice"). For each note, change the beats, then run Step 6 (if the plan changed), Step 7 and Step 8 again. Give every fix with its time in the NEW version, because a cut moves every later time. Never swap an approved concept for a new one: level up the motion inside it.
+
+## When something goes wrong
+
+- A word is clipped at a join: move that cut into true silence, run Step 3 checks again.
+- The graphics land late: they used raw timings. Transcribe `cut-audio.wav` again, run `make-data.js`.
+- A caption sits on a graphic: Step 7 flags it. Move the object, never the caption.
+- The graphics feel weak: one bigger 3D object per line that fills the panel and hits on the word.
+- The music fades early: loop its own bars to fill the end, then run `music-steady.py`.
+- Chrome is missing: `npx puppeteer browsers install chrome`.
diff --git a/skills/claude-reel-editor/components/carousel.js b/skills/claude-reel-editor/components/carousel.js
new file mode 100644
index 0000000..9988ec2
--- /dev/null
+++ b/skills/claude-reel-editor/components/carousel.js
@@ -0,0 +1,26 @@
+// VERSION CAROUSEL: a big 3D ring of 9:16 cards (your earlier versions) fills the panel. Each word turns it one card,
+// then it spins fast to the winner, which lifts forward and gets a tick while the others grey back.
+// Use real 9:16 frames of your own earlier renders, never landscape stills cropped to fit.
+//
+// carousel(t, {
+// images: ['v1.jpg', ..., 'v5.jpg'], the last image is the winner
+// start: 6.6, beat start
+// turns: [6.9, 7.1, 7.3], one turn per word
+// spinAt: 7.6, the fast spin to the winner
+// landAt: 8.3, the winner lifts and ticks (the payoff word)
+// label: 'v5' optional badge on the winner
+// })
+function carousel(t, o) {
+ const IM = o.images, N = IM.length, win = N - 1;
+ const spinSteps = ((win - o.turns.length) % N + N) % N || N;
+ const s = P(t, o.spinAt, .5);
+ const k = o.turns.reduce((a, h) => a + eo(P(t, h, .16)), 0) + spinSteps * (s < .5 ? 4 * s * s * s : 1 - Math.pow(-2 * s + 2, 3) / 2);
+ const blur = s > 0 && s < 1 ? 5 * Math.sin(Math.PI * s) : 0, lift = land(t, o.landAt, .45), half = N / 2;
+ const cards = IM.map((im, i) => { const d = ((i - k + half) % N + N) % N - half, ad = Math.abs(d); if (ad > 2.7) return ''; const front = i === win;
+ const x = 540 + Math.sign(d) * 560 * (1 - Math.exp(-.9 * ad)), ry = -Math.max(-60, Math.min(60, d * 34)), z = -ad * 260 + (front ? lift * 80 : -lift * 120);
+ return `<div style="position:absolute;left:${f2(x - 169)}px;top:240px;width:338px;height:600px;z-index:${100 - Math.round(ad * 10)};transform:translateZ(${f2(z)}px) rotateY(${f2(ry)}deg);filter:grayscale(${f2(front ? 0 : lift * .8)}) blur(${f2(ad < .5 ? 0 : blur)}px);opacity:${f2(Math.min(1, 2.7 - ad) * (front ? 1 : 1 - lift * .35))}">
+ <div style="width:100%;height:100%;border-radius:30px;overflow:hidden;position:relative;box-shadow:${BRAND.shadow}">${pic(im)}
+ ${front && o.label ? `<div style="position:absolute;left:20px;top:20px;padding:8px 20px;border-radius:22px;font:800 34px ${BRAND.font};background:${BRAND.accent};color:#fff;opacity:${fade(t, o.landAt - .2)}">${o.label}</div>` : ''}</div>
+ ${front && t >= o.landAt ? `<div style="position:absolute;right:-34px;top:-34px;${slam(t, o.landAt, { z: 500, rx: 30, y: 0, d: .35 })}">${tick(96)}</div>` : ''}</div>`; }).join('');
+ return camH(t, o.start, `<div style="position:absolute;inset:0;${e3(t, o.start, .55, { rx: 30, y: -40, z: -1100, org: '50% 50%' })}"><div style="position:absolute;inset:0;perspective:1700px;perspective-origin:540px 520px;transform-style:preserve-3d">${cards}</div></div>`, { rx0: -14, ry0: -18 });
+}
diff --git a/skills/claude-reel-editor/components/codedemo.js b/skills/claude-reel-editor/components/codedemo.js
new file mode 100644
index 0000000..16c1064
--- /dev/null
+++ b/skills/claude-reel-editor/components/codedemo.js
@@ -0,0 +1,24 @@
+// CODE WINDOW DEMO: a real-looking AI coding window. The prompt types as you say it, sends, then the tool lines
+// appear one per word and a file lifts out of the window on the payoff word.
+// Type the REAL command or prompt you used. A made-up command is the first thing a viewer will try and fail.
+//
+// codeDemo(t, {
+// start: 2.0, the window tilts in
+// prompt: '/init', what you type
+// typeFrom: 2.3, typeTo: 2.8, it types between these two times (your words)
+// sendAt: 3.0, it sends
+// lines: [{ at: 3.2, tool: 'Read', arg: '2 files' }, { at: 3.6, tool: 'Write', arg: 'NOTES.md', res: 'Wrote 24 lines', resAt: 3.9 }],
+// fileAt: 3.9, fileIcon: 'doc', optional, a file tile lifts out of the window
+// title: 'assistant ~/my-reel',
+// L: 74, T: 330, W: 932, H: 540
+// })
+function codeDemo(t, o) {
+ const L = o.L ?? 74, T = o.T ?? 330, W = o.W ?? 932, H = o.H ?? 540, sent = t >= o.sendAt;
+ const lines = sent ? code.user(o.prompt, `opacity:${fade(t, o.sendAt, .1)}`) + (o.lines || []).filter(x => t >= x.at)
+ .map(x => code.tool(x.tool, x.arg, x.res && t >= (x.resAt ?? x.at) ? x.res : '', `opacity:${fade(t, x.at, .1)}`)).join('') : '';
+ const body = lines + `<div style="position:absolute;left:30px;right:30px;bottom:26px">${code.input(sent ? '' : typed(o.prompt, t, o.typeFrom, o.typeTo), true)}</div>`;
+ const win = code.win(L, T, W, H, body, e3(t, o.start, .6, { rx: 30, y: -24 }), o.title);
+ const k = o.fileAt ? land(t, o.fileAt, .5) : 0;
+ const file = o.fileAt && t >= o.fileAt ? `<div style="position:absolute;left:${L + W - 230}px;top:${f2(T + 100 - k * 150)}px;transform:rotate(${f2(8 * k)}deg);opacity:${fade(t, o.fileAt, .1)}">${tileSym(o.fileIcon || 'doc', 150)}</div>` + ring(L + W - 155, T + 25, t, o.fileAt + .16, BRAND.accent, 60, 1.0) : '';
+ return cam(t, o.start, win + file);
+}
diff --git a/skills/claude-reel-editor/components/countup.js b/skills/claude-reel-editor/components/countup.js
new file mode 100644
index 0000000..ed7fd05
--- /dev/null
+++ b/skills/claude-reel-editor/components/countup.js
@@ -0,0 +1,15 @@
+// COUNT-UP STAT: a big stat card slams in from deep on its word and the number counts up with its label under it.
+// Chain two for "29 reels from 13 creators": the first one fades as the second lands.
+//
+// countUp(t, {
+// n: 29, label: 'viral reels', the number and what it counts
+// at: 3.1, the spoken number (use word('29'))
+// d: .7, how long the count takes
+// outAt: 4.5, optional, the card fades out here
+// x: 310, y: 330, w: 380 position and width
+// })
+function countUp(t, o) {
+ if (t < o.at || (o.outAt && t > o.outAt + .2)) return '';
+ const n = Math.round(o.n * eo(P(t, o.at, o.d ?? .7))), out = o.outAt ? 1 - P(t, o.outAt, .2) : 1;
+ return stat(n, o.label, `left:${o.x ?? 310}px;top:${o.y ?? 330}px;width:${o.w ?? 380}px;${slam(t, o.at, { z: 500, rx: 30, y: 0, d: .4 })};opacity:${f2(out)}`);
+}
diff --git a/skills/claude-reel-editor/components/dial.js b/skills/claude-reel-editor/components/dial.js
new file mode 100644
index 0000000..9548b0a
--- /dev/null
+++ b/skills/claude-reel-editor/components/dial.js
@@ -0,0 +1,34 @@
+// GIANT DIAL: one huge 3D clock face fills the panel. An accent arc sweeps the short time ("five minutes"),
+// REC lights, then a grey arc races round the long time ("another hour"), shatters and falls, and the number
+// snaps back to the short time. The shards fall back into depth, never down across the caption line. A tick lands on the last word.
+//
+// dial(t, {
+// start: 8.0, beat start (the dial swings in)
+// fastAt: 8.2, mins: 5, the accent arc sweeps to `mins` on the short time's word
+// recAt: 8.8, optional, REC lights
+// slowAt: 9.2, slowMins: 60, the grey arc races round on the long time's word
+// breakAt: 9.6, the grey arc shatters and falls
+// tickAt: 10.2, the tick (the payoff word)
+// unit: 'min'
+// })
+function dial(t, o) {
+ const cx = 540, cy = 520, r = 270, full = o.slowMins || 60;
+ const arc = (a0, a1) => { const p = a => [cx + (r - 6) * Math.sin(a * Math.PI * 2), cy - (r - 6) * Math.cos(a * Math.PI * 2)], [x0, y0] = p(a0), [x1, y1] = p(a1);
+ return `M${f2(x0)} ${f2(y0)} A${r - 6} ${r - 6} 0 ${a1 - a0 > .5 ? 1 : 0} 1 ${f2(x1)} ${f2(y1)}`; };
+ const blue = eo(P(t, o.fastAt, .5)) * (o.mins / full), grey = P(t, o.slowAt, .36), brk = P(t, o.breakAt, .5);
+ const mins = t < o.slowAt ? Math.round(blue * full) : t < o.breakAt ? Math.max(o.mins, Math.round(grey * full)) : o.mins, hot = t >= o.slowAt && t < o.breakAt;
+ const ticks = Array.from({ length: 60 }, (_, i) => { const a = i / 60 * Math.PI * 2, L = i % 5 ? 14 : 30;
+ return `<line x1="${f2(cx + Math.sin(a) * (r - 38))}" y1="${f2(cy - Math.cos(a) * (r - 38))}" x2="${f2(cx + Math.sin(a) * (r - 38 - L))}" y2="${f2(cy - Math.cos(a) * (r - 38 - L))}" stroke="${i % 5 ? '#D3D7DE' : '#9AA0AA'}" stroke-width="${i % 5 ? 3 : 5}" stroke-linecap="round"/>`; }).join('');
+ const shards = grey > 0 && brk < 1 ? Array.from({ length: 12 }, (_, i) => { const a0 = i / 12, a1 = Math.min(grey, (i + 1) / 12); if (a1 <= a0) return ''; const fall = brk * brk;
+ return `<path d="${arc(a0, a1 - .004)}" fill="none" stroke="#B7BCC6" stroke-width="30" transform="translate(${f2(Math.sin(i) * 120 * fall)} ${f2(fall * 160)}) rotate(${f2((i % 2 ? 1 : -1) * 40 * fall)} ${cx} ${cy})" opacity="${f2(1 - brk)}"/>`; }).join('') : '';
+ const face = `<svg width="1080" height="1000" viewBox="0 0 1080 1000" style="position:absolute;left:0;top:0;overflow:visible">
+ <defs><radialGradient id="dialg" cx="50%" cy="40%" r="65%"><stop offset="0" stop-color="#fff"/><stop offset="1" stop-color="${BRAND.soft}"/></radialGradient><filter id="dialb"><feGaussianBlur stdDeviation="18"/></filter></defs>
+ <circle cx="${cx}" cy="${cy + 26}" r="${r + 8}" fill="rgba(0,19,47,.12)" filter="url(#dialb)"/>
+ <circle cx="${cx}" cy="${cy}" r="${r + 12}" fill="url(#dialg)" stroke="rgba(0,19,47,.10)" stroke-width="3"/>${ticks}
+ <circle cx="${cx}" cy="${cy}" r="${r - 6}" fill="none" stroke="${BRAND.soft}" stroke-width="30"/>${shards}
+ ${blue > 0 ? `<path d="${arc(0, Math.max(.001, blue))}" fill="none" stroke="${BRAND.accent}" stroke-width="30" stroke-linecap="round"/>` : ''}</svg>
+ <div style="position:absolute;left:0;right:0;top:${cy - 92}px;text-align:center;font:800 150px/1 ${BRAND.font};letter-spacing:-.05em;color:${hot ? '#9AA0AA' : BRAND.ink}">${mins}<span style="font-size:64px;letter-spacing:-.02em;color:${hot ? '#9AA0AA' : BRAND.accent}"> ${o.unit || 'min'}</span></div>
+ ${o.recAt ? `<div style="position:absolute;left:${cx - 70}px;top:${cy + 86}px;width:140px;padding:10px 0;border-radius:30px;text-align:center;font:700 30px ${BRAND.font};background:${t >= o.recAt ? BRAND.ink : '#E5E7EB'};color:#fff;opacity:${fade(t, o.recAt, .15)}"><span style="color:${BRAND.rec}">●</span> REC</div>` : ''}
+ ${t >= o.tickAt ? `<div style="position:absolute;left:${cx + r - 40}px;top:${cy - r - 10}px;${e3(t, o.tickAt, .4, { rx: -60, y: -40, z: 300 })}">${tick(96)}</div>` : ''}`;
+ return camH(t, o.start, `<div style="position:absolute;inset:0;${e3(t, o.start, .5, { rx: -50, y: 160, z: -900, org: '50% 50%' })}">${face}</div>`, { rx0: -22, ry0: -16 });
+}
diff --git a/skills/claude-reel-editor/components/dropzone.js b/skills/claude-reel-editor/components/dropzone.js
new file mode 100644
index 0000000..972e1af
--- /dev/null
+++ b/skills/claude-reel-editor/components/dropzone.js
@@ -0,0 +1,30 @@
+// DROP ZONE: a big code window with a dashed drop area. On the word "drop" your raw clip flies in on an arc and lands
+// with a small squash. Its waveform rises bar by bar, the bad sections lift out in grey, and the working files
+// fly in from both sides, one per word, and file themselves under the waveform.
+//
+// dropZone(t, {
+// start: 4.0, beat start (the window tilts in)
+// dropAt: 4.3, the clip lands
+// clip: 'assets/raw.jpg', a 16:9 still of the raw take
+// clipLabel: 'raw.mp4 · 2:44', optional
+// waveAt: 4.7, the waveform rises
+// badAt: 5.4, the grey bad sections lift out
+// files: [{ name: 'cut-audio.wav', icon: 'wave', at: 4.8 }, { name: 'words.json', icon: 'doc', at: 5.1 }],
+// title: 'assistant ~/my-reel' optional window title
+// })
+function dropZone(t, o) {
+ const PX = 74, PW = 932, TOP = 220, N = 34, BAD = o.bad || [5, 6, 7, 15, 16, 24, 25, 26];
+ const g = P(t, o.dropAt, .4), k = 1 - g, squash = g >= 1 ? 1 - .05 * Math.sin(Math.PI * Math.min(1, (t - o.dropAt - .4) / .18)) : 1;
+ const bars = Array.from({ length: N }, (_, i) => { const bad = BAD.includes(i), h = 36 + Math.abs(Math.sin(i * 1.9 + 1)) * 104, up = eo(P(t, o.waveAt + i * .012, .22)), lift = bad ? P(t, o.badAt + (i % 3) * .05, .35) : 0;
+ return `<i style="display:inline-block;width:18px;margin:0 3px;height:${f2(h * up)}px;border-radius:9px;vertical-align:middle;background:${bad ? '#C7CBD3' : BRAND.accent};transform:translateY(${f2(-lift * lift * 240)}px) rotate(${f2(lift * (i % 2 ? 24 : -24))}deg);opacity:${f2(1 - lift)}"></i>`; }).join('');
+ const clip = `<div style="position:absolute;left:${PX + 186}px;top:${TOP + 70}px;width:560px;height:316px;transform:translate(${f2(k * k * 560)}px,${f2(-k * (2 - k) * 420)}px) rotate(${f2(k * 14)}deg) scaleY(${squash.toFixed(3)});transform-origin:50% 100%;opacity:${f2(cl((t - o.dropAt + .08) / .08))}">
+ <div style="width:100%;height:100%;border-radius:24px;overflow:hidden;box-shadow:0 1px 2px rgba(0,0,0,.06),0 24px 50px rgba(0,0,0,.16);position:relative">${pic(o.clip)}
+ <div style="position:absolute;inset:0;display:flex;align-items:center;justify-content:center"><div style="width:100px;height:100px;border-radius:50%;background:rgba(255,255,255,.92);display:flex;align-items:center;justify-content:center"><svg viewBox="0 0 24 24" width="50" height="50" fill="${BRAND.ink}"><path d="M8 5v14l11-7z"/></svg></div></div>
+ ${o.clipLabel ? `<div style="position:absolute;left:18px;bottom:16px;padding:8px 16px;border-radius:12px;background:rgba(0,0,0,.6);color:#fff;font:600 28px ${BRAND.mono};opacity:${fade(t, o.dropAt + .4)}">${o.clipLabel}</div>` : ''}</div></div>`;
+ const files = (o.files || []).map((f, i) => { const s = i % 2 ? 1 : -1, u = eo(P(t, f.at, .42)), q = 1 - u; if (t < f.at) return '';
+ return `<div style="position:absolute;left:${f2(PX + 90 + i * 400 + s * q * 520)}px;top:${f2(TOP + 590 - q * 300)}px;display:flex;align-items:center;gap:14px;padding:12px 22px 12px 12px;border-radius:20px;${BRAND.card};transform:rotate(${f2(q * s * 18)}deg) scale(${f2(1 + q * .2)});opacity:${f2(Math.min(1, u * 3))}">${tileSym(f.icon || 'doc', 52)}<span style="font:600 30px ${BRAND.mono};white-space:nowrap">${f.name}</span></div>`; }).join('');
+ const win = `<div style="position:absolute;inset:0;${e3(t, o.start, .55, { rx: 46, y: 120 })}">${code.win(PX, TOP, PW, 660, '', '', o.title)}
+ <div style="position:absolute;left:${PX + 30}px;top:${TOP + 76}px;width:${PW - 60}px;height:560px;border-radius:24px;border:4px dashed color-mix(in srgb,${BRAND.accent} ${f2(40 * (1 - eo(P(t, o.dropAt + .27, .3))))}%,transparent)"></div>
+ <div style="position:absolute;left:${PX}px;width:${PW}px;top:${TOP + 470}px;text-align:center;white-space:nowrap">${bars}</div></div>`;
+ return camH(t, o.start, win + clip + files, { rx0: -30, ry0: -18 });
+}
diff --git a/skills/claude-reel-editor/components/filmstrip.js b/skills/claude-reel-editor/components/filmstrip.js
new file mode 100644
index 0000000..43dea53
--- /dev/null
+++ b/skills/claude-reel-editor/components/filmstrip.js
@@ -0,0 +1,43 @@
+// FILMSTRIP + SCANNER: the reel's own frames step under an accent scanner in 3D, each one ticked as it passes.
+// On the stop word the frame under the scanner lifts out toward the camera. Good for "it checks every frame".
+// Pass different frames: never show the same example twice in one reel.
+//
+// filmstripScan(t, {
+// frames: ['f00.jpg', ... 16 images], 9:16 frames
+// start: 3.0, beat start
+// stopAt: 5.0, the scanner stops and the centre frame lifts (the payoff word)
+// top: 210 optional, y of the strip
+// })
+function filmstripScan(t, o) {
+ const FR = o.frames, stopI = Math.min(8, FR.length - 1), a = o.start + .03, IV = (o.stopAt - a) / stopI;
+ const raw = Math.max(0, Math.min(t, o.stopAt) - a) / IV, st = Math.min(stopI, Math.floor(raw) + eo(Math.min(1, (raw % 1) * 1.6))), off = st * 236, stop = land(t, o.stopAt, .45);
+ const frames = FR.map((src, i) => { const d = Math.abs(i - st), lift = Math.max(0, 1 - d * 1.6) + (i === stopI ? stop * 1.4 : 0), done = i < st - .45;
+ return `<div style="position:relative;width:220px;height:390px;flex:none;transform:translateZ(${f2(lift * 110)}px) translateY(${f2(-lift * 18)}px)"><div style="width:220px;height:390px;border-radius:20px;overflow:hidden;${BRAND.card};opacity:${d < .5 || (i === stopI && t >= o.stopAt) ? 1 : .55}">${pic(src)}</div>${done ? `<div style="position:absolute;right:-14px;top:-14px">${tick(50)}</div>` : ''}</div>`; }).join('');
+ const scan = `<div style="position:absolute;left:${540 - 126}px;top:${f2(52 - stop * 20)}px;width:252px;height:${f2(426 + stop * 40)}px;border-radius:28px;border:7px solid ${BRAND.accent};box-shadow:0 0 0 10px color-mix(in srgb,${BRAND.accent} 12%,transparent);${slam(t, o.start + .15, { z: 600, rx: 0, y: 0, d: .35 })}"></div>`;
+ const tilt = eo(P(t, o.start, 2.5));
+ return `<div style="${slam(t, o.start, { rx: -40, ry: 50 })}"><div style="position:absolute;left:0;top:${o.top ?? 210}px;width:1080px;height:600px;perspective:1600px;perspective-origin:540px 260px"><div style="position:absolute;inset:0;transform-style:preserve-3d;transform:rotateX(${f2(16 - 8 * tilt)}deg) rotateY(${f2(-18 + 10 * tilt)}deg)"><div style="position:absolute;left:${f2(430 - off)}px;top:70px;display:flex;gap:16px;transform-style:preserve-3d">${frames}</div>${scan}</div></div></div>${ring(540, (o.top ?? 210) + 260, t, o.stopAt, BRAND.accent, 150, .5)}`;
+}
+
+// CUT STRIP: the raw take as a big 3D filmstrip with grey pauses between the clips. A playhead sweeps and every pause
+// snaps shut, then a graphic card rises out of each clip, one per word, and the row locks in an accent box with a tick.
+//
+// cutStrip(t, {
+// clips: ['c1.jpg', ... up to 6], stills from the raw take
+// graphics: ['g1.jpg', ...], one graphic per clip (same count)
+// start: 3.0, cutAt: 3.3, the playhead starts on "cut"
+// riseAt: 4.4, the graphics rise from here, one every 0.2s
+// lockAt: 6.0 the accent box locks round the row
+// })
+function cutStrip(t, o) {
+ const PX = 74, F = o.clips, G = o.graphics, cw = 136, gap0 = 34, head = P(t, o.cutAt, 1.0), x0 = PX + 18, sy = 400 + 240 * eo(P(t, o.riseAt - .05, .45));
+ let x = x0;
+ const clips = F.map((f, i) => { const shut = i === 0 ? 1 : eo(P(t, o.cutAt + i * .17, .12)), gap = i === 0 ? 0 : gap0 * (1 - shut) + 6; x += gap;
+ const cx = x; x += cw; const rise = eo(P(t, o.riseAt + i * .16, .3));
+ const pause = i === 0 ? '' : `<div style="position:absolute;left:${f2(cx - gap)}px;top:${f2(sy)}px;width:${f2(gap)}px;height:230px;border-radius:10px;background:#D8DCE3;opacity:${f2(1 - shut)}"></div>`;
+ return `${pause}<div style="position:absolute;left:${f2(cx)}px;top:${f2(sy)}px;width:${cw}px;height:230px;border-radius:14px;overflow:hidden;box-shadow:0 14px 30px -12px rgba(0,19,47,.4)">${pic(f)}</div>
+ <div style="position:absolute;left:${f2(cx)}px;top:206px;width:${cw}px;height:280px;border-radius:16px;overflow:hidden;background:#fff;box-shadow:0 24px 40px -18px rgba(0,19,47,.45),0 2px 6px rgba(0,19,47,.1);transform-origin:50% 100%;transform:perspective(900px) translateY(${f2((1 - rise) * 330)}px) rotateX(${f2((1 - rise) * -70)}deg) scale(${f2(.6 + .4 * rise)});opacity:${f2(rise)}">${pic(G[i], 'object-position:50% 0')}</div>`; }).join('');
+ const ph = t >= o.cutAt && t < o.cutAt + 1.17 ? `<div style="position:absolute;left:${f2(x0 + head * (x - x0))}px;top:${f2(sy - 22)}px;width:8px;height:274px;border-radius:4px;background:${BRAND.accent}"></div>` : '';
+ const lock = t >= o.lockAt ? `<div style="position:absolute;left:${PX + 4}px;top:186px;width:${f2(x - x0 + 28)}px;height:700px;border-radius:30px;border:10px solid ${BRAND.accent};transform:scale(${f2(1.12 - .12 * P(t, o.lockAt, .12))})"></div><div style="position:absolute;left:${f2(x - 30)}px;top:156px">${tick(64)}</div>` : '';
+ const big = 1.45 - .45 * eo(P(t, o.riseAt - .05, .45)); // the strip fills the panel width until the graphics rise
+ return camH(t, o.start, `<div style="position:absolute;inset:0;${e3(t, o.start, .5, { rx: 40, y: 140 })}"><div style="position:absolute;inset:0;transform-origin:540px ${f2(sy + 115)}px;transform:scale(${f2(big)})">${clips}${ph}</div>${lock}</div>`, { rx0: -26, ry0: 22 });
+}
diff --git a/skills/claude-reel-editor/components/ring.js b/skills/claude-reel-editor/components/ring.js
new file mode 100644
index 0000000..0243c44
--- /dev/null
+++ b/skills/claude-reel-editor/components/ring.js
@@ -0,0 +1,24 @@
+// PROGRESS RING + GRID: a ring counts up to a total while a grid lights cell by cell. When it closes, the number
+// becomes a tick and the pass line types under the real command. Good for "checks 212 frames" or "40 posts scheduled".
+// It sits inside a code window in the lower box by default. Every readable line stays above y1520 (Instagram's caption area).
+//
+// progressRing(t, {
+// start: 7.0, dur: 2.5, the count runs from start for dur seconds
+// total: 212, unit: 'frames', the number it counts to
+// doneAt: 9.6, the tick and the pass line (the payoff word)
+// doneText: 'NO FLAGS',
+// cmd: 'node scripts/check-frames.js', the real command, shown as the tool line
+// L: 74, T: 1114, W: 932, H: 618 the box. Defaults to the lower box
+// })
+function progressRing(t, o) {
+ const L = o.L ?? 74, T = o.T ?? 1114, W = o.W ?? 932, H = o.H ?? 618;
+ const p = eo(P(t, o.start, o.dur)), n = Math.round(o.total * p), done = t >= o.doneAt, R = 110, C = 2 * Math.PI * R;
+ const res = done ? `<span style="display:inline-block;color:${BRAND.good};font-weight:800;${slam(t, o.doneAt, { z: 500, rx: 30, y: 0, d: .4 })}">${o.doneText || 'DONE'}</span>` : '&nbsp;';
+ const head = `<div style="margin:0 0 10px;white-space:nowrap;opacity:${fade(t, o.start - .1)}"><span style="color:${BRAND.good}">●</span> <b style="font-weight:700">Bash</b>(${o.cmd || 'check'})<div style="color:${BRAND.mute};padding-left:30px">⎿&nbsp; ${res}</div></div>`;
+ const ringSvg = `<svg width="260" height="260" viewBox="0 0 260 260" style="position:absolute;left:0;top:0"><circle cx="130" cy="130" r="${R}" fill="none" stroke="${BRAND.soft}" stroke-width="20"/><circle cx="130" cy="130" r="${R}" fill="none" stroke="${BRAND.accent}" stroke-width="20" stroke-linecap="round" stroke-dasharray="${f2(C * p)} ${f2(C)}" transform="rotate(-90 130 130)"/></svg>
+ <div style="position:absolute;left:0;top:0;width:260px;height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center">${done ? `<div style="${slam(t, o.doneAt, { z: 400, rx: 30, y: 0, d: .35 })}">${tick(100)}</div>` : `<div style="font:800 76px/1 ${BRAND.font};letter-spacing:-.04em;font-variant-numeric:tabular-nums">${n}</div><div style="font:600 24px ${BRAND.font};color:${BRAND.mute};margin-top:6px;white-space:nowrap">of ${o.total} ${o.unit || ''}</div>`}</div>`;
+ const N = 32, cells = Array.from({ length: N }, (_, i) => { const lit = i < Math.floor(N * p), hot = i === Math.floor(N * p);
+ return `<i style="display:block;width:46px;height:46px;border-radius:12px;background:${lit ? BRAND.accent : hot ? `color-mix(in srgb,${BRAND.accent} 30%,#fff)` : BRAND.soft};transform:scale(${hot ? 1.12 : 1})"></i>`; }).join('');
+ const grid = `<div style="position:absolute;left:330px;top:10px;display:grid;grid-template-columns:repeat(8,46px);gap:12px">${cells}</div>`;
+ return code.win(L, T, W, H, `${head}<div style="position:relative;height:270px">${ringSvg}${grid}</div>`, '', o.title);
+}
diff --git a/skills/claude-reel-editor/components/staircase.js b/skills/claude-reel-editor/components/staircase.js
new file mode 100644
index 0000000..c992540
--- /dev/null
+++ b/skills/claude-reel-editor/components/staircase.js
@@ -0,0 +1,49 @@
+// STAIRCASE: "N steps" as real 3D blocks. They rise from the floor, a ball climbs one step per spoken word,
+// each step lights as the ball lands, and the name of the current step flips over in a pill.
+// The payoff is the ball reaching the top step ON its word: pass that word's time as the last entry of `times`.
+//
+// staircase(t, {
+// steps: ['Cut', 'Storyboard', ...], labels, one per step
+// times: [2.4, 2.7, ...], when the ball lands on each step (use word('...'))
+// start: 2.2, beat start: blocks rise from here
+// title: 'Edit in <b>4 steps</b>', optional title top left (HTML)
+// full: false, true = full-frame height (a FULL beat), false = fits the split panel
+// })
+function staircase(t, o) {
+ const S = o.steps, n = S.length, a0 = o.start, id = o.id || 'st';
+ const full = !!o.full, W = Math.min(210, Math.floor(840 / n)), DX = 26, DY = 22;
+ const BASE = full ? 1610 : 846, top0 = full ? 1440 : 772, rise = (full ? 940 : 480) / n;
+ const x = i => 74 + i * W, yt = i => top0 - i * rise, arr = i => o.times[i];
+ const cur = S.reduce((c, s, i) => t >= arr(i) ? i : c, -1);
+ const lit = BRAND.accent, litTop = `color-mix(in srgb,${BRAND.accent} 50%,#fff)`, litSide = BRAND.accentDark;
+ let g = `<defs><linearGradient id="${id}l" x1="0" y1="0" x2="0" y2="1"><stop offset="0" style="stop-color:${BRAND.accentLight}"/><stop offset="1" style="stop-color:${BRAND.accentDark}"/></linearGradient>
+ <linearGradient id="${id}o" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#FFFFFF"/><stop offset="1" stop-color="${BRAND.soft}"/></linearGradient>
+ <radialGradient id="${id}f"><stop offset="0" stop-color="rgba(0,19,47,.20)"/><stop offset="1" stop-color="rgba(0,19,47,0)"/></radialGradient></defs>
+ <ellipse cx="${x(n / 2)}" cy="${BASE + 6}" rx="520" ry="26" fill="url(#${id}f)" opacity="${f2(eo(P(t, a0 + .06, .5)))}"/>`;
+ for (let i = 0; i < n; i++) { // low to high, so each taller step hides the side of the one below it
+ const k = spr(P(t, a0 + .04 + i * .045, .55)), top = BASE - (BASE - yt(i)) * k, L = t >= arr(i);
+ const press = L ? 5 * Math.sin(Math.PI * P(t, arr(i), .22)) : 0, y = top + press, X = x(i);
+ if (k <= 0) continue;
+ g += `<g opacity="${f2(eo(P(t, a0 + .04 + i * .045, .15)))}">
+ <polygon points="${X + W},${f2(y)} ${X + W + DX},${f2(y - DY)} ${X + W + DX},${BASE - DY} ${X + W},${BASE}" style="fill:${L ? litSide : '#DCE1EA'}"/>
+ <rect x="${X}" y="${f2(y)}" width="${W}" height="${f2(BASE - y)}" fill="url(#${id}${L ? 'l' : 'o'})" stroke="${L ? 'rgba(0,40,100,.25)' : 'rgba(0,19,47,.10)'}" stroke-width="1.5"/>
+ <polygon points="${X},${f2(y)} ${X + DX},${f2(y - DY)} ${X + W + DX},${f2(y - DY)} ${X + W},${f2(y)}" style="fill:${L ? litTop : '#FFFFFF'}" stroke="rgba(0,19,47,.10)" stroke-width="1.5"/>
+ <text x="${X + W / 2}" y="${f2(y + Math.min(60, W * .62))}" text-anchor="middle" style="font:800 ${Math.round(Math.min(56, W * .48))}px ${BRAND.font};fill:${L ? '#fff' : '#AEB4BF'}">${i + 1}</text></g>`;
+ }
+ // the ball hops from step top to step top on an arc, with a pulse on each landing
+ const tp = i => [x(i) + W / 2 + DX / 2, yt(i) - DY / 2 - 14];
+ if (t >= arr(0) - .25) {
+ let q;
+ if (t < arr(0)) { const u = eo(P(t, arr(0) - .25, .25)); q = [tp(0)[0], tp(0)[1] - 80 * (1 - u)]; }
+ else if (cur < n - 1) { const u = P(t, arr(cur) + .05, Math.min(.22, arr(cur + 1) - arr(cur) - .05)), a = tp(cur), b = tp(cur + 1); q = [a[0] + (b[0] - a[0]) * u, a[1] + (b[1] - a[1]) * u - Math.sin(Math.PI * u) * 46]; }
+ else q = tp(n - 1);
+ g += `<circle cx="${f2(q[0])}" cy="${f2(q[1])}" r="15" fill="${lit}" stroke="#fff" stroke-width="6"/>`;
+ }
+ g += S.map((s, i) => pulse([tp(i)[0], tp(i)[1] + 14], t, arr(i), lit, 16, 1.6)).join('');
+ // the current step's name in one fixed pill under the title, flipping over as each step lands
+ let lab = '';
+ if (cur >= 0) { const f = eo(P(t, arr(cur), .18));
+ lab = `<div style="position:absolute;left:74px;top:${full ? 620 : 466}px;perspective:500px"><div style="height:72px;padding:0 28px 0 12px;border-radius:36px;display:inline-flex;align-items:center;gap:16px;font:650 36px ${BRAND.font};letter-spacing:-.02em;white-space:nowrap;${BRAND.card};transform-origin:50% 0;transform:rotateX(${f2(-80 * (1 - f))}deg)"><b style="width:50px;height:50px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font:800 26px ${BRAND.font};background:linear-gradient(180deg,${BRAND.accentLight},${BRAND.accent})">${cur + 1}</b>${S[cur]}</div></div>`; }
+ const title = o.title ? `<div style="position:absolute;left:74px;top:${full ? 350 : 250}px;font:800 76px/1.02 ${BRAND.font};letter-spacing:-.035em;${e3(t, a0, .6, { rx: 30, y: full ? 60 : -30 })}">${o.title}</div>` : '';
+ return cam(t, a0, title + `<svg style="position:absolute;left:0;top:0;width:1080px;height:1920px;overflow:visible">${g}</svg>` + lab, { rx0: -10, rx1: -3, ry0: -14, ry1: -5 });
+}
diff --git a/skills/claude-reel-editor/components/style-transfer.js b/skills/claude-reel-editor/components/style-transfer.js
new file mode 100644
index 0000000..01634e8
--- /dev/null
+++ b/skills/claude-reel-editor/components/style-transfer.js
@@ -0,0 +1,25 @@
+// STYLE TRANSFER CHIPS: your reference style slams in big on the left, the flat version slams in grey on the right.
+// On "same look" its colour, its type and its card style fly across as three chips, one per word, and the right
+// card turns to full colour. On the last word both cards turn to face the camera.
+//
+// styleTransfer(t, {
+// from: 'assets/style.jpg', the look you are matching (portrait, about 4:5)
+// to: 'assets/flat.jpg', the flat frame that takes the look (9:16)
+// fromAt: 2.0, toAt: 2.6, the two cards slam in
+// chips: [3.0, 3.2, 3.4], the three chips fly across, one per word
+// faceAt: 4.0, both cards face the camera (the payoff word)
+// start: 1.9 beat start
+// })
+function styleTransfer(t, o) {
+ const face = eo(P(t, o.faceAt, .5)), C = o.chips, from = [344, 470], to = [810, 470];
+ const col = C.reduce((a, c) => a + eo(P(t, c + .35, .2)), 0) / C.length;
+ const chip = [`<div style="width:84px;height:84px;border-radius:50%;background:linear-gradient(180deg,${BRAND.accentLight},${BRAND.accent})"></div>`,
+ `<div style="width:96px;height:96px;border-radius:24px;${BRAND.card};display:flex;align-items:center;justify-content:center;font:800 46px ${BRAND.font};letter-spacing:-.03em">Aa</div>`,
+ `<div style="width:120px;height:84px;border-radius:20px;${BRAND.card};padding:18px"><div style="height:12px;width:70%;border-radius:6px;background:${BRAND.accent}"></div><div style="height:12px;width:45%;margin-top:12px;border-radius:6px;background:#C7CBD3"></div></div>`];
+ const chips = C.map((c, i) => { const u = eo(P(t, c, .35)); if (t < c || u >= 1) return '';
+ const x = from[0] + (to[0] - from[0]) * u, y = from[1] + (to[1] - from[1]) * u - Math.sin(Math.PI * u) * 230 + (i - 1) * 90;
+ return `<div style="position:absolute;left:${f2(x)}px;top:${f2(y)}px;transform:translate(-50%,-50%) scale(${f2(1.15 - .35 * u)}) rotate(${f2((1 - u) * (i - 1) * 20)}deg)">${chip[i % 3]}</div>`; }).join('');
+ const left = `<div style="position:absolute;left:84px;top:196px;width:520px;height:650px;${slam(t, o.fromAt, { ry: -60, rx: -30, z: -1500, d: .5 })}"><div style="width:100%;height:100%;border-radius:26px;overflow:hidden;box-shadow:${BRAND.shadow};transform:rotateY(${f2(16 * (1 - face))}deg) translateZ(${f2(face * 40)}px)">${pic(o.from, 'object-position:50% 0')}</div></div>`;
+ const right = `<div style="position:absolute;left:644px;top:212px;width:340px;height:604px;${slam(t, o.toAt, { ry: 60, rx: -30, z: -1500, d: .5 })}"><div style="width:100%;height:100%;border-radius:26px;overflow:hidden;box-shadow:${BRAND.shadow},0 0 0 ${f2(6 * eo(P(t, C[C.length - 1] + .35, .2)) * (1 - face))}px ${BRAND.accent};transform:rotateY(${f2(-16 * (1 - face))}deg) translateZ(${f2(face * 40)}px);filter:grayscale(${f2(1 - col)}) contrast(${f2(.85 + .15 * col)})">${pic(o.to)}</div></div>`;
+ return camH(t, o.start, `<div style="position:absolute;inset:0;perspective:1800px;perspective-origin:540px 520px">${left}${right}</div>${chips}` + C.map(c => ring(814, 514, t, c + .35, BRAND.accent, 60, 1.2)).join(''), { rx0: -16, ry0: 20 });
+}
diff --git a/skills/claude-reel-editor/components/timeline-hook.js b/skills/claude-reel-editor/components/timeline-hook.js
new file mode 100644
index 0000000..89e08e0
--- /dev/null
+++ b/skills/claude-reel-editor/components/timeline-hook.js
@@ -0,0 +1,34 @@
+// TIMELINE HOOK: the text hook IS the opening animation, never a flat title card on top of the video.
+// The title cascades in letter by letter while a tilted 3D edit timeline (video clips, graphic clips, a waveform)
+// scrolls sideways below it, and an accent playhead slices every track on the words you name.
+//
+// timelineHook(t, {
+// lines: ['Edit your reel', 'with code'], the hook, two short lines. The second is in the accent colour
+// cuts: [0.6, 1.1, 1.6], the playhead slices on these words
+// frames: ['f1.jpg', ... 9 images], stills for the video track (frames of your raw take)
+// icon: 'assets/mark.svg', optional, a mark that lands on the title
+// size: 118 title px. Keep it 92 or more so it reads on a phone
+// })
+function timelineHook(t, o) {
+ const TL = { top: 500, rowH: 104, gap: 16, speed: 150, ph: 540 }, CUTS = o.cuts || [];
+ const drift = -t * TL.speed - 120;
+ // a cut made at time c sits at content x = playhead - drift(c). Everything right of it opens by 26px
+ const cutsX = CUTS.map(c => TL.ph - (-c * TL.speed - 120));
+ const shift = x => CUTS.reduce((s, c, i) => s + (x > cutsX[i] ? 26 * eo(P(t, c, .16)) : 0), 0);
+ const track = (row, items) => items.map(([x, w, st, inner]) => `<div style="position:absolute;left:${f2(x + drift + shift(x))}px;top:${TL.top + row * (TL.rowH + TL.gap)}px;width:${w}px;height:${TL.rowH}px;border-radius:16px;overflow:hidden;${st}">${inner}</div>`).join('');
+ const lane = (n, w, f) => Array.from({ length: n }, (_, i) => f(i, i * (w + 10), w));
+ const FR = o.frames || [];
+ const video = lane(9, 200, (i, x, w) => [x, w, 'background:#D9DDE3;box-shadow:0 10px 24px -10px rgba(0,19,47,.4)', FR.length ? pic(FR[i % FR.length]) : '']);
+ const gfx = lane(7, 260, (i, x, w) => [x + 60, w, `background:linear-gradient(180deg,${BRAND.accentLight},${BRAND.accent})`, `<div style="margin:30px 0 0 26px;width:${f2(w * .5)}px;height:16px;border-radius:8px;background:rgba(255,255,255,.85)"></div><div style="margin:14px 0 0 26px;width:${f2(w * .3)}px;height:16px;border-radius:8px;background:rgba(255,255,255,.55)"></div>`]);
+ const audio = [[0, 2000, `background:${BRAND.soft};display:flex;align-items:center;gap:6px;padding:0 12px`, Array.from({ length: 150 }, (_, i) => `<i style="flex:none;width:7px;height:${f2(14 + Math.abs(Math.sin(i * .9)) * 80)}px;border-radius:4px;background:${BRAND.accent};opacity:.75"></i>`).join('')]];
+ const rows = track(0, video) + track(1, gfx) + track(2, audio);
+ // playhead fixed at the centre, the timeline runs under it. A flash on each cut
+ const hit = CUTS.filter(c => t >= c).pop(), flash = hit === undefined ? 0 : 1 - P(t, hit, .22), H = 3 * (TL.rowH + TL.gap);
+ const head = `<div style="position:absolute;left:${TL.ph - 4}px;top:${TL.top - 46}px;width:8px;height:${H + 50}px;border-radius:4px;background:${BRAND.accent};box-shadow:0 0 0 ${f2(4 + 14 * flash)}px color-mix(in srgb,${BRAND.accent} ${f2(15 + 35 * flash)}%,transparent)"></div>
+ <div style="position:absolute;left:${TL.ph - 26}px;top:${TL.top - 70}px;width:52px;height:40px;border-radius:12px 12px 26px 26px;background:${BRAND.accent}"></div>`;
+ const wall = `<div style="position:absolute;inset:0;perspective:1500px;perspective-origin:540px 560px"><div style="position:absolute;inset:0;transform-origin:540px 680px;transform:rotateX(24deg) rotateZ(-4deg) scale(1.06);opacity:${fade(t, 0, .2)}">${rows}${head}</div></div>`;
+ const [l1, l2 = ''] = o.lines, sz = o.size || 118;
+ const title = cam(t, 0, `<div style="position:absolute;left:${CL}px;top:240px;width:${CW}px;text-align:center;font:800 ${sz}px/1.02 ${BRAND.font};letter-spacing:-.04em">${cascade(l1, t, .05)}<br>${cascade(l2, t, .45, BRAND.accent)}</div>
+ ${o.icon ? `<div style="position:absolute;left:${CL + CW - 150}px;top:${240 + sz * 2 + 10}px;${e3(t, 1.0, .6, { rx: -50, y: -40, z: 200 })}">${tileImg(o.icon, 120)}</div>` : ''}`, { rx0: -10, rx1: -3, ry0: -10, ry1: -2 });
+ return `<div style="position:absolute;inset:0;${e3(t, .3, .7, { rx: 40, y: 60 })}">${wall}</div>` + title;
+}
diff --git a/skills/claude-reel-editor/engine/brand.js b/skills/claude-reel-editor/engine/brand.js
new file mode 100644
index 0000000..3ef8f4c
--- /dev/null
+++ b/skills/claude-reel-editor/engine/brand.js
@@ -0,0 +1,36 @@
+// brand.js: every colour, font and finish the reel uses lives here and nowhere else.
+// Change these values to make the reel yours. Nothing else in engine/ or components/ hard-codes a brand value.
+window.BRAND = {
+ // The one accent colour. Everything that "happens" on screen uses it: the lit step, the tick, the progress ring.
+ // EDIT ME. Pick one strong colour and keep it for every reel so your feed reads as one brand.
+ accent: '#0071E3',
+ accentLight: '#3D95F0', // top of the accent gradient on balls, ticks and lit steps
+ accentDark: '#0053AE', // the shaded side of a lit 3D step
+
+ bg: '#FFFFFF', // the canvas
+ ink: '#1D1D1F', // main text
+ mute: '#86868B', // secondary text, the thing being acted on
+ line: '#E5E5EA', // empty tracks, unlit cells
+ soft: '#EEF1F6', // unlit 3D faces, empty ring track
+ good: '#34C759', // "pass" text, a green tool dot
+ rec: '#FF3B30', // the red record dot
+
+ // Background grid behind everything. Set gridOpacity to 0 for a plain canvas.
+ gridOpacity: 0.05,
+ gridSize: 54,
+
+ // The card finish: white, a 1px hairline and two soft shadows. Every card, window and tile uses it.
+ card: 'background:#fff;border:1px solid rgba(0,0,0,.07);box-shadow:0 1px 2px rgba(0,0,0,.04),0 12px 40px rgba(0,0,0,.08)',
+ shadow: '0 44px 80px -26px rgba(0,19,47,.5),0 3px 10px rgba(0,19,47,.12)', // under big objects (phones, reel cards)
+
+ // Fonts. Inter and JetBrains Mono are free (SIL Open Font License) and load from Google Fonts.
+ // To use your own font, change the family names and the URL. Keep a fallback after the name.
+ font: "'Inter', system-ui, sans-serif",
+ mono: "'JetBrains Mono', ui-monospace, monospace",
+ fontsUrl: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600;700&display=block',
+ // The render waits for these before the first frame, so frame 0 never shows a fallback font.
+ fontChecks: ["800 100px 'Inter'", "600 40px 'Inter'", "600 40px 'JetBrains Mono'"],
+
+ // Captions: one line, centred, on the seam between the graphic and the face card.
+ caption: { size: 52, weight: 650, y: 930, faceY: 1380 },
+};
diff --git a/skills/claude-reel-editor/engine/engine.js b/skills/claude-reel-editor/engine/engine.js
new file mode 100644
index 0000000..e84a1cc
--- /dev/null
+++ b/skills/claude-reel-editor/engine/engine.js
@@ -0,0 +1,154 @@
+// engine.js: draws any moment of the reel. window.seek(t) puts frame t on screen and nothing else.
+//
+// The reel is a list of beats. One beat = one spoken line = one big graphic.
+// { a, b, start and end on the CUT clock (seconds)
+// lay, 'split' = graphic on top, face card below
+// 'full' = graphic fills the frame, no face
+// 'face' = the face fills the frame (a hard cut, for a break)
+// still, the time the storyboard shoots for this beat (the payoff moment)
+// move, one plain sentence: what the graphic does, and on which word
+// draw(t, beat), returns the HTML for time t
+// hits: [t], optional. The graphic punches 5% on each of these words
+// carry: true, optional. This beat hands its object to the next one, so no zoom-through between them
+// cap: 1300 } optional. Caption y for this beat, when the hero needs the seam line
+//
+// Frame sizes are fixed: 1080x1920. The zones below are where things may go.
+const ZONE = {
+ panel: { x: 74, y: 170, w: 932, h: 710 }, // the hero fills this on split beats (x74-1006, y170-880)
+ low: { x: 40, y: 1114, w: 1000, h: 618 }, // the face card on split beats, the second box on full beats
+ capBand: [930, 990], // the caption line. Nothing crosses it
+ dead: { top: 210, bottom: 1520, right: 950, rightFrom: 960 }, // Instagram covers these: no text there
+};
+const CL = ZONE.panel.x, CW = ZONE.panel.w;
+const $ = id => document.getElementById(id);
+const pad5 = n => String(Math.max(0, n)).padStart(5, '0');
+
+// CUT holds the cut transcript and the cut list. data.js sets it (scripts/make-data.js writes data.js).
+window.CUT = window.CUT || { words: [], segs: [], dur: 0 };
+// word('3D') = the first word "3D" in the cut. word('step', 2) = the third "step". Use it so every hit lands on its word.
+const word = (txt, n = 0) => { const k = String(txt).toLowerCase().replace(/[^a-z0-9%']/g, '');
+ const hits = CUT.words.filter(w => w.word.toLowerCase().replace(/[^a-z0-9%']/g, '') === k);
+ if (!hits[n]) throw new Error(`word("${txt}", ${n}) is not in the cut transcript`);
+ return hits[n].start; };
+const wordEnd = (txt, n = 0) => { const s = word(txt, n); return CUT.words.find(w => w.start === s).end; };
+
+// cut time -> raw time, from the cut list. The face frame always comes from the true raw time, so lip sync never drifts across a join.
+const rawOf = c => { const S = CUT.segs; if (!S || !S.length) return c; let acc = 0;
+ for (const [a, b] of S) { if (c < acc + (b - a)) return a + (c - acc); acc += b - a; }
+ return S[S.length - 1][1] - 1e-3; };
+const faceIndex = t => Math.round(rawOf(t) * (REEL.faceFps || 30));
+
+document.head.insertAdjacentHTML('beforeend', `<link rel="stylesheet" href="${BRAND.fontsUrl}"><style>
+*{box-sizing:border-box;margin:0;padding:0}
+body{width:1080px;height:1920px;overflow:hidden;background:${BRAND.bg};font-family:${BRAND.font};color:${BRAND.ink};position:relative;-webkit-font-smoothing:antialiased}
+#bg{position:absolute;inset:-60px;background-image:linear-gradient(rgba(16,24,40,${BRAND.gridOpacity}) 1px,transparent 1px),linear-gradient(90deg,rgba(16,24,40,${BRAND.gridOpacity}) 1px,transparent 1px);background-size:${BRAND.gridSize}px ${BRAND.gridSize}px}
+#port{position:absolute;inset:0;display:none;background:#D9DDE3}#port img{width:1080px;height:1920px;object-fit:cover;display:block}
+#fcard{position:absolute;left:${ZONE.low.x}px;top:${ZONE.low.y}px;width:${ZONE.low.w}px;height:${ZONE.low.h}px;border-radius:48px;overflow:hidden;background:#D9DDE3;box-shadow:0 2px 6px rgba(16,24,40,.08),0 24px 60px rgba(16,24,40,.16);display:none}
+#fcard img{width:1000px;height:640px;object-fit:cover;display:block}
+#pop{position:absolute;left:${ZONE.low.x}px;top:1000px;width:1000px;height:114px;overflow:hidden;z-index:8;display:none;pointer-events:none}
+#pop img{position:absolute}
+.bt{position:absolute;inset:0;display:none}
+#cap{position:absolute;left:40px;width:1000px;top:${BRAND.caption.y}px;text-align:center;font:${BRAND.caption.weight} ${BRAND.caption.size}px ${BRAND.font};letter-spacing:-.022em;color:${BRAND.ink};text-shadow:0 0 2px #fff,0 0 14px rgba(255,255,255,.95),0 0 28px rgba(255,255,255,.85);white-space:nowrap;z-index:20}
+#cap span{display:inline-block;margin:0 6px}
+#cap.chest{top:${BRAND.caption.faceY}px;color:#fff;text-shadow:0 2px 14px rgba(0,0,0,.55),0 0 2px rgba(0,0,0,.4)}
+#cta{position:absolute;left:90px;width:900px;top:240px;z-index:10;display:none;padding:40px 46px;border-radius:44px;background:#fff;box-shadow:0 2px 6px rgba(16,24,40,.1),0 30px 70px rgba(0,0,0,.28)}
+#cta .lb{font:600 38px ${BRAND.font};color:${BRAND.mute}}#cta .kw{font:800 104px ${BRAND.font};letter-spacing:-.03em;display:flex;align-items:center;gap:26px}
+#cta .ic{width:92px;height:92px;border-radius:24px;background:${BRAND.accent};display:flex;align-items:center;justify-content:center}
+</style>`);
+
+// captions: chunks of up to 4 words from the CUT transcript, broken at punctuation and at pauses. Each word blurs in on its start.
+function buildCaps(words) {
+ const out = []; let cur = [];
+ const flush = () => { if (cur.length) { out.push({ a: cur[0].start, b: cur[cur.length - 1].end, w: cur }); cur = []; } };
+ words.forEach((w, i) => { cur.push(w); const nx = words[i + 1], len = cur.map(x => x.text).join(' ').length;
+ if (/[.,?!]$/.test(w.text) || cur.length >= 4 || len > 20 || (nx && nx.start - w.end > .3)) flush(); });
+ flush();
+ out.forEach((c, i) => { c.b = out[i + 1] ? out[i + 1].a : c.b + .5; });
+ return out;
+}
+let CAPS = [];
+function caps(t, B) {
+ const el = $('cap'); el.className = B.lay === 'face' ? 'chest' : '';
+ el.style.top = B.cap && B.lay !== 'face' ? B.cap + 'px' : '';
+ const c = CAPS.find(k => t >= k.a && t < k.b);
+ if (!c) { el.innerHTML = ''; return; }
+ el.innerHTML = c.w.map(w => { const p = eo(P(t, w.start - .04, .22));
+ return `<span style="opacity:${p.toFixed(3)};filter:blur(${((1 - p) * 7).toFixed(2)}px);transform:translateY(${((1 - p) * 10).toFixed(1)}px)">${w.text}</span>`; }).join('');
+}
+
+// head pop-out: the card image is scaled up and lifted so the head crosses the card top. A strip above the card shows only
+// the cut-out of the same frame (scripts/matte.py), so only the person breaks out of the box, never the background.
+const POP = { s: 1.10, dx: -50, dy: -86 };
+
+function init() {
+ if (typeof REEL === 'undefined') throw new Error('beats.js must define REEL');
+ REEL.dur = REEL.dur || CUT.dur || Math.max(...REEL.beats.map(b => b.b));
+ const words = (REEL.fix ? REEL.fix(CUT.words) : CUT.words).map(w => ({ ...w, text: (REEL.spell && REEL.spell[w.word]) || w.word }));
+ CAPS = buildCaps(words);
+ document.body.insertAdjacentHTML('afterbegin', `<div id="bg"></div><div id="port"><img id="portI"></div><div id="fcard"><img id="faceI"></div><div id="pop"><img id="popI"></div><div id="cap"></div>
+ <div id="cta"><div class="lb">${REEL.cta ? REEL.cta.label || 'Comment' : ''}</div><div class="kw"><div class="ic"><svg viewBox="0 0 24 24" width="56" height="56" fill="#fff"><path d="M4 4h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H9l-5 4V6a2 2 0 0 1 2-2z"/></svg></div><span>${REEL.cta ? REEL.cta.word : ''}</span></div></div>`);
+ if (REEL.pop) {
+ const fi = $('faceI'), pi = $('popI');
+ fi.style.cssText = `width:${1000 * POP.s}px;height:${640 * POP.s}px;object-fit:cover;transform:translate(${POP.dx}px,${POP.dy}px)`;
+ pi.style.cssText = `left:${POP.dx}px;top:${ZONE.low.y - 1000 + POP.dy}px;width:${1000 * POP.s}px;height:${640 * POP.s}px`;
+ }
+ REEL.beats.forEach((b, i) => { const d = document.createElement('div'); d.className = 'bt'; d.id = 'b' + i; document.body.insertBefore(d, $('cap')); b.el = d; b.i = i; });
+}
+
+const setSrc = (img, src) => { if (img.getAttribute('src') !== src) img.setAttribute('src', src); };
+window.seek = function (t) {
+ const bi = REEL.beats.findIndex(b => t >= b.a && t < b.b), B = REEL.beats[bi < 0 ? REEL.beats.length - 1 : bi];
+ REEL.beats.forEach(b => { b.el.style.display = b === B ? 'block' : 'none'; });
+ B.el.innerHTML = B.draw ? B.draw(t, B) : '';
+ // layouts
+ $('port').style.display = B.lay === 'face' ? 'block' : 'none';
+ $('fcard').style.display = B.lay === 'split' ? 'block' : 'none';
+ $('pop').style.display = B.lay === 'split' && REEL.pop ? 'block' : 'none';
+ if (REEL.frames) {
+ const k = pad5(faceIndex(t));
+ if (B.lay === 'face') setSrc($('portI'), `${REEL.frames}/portrait/${k}.jpg`);
+ if (B.lay === 'split') { setSrc($('faceI'), `${REEL.frames}/split/${k}.jpg`); if (REEL.pop) setSrc($('popI'), `${REEL.frames}/cutout/${k}.png`); }
+ }
+ // the end card
+ const C = REEL.cta;
+ $('cta').style.cssText = C && t >= C.at ? 'display:block;' + e3(t, C.at, .4, { y: 40, rx: -30 }) : 'display:none';
+ caps(t, B);
+ // transitions. Face cuts are hard cuts. Between two graphic beats the old one zooms through into the new one.
+ B.el.style.transform = ''; B.el.style.filter = ''; B.el.style.opacity = ''; REEL._tr = 0;
+ if (B.lay === 'face') return;
+ const prv = REEL.beats[B.i - 1], nxt = REEL.beats[B.i + 1], zt = REEL.zoomThrough !== false;
+ const zin = zt && prv && prv.lay !== 'face' && !prv.carry ? 1 - eo(P(t, B.a, .32)) : 0;
+ const zo = zt && nxt && nxt.lay !== 'face' && !B.carry ? P(t, B.b - .2, .2) : 0, e = zo * zo;
+ const hit = (B.hits || []).filter(h => t >= h).pop();
+ const punch = hit === undefined ? 1 : 1 + .05 * Math.sin(Math.PI * Math.min(1, (t - hit) / .28));
+ REEL._tr = Math.max(zin, zo); // the checks skip frames that are mid zoom-through
+ const s = (1 - .2 * zin) * punch * (1 + 1.2 * e);
+ if (s !== 1) { B.el.style.transformOrigin = '540px 520px'; B.el.style.transform = `scale(${s.toFixed(4)})`; }
+ const bl = 9 * zin + 16 * e;
+ if (bl > .05) B.el.style.filter = `blur(${f2(bl)}px)`;
+ if (zin || e) B.el.style.opacity = f2((1 - .85 * zin) * (1 - e));
+};
+
+// The page modes. reel.html#play plays the reel with sound (click, space, arrow keys jump 2s).
+// reel.html#4,6 loops 4s to 6s. No hash = frame 0, which is what the render and the checks use.
+function startPage() {
+ init();
+ const H = location.hash.slice(1);
+ if (H === 'play') {
+ const au = new Audio(REEL.audio || 'cut-audio.wav'); let raf = 0;
+ document.body.insertAdjacentHTML('beforeend', `<div id="pl" style="position:absolute;inset:0;z-index:99;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.35);cursor:pointer"><div style="width:260px;height:260px;border-radius:50%;background:${BRAND.accent};display:flex;align-items:center;justify-content:center"><svg viewBox="0 0 24 24" width="120" height="120" fill="#fff"><path d="M8 5v14l11-7z"/></svg></div></div><div id="pb" style="position:absolute;left:0;bottom:0;height:14px;width:0;background:${BRAND.accent};z-index:98"></div>`);
+ const pl = $('pl'), pb = $('pb');
+ const loop = () => { seek(au.currentTime); pb.style.width = (au.currentTime / REEL.dur * 100) + '%'; if (!au.paused) raf = requestAnimationFrame(loop); };
+ const tog = () => { if (au.paused) { au.play(); pl.style.display = 'none'; loop(); } else { au.pause(); pl.style.display = 'flex'; } };
+ addEventListener('click', tog);
+ addEventListener('keydown', e => { if (e.code === 'Space') { e.preventDefault(); tog(); } if (e.code === 'ArrowRight' || e.code === 'ArrowLeft') { au.currentTime = Math.max(0, au.currentTime + (e.code === 'ArrowRight' ? 2 : -2)); seek(au.currentTime); } });
+ // the storyboard page posts {t} when a card is clicked: jump there and play with sound
+ addEventListener('message', e => { const d = e.data || {}; if (typeof d.t === 'number') { au.currentTime = d.t; seek(d.t); if (au.paused) tog(); } });
+ au.addEventListener('ended', () => { pl.style.display = 'flex'; au.currentTime = 0; });
+ seek(0);
+ } else {
+ const N = H.split(',').map(Number);
+ if (N.length === 2 && N.every(n => !isNaN(n))) { const [a, b] = N, t0 = performance.now(); const f = () => { const e = ((performance.now() - t0) / 1000) % (b - a + .8); seek(Math.min(b - .01, a + e)); requestAnimationFrame(f); }; f(); }
+ else seek(0);
+ }
+}
diff --git a/skills/claude-reel-editor/engine/motion.js b/skills/claude-reel-editor/engine/motion.js
new file mode 100644
index 0000000..8977a2d
--- /dev/null
+++ b/skills/claude-reel-editor/engine/motion.js
@@ -0,0 +1,59 @@
+// motion.js: the timing and motion helpers every beat uses.
+// Every helper is a pure function of t (seconds on the CUT clock). Nothing keeps state between frames,
+// so seek(t) draws the same frame every time and the render can jump to any frame in any order.
+
+const cl = x => Math.max(0, Math.min(1, x));
+const P = (t, a, d) => cl((t - a) / d); // progress 0 to 1 of a move that starts at a and lasts d
+const eo = x => 1 - Math.pow(1 - x, 3); // ease out
+const f2 = n => (+n).toFixed(2);
+// critically damped settle: lands like a spring with no overshoot and no bounce
+const spr = x => x <= 0 ? 0 : x >= 1 ? 1 : (1 - (1 + 7 * x) * Math.exp(-7 * x)) / (1 - 8 * Math.exp(-7));
+const land = (t, a, d = .5) => spr(P(t, a, d)); // 0 to 1, settles on time
+const fade = (t, a, d = .18) => f2(eo(P(t, a, d))); // opacity string for a quick fade in
+const on = (t, a) => t >= a;
+
+// typed text: the string types out between a and b
+const typed = (s, t, a, b) => s.slice(0, Math.round(s.length * cl((t - a) / (b - a))));
+const caret = (t, h = 52) => (Math.floor(t * 2.4) % 2 ? '' : `<i style="display:inline-block;width:4px;height:${h}px;background:${BRAND.accent};vertical-align:-8px;margin-left:3px"></i>`);
+
+// 3D entrance: comes from back and tilted, settles flat. Opacity leads so it never pops.
+const e3 = (t, a, d = .7, o = {}) => { const s = spr(P(t, a, d)), f = eo(P(t, a, d * .45));
+ return `opacity:${f2(f)};transform-origin:${o.org ?? '50% 0%'};transform:translate3d(0,${f2((1 - s) * (o.y ?? 40))}px,${f2((1 - s) * (o.z ?? -220))}px) rotateX(${f2((1 - s) * (o.rx ?? -38))}deg) rotateY(${f2((1 - s) * (o.ry ?? 0))}deg)`; };
+// SLAM: a hard 3D entrance from deep (z -1300) with a big tilt. Use it on the spoken word.
+const slam = (t, a, o = {}) => e3(t, a, o.d ?? .55, { rx: o.rx ?? -62, ry: o.ry ?? 0, y: o.y ?? 220, z: o.z ?? -1300, org: o.org ?? '50% 50%' });
+// CRASH: gravity exit. Accelerates, tips and drops back into depth, so it never crosses the caption line.
+const crash = (t, a, d = .5, o = {}) => { const k = P(t, a, d), e = k * k;
+ return `transform-origin:50% 100%;transform:translate3d(0,${f2(e * (o.y ?? 160))}px,${f2(-e * (o.z ?? 1100))}px) rotateX(${f2(e * (o.rx ?? 80))}deg) rotateZ(${f2(e * (o.rz ?? 12))}deg);opacity:${f2(1 - P(t, a + d * .55, d * .45))}`; };
+
+// CAMERA: wraps a layer in perspective. It starts tilted and settles once over d seconds, then holds still.
+const cam = (t, a, html, o = {}) => { const k = eo(P(t, a, o.d ?? 2.4)), oy = o.oy ?? 520;
+ const rx = (o.rx0 ?? -12) + ((o.rx1 ?? -4) - (o.rx0 ?? -12)) * k, ry = (o.ry0 ?? -12) + ((o.ry1 ?? -3) - (o.ry0 ?? -12)) * k;
+ return `<div style="position:absolute;inset:0;perspective:${o.per ?? 2600}px;perspective-origin:540px ${oy}px"><div style="position:absolute;inset:0;transform-style:preserve-3d;transform-origin:540px ${oy}px;transform:rotateX(${f2(rx)}deg) rotateY(${f2(ry)}deg)">${html}</div></div>`; };
+const camH = (t, a, html, o = {}) => cam(t, a, html, { rx0: -24, ry0: -26, rx1: -4, ry1: -2, d: 1.5, ...o }); // a harder tilt that settles faster
+
+// letters cascade in one by one, each flipping up from below
+const cascade = (s, t, a, col = BRAND.ink, gap = .035) => [...s].map((ch, i) => { const k = land(t, a + i * gap, .55);
+ return `<span style="display:inline-block;white-space:pre;opacity:${fade(t, a + i * gap, .12)};transform:translateY(${f2((1 - k) * 60)}px) rotateX(${f2((1 - k) * -80)}deg);transform-origin:50% 100%;color:${col}">${ch}</span>`; }).join('');
+
+// a ring that expands and fades from a point: the "hit" mark on a word. HTML version and SVG version.
+const ring = (cx, cy, t, a, c = BRAND.accent, r = 30, g = 1.4) => { const k = P(t, a, .55); if (!(t >= a && k < 1)) return ''; const R = r + eo(k) * r * g;
+ return `<div style="position:absolute;left:${f2(cx - R)}px;top:${f2(cy - R)}px;width:${f2(2 * R)}px;height:${f2(2 * R)}px;border-radius:50%;border:${f2(6 * (1 - k))}px solid ${c};opacity:${f2(1 - k)}"></div>`; };
+const pulse = (q, t, a, c = BRAND.accent, r = 9, g = 2.4) => { const k = P(t, a, .5);
+ return t >= a && k < 1 ? `<circle cx="${f2(q[0])}" cy="${f2(q[1])}" r="${f2(r + eo(k) * r * g)}" fill="none" stroke="${c}" stroke-width="${f2(r * .42 * (1 - k))}" opacity="${f2(1 - k)}"/>` : ''; };
+
+// a ball that travels a cubic bezier with a short trail, then pulses where it lands (SVG)
+const bz = (p, u) => { const m = 1 - u; return [0, 1].map(k => m * m * m * p[0][k] + 3 * m * m * u * p[1][k] + 3 * m * u * u * p[2][k] + u * u * u * p[3][k]); };
+const ball = (pts, t, a, d, c = BRAND.accent, r = 9, g = 2.4) => {
+ if (t < a) return ''; const u = P(t, a, d); let s = '';
+ if (u < 1) { const ue = u < .5 ? 2 * u * u : 1 - Math.pow(-2 * u + 2, 2) / 2;
+ [.16, .1, .05].forEach((gg, i) => { const q = bz(pts, Math.max(0, ue - gg)); s += `<circle cx="${f2(q[0])}" cy="${f2(q[1])}" r="${f2(r * (.45 + i * .15))}" fill="${c}" opacity="${f2(.16 + i * .12)}"/>`; });
+ const q = bz(pts, ue); s += `<circle cx="${f2(q[0])}" cy="${f2(q[1])}" r="${r}" fill="${c}" stroke="#fff" stroke-width="${f2(r * .45)}"/>`; }
+ return s + pulse(pts[3], t, a + d, c, r, g);
+};
+
+// a label that flips over on rotateX at time at, from text a to text b
+const flipTxt = (t, at, a, b, d = .14) => { const ang = t < at ? -90 * eo(P(t, at - d, d)) : 90 * (1 - eo(P(t, at, d + .04)));
+ return { txt: t < at ? a : b, st: `transform:rotateX(${f2(ang)}deg)` }; };
+
+// stretch a component's own clock so its payoff lands on a word: maps t so that time `from` plays at `to`
+const stretch = (t, start, from, to) => start + (t - start) * ((from - start) / (to - start));
diff --git a/skills/claude-reel-editor/engine/ui.js b/skills/claude-reel-editor/engine/ui.js
new file mode 100644
index 0000000..7726a27
--- /dev/null
+++ b/skills/claude-reel-editor/engine/ui.js
@@ -0,0 +1,46 @@
+// ui.js: the building blocks a beat is made of. Cards, tiles, ticks, icons, phones and a code window.
+// Image paths are passed in whole (relative to the reel page), so nothing here points at anyone's assets.
+
+// line icons, 24x24, stroke only. Add your own: SYM.name = '<path d="..."/>'
+const SYM = {
+ doc: '<path d="M6 3h8l4 4v14H6z"/><path d="M14 3v4h4"/>',
+ cal: '<rect x="3" y="4" width="18" height="18" rx="3"/><path d="M16 2v4M8 2v4M3 10h18"/>',
+ pen: '<path d="M12 19l7-7 3 3-7 7-3-3z"/><path d="M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"/><path d="M2 2l7.6 7.6"/><circle cx="11" cy="11" r="2"/>',
+ zap: '<path d="M13 2 4 14h8l-1 8 9-12h-8l1-8z"/>',
+ layers: '<path d="M12 2 2 7l10 5 10-5-10-5z"/><path d="M2 17l10 5 10-5"/><path d="M2 12l10 5 10-5"/>',
+ chat: '<path d="M4 5h16v11H9l-5 4z"/>',
+ check: '<path d="M5 12.5l4.5 4.5L19 7.5"/>',
+ box: '<path d="M3 7.5 12 3l9 4.5v9L12 21l-9-4.5z"/><path d="M3 7.5 12 12l9-4.5M12 12v9"/>',
+ term: '<rect x="3" y="4" width="18" height="16" rx="2.5"/><path d="M7 9l3 3-3 3M12.5 15H17"/>',
+ wave: '<path d="M3 12h2M7 8v8M11 5v14M15 9v6M19 11v2"/>',
+ film: '<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M7 4v16M17 4v16M3 9h4M3 15h4M17 9h4M17 15h4"/>',
+ spark: '<path d="M12 3v5M12 16v5M3 12h5M16 12h5M6 6l3 3M15 15l3 3M18 6l-3 3M9 15l-3 3"/>',
+};
+
+// a card with the brand finish at a fixed position
+const box = (L, T, W, H, inner, st = '', r = 40) => `<div style="position:absolute;left:${L}px;top:${T}px;width:${W}px;height:${H}px;border-radius:${r}px;${BRAND.card};${st}">${inner}</div>`;
+// an image that fills its parent
+const pic = (src, st = '') => `<img src="${src}" style="width:100%;height:100%;object-fit:cover;display:block;${st}">`;
+// an app-style tile holding an image (a logo or icon you supply)
+const tileImg = (src, s, st = '') => `<div style="width:${s}px;height:${s}px;border-radius:${f2(s * .24)}px;${BRAND.card};display:flex;align-items:center;justify-content:center;flex:none;${st}"><img src="${src}" style="width:${f2(s * .6)}px;height:${f2(s * .6)}px;object-fit:contain"></div>`;
+// a glossy 3D tile with a line icon from SYM, in any colour
+const tileSym = (sy, s, c = BRAND.accent, st = '') => `<div style="width:${s}px;height:${s}px;border-radius:${f2(s * .24)}px;flex:none;display:flex;align-items:center;justify-content:center;background:linear-gradient(180deg,color-mix(in srgb,${c} 72%,#fff),${c});box-shadow:inset 0 2px 0 rgba(255,255,255,.45),inset 0 -4px 0 rgba(0,0,0,.12),0 14px 30px color-mix(in srgb,${c} 35%,transparent);${st}"><svg viewBox="0 0 24 24" width="${f2(s * .54)}" height="${f2(s * .54)}" fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${SYM[sy] || SYM.spark}</svg></div>`;
+// the accent tick, glossy and round
+const tick = (s, st = '') => `<div style="width:${s}px;height:${s}px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;background:linear-gradient(180deg,${BRAND.accentLight},${BRAND.accent});box-shadow:inset 0 2px 0 rgba(255,255,255,.45),inset 0 -3px 0 rgba(0,0,0,.12),0 8px 18px color-mix(in srgb,${BRAND.accent} 35%,transparent);${st}"><svg viewBox="0 0 24 24" width="${f2(s * .58)}" height="${f2(s * .58)}" fill="none" stroke="#fff" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg></div>`;
+// a phone with a 9:16 screen. inner = the screen content
+const phone = (L, T, w, inner, st = '') => `<div style="position:absolute;left:${L}px;top:${T}px;width:${w}px;height:${f2(w * 16 / 9)}px;border-radius:${f2(w * .13)}px;padding:${f2(w * .035)}px;background:${BRAND.ink};box-shadow:0 30px 60px -20px rgba(0,19,47,.45);${st}"><div style="width:100%;height:100%;border-radius:${f2(w * .1)}px;overflow:hidden;background:#fff;position:relative">${inner}</div></div>`;
+// a big number with a label under it
+const stat = (n, label, st = '') => `<div style="position:absolute;${st};padding:20px 44px 22px;border-radius:32px;${BRAND.card};text-align:center"><div style="font:800 128px/1 ${BRAND.font};letter-spacing:-.045em;color:${BRAND.accent};font-variant-numeric:tabular-nums">${n}</div><div style="margin-top:8px;font:600 32px ${BRAND.font};color:${BRAND.mute};white-space:nowrap">${label}</div></div>`;
+
+// CODE WINDOW: a light terminal-style chat window, drawn the way a real AI coding app looks.
+// When you demo a tool on screen, type the REAL command you used, never a made-up one.
+// code.win(L, T, W, H, inner, st, title) draws the window. The rest are the lines that go inside it.
+const code = {
+ icon: (s) => `<svg viewBox="0 0 24 24" width="${s}" height="${s}" fill="none" stroke="${BRAND.accent}" stroke-width="2.4" stroke-linecap="round" style="vertical-align:-${f2(s * .14)}px">${SYM.spark}</svg>`,
+ win: (L, T, W, H, inner, st = '', title = 'assistant ~/my-reel') => box(L, T, W, H, `<div style="height:62px;display:flex;align-items:center;gap:12px;padding:0 26px;border-bottom:1.5px solid rgba(0,19,47,.07)">${'<i style="width:16px;height:16px;border-radius:50%;background:#E3E6EC"></i>'.repeat(3)}<span style="margin-left:12px;font:600 25px ${BRAND.mono};color:${BRAND.mute};white-space:nowrap">${title}</span></div><div style="padding:24px 30px;font:500 34px/1.5 ${BRAND.mono};color:${BRAND.ink}">${inner}</div>`, st, 30),
+ input: (txt, cur, hint = '? for shortcuts', hc = BRAND.mute) => `<div style="border:2.5px solid #C7CBD3;border-radius:14px;padding:14px 20px;font:500 36px ${BRAND.mono};white-space:nowrap;overflow:hidden"><span style="color:${BRAND.mute}">&gt;&nbsp;</span>${txt}${cur ? `<i style="display:inline-block;width:16px;height:34px;background:${BRAND.ink};vertical-align:-6px;margin-left:2px"></i>` : ''}</div><div style="padding:8px 4px 0;font:500 27px ${BRAND.mono};color:${hc};white-space:nowrap">${hint}</div>`,
+ user: (txt, st = '') => `<div style="background:#F2F3F6;border-radius:10px;padding:8px 16px;margin:0 0 14px;white-space:nowrap;${st}"><span style="color:${BRAND.mute}">&gt;&nbsp;</span>${txt}</div>`,
+ tool: (nm, arg, res, st = '', dot = BRAND.good) => `<div style="margin:0 0 10px;white-space:nowrap;${st}"><span style="color:${dot}">●</span> <b style="font-weight:700">${nm}</b>(${arg})${res ? `<div style="color:${BRAND.mute};padding-left:30px">⎿&nbsp; ${res}</div>` : ''}</div>`,
+ say: (txt, st = '') => `<div style="margin:0 0 10px;white-space:nowrap;${st}">● ${txt}</div>`,
+ think: (t, st = '') => `<div style="margin:0 0 10px;color:${BRAND.mute};white-space:nowrap;${st}"><span style="display:inline-block;transform:rotate(${f2((t * 160) % 360)}deg)">${code.icon(30)}</span>&nbsp; Thinking…</div>`,
+};
diff --git a/skills/claude-reel-editor/example/assets/clip-1.svg b/skills/claude-reel-editor/example/assets/clip-1.svg
new file mode 100644
index 0000000..abc1e66
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/clip-1.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="440" viewBox="0 0 400 440"><rect width="400" height="440" fill="#afb7c0"/><circle cx="200" cy="190" r="80" fill="#9EA5B1"/><rect x="80" y="290" width="240" height="200" rx="100" fill="#9EA5B1"/></svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/clip-2.svg b/skills/claude-reel-editor/example/assets/clip-2.svg
new file mode 100644
index 0000000..08669c1
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/clip-2.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="440" viewBox="0 0 400 440"><rect width="400" height="440" fill="#b4bcc4"/><circle cx="200" cy="190" r="80" fill="#9EA5B1"/><rect x="80" y="290" width="240" height="200" rx="100" fill="#9EA5B1"/></svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/clip-3.svg b/skills/claude-reel-editor/example/assets/clip-3.svg
new file mode 100644
index 0000000..27135aa
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/clip-3.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="440" viewBox="0 0 400 440"><rect width="400" height="440" fill="#bac1c9"/><circle cx="200" cy="190" r="80" fill="#9EA5B1"/><rect x="80" y="290" width="240" height="200" rx="100" fill="#9EA5B1"/></svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/clip-4.svg b/skills/claude-reel-editor/example/assets/clip-4.svg
new file mode 100644
index 0000000..ee643d4
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/clip-4.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="440" viewBox="0 0 400 440"><rect width="400" height="440" fill="#c0c6cd"/><circle cx="200" cy="190" r="80" fill="#9EA5B1"/><rect x="80" y="290" width="240" height="200" rx="100" fill="#9EA5B1"/></svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/clip-5.svg b/skills/claude-reel-editor/example/assets/clip-5.svg
new file mode 100644
index 0000000..dda6903
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/clip-5.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="440" viewBox="0 0 400 440"><rect width="400" height="440" fill="#c5cbd2"/><circle cx="200" cy="190" r="80" fill="#9EA5B1"/><rect x="80" y="290" width="240" height="200" rx="100" fill="#9EA5B1"/></svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/clip-6.svg b/skills/claude-reel-editor/example/assets/clip-6.svg
new file mode 100644
index 0000000..a82fee1
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/clip-6.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="440" viewBox="0 0 400 440"><rect width="400" height="440" fill="#cbd1d6"/><circle cx="200" cy="190" r="80" fill="#9EA5B1"/><rect x="80" y="290" width="240" height="200" rx="100" fill="#9EA5B1"/></svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/flat.svg b/skills/claude-reel-editor/example/assets/flat.svg
new file mode 100644
index 0000000..124c021
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/flat.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960"><rect width="540" height="960" fill="#F4F5F8"/><rect x="30" y="80" width="480" height="420" rx="10" fill="#E3E6EB"/><rect x="70" y="130" width="250" height="30" fill="#C2C7CF"/><rect x="70" y="180" width="170" height="30" fill="#D1D5DB"/><rect x="30" y="560" width="480" height="330" rx="10" fill="#D7DBE2"/><circle cx="270" cy="690" r="78" fill="#BCC2CC"/></svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/frame-00.svg b/skills/claude-reel-editor/example/assets/frame-00.svg
new file mode 100644
index 0000000..3ea6972
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/frame-00.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#c97272"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#a63f3f">frame 0</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/frame-01.svg b/skills/claude-reel-editor/example/assets/frame-01.svg
new file mode 100644
index 0000000..863cd93
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/frame-01.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#c99372"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#a6663f">frame 4</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/frame-02.svg b/skills/claude-reel-editor/example/assets/frame-02.svg
new file mode 100644
index 0000000..d445888
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/frame-02.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#c9b572"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#a68e3f">frame 8</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/frame-03.svg b/skills/claude-reel-editor/example/assets/frame-03.svg
new file mode 100644
index 0000000..4547217
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/frame-03.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#bcc972"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#96a63f">frame 12</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/frame-04.svg b/skills/claude-reel-editor/example/assets/frame-04.svg
new file mode 100644
index 0000000..5467e36
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/frame-04.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#9bc972"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#6fa63f">frame 16</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/frame-05.svg b/skills/claude-reel-editor/example/assets/frame-05.svg
new file mode 100644
index 0000000..2bd7c72
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/frame-05.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#79c972"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#47a63f">frame 20</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/frame-06.svg b/skills/claude-reel-editor/example/assets/frame-06.svg
new file mode 100644
index 0000000..59e7448
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/frame-06.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#72c98c"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#3fa65e">frame 24</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/frame-07.svg b/skills/claude-reel-editor/example/assets/frame-07.svg
new file mode 100644
index 0000000..2589704
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/frame-07.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#72c9ae"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#3fa685">frame 28</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/frame-08.svg b/skills/claude-reel-editor/example/assets/frame-08.svg
new file mode 100644
index 0000000..4c1f91d
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/frame-08.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#72c3c9"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#3f9fa6">frame 32</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/frame-09.svg b/skills/claude-reel-editor/example/assets/frame-09.svg
new file mode 100644
index 0000000..74e6a05
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/frame-09.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#72a2c9"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#3f77a6">frame 36</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/frame-10.svg b/skills/claude-reel-editor/example/assets/frame-10.svg
new file mode 100644
index 0000000..647bed4
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/frame-10.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#7281c9"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#3f50a6">frame 40</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/frame-11.svg b/skills/claude-reel-editor/example/assets/frame-11.svg
new file mode 100644
index 0000000..b73d7b6
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/frame-11.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#8572c9"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#553fa6">frame 44</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/frame-12.svg b/skills/claude-reel-editor/example/assets/frame-12.svg
new file mode 100644
index 0000000..ed74089
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/frame-12.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#a672c9"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#7d3fa6">frame 48</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/frame-13.svg b/skills/claude-reel-editor/example/assets/frame-13.svg
new file mode 100644
index 0000000..805c2fd
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/frame-13.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#c872c9"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#a43fa6">frame 52</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/frame-14.svg b/skills/claude-reel-editor/example/assets/frame-14.svg
new file mode 100644
index 0000000..25b0b8f
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/frame-14.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#c972a9"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#a63f80">frame 56</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/frame-15.svg b/skills/claude-reel-editor/example/assets/frame-15.svg
new file mode 100644
index 0000000..e63d880
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/frame-15.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#c97288"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#a63f58">frame 60</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/gfx-1.svg b/skills/claude-reel-editor/example/assets/gfx-1.svg
new file mode 100644
index 0000000..55b895c
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/gfx-1.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="820" viewBox="0 0 400 820"><rect width="400" height="820" fill="#fff"/><rect x="30" y="40" width="340" height="300" rx="28" fill="#5badd6"/><rect x="30" y="380" width="250" height="30" rx="15" fill="#1D1D1F"/><rect x="30" y="430" width="180" height="30" rx="15" fill="#C7CBD3"/><rect x="30" y="500" width="340" height="280" rx="28" fill="#EEF1F6"/></svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/gfx-2.svg b/skills/claude-reel-editor/example/assets/gfx-2.svg
new file mode 100644
index 0000000..361b0a9
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/gfx-2.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="820" viewBox="0 0 400 820"><rect width="400" height="820" fill="#fff"/><rect x="30" y="40" width="340" height="300" rx="28" fill="#7a5bd6"/><rect x="30" y="380" width="250" height="30" rx="15" fill="#1D1D1F"/><rect x="30" y="430" width="180" height="30" rx="15" fill="#C7CBD3"/><rect x="30" y="500" width="340" height="280" rx="28" fill="#EEF1F6"/></svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/gfx-3.svg b/skills/claude-reel-editor/example/assets/gfx-3.svg
new file mode 100644
index 0000000..3d55408
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/gfx-3.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="820" viewBox="0 0 400 820"><rect width="400" height="820" fill="#fff"/><rect x="30" y="40" width="340" height="300" rx="28" fill="#d65bc1"/><rect x="30" y="380" width="250" height="30" rx="15" fill="#1D1D1F"/><rect x="30" y="430" width="180" height="30" rx="15" fill="#C7CBD3"/><rect x="30" y="500" width="340" height="280" rx="28" fill="#EEF1F6"/></svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/gfx-4.svg b/skills/claude-reel-editor/example/assets/gfx-4.svg
new file mode 100644
index 0000000..47be50e
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/gfx-4.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="820" viewBox="0 0 400 820"><rect width="400" height="820" fill="#fff"/><rect x="30" y="40" width="340" height="300" rx="28" fill="#d6655b"/><rect x="30" y="380" width="250" height="30" rx="15" fill="#1D1D1F"/><rect x="30" y="430" width="180" height="30" rx="15" fill="#C7CBD3"/><rect x="30" y="500" width="340" height="280" rx="28" fill="#EEF1F6"/></svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/gfx-5.svg b/skills/claude-reel-editor/example/assets/gfx-5.svg
new file mode 100644
index 0000000..1a7fb71
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/gfx-5.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="820" viewBox="0 0 400 820"><rect width="400" height="820" fill="#fff"/><rect x="30" y="40" width="340" height="300" rx="28" fill="#d6d65b"/><rect x="30" y="380" width="250" height="30" rx="15" fill="#1D1D1F"/><rect x="30" y="430" width="180" height="30" rx="15" fill="#C7CBD3"/><rect x="30" y="500" width="340" height="280" rx="28" fill="#EEF1F6"/></svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/gfx-6.svg b/skills/claude-reel-editor/example/assets/gfx-6.svg
new file mode 100644
index 0000000..9f010f5
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/gfx-6.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="820" viewBox="0 0 400 820"><rect width="400" height="820" fill="#fff"/><rect x="30" y="40" width="340" height="300" rx="28" fill="#66d65b"/><rect x="30" y="380" width="250" height="30" rx="15" fill="#1D1D1F"/><rect x="30" y="430" width="180" height="30" rx="15" fill="#C7CBD3"/><rect x="30" y="500" width="340" height="280" rx="28" fill="#EEF1F6"/></svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/mark.svg b/skills/claude-reel-editor/example/assets/mark.svg
new file mode 100644
index 0000000..62a97eb
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/mark.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 24 24"><circle cx="12" cy="12" r="11" fill="#0071E3"/><path d="M12 5v4M12 15v4M5 12h4M15 12h4M7.5 7.5l2.2 2.2M14.3 14.3l2.2 2.2M16.5 7.5l-2.2 2.2M9.7 14.3l-2.2 2.2" stroke="#fff" stroke-width="1.8" stroke-linecap="round"/></svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/raw.svg b/skills/claude-reel-editor/example/assets/raw.svg
new file mode 100644
index 0000000..55c55bd
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/raw.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="720" viewBox="0 0 1280 720"><rect width="1280" height="720" fill="#C9CED6"/><rect x="0" y="560" width="1280" height="160" fill="#B7BDC7"/><circle cx="640" cy="300" r="120" fill="#9EA5B1"/><rect x="460" y="430" width="360" height="300" rx="150" fill="#9EA5B1"/></svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/style.svg b/skills/claude-reel-editor/example/assets/style.svg
new file mode 100644
index 0000000..c863487
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/style.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="800" height="1000" viewBox="0 0 800 1000"><rect width="800" height="1000" fill="#fff"/><g fill="none" stroke="#E9ECF1" stroke-width="2"><path d="M0 0V1000"/><path d="M50 0V1000"/><path d="M100 0V1000"/><path d="M150 0V1000"/><path d="M200 0V1000"/><path d="M250 0V1000"/><path d="M300 0V1000"/><path d="M350 0V1000"/><path d="M400 0V1000"/><path d="M450 0V1000"/><path d="M500 0V1000"/><path d="M550 0V1000"/><path d="M600 0V1000"/><path d="M650 0V1000"/><path d="M700 0V1000"/><path d="M750 0V1000"/><path d="M0 0H800"/><path d="M0 50H800"/><path d="M0 100H800"/><path d="M0 150H800"/><path d="M0 200H800"/><path d="M0 250H800"/><path d="M0 300H800"/><path d="M0 350H800"/><path d="M0 400H800"/><path d="M0 450H800"/><path d="M0 500H800"/><path d="M0 550H800"/><path d="M0 600H800"/><path d="M0 650H800"/><path d="M0 700H800"/><path d="M0 750H800"/><path d="M0 800H800"/><path d="M0 850H800"/><path d="M0 900H800"/><path d="M0 950H800"/></g><rect x="60" y="70" width="520" height="70" rx="20" fill="#1D1D1F"/><rect x="60" y="160" width="360" height="70" rx="20" fill="#0071E3"/><rect x="60" y="300" width="680" height="104" rx="26" fill="#fff" stroke="#E5E5EA" stroke-width="3"/><circle cx="120" cy="352" r="30" fill="#0071E3"/><rect x="170" y="336" width="380" height="32" rx="16" fill="#1D1D1F"/><rect x="60" y="430" width="680" height="104" rx="26" fill="#fff" stroke="#E5E5EA" stroke-width="3"/><circle cx="120" cy="482" r="30" fill="#0071E3"/><rect x="170" y="466" width="340" height="32" rx="16" fill="#1D1D1F"/><rect x="60" y="560" width="680" height="104" rx="26" fill="#fff" stroke="#E5E5EA" stroke-width="3"/><circle cx="120" cy="612" r="30" fill="#0071E3"/><rect x="170" y="596" width="300" height="32" rx="16" fill="#1D1D1F"/><rect x="60" y="690" width="680" height="104" rx="26" fill="#fff" stroke="#E5E5EA" stroke-width="3"/><circle cx="120" cy="742" r="30" fill="#0071E3"/><rect x="170" y="726" width="260" height="32" rx="16" fill="#1D1D1F"/><rect x="60" y="820" width="680" height="104" rx="26" fill="#fff" stroke="#E5E5EA" stroke-width="3"/><circle cx="120" cy="872" r="30" fill="#0071E3"/><rect x="170" y="856" width="220" height="32" rx="16" fill="#1D1D1F"/></svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/v1.svg b/skills/claude-reel-editor/example/assets/v1.svg
new file mode 100644
index 0000000..fe19636
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/v1.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#68afd3"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#3387b1">version 1</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/v2.svg b/skills/claude-reel-editor/example/assets/v2.svg
new file mode 100644
index 0000000..d8533a1
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/v2.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#9568d3"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#6833b1">version 2</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/v3.svg b/skills/claude-reel-editor/example/assets/v3.svg
new file mode 100644
index 0000000..a873e13
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/v3.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#d3689e"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#b13372">version 3</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/v4.svg b/skills/claude-reel-editor/example/assets/v4.svg
new file mode 100644
index 0000000..2000845
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/v4.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#d39568"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#b16833">version 4</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/assets/v5.svg b/skills/claude-reel-editor/example/assets/v5.svg
new file mode 100644
index 0000000..7a4d964
--- /dev/null
+++ b/skills/claude-reel-editor/example/assets/v5.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="540" height="960" viewBox="0 0 540 960">
+<rect width="540" height="960" fill="#F4F5F8"/>
+<rect x="30" y="80" width="480" height="420" rx="34" fill="#68d39e"/>
+<rect x="70" y="130" width="250" height="34" rx="17" fill="#fff" opacity=".9"/>
+<rect x="70" y="182" width="170" height="34" rx="17" fill="#fff" opacity=".6"/>
+<circle cx="390" cy="380" r="70" fill="#fff" opacity=".85"/>
+<rect x="30" y="560" width="480" height="330" rx="34" fill="#D7DBE2"/>
+<circle cx="270" cy="690" r="78" fill="#BCC2CC"/>
+<rect x="150" y="790" width="240" height="100" rx="50" fill="#BCC2CC"/>
+<text x="270" y="535" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-weight="800" font-size="34" fill="#33b172">version 5</text>
+</svg>
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/cut-words.json b/skills/claude-reel-editor/example/cut-words.json
new file mode 100644
index 0000000..d6e5ae7
--- /dev/null
+++ b/skills/claude-reel-editor/example/cut-words.json
@@ -0,0 +1,172 @@
+[
+ {
+ "word": "Edit",
+ "start": 0.08,
+ "end": 0.36
+ },
+ {
+ "word": "your",
+ "start": 0.42,
+ "end": 0.7
+ },
+ {
+ "word": "reel",
+ "start": 0.76,
+ "end": 1.04
+ },
+ {
+ "word": "with",
+ "start": 1.1,
+ "end": 1.38
+ },
+ {
+ "word": "code.",
+ "start": 1.44,
+ "end": 1.72
+ },
+ {
+ "word": "It",
+ "start": 1.885,
+ "end": 2.075
+ },
+ {
+ "word": "takes",
+ "start": 2.135,
+ "end": 2.46
+ },
+ {
+ "word": "four",
+ "start": 2.52,
+ "end": 2.8
+ },
+ {
+ "word": "steps.",
+ "start": 2.86,
+ "end": 3.185
+ },
+ {
+ "word": "Cut,",
+ "start": 3.365,
+ "end": 3.6
+ },
+ {
+ "word": "storyboard,",
+ "start": 3.78,
+ "end": 4.33
+ },
+ {
+ "word": "build,",
+ "start": 4.51,
+ "end": 4.835
+ },
+ {
+ "word": "check.",
+ "start": 5.015,
+ "end": 5.34
+ },
+ {
+ "word": "Every",
+ "start": 5.5,
+ "end": 5.825
+ },
+ {
+ "word": "note",
+ "start": 5.885,
+ "end": 6.165
+ },
+ {
+ "word": "makes",
+ "start": 6.225,
+ "end": 6.55
+ },
+ {
+ "word": "a",
+ "start": 6.61,
+ "end": 6.755
+ },
+ {
+ "word": "new",
+ "start": 6.815,
+ "end": 7.05
+ },
+ {
+ "word": "version.",
+ "start": 7.11,
+ "end": 7.525
+ },
+ {
+ "word": "And",
+ "start": 7.695,
+ "end": 7.93
+ },
+ {
+ "word": "you",
+ "start": 7.99,
+ "end": 8.225
+ },
+ {
+ "word": "stay",
+ "start": 8.285,
+ "end": 8.565
+ },
+ {
+ "word": "in",
+ "start": 8.625,
+ "end": 8.815
+ },
+ {
+ "word": "charge.",
+ "start": 8.875,
+ "end": 9.245
+ },
+ {
+ "word": "Five",
+ "start": 9.415,
+ "end": 9.695
+ },
+ {
+ "word": "minutes,",
+ "start": 9.755,
+ "end": 10.17
+ },
+ {
+ "word": "not",
+ "start": 10.35,
+ "end": 10.585
+ },
+ {
+ "word": "another",
+ "start": 10.645,
+ "end": 11.06
+ },
+ {
+ "word": "hour.",
+ "start": 11.12,
+ "end": 11.4
+ },
+ {
+ "word": "And",
+ "start": 11.56,
+ "end": 11.795
+ },
+ {
+ "word": "every",
+ "start": 11.855,
+ "end": 12.18
+ },
+ {
+ "word": "frame",
+ "start": 12.24,
+ "end": 12.565
+ },
+ {
+ "word": "is",
+ "start": 12.625,
+ "end": 12.815
+ },
+ {
+ "word": "checked.",
+ "start": 12.875,
+ "end": 13.29
+ }
+]
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/gallery/page/data.js b/skills/claude-reel-editor/example/gallery/page/data.js
new file mode 100644
index 0000000..99a54d1
--- /dev/null
+++ b/skills/claude-reel-editor/example/gallery/page/data.js
@@ -0,0 +1,2 @@
+// The gallery has no voice track: no words and no cut list. Every component runs on its own clock.
+window.CUT = { dur: 14, segs: [], words: [] };
diff --git a/skills/claude-reel-editor/example/gallery/page/gallery.html b/skills/claude-reel-editor/example/gallery/page/gallery.html
new file mode 100644
index 0000000..fe6ad1f
--- /dev/null
+++ b/skills/claude-reel-editor/example/gallery/page/gallery.html
@@ -0,0 +1,36 @@
+<!doctype html><html><head><meta charset="utf-8"><title>Component gallery</title></head><body>
+<!-- One beat per component the example reel does not use. node scripts/storyboard.js example/gallery shoots them all. -->
+<script src="../../../engine/brand.js"></script>
+<script src="../../../engine/motion.js"></script>
+<script src="../../../engine/ui.js"></script>
+<script src="../../../engine/engine.js"></script>
+<script src="../../../components/dropzone.js"></script>
+<script src="../../../components/filmstrip.js"></script>
+<script src="../../../components/countup.js"></script>
+<script src="../../../components/style-transfer.js"></script>
+<script src="../../../components/codedemo.js"></script>
+<script src="data.js"></script>
+<script>
+const A = '../../assets/';
+const FR = Array.from({ length: 16 }, (_, i) => `${A}frame-${String(i).padStart(2, '0')}.svg`);
+const REEL = {
+ title: 'Component gallery',
+ beats: [
+ { a: 0, b: 2.4, lay: 'split', still: 2.2, move: 'dropZone: the raw clip flies in on an arc, the waveform rises, bad sections lift out, two files fly in',
+ draw: t => dropZone(t, { start: 0, dropAt: .3, clip: A + 'raw.svg', clipLabel: 'raw.mp4 · 0:19', waveAt: .75, badAt: 1.4, files: [{ name: 'cut-audio.wav', icon: 'wave', at: .8 }, { name: 'words.json', icon: 'doc', at: 1.1 }] }) },
+ { a: 2.4, b: 4.6, lay: 'split', still: 4.4, move: 'filmstripScan: frames step under the scanner, each ticked, the centre one lifts on the stop word',
+ draw: t => filmstripScan(t, { frames: FR, start: 2.4, stopAt: 4.0 }) },
+ { a: 4.6, b: 7.0, lay: 'split', still: 6.8, move: 'cutStrip: the pauses snap shut under a playhead, a graphic rises out of each clip, the row locks with a tick',
+ draw: t => cutStrip(t, { clips: [1, 2, 3, 4, 5, 6].map(i => `${A}clip-${i}.svg`), graphics: [1, 2, 3, 4, 5, 6].map(i => `${A}gfx-${i}.svg`), start: 4.6, cutAt: 4.8, riseAt: 5.6, lockAt: 6.6 }) },
+ { a: 7.0, b: 9.0, lay: 'split', still: 8.8, move: 'countUp x2: 29 viral reels counts up, fades, then 13 creators lands below',
+ // a count-up sits on top of what it counts: here a tilted wall of the frames it is counting, each slamming in from deep
+ draw: t => camH(t, 7.0, `<div style="position:absolute;inset:0;perspective:1800px"><div style="position:absolute;inset:0;transform:rotateX(18deg) rotateY(-14deg);transform-style:preserve-3d">${FR.slice(0, 12).map((f, i) => `<div style="position:absolute;left:${90 + (i % 6) * 152}px;top:${200 + Math.floor(i / 6) * 330}px;width:140px;height:249px;border-radius:18px;overflow:hidden;box-shadow:${BRAND.shadow};${slam(t, 7.05 + i * .06, { z: -900, rx: -40, y: 80 })};filter:grayscale(${f2(P(t, 8.0, .3) * .7)})">${pic(f)}</div>`).join('')}</div></div>`)
+ + countUp(t, { n: 29, label: 'viral reels', at: 7.1, outAt: 8.0, x: 310, y: 330 }) + countUp(t, { n: 13, label: 'creators', at: 8.1, x: 330, y: 560, w: 340 }) },
+ { a: 9.0, b: 11.4, lay: 'split', still: 11.2, move: 'styleTransfer: the reference slams in, the flat frame slams in grey, three chips fly across, both face the camera',
+ draw: t => styleTransfer(t, { from: A + 'style.svg', to: A + 'flat.svg', start: 9.0, fromAt: 9.05, toAt: 9.4, chips: [9.8, 10.0, 10.2], faceAt: 10.8 }) },
+ { a: 11.4, b: 14, lay: 'split', still: 13.6, move: 'codeDemo: the prompt types, sends, two tool lines land, a file lifts out of the window',
+ draw: t => codeDemo(t, { start: 11.4, prompt: '/init', typeFrom: 11.7, typeTo: 12.1, sendAt: 12.3, lines: [{ at: 12.45, tool: 'Read', arg: '2 files' }, { at: 12.75, tool: 'Write', arg: 'NOTES.md', res: 'Wrote 24 lines', resAt: 13.05 }], fileAt: 13.05 }) },
+ ],
+};
+startPage();
+</script></body></html>
diff --git a/skills/claude-reel-editor/example/gallery/reel.config.json b/skills/claude-reel-editor/example/gallery/reel.config.json
new file mode 100644
index 0000000..b3739fe
--- /dev/null
+++ b/skills/claude-reel-editor/example/gallery/reel.config.json
@@ -0,0 +1,4 @@
+{
+ "page": "page/gallery.html",
+ "fps": 60
+}
diff --git a/skills/claude-reel-editor/example/make-test-footage.py b/skills/claude-reel-editor/example/make-test-footage.py
new file mode 100644
index 0000000..3e73e61
--- /dev/null
+++ b/skills/claude-reel-editor/example/make-test-footage.py
@@ -0,0 +1,84 @@
+#!/usr/bin/env python3
+"""Make test footage for the example reel, so every step runs on a fresh machine with no camera and no voice.
+
+Writes, next to this file:
+ raw.mp4 1080x1920, 30fps. The picture is ffmpeg's testsrc, which prints a frame counter, so you can
+ check lip sync: the counter in the face card must jump exactly where the cut list says.
+ raw-words.json the "transcript" of raw.mp4 on the raw clock. It stands in for whisper, because the sound
+ is tone bursts, not speech. Each burst is one word.
+ music.wav a steady test pad for the music step. Replace it with your own licensed track.
+
+The raw take has real silences between lines, one long pause, and one fluffed take ("It takes, um") that
+the cut must drop. That is what a real recording looks like.
+Needs Python 3 and ffmpeg. No other packages.
+"""
+import json, math, os, random, struct, subprocess, sys, wave
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+SR = 48000
+random.seed(7)
+
+LINES = [ # (words, pause after the line in seconds). The pause is what the cut removes.
+ ("Edit your reel with code.", 0.9),
+ ("It takes, um", 0.8), # a fluffed take: the cut drops it
+ ("It takes four steps. Cut, storyboard, build, check.", 0.6),
+ ("Every note makes a new version.", 1.3), # a long pause
+ ("And you stay in charge.", 0.5),
+ ("Five minutes, not another hour.", 0.7),
+ ("And every frame is checked.", 0.0),
+]
+LEAD, TAIL = 0.7, 0.8
+
+def word_len(w):
+ return 0.10 + 0.045 * len([c for c in w if c.isalpha()])
+
+words, t = [], LEAD
+for li, (line, pause) in enumerate(LINES):
+ ws = line.split()
+ for i, w in enumerate(ws):
+ d = word_len(w)
+ words.append({"word": w, "start": round(t, 3), "end": round(t + d, 3), "line": li})
+ t += d
+ if i < len(ws) - 1:
+ t += 0.18 if w.endswith(",") or w.endswith(".") else 0.06
+ t += pause if pause else 0
+dur = t + TAIL
+
+# tone bursts: a voiced buzz with harmonics and a syllable wobble, a soft attack and release, on a -70 dB noise floor
+n = int(dur * SR)
+buf = [random.gauss(0, 10.4) for _ in range(n)]
+for k, w in enumerate(words):
+ f0 = 150 + (k * 37) % 90
+ a, b = int(w["start"] * SR), int(w["end"] * SR)
+ for i in range(a, min(b, n)):
+ x = (i - a) / SR
+ env = min(1, x / .015, (b - i) / SR / .025)
+ wob = .75 + .25 * math.sin(2 * math.pi * 5 * x)
+ s = math.sin(2 * math.pi * f0 * x) + .5 * math.sin(4 * math.pi * f0 * x) + .25 * math.sin(6 * math.pi * f0 * x)
+ buf[i] += 5200 * env * wob * s
+
+def write_wav(path, data):
+ with wave.open(path, "wb") as f:
+ f.setnchannels(1); f.setsampwidth(2); f.setframerate(SR)
+ f.writeframes(b"".join(struct.pack("<h", max(-32767, min(32767, int(v)))) for v in data))
+
+wav = os.path.join(HERE, "raw-audio.wav")
+write_wav(wav, buf)
+json.dump([{k: w[k] for k in ("word", "start", "end")} for w in words], open(os.path.join(HERE, "raw-words.json"), "w"), indent=1)
+
+out = os.path.join(HERE, "raw.mp4")
+r = subprocess.run(["ffmpeg", "-v", "error", "-y", "-f", "lavfi", "-i", f"testsrc=size=1080x1920:rate=30:duration={dur:.3f}",
+ "-i", wav, "-c:v", "libx264", "-pix_fmt", "yuv420p", "-preset", "veryfast", "-crf", "23",
+ "-c:a", "aac", "-b:a", "128k", "-shortest", out])
+if r.returncode:
+ sys.exit("ffmpeg failed making raw.mp4")
+os.remove(wav)
+
+# music: a steady three-note pad, 20 seconds, about -24 dBFS. The export loops it to the reel's length.
+m = []
+for i in range(20 * SR):
+ x = i / SR
+ v = sum(math.sin(2 * math.pi * f * x) for f in (220.0, 261.63, 329.63)) / 3
+ m.append(2000 * v * (1 + .05 * math.sin(2 * math.pi * .25 * x)))
+write_wav(os.path.join(HERE, "music.wav"), m)
+print(f"raw.mp4 {dur:.2f}s, {len(words)} words, music.wav 20s")
diff --git a/skills/claude-reel-editor/example/page/beats.js b/skills/claude-reel-editor/example/page/beats.js
new file mode 100644
index 0000000..822ff84
--- /dev/null
+++ b/skills/claude-reel-editor/example/page/beats.js
@@ -0,0 +1,46 @@
+// The example reel: five beats, about 13 seconds. Every time comes from word(), so every hit lands on its spoken word.
+// It shows each rule once: the hook is the animation, one big 3D object per line, the payoff on its word,
+// an object carried across a cut, a zoom-through between two graphic beats, and a hard cut to the face.
+const STEPS = ['Cut', 'Storyboard', 'Build', 'Check'];
+const STEP_TIMES = () => [word('Cut'), word('storyboard'), word('build'), word('check')];
+const RAWF = [30, 150, 210, 300, 380, 450, 500, 540, 570].map(k => `frames/split/${String(k).padStart(5, '0')}.jpg`); // stills of the raw take for the hook's video track
+const VERSIONS = ['v1', 'v2', 'v3', 'v4', 'v5'].map(v => `../assets/${v}.svg`);
+
+const REEL = {
+ title: 'Example reel',
+ frames: 'frames', // face frames, cut from raw.mp4 by the render (folder relative to this page)
+ audio: '../cut-audio.wav', // the player plays this
+ spell: { four: '4', Five: '5' }, // captions write spoken numbers as digits
+ beats: [
+ // 0 HOOK. The hook text is the animation: the title cascades in while an edit timeline scrolls below it,
+ // and the playhead slices every track on "Edit", "reel" and "code".
+ { a: 0, b: 1.85, lay: 'split', still: 1.6,
+ move: 'HOOK: "Edit your reel / with code" cascades in over a tilted 3D edit timeline. The playhead slices every track on "Edit", "reel" and "code"',
+ draw: (t) => timelineHook(t, { lines: ['Edit your reel', 'with code'], cuts: [word('Edit'), word('reel'), word('code')], frames: RAWF, icon: '../assets/mark.svg', size: 112 }) },
+
+ // 1 A staircase for "four steps". The ball lands on a step per word and tops out ON "check".
+ // carry: it hands the staircase to the next beat instead of zooming through.
+ { a: 1.85, b: 5.45, lay: 'split', still: 5.3, carry: true, hits: [word('check')],
+ move: 'Four 3D steps rise on "four steps". The ball climbs one step per word: Cut, storyboard, build, and tops out on "check"',
+ draw: (t) => staircase(t, { steps: STEPS, times: STEP_TIMES(), start: 1.85, title: `It takes<br><span style="color:${BRAND.accent}">4 steps</span>` }) },
+
+ // 2 The staircase swings away into depth while the version carousel rises in front of it. Each word turns it a card,
+ // it spins on "a new", and v5 lifts and ticks on "version".
+ { a: 5.45, b: 7.65, lay: 'split', still: 7.45,
+ move: 'The staircase carries over and swings away into depth as a 3D carousel of versions rises. One turn per word, a fast spin on "a new", v5 lifts and ticks on "version"',
+ draw: (t) => {
+ const out = P(t, 5.45, .55), oe = out * out;
+ const stair = out < 1 ? `<div style="position:absolute;inset:0;perspective:1800px;perspective-origin:540px 520px"><div style="position:absolute;inset:0;transform-origin:540px 600px;transform:translateZ(${f2(-oe * 1500)}px) rotateY(${f2(-18 - 26 * eo(out))}deg) rotateX(${f2(oe * 35)}deg);opacity:${f2(1 - out)};filter:grayscale(${f2(out)})">${staircase(5.44, { steps: STEPS, times: STEP_TIMES(), start: 1.85, id: 'carry' })}</div></div>` : '';
+ return stair + carousel(t, { images: VERSIONS, start: 5.6, turns: [word('every'), word('note'), word('makes')], spinAt: word('a'), landAt: word('version'), label: 'v5' });
+ } },
+
+ // 3 A hard cut to the face, full frame, for a break. The caption moves to the chest.
+ { a: 7.65, b: 9.35, lay: 'face', still: 8.4, move: 'Hard cut to the face, full frame. Caption on the chest', draw: () => '' },
+
+ // 4 FULL graphic: the giant dial on top, the frame check in the lower box. The ring closes on "checked".
+ { a: 9.35, b: 13.37, lay: 'full', still: 13.2,
+ move: 'FULL: a giant dial. The accent arc sweeps 5 min on "Five minutes", the grey arc races round on "another", shatters on "hour". Below, the frame check counts and closes on "checked"',
+ draw: (t) => dial(t, { start: 9.35, fastAt: word('five'), mins: 5, recAt: word('minutes'), slowAt: word('another'), breakAt: word('hour'), tickAt: wordEnd('hour') })
+ + progressRing(t, { start: 9.6, dur: word('checked') - 9.6, total: Math.round(CUT.dur * 4), unit: 'frames', doneAt: word('checked'), doneText: 'NO FLAGS', cmd: 'node scripts/check-frames.js' }) },
+ ],
+};
diff --git a/skills/claude-reel-editor/example/page/data.js b/skills/claude-reel-editor/example/page/data.js
new file mode 100644
index 0000000..53a0363
--- /dev/null
+++ b/skills/claude-reel-editor/example/page/data.js
@@ -0,0 +1,2 @@
+// written by scripts/make-data.js from cut-words.json and segs.json. Do not edit by hand.
+window.CUT = {"dur":13.37,"segs":[[0.62,2.42],[4.9,8.52],[8.96,11.15],[12.28,14],[14.33,16.48],[17.02,18.91]],"words":[{"word":"Edit","start":0.08,"end":0.36},{"word":"your","start":0.42,"end":0.7},{"word":"reel","start":0.76,"end":1.04},{"word":"with","start":1.1,"end":1.38},{"word":"code.","start":1.44,"end":1.72},{"word":"It","start":1.885,"end":2.075},{"word":"takes","start":2.135,"end":2.46},{"word":"four","start":2.52,"end":2.8},{"word":"steps.","start":2.86,"end":3.185},{"word":"Cut,","start":3.365,"end":3.6},{"word":"storyboard,","start":3.78,"end":4.33},{"word":"build,","start":4.51,"end":4.835},{"word":"check.","start":5.015,"end":5.34},{"word":"Every","start":5.5,"end":5.825},{"word":"note","start":5.885,"end":6.165},{"word":"makes","start":6.225,"end":6.55},{"word":"a","start":6.61,"end":6.755},{"word":"new","start":6.815,"end":7.05},{"word":"version.","start":7.11,"end":7.525},{"word":"And","start":7.695,"end":7.93},{"word":"you","start":7.99,"end":8.225},{"word":"stay","start":8.285,"end":8.565},{"word":"in","start":8.625,"end":8.815},{"word":"charge.","start":8.875,"end":9.245},{"word":"Five","start":9.415,"end":9.695},{"word":"minutes,","start":9.755,"end":10.17},{"word":"not","start":10.35,"end":10.585},{"word":"another","start":10.645,"end":11.06},{"word":"hour.","start":11.12,"end":11.4},{"word":"And","start":11.56,"end":11.795},{"word":"every","start":11.855,"end":12.18},{"word":"frame","start":12.24,"end":12.565},{"word":"is","start":12.625,"end":12.815},{"word":"checked.","start":12.875,"end":13.29}]};
diff --git a/skills/claude-reel-editor/example/page/reel.html b/skills/claude-reel-editor/example/page/reel.html
new file mode 100644
index 0000000..f4ad313
--- /dev/null
+++ b/skills/claude-reel-editor/example/page/reel.html
@@ -0,0 +1,15 @@
+<!doctype html><html><head><meta charset="utf-8"><title>Example reel</title></head><body>
+<!-- Load order: brand, motion, ui, engine, the components you use, the cut data, then this reel's beats. -->
+<script src="../../engine/brand.js"></script>
+<script src="../../engine/motion.js"></script>
+<script src="../../engine/ui.js"></script>
+<script src="../../engine/engine.js"></script>
+<script src="../../components/timeline-hook.js"></script>
+<script src="../../components/staircase.js"></script>
+<script src="../../components/carousel.js"></script>
+<script src="../../components/dial.js"></script>
+<script src="../../components/ring.js"></script>
+<script src="data.js"></script>
+<script src="beats.js"></script>
+<script>startPage();</script>
+</body></html>
diff --git a/skills/claude-reel-editor/example/raw-words.json b/skills/claude-reel-editor/example/raw-words.json
new file mode 100644
index 0000000..31a9df4
--- /dev/null
+++ b/skills/claude-reel-editor/example/raw-words.json
@@ -0,0 +1,187 @@
+[
+ {
+ "word": "Edit",
+ "start": 0.7,
+ "end": 0.98
+ },
+ {
+ "word": "your",
+ "start": 1.04,
+ "end": 1.32
+ },
+ {
+ "word": "reel",
+ "start": 1.38,
+ "end": 1.66
+ },
+ {
+ "word": "with",
+ "start": 1.72,
+ "end": 2.0
+ },
+ {
+ "word": "code.",
+ "start": 2.06,
+ "end": 2.34
+ },
+ {
+ "word": "It",
+ "start": 3.24,
+ "end": 3.43
+ },
+ {
+ "word": "takes,",
+ "start": 3.49,
+ "end": 3.815
+ },
+ {
+ "word": "um",
+ "start": 3.995,
+ "end": 4.185
+ },
+ {
+ "word": "It",
+ "start": 4.985,
+ "end": 5.175
+ },
+ {
+ "word": "takes",
+ "start": 5.235,
+ "end": 5.56
+ },
+ {
+ "word": "four",
+ "start": 5.62,
+ "end": 5.9
+ },
+ {
+ "word": "steps.",
+ "start": 5.96,
+ "end": 6.285
+ },
+ {
+ "word": "Cut,",
+ "start": 6.465,
+ "end": 6.7
+ },
+ {
+ "word": "storyboard,",
+ "start": 6.88,
+ "end": 7.43
+ },
+ {
+ "word": "build,",
+ "start": 7.61,
+ "end": 7.935
+ },
+ {
+ "word": "check.",
+ "start": 8.115,
+ "end": 8.44
+ },
+ {
+ "word": "Every",
+ "start": 9.04,
+ "end": 9.365
+ },
+ {
+ "word": "note",
+ "start": 9.425,
+ "end": 9.705
+ },
+ {
+ "word": "makes",
+ "start": 9.765,
+ "end": 10.09
+ },
+ {
+ "word": "a",
+ "start": 10.15,
+ "end": 10.295
+ },
+ {
+ "word": "new",
+ "start": 10.355,
+ "end": 10.59
+ },
+ {
+ "word": "version.",
+ "start": 10.65,
+ "end": 11.065
+ },
+ {
+ "word": "And",
+ "start": 12.365,
+ "end": 12.6
+ },
+ {
+ "word": "you",
+ "start": 12.66,
+ "end": 12.895
+ },
+ {
+ "word": "stay",
+ "start": 12.955,
+ "end": 13.235
+ },
+ {
+ "word": "in",
+ "start": 13.295,
+ "end": 13.485
+ },
+ {
+ "word": "charge.",
+ "start": 13.545,
+ "end": 13.915
+ },
+ {
+ "word": "Five",
+ "start": 14.415,
+ "end": 14.695
+ },
+ {
+ "word": "minutes,",
+ "start": 14.755,
+ "end": 15.17
+ },
+ {
+ "word": "not",
+ "start": 15.35,
+ "end": 15.585
+ },
+ {
+ "word": "another",
+ "start": 15.645,
+ "end": 16.06
+ },
+ {
+ "word": "hour.",
+ "start": 16.12,
+ "end": 16.4
+ },
+ {
+ "word": "And",
+ "start": 17.1,
+ "end": 17.335
+ },
+ {
+ "word": "every",
+ "start": 17.395,
+ "end": 17.72
+ },
+ {
+ "word": "frame",
+ "start": 17.78,
+ "end": 18.105
+ },
+ {
+ "word": "is",
+ "start": 18.165,
+ "end": 18.355
+ },
+ {
+ "word": "checked.",
+ "start": 18.415,
+ "end": 18.83
+ }
+]
\ No newline at end of file
diff --git a/skills/claude-reel-editor/example/reel.config.json b/skills/claude-reel-editor/example/reel.config.json
new file mode 100644
index 0000000..ae7fc10
--- /dev/null
+++ b/skills/claude-reel-editor/example/reel.config.json
@@ -0,0 +1,13 @@
+{
+ "page": "page/reel.html",
+ "raw": "raw.mp4",
+ "segs": "segs.json",
+ "audio": "cut-audio.wav",
+ "words": "cut-words.json",
+ "frames": "page/frames",
+ "splitCrop": "1080:691:0:615",
+ "portraitCrop": "1080:1920:0:0",
+ "fps": 60,
+ "workers": 4,
+ "out": "out/reel.mp4"
+}
diff --git a/skills/claude-reel-editor/example/segs.json b/skills/claude-reel-editor/example/segs.json
new file mode 100644
index 0000000..f2ef7dc
--- /dev/null
+++ b/skills/claude-reel-editor/example/segs.json
@@ -0,0 +1,26 @@
+[
+ [
+ 0.62,
+ 2.42
+ ],
+ [
+ 4.9,
+ 8.52
+ ],
+ [
+ 8.96,
+ 11.15
+ ],
+ [
+ 12.28,
+ 14.0
+ ],
+ [
+ 14.33,
+ 16.48
+ ],
+ [
+ 17.02,
+ 18.91
+ ]
+]
\ No newline at end of file
diff --git a/skills/claude-reel-editor/package.json b/skills/claude-reel-editor/package.json
new file mode 100644
index 0000000..a1a928b
--- /dev/null
+++ b/skills/claude-reel-editor/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "claude-reel-editor",
+ "version": "1.0.0",
+ "description": "Edit a talking-head reel with Claude Code: cut on true silence, storyboard first, one 3D graphic per line, rendered frame by frame in Chrome.",
+ "license": "MIT",
+ "private": true,
+ "engines": {
+ "node": ">=18"
+ },
+ "scripts": {
+ "setup": "npm install && npx puppeteer browsers install chrome",
+ "example:footage": "python3 example/make-test-footage.py",
+ "example:cut": "python3 scripts/cut/raw-probe.py example/raw.mp4 && python3 scripts/cut/silences.py example/raw.mp4 example/segs.json --words example/raw-words.json --drop 2 && python3 scripts/cut/join-check.py example/raw.mp4 example/segs.json && python3 scripts/cut/pause-check.py example/raw.mp4 example/segs.json && python3 scripts/cut/make-cut.py example/raw.mp4 example/segs.json example/cut-audio.wav && python3 scripts/cut/retime-words.py example/raw-words.json example/segs.json example/cut-words.json && python3 scripts/cut/words-check.py example/cut-words.json && node scripts/make-data.js example",
+ "storyboard": "node scripts/storyboard.js example",
+ "check": "node scripts/check-frames.js example",
+ "render": "node scripts/render.js example",
+ "export": "python3 scripts/music-steady.py example/music.wav && bash scripts/export.sh example/out/reel.mp4 example/music.wav example/out/reel-ig.mp4",
+ "qa": "python3 scripts/qa.py example/out/reel-ig.mp4",
+ "gallery": "node scripts/storyboard.js example/gallery && node scripts/check-frames.js example/gallery",
+ "example": "npm run example:footage && npm run example:cut && npm run storyboard && npm run check && npm run render && npm run export && npm run qa"
+ },
+ "dependencies": {
+ "puppeteer": "^23.11.1"
+ }
+}
diff --git a/skills/claude-reel-editor/scripts/check-frames.js b/skills/claude-reel-editor/scripts/check-frames.js
new file mode 100644
index 0000000..a258b15
--- /dev/null
+++ b/skills/claude-reel-editor/scripts/check-frames.js
@@ -0,0 +1,82 @@
+// check-frames.js: Claude's own check before you see anything. A frame every 0.25s, every beat.
+// usage: node scripts/check-frames.js <project dir> [beat numbers...] [--no-shots] [--allow-fallback]
+// Flags, each one a reason to fix before showing:
+// DEADZONE text where Instagram covers it: the top 210px, below y1520, or right of x950 in the lower half
+// OFF-FRAME text cut off by the edge of the frame
+// CAP-OVER the caption touches a graphic
+// Frames mid zoom-through are skipped for these three: everything is moving, blurred and fading there.
+// SMALL-HERO on a split beat, after its first 0.6s, the graphic covers under 45% of the panel (x74-1006, y170-880)
+// DEAD-STRETCH the graphic does not change for 1.5s or more (captions do not count)
+// Prints NO FLAGS and exits 0 when clean. Exits 1 on any flag. Saves the frames and a contact sheet to <project>/check/.
+const fs = require('fs'), path = require('path'), { spawnSync } = require('child_process');
+const { loadProject, launch, openReel, seekAndWait, extractFrames } = require('./lib');
+const args = process.argv.slice(2), P = loadProject(args[0]);
+const only = args.slice(1).filter(a => /^\d+$/.test(a)).map(Number), shots = !args.includes('--no-shots');
+
+function inspect() { // runs inside the page after seek(t)
+ const B = REEL.beats.find(b => b.el.style.display === 'block'), o = [];
+ const opac = e => { let op = 1; while (e && e !== document.body) { op *= +getComputedStyle(e).opacity; e = e.parentElement; } return op; };
+ const cap = [...document.querySelectorAll('#cap span')].map(s => s.getBoundingClientRect()).filter(r => r.width);
+ const hit = (r, c) => r.left < c.right && r.right > c.left && r.top < c.bottom && r.bottom > c.top;
+ // text
+ const w = document.createTreeWalker(B.el, NodeFilter.SHOW_TEXT); let x;
+ while (!REEL._tr && (x = w.nextNode())) { const s = x.textContent.trim(); if (!s || opac(x.parentElement) < .3) continue;
+ const rg = document.createRange(); rg.selectNodeContents(x);
+ for (const r of rg.getClientRects()) { if (!r.width) continue; const lab = s.slice(0, 18);
+ if (r.top < 210) o.push(`DEADZONE top "${lab}"`);
+ if (r.bottom > 1522) o.push(`DEADZONE bottom "${lab}" y${Math.round(r.bottom)}`);
+ if (r.right > 952 && r.top > 960) o.push(`DEADZONE right "${lab}" x${Math.round(r.right)}`);
+ if (r.left < -2 || r.right > 1082) o.push(`OFF-FRAME "${lab}"`);
+ if (cap.some(c => hit(r, c))) o.push(`CAP-OVER text "${lab}"`); } }
+ // painted things: images, svg, and anything with a fill, border or shadow. Full-frame wrappers paint nothing, so they never count.
+ const painted = [];
+ for (const e of B.el.querySelectorAll('*')) { const r = e.getBoundingClientRect(); if (r.width < 4 || r.height < 4) continue;
+ const cs = getComputedStyle(e), tag = e.tagName.toLowerCase();
+ const paints = tag === 'img' || tag === 'svg' || cs.backgroundImage !== 'none' || !/rgba\(0, 0, 0, 0\)|transparent/.test(cs.backgroundColor) || parseFloat(cs.borderTopWidth) > 0;
+ if (!paints || tag === 'circle' || tag === 'path' || tag === 'polygon' || tag === 'rect' || opac(e) < .3) continue;
+ if (tag === 'svg') { // an svg box is often the whole frame: measure the shapes inside it (client rects include CSS 3D transforms)
+ const sh = [...e.querySelectorAll('rect,polygon,circle,ellipse,path,line,text')].filter(x => !x.closest('defs') && +(x.getAttribute('opacity') ?? 1) > .3).map(x => x.getBoundingClientRect()).filter(q => q.width > 1);
+ if (sh.length) painted.push(sh.reduce((a, q) => ({ left: Math.min(a.left, q.left), top: Math.min(a.top, q.top), right: Math.max(a.right, q.right), bottom: Math.max(a.bottom, q.bottom) }), { left: 1e9, top: 1e9, right: -1e9, bottom: -1e9 }));
+ continue; }
+ painted.push(r); }
+ if (!REEL._tr) for (const r of painted) if (cap.some(c => hit({ left: r.left + 6, right: r.right - 6, top: r.top + 6, bottom: r.bottom - 6 }, c))) { o.push(`CAP-OVER object y${Math.round(r.top)}-${Math.round(r.bottom)}`); break; }
+ // how much of the panel the hero covers (union box of everything painted, clipped to the panel)
+ let fill = null;
+ if (B.lay === 'split' && painted.length) { const X0 = 74, X1 = 1006, Y0 = 170, Y1 = 880;
+ const u = painted.reduce((a, r) => ({ l: Math.min(a.l, r.left), t: Math.min(a.t, r.top), r: Math.max(a.r, r.right), b: Math.max(a.b, r.bottom) }), { l: 1e9, t: 1e9, r: -1e9, b: -1e9 });
+ fill = Math.max(0, Math.min(X1, u.r) - Math.max(X0, u.l)) * Math.max(0, Math.min(Y1, u.b) - Math.max(Y0, u.t)) / ((X1 - X0) * (Y1 - Y0)); }
+ return { i: B.i, lay: B.lay, a: B.a, flags: [...new Set(o)], fill, hash: B.el.innerHTML.length + ':' + B.el.style.cssText + ':' + B.el.innerHTML };
+}
+
+(async () => {
+ extractFrames(P);
+ const br = await launch();
+ const { pg, errs } = await openReel(br, P, { allowFallback: args.includes('--allow-fallback') });
+ const beats = await pg.evaluate(() => REEL.beats.map(b => ({ a: b.a, b: b.b, lay: b.lay })));
+ const OUT = path.join(P.dir, 'check');
+ if (shots) { fs.rmSync(OUT, { recursive: true, force: true }); fs.mkdirSync(OUT, { recursive: true }); }
+ const flags = []; let n = 0, samples = 0;
+ for (const [i, b] of beats.entries()) {
+ if (only.length && !only.includes(i)) continue;
+ let prev = null, same = 0, sameFrom = 0;
+ for (let t = b.a + .05; t < b.b; t += .25) {
+ await seekAndWait(pg, t); samples++;
+ const r = await pg.evaluate(inspect);
+ const f = [...r.flags];
+ if (r.fill !== null && t > b.a + .6 && r.fill < .45) f.push(`SMALL-HERO ${(r.fill * 100).toFixed(0)}% of the panel`);
+ if (b.lay !== 'face') { if (r.hash === prev) { if (!same) sameFrom = t - .25; same++; } else same = 0; prev = r.hash;
+ if (same === 6) f.push(`DEAD-STRETCH graphic still since ${sameFrom.toFixed(2)}s`); }
+ if (f.length) flags.push(`beat ${i} t=${t.toFixed(2)}: ${f.join(' | ')}`);
+ if (shots) await pg.screenshot({ path: path.join(OUT, `c${String(n++).padStart(5, '0')}.jpg`), type: 'jpeg', quality: 60 });
+ }
+ }
+ await br.close();
+ if (shots && n) {
+ const cols = 10, rows = Math.ceil(n / cols);
+ spawnSync('ffmpeg', ['-v', 'error', '-y', '-i', path.join(OUT, 'c%05d.jpg'), '-vf', `scale=216:384,tile=${cols}x${rows}:padding=4:color=white`, '-frames:v', '1', path.join(OUT, 'sheet.jpg')]);
+ }
+ console.log(`${samples} frames checked${shots ? `, sheet ${path.join(OUT, 'sheet.jpg')}` : ''}`);
+ if (errs.length) { console.error('PAGE ERRORS\n' + errs.join('\n')); process.exit(2); }
+ console.log(flags.length ? flags.join('\n') + `\n${flags.length} FLAGS` : 'NO FLAGS');
+ process.exit(flags.length ? 1 : 0);
+})().catch(e => { console.error('FAILED', e.message); process.exit(2); });
diff --git a/skills/claude-reel-editor/scripts/cut/join-check.py b/skills/claude-reel-editor/scripts/cut/join-check.py
new file mode 100644
index 0000000..f855d10
--- /dev/null
+++ b/skills/claude-reel-editor/scripts/cut/join-check.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python3
+"""join-check.py: fail if any cut clips speech.
+
+usage: python3 join-check.py <raw.mp4|wav> <segs.json>
+ segs.json [[start, end], ...] in raw seconds (the parts you keep)
+
+Measured on the waveform, never on whisper's word edges: whisper stretches a word's start back to the previous
+word's end, and it will still transcribe a word whole while a slice of it is cut. Each cut lands on a 30fps frame.
+At every cut-out, the loudest 20ms slice from 40ms before to 60ms after must sit under -48 dB.
+At every cut-in, the 100ms before must sit under -48 dB.
+Exit 0 = every join is clean. Exit 1 = at least one join clips speech. Fix it with: "Re-cut that join in true silence."
+"""
+import json, subprocess, sys
+import numpy as np
+
+if len(sys.argv) != 3:
+ print(__doc__); sys.exit(2)
+src, segs = sys.argv[1], json.load(open(sys.argv[2]))
+TH = -48.0
+a = np.frombuffer(subprocess.run(['ffmpeg', '-v', 'error', '-i', src, '-map', '0:a:0', '-f', 's16le', '-ac', '1', '-ar', '16000', '-'],
+ capture_output=True).stdout, dtype=np.int16).astype(float)
+def db(t0, t1):
+ x = a[max(0, int(t0 * 16000)):int(t1 * 16000)]
+ return 20 * np.log10(np.sqrt(np.mean(x ** 2)) / 32768 + 1e-9) if len(x) else -120
+def loud(t0, t1):
+ return max(db(t, t + .02) for t in np.arange(t0, t1 - .019, .01))
+bad = 0
+for i, (s, e) in enumerate(segs):
+ fs, fe = round(s * 30) / 30, round(e * 30) / 30
+ flags = []
+ end = loud(fe - .04, fe + .06)
+ if end > TH: flags.append(f'END {fe:.2f} clips speech (loudest 20ms {end:.1f} dB within -40/+60ms)')
+ if i > 0:
+ st = loud(fs - .10, fs)
+ if st > TH: flags.append(f'START {fs:.2f} cuts into speech ({st:.1f} dB in the 100ms before)')
+ bad += bool(flags)
+ print(f"seg {i + 1:2d} {fs:8.2f}-{fe:8.2f} {'; '.join(flags) or 'ok'}")
+print('FAIL' if bad else 'PASS', f'{bad} join(s) clip speech')
+sys.exit(1 if bad else 0)
diff --git a/skills/claude-reel-editor/scripts/cut/make-cut.py b/skills/claude-reel-editor/scripts/cut/make-cut.py
new file mode 100644
index 0000000..45e7f88
--- /dev/null
+++ b/skills/claude-reel-editor/scripts/cut/make-cut.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python3
+"""make-cut.py: build the cut audio from the raw take and the cut list.
+
+usage: python3 make-cut.py <raw.mp4> <segs.json> <cut-audio.wav> [--preview cut.mp4]
+Every join gets a 30ms fade each side so nothing clicks. The gain is untouched (no normaliser here).
+--preview also writes a cut video, handy to watch the cut or to transcribe it.
+Transcribe cut-audio.wav next (transcribe.py), and build every graphic on THOSE timings, never the raw take's.
+"""
+import argparse, json, os, subprocess, sys, tempfile
+
+ap = argparse.ArgumentParser(); ap.add_argument('raw'); ap.add_argument('segs'); ap.add_argument('out'); ap.add_argument('--preview')
+a = ap.parse_args()
+S = json.load(open(a.segs)); F = .03
+parts, labels, vparts = [], '', []
+for i, (s, e) in enumerate(S):
+ d = e - s
+ parts.append(f"[0:a:0]atrim={s:.4f}:{e:.4f},asetpts=PTS-STARTPTS,afade=t=in:d={F},afade=t=out:st={max(0, d - F):.4f}:d={F}[a{i}]")
+ vparts.append(f"[0:v:0]trim={s:.4f}:{e:.4f},setpts=PTS-STARTPTS[v{i}]")
+def run(graph, maps, out, extra):
+ with tempfile.NamedTemporaryFile('w', suffix='.txt', delete=False) as f:
+ f.write(';\n'.join(graph)); path = f.name
+ r = subprocess.run(['ffmpeg', '-v', 'error', '-y', '-i', a.raw, '-filter_complex_script', path, *maps, *extra, out])
+ os.remove(path)
+ if r.returncode: sys.exit(f'ffmpeg failed on {out}')
+n = len(S)
+run(parts + [''.join(f'[a{i}]' for i in range(n)) + f'concat=n={n}:v=0:a=1[a]'], ['-map', '[a]'], a.out, ['-ar', '48000'])
+if a.preview:
+ run(parts + vparts + [''.join(f'[v{i}][a{i}]' for i in range(n)) + f'concat=n={n}:v=1:a=1[v][a]'], ['-map', '[v]', '-map', '[a]'], a.preview,
+ ['-c:v', 'libx264', '-preset', 'veryfast', '-crf', '24', '-pix_fmt', 'yuv420p', '-c:a', 'aac'])
+dur = sum(e - s for s, e in S)
+print(f'{n} segments, cut length {dur:.2f}s -> {a.out}' + (f' and {a.preview}' if a.preview else ''))
diff --git a/skills/claude-reel-editor/scripts/cut/pause-check.py b/skills/claude-reel-editor/scripts/cut/pause-check.py
new file mode 100644
index 0000000..ebb5f59
--- /dev/null
+++ b/skills/claude-reel-editor/scripts/cut/pause-check.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python3
+"""pause-check.py: fail if the cut keeps a pause longer than 0.25s inside a kept segment.
+
+usage: python3 pause-check.py <raw.mp4|wav> <segs.json> [max_pause=0.25]
+A slow edit loses people. Silence here = 20ms slices under -42 dB.
+Careful: soft words ("tests", "keys") can also sit under -42 dB. Split a segment inside a flagged pause only where
+no word of the raw transcript overlaps the part you remove, then run join-check.py again.
+Exit 0 = no long pause, 1 = at least one.
+"""
+import json, subprocess, sys
+import numpy as np
+
+if len(sys.argv) < 3:
+ print(__doc__); sys.exit(2)
+src, segs = sys.argv[1], json.load(open(sys.argv[2]))
+MAX = float(sys.argv[3]) if len(sys.argv) > 3 else 0.25
+a = np.frombuffer(subprocess.run(['ffmpeg', '-v', 'error', '-i', src, '-map', '0:a:0', '-f', 's16le', '-ac', '1', '-ar', '16000', '-'],
+ capture_output=True).stdout, dtype=np.int16).astype(float)
+bad = 0
+for i, (s, e) in enumerate(segs):
+ t, run0 = s + .10, None
+ while t < e - .10:
+ x = a[int(t * 16000):int((t + .02) * 16000)]
+ quiet = 20 * np.log10(np.sqrt(np.mean(x ** 2)) / 32768 + 1e-9) < -42
+ if quiet and run0 is None: run0 = t
+ if not quiet and run0 is not None:
+ if t - run0 > MAX: print(f'seg {i + 1}: pause {run0:.2f}-{t:.2f} ({t - run0:.2f}s)'); bad += 1
+ run0 = None
+ t += .02
+print('FAIL' if bad else 'PASS', f'{bad} pause(s) over {MAX}s')
+sys.exit(1 if bad else 0)
diff --git a/skills/claude-reel-editor/scripts/cut/raw-probe.py b/skills/claude-reel-editor/scripts/cut/raw-probe.py
new file mode 100644
index 0000000..75ac92f
--- /dev/null
+++ b/skills/claude-reel-editor/scripts/cut/raw-probe.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python3
+"""raw-probe.py: check a raw phone recording before the first cut.
+
+usage: python3 raw-probe.py <raw.mp4>
+Three phone traps, all measured with ffprobe:
+1. A rotation tag: the file says 1920x1080 but plays 1080x1920. Read the size after rotation. (info)
+2. More than one audio track: some phones add a spatial track. Map the normal one with -map 0:a:0. (FAIL)
+3. Sound starts later than the picture (start_time differs by more than 0.02s): words land late on the lips.
+ Fix the offset before any cut. (FAIL)
+Exit 1 on a FAIL.
+"""
+import json, subprocess, sys
+
+if len(sys.argv) != 2:
+ print(__doc__); sys.exit(2)
+p = json.loads(subprocess.run(['ffprobe', '-v', 'error', '-show_streams', '-show_format', '-of', 'json', sys.argv[1]], capture_output=True, text=True).stdout or '{}')
+st = p.get('streams', [])
+v = [s for s in st if s.get('codec_type') == 'video']; au = [s for s in st if s.get('codec_type') == 'audio']
+fails = []
+if not v:
+ print('FAIL no video stream'); sys.exit(1)
+v0 = v[0]
+rot = int(float(v0.get('tags', {}).get('rotate', 0) or 0))
+for sd in v0.get('side_data_list', []) or []:
+ if 'rotation' in sd: rot = int(float(sd['rotation']))
+w, h = int(v0['width']), int(v0['height'])
+if abs(rot) in (90, 270): w, h = h, w
+print(f"INFO video {w}x{h} as played (rotation tag {rot}), {v0.get('codec_name')}, {float(p.get('format', {}).get('duration', 0)):.2f}s")
+if len(au) > 1: fails.append(f'{len(au)} audio tracks: map the normal one with -map 0:a:0 in every ffmpeg call')
+if au:
+ off = float(au[0].get('start_time', 0)) - float(v0.get('start_time', 0))
+ print(f'INFO sound starts {off:+.3f}s against the picture')
+ if abs(off) > 0.02: fails.append(f'sound offset {off:+.3f}s: shift the audio by {-off:+.3f}s before cutting')
+else:
+ fails.append('no audio track')
+for f in fails: print('FAIL ', f)
+if not fails: print('PASS ready to cut')
+sys.exit(1 if fails else 0)
diff --git a/skills/claude-reel-editor/scripts/cut/retime-words.py b/skills/claude-reel-editor/scripts/cut/retime-words.py
new file mode 100644
index 0000000..92213f0
--- /dev/null
+++ b/skills/claude-reel-editor/scripts/cut/retime-words.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python3
+"""retime-words.py: move a RAW transcript onto the CUT clock, using the cut list.
+
+usage: python3 retime-words.py <raw-words.json> <segs.json> <cut-words.json>
+Words inside a kept segment keep their place, shifted to cut time. Words in a dropped part go.
+Use it only when you cannot transcribe the cut itself (the example reel has tone bursts, not speech).
+For a real reel, transcribe cut-audio.wav with transcribe.py: that is always the more accurate clock.
+"""
+import json, sys
+
+if len(sys.argv) != 4:
+ print(__doc__); sys.exit(2)
+W = json.load(open(sys.argv[1])); W = W['words'] if isinstance(W, dict) else W
+S = json.load(open(sys.argv[2]))
+out, acc = [], 0.0
+for s, e in S:
+ for w in W:
+ ws, we = w.get('start', w.get('s')), w.get('end', w.get('e'))
+ if ws >= s - 1e-3 and we <= e + 1e-3:
+ out.append({'word': w.get('word', w.get('w', '')).strip(), 'start': round(ws - s + acc, 3), 'end': round(we - s + acc, 3)})
+ acc += e - s
+json.dump(out, open(sys.argv[3], 'w'), indent=1)
+print(f'{len(out)} of {len(W)} words kept, cut clock ends {acc:.2f}s -> {sys.argv[3]}')
diff --git a/skills/claude-reel-editor/scripts/cut/silences.py b/skills/claude-reel-editor/scripts/cut/silences.py
new file mode 100644
index 0000000..709ab94
--- /dev/null
+++ b/skills/claude-reel-editor/scripts/cut/silences.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python3
+"""silences.py: find every stretch of speech between TRUE silences and propose the cut list.
+
+Cut a talking-head take ONLY on these edges. Whisper's word timings are loose, so a cut placed on them can clip a
+word or leave a doubled one. A silence here is measured on the waveform: under -52 dB for 0.25s or more, every 10ms.
+
+usage: python3 silences.py <raw.mp4|wav> <segs.json> [--words raw-words.json] [--drop 2,5] [--pad 0.08]
+ --words a transcript of the RAW take (from transcribe.py). Each island prints the words inside it,
+ so you can see which islands are fluffed takes.
+ --drop island numbers to leave out (the fluffed takes, the "let me start again"). Keep the LAST clean take of each line.
+ --pad seconds of silence kept either side of each island (0.08 keeps the joins at 0.15 to 0.2s)
+Writes segs.json = [[start, end], ...] in raw seconds, the parts you keep, in order.
+Then run join-check.py and pause-check.py on it.
+"""
+import argparse, json, subprocess, sys
+import numpy as np
+
+ap = argparse.ArgumentParser()
+ap.add_argument('src'); ap.add_argument('out')
+ap.add_argument('--words'); ap.add_argument('--drop', default='')
+ap.add_argument('--pad', type=float, default=0.08)
+ap.add_argument('--db', type=float, default=-52); ap.add_argument('--min', type=float, default=0.25)
+a = ap.parse_args()
+SR = 16000
+raw = subprocess.run(['ffmpeg', '-v', 'error', '-i', a.src, '-map', '0:a:0', '-f', 'f32le', '-ac', '1', '-ar', str(SR), '-'], capture_output=True).stdout
+x = np.frombuffer(raw, np.float32)
+if not len(x):
+ sys.exit('no audio decoded: check the file has a sound track')
+hop = SR // 100
+fr = x[:len(x) // hop * hop].reshape(-1, hop)
+db = 20 * np.log10(np.sqrt((fr ** 2).mean(axis=1)) + 1e-9)
+dur = len(x) / SR
+
+sil, st = [], None
+for i, v in enumerate(np.append(db, 0)):
+ if v < a.db:
+ st = i if st is None else st
+ else:
+ if st is not None and (i - st) / 100 >= a.min:
+ sil.append((st / 100, i / 100))
+ st = None
+if not sil or sil[0][0] > 0: sil.insert(0, (0.0, 0.0)) # speech from the very first frame
+if sil[-1][1] < dur - .01: sil.append((dur, dur)) # speech to the very last frame
+
+W = json.load(open(a.words)) if a.words else []
+W = W['words'] if isinstance(W, dict) else W
+drop = {int(k) for k in a.drop.split(',') if k.strip()}
+segs, n = [], 0
+for (s0, s1), (e0, e1) in zip(sil, sil[1:]):
+ if e0 - s1 < .05: continue
+ n += 1
+ inn = max(s0 + (s1 - s0) / 2, s1 - a.pad); out = min(e0 + (e1 - e0) / 2, e0 + a.pad)
+ txt = ' '.join(w.get('word', w.get('w', '')).strip() for w in W if s1 - .05 <= w.get('start', w.get('s', 0)) < e0 + .05)
+ mark = 'DROP' if n in drop else 'keep'
+ print(f"{n:3d} {mark} {s1:8.2f}-{e0:8.2f} [silence before {s1 - s0:.2f}s | after {e1 - e0:.2f}s] {txt}")
+ if n not in drop: segs.append([round(inn, 3), round(out, 3)])
+json.dump(segs, open(a.out, 'w'), indent=1)
+kept = sum(e - s for s, e in segs)
+print(f"\n{n} islands, kept {len(segs)}, cut length {kept:.2f}s of {dur:.2f}s raw -> {a.out}")
diff --git a/skills/claude-reel-editor/scripts/cut/transcribe.py b/skills/claude-reel-editor/scripts/cut/transcribe.py
new file mode 100644
index 0000000..8ef1edb
--- /dev/null
+++ b/skills/claude-reel-editor/scripts/cut/transcribe.py
@@ -0,0 +1,48 @@
+#!/usr/bin/env python3
+"""transcribe.py: speech to text with a timestamp on every word.
+
+usage: python3 transcribe.py <audio-or-video> <words.json> [--model small.en]
+Writes words.json = [{"word": "Claude", "start": 0.0, "end": 0.42}, ...]
+
+Apple Silicon Mac: runs mlx-whisper through uv, nothing to install by hand except uv (brew install uv):
+ uvx --python 3.11 --from mlx-whisper mlx_whisper audio.wav --model mlx-community/whisper-small.en-mlx \
+ --output-format json --word-timestamps True
+Windows, Linux or an Intel Mac: uses faster-whisper (pip install faster-whisper).
+Set ASR=faster to force faster-whisper on a Mac.
+Run it twice per reel: once on the raw take (to pick takes), once on cut-audio.wav (the clock every graphic uses).
+"""
+import argparse, glob, json, os, platform, shutil, subprocess, sys, tempfile
+
+ap = argparse.ArgumentParser(); ap.add_argument('src'); ap.add_argument('out'); ap.add_argument('--model', default='small.en')
+a = ap.parse_args()
+mac = platform.system() == 'Darwin' and platform.machine() == 'arm64' and os.environ.get('ASR') != 'faster'
+words = []
+if mac:
+ if not shutil.which('uvx'):
+ sys.exit('uvx not found. Install uv first: brew install uv')
+ tmp = tempfile.mkdtemp()
+ wav = os.path.join(tmp, 'audio.wav') # whisper wants 16kHz mono. This also strips the video
+ subprocess.run(['ffmpeg', '-v', 'error', '-y', '-i', a.src, '-map', '0:a:0', '-ac', '1', '-ar', '16000', wav], check=True)
+ subprocess.run(['uvx', '--python', '3.11', '--from', 'mlx-whisper', 'mlx_whisper', wav, '--model', f'mlx-community/whisper-{a.model}-mlx',
+ '--output-format', 'json', '--word-timestamps', 'True', '--output-dir', tmp], check=True)
+ js = [p for p in glob.glob(os.path.join(tmp, '*.json'))]
+ if not js:
+ sys.exit('mlx_whisper wrote no json')
+ r = json.load(open(js[0]))
+ for s in r.get('segments', []):
+ for w in s.get('words', []):
+ words.append({'word': w['word'].strip(), 'start': round(w['start'], 3), 'end': round(w['end'], 3)})
+ shutil.rmtree(tmp, ignore_errors=True)
+else:
+ try:
+ from faster_whisper import WhisperModel
+ except ImportError:
+ sys.exit('faster-whisper not installed: pip install faster-whisper')
+ m = WhisperModel(a.model, device='auto', compute_type='auto')
+ segs, _ = m.transcribe(a.src, word_timestamps=True, condition_on_previous_text=False)
+ for s in segs:
+ for w in (s.words or []):
+ words.append({'word': w.word.strip(), 'start': round(w.start, 3), 'end': round(w.end, 3)})
+json.dump(words, open(a.out, 'w'), indent=1)
+print(f'{len(words)} words -> {a.out}')
+print(' '.join(w['word'] for w in words)[:400])
diff --git a/skills/claude-reel-editor/scripts/cut/words-check.py b/skills/claude-reel-editor/scripts/cut/words-check.py
new file mode 100644
index 0000000..6ad7d1d
--- /dev/null
+++ b/skills/claude-reel-editor/scripts/cut/words-check.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python3
+"""words-check.py: read the CUT transcript and flag words that should not survive the edit.
+
+usage: python3 words-check.py <cut-words.json>
+FAIL (exit 1): a filler sound (um, uh, er, erm, hmm, ah), the same word twice in a row, a word cut off halfway ("wo-"),
+or a take you rejected out loud ("scratch that", "let me start again"). A rejected take goes, even with no pause around it.
+REVIEW (printed, exit 0): soft fillers (like, you know, I mean, basically). Keep them only when they carry meaning.
+"""
+import json, re, sys
+
+HARD = {'um', 'uh', 'er', 'erm', 'hmm', 'mm', 'ah', 'uhm'}
+SOFT = ['you know', 'i mean', 'basically', 'like']
+REJECT = ['scratch that', 'start again', 'let me start again', 'let me try again', 'let me redo', 'take two',
+ 'one more time', 'no wait', 'wait no', 'hang on', 'sorry let me', 'from the top']
+if len(sys.argv) != 2:
+ print(__doc__); sys.exit(2)
+d = json.load(open(sys.argv[1], encoding='utf-8')); d = d['words'] if isinstance(d, dict) else d
+words = [(str(x.get('word', x.get('w', ''))).strip(), float(x.get('start', x.get('s', 0)))) for x in d]
+norm = [re.sub(r"[^a-z0-9'-]", '', t.lower()) for t, _ in words]
+fails, review = [], []
+for i, (n, (t, s)) in enumerate(zip(norm, words)):
+ if n.strip('-') in HARD: fails.append(f'{s:7.2f}s filler "{t}"')
+ if n.endswith('-') and len(n) > 1: fails.append(f'{s:7.2f}s word cut off halfway "{t}"')
+ if i and n and n == norm[i - 1] and n not in ('that', 'had'): fails.append(f'{s:7.2f}s doubled word "{words[i - 1][0]} {t}"')
+text = ' '.join(norm); starts, pos = [], 0
+for n in norm: starts.append(pos); pos += len(n) + 1
+def time_at(ch): return words[max(i for i, p in enumerate(starts) if p <= ch)][1]
+for ph in REJECT:
+ for m in re.finditer(r'\b' + re.escape(ph) + r'\b', text): fails.append(f'{time_at(m.start()):7.2f}s rejected take "{ph}": cut the whole take, keep the retake')
+for ph in SOFT:
+ for m in re.finditer(r'\b' + re.escape(ph) + r'\b', text): review.append(f'{time_at(m.start()):7.2f}s soft filler "{ph}": keep only if it carries meaning')
+for f in sorted(fails): print('FAIL ', f)
+for r in sorted(review): print('REVIEW', r)
+print(f'{len(words)} words, {len(fails)} fail, {len(review)} to review')
+sys.exit(1 if fails else 0)
diff --git a/skills/claude-reel-editor/scripts/export.sh b/skills/claude-reel-editor/scripts/export.sh
new file mode 100644
index 0000000..49a4340
--- /dev/null
+++ b/skills/claude-reel-editor/scripts/export.sh
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+# export.sh: music under the voice, loudness set for Instagram, and the H.264 file Instagram wants.
+# usage: bash scripts/export.sh <reel.mp4> <music.wav|none> <out-ig.mp4> [dB the music sits under the voice, default 12]
+#
+# 1 the music loops to the full length of the reel, so it never fades or stops before the last frame
+# 2 the music sits 12 dB under the voice (measured loudness, not a guess)
+# 3 the mix gets one static gain to -14 LUFS, then a limiter that never raises the level (level=disabled)
+# 4 the video is copied if it is already H.264 1080x1920 limited range, and re-encoded to that if not
+# 5 it measures the result and fails outside -15 to -13 LUFS or above -1.5 dB true peak
+# Use music you have the rights to. Check it stays level first: python3 scripts/music-steady.py <music.wav>
+set -euo pipefail
+[[ $# -ge 3 ]] || { sed -n 2,11p "$0"; exit 2; }
+IN=$1; MUSIC=$2; OUT=$3; UNDER=${4:-12}
+TMP=$(mktemp -d); trap 'rm -rf "$TMP"' EXIT
+loud() { ffmpeg -hide_banner -nostats -i "$1" -af ebur128=peak=true -f null - 2>&1 | awk '$1=="I:"{i=$2} $1=="Peak:"{p=$2} END{print i, p}'; }
+DUR=$(ffprobe -v error -select_streams v:0 -show_entries format=duration -of csv=p=0 "$IN")
+
+ffmpeg -v error -y -i "$IN" -map 0:a:0 -ac 2 -ar 48000 "$TMP/voice.wav"
+read -r IV _ <<< "$(loud "$TMP/voice.wav")"
+if [[ "$MUSIC" != "none" ]]; then
+ ffmpeg -v error -y -stream_loop -1 -i "$MUSIC" -t "$DUR" -ac 2 -ar 48000 "$TMP/music.wav"
+ read -r IM _ <<< "$(loud "$TMP/music.wav")"
+ GM=$(awk -v v="$IV" -v m="$IM" -v u="$UNDER" 'BEGIN{printf "%.2f", (v - u) - m}')
+ echo "voice $IV LUFS, music $IM LUFS, music gain $GM dB (sits $UNDER dB under the voice)"
+ ffmpeg -v error -y -i "$TMP/voice.wav" -i "$TMP/music.wav" -filter_complex "[1:a]volume=${GM}dB[m];[0:a][m]amix=inputs=2:normalize=0:duration=first[a]" -map "[a]" "$TMP/mix.wav"
+else
+ echo "voice $IV LUFS, no music"
+ cp "$TMP/voice.wav" "$TMP/mix.wav"
+fi
+read -r IX _ <<< "$(loud "$TMP/mix.wav")"
+G=$(awk -v i="$IX" 'BEGIN{printf "%.2f", -14 - i}')
+ffmpeg -v error -y -i "$TMP/mix.wav" -af "volume=${G}dB,alimiter=limit=0.79:level=disabled" -ar 48000 "$TMP/final.wav"
+
+V=$(ffprobe -v error -select_streams v:0 -show_entries stream=codec_name,width,height,pix_fmt,color_range -of csv=p=0 "$IN")
+if [[ "$V" == "h264,1080,1920,yuv420p,tv" ]]; then VC=(-c:v copy); else
+ VC=(-c:v libx264 -profile:v high -preset slow -pix_fmt yuv420p -vf "scale=1080:1920:in_range=full:out_range=limited,format=yuv420p"
+ -color_range tv -colorspace bt709 -color_primaries bt709 -color_trc bt709 -b:v 14M -maxrate 16M -bufsize 24M); fi
+ffmpeg -v error -y -i "$IN" -i "$TMP/final.wav" -map 0:v:0 -map 1:a "${VC[@]}" -c:a aac -b:a 128k -ar 44100 -movflags +faststart -shortest "$OUT"
+
+read -r I TP <<< "$(loud "$OUT")"
+P=$(ffprobe -v error -select_streams v:0 -show_entries stream=codec_name,width,height,pix_fmt,color_range -show_entries format=duration,size -of default=nw=1:nk=1 "$OUT" | paste -sd' ' -)
+echo "$P · $I LUFS · true peak $TP dB"
+awk -v i="$I" -v p="$TP" 'BEGIN{ok = (i >= -15 && i <= -13 && p <= -1.5); print (ok ? "PASS" : "FAIL") " loudness -15..-13 LUFS and true peak at or under -1.5 dB"; exit !ok}'
diff --git a/skills/claude-reel-editor/scripts/lib.js b/skills/claude-reel-editor/scripts/lib.js
new file mode 100644
index 0000000..71adde0
--- /dev/null
+++ b/skills/claude-reel-editor/scripts/lib.js
@@ -0,0 +1,73 @@
+// lib.js: shared by render.js, storyboard.js and check-frames.js.
+// A reel project is a folder with reel.config.json in it. See example/reel.config.json.
+const fs = require('fs'), path = require('path'), { spawnSync } = require('child_process');
+
+function loadProject(dir) {
+ const d = path.resolve(dir || '.'), f = path.join(d, 'reel.config.json');
+ if (!fs.existsSync(f)) { console.error(`No reel.config.json in ${d}`); process.exit(2); }
+ const c = JSON.parse(fs.readFileSync(f, 'utf8')), r = k => (c[k] ? path.resolve(d, c[k]) : null);
+ return { dir: d, cfg: c, page: r('page'), raw: r('raw'), segs: r('segs'), audio: r('audio'), words: r('words'), frames: r('frames'),
+ out: r('out') || path.join(d, 'out/reel.mp4'), fps: c.fps || 60, workers: c.workers || 4 };
+}
+
+// Puppeteer drives a real Chrome. npm install in the kit folder gets it, or point PUPPETEER_PATH at an existing install.
+function puppeteer() {
+ try { return require(process.env.PUPPETEER_PATH || 'puppeteer'); }
+ catch (e) { console.error('Puppeteer not found. Run "npm install" in the kit folder, or set PUPPETEER_PATH to a puppeteer folder.'); process.exit(2); }
+}
+const launch = () => puppeteer().launch({ headless: true, args: ['--allow-file-access-from-files', '--disable-web-security', '--font-render-hinting=none', '--force-color-profile=srgb', '--use-mock-keychain', '--no-first-run'] })
+ .catch(e => { if (/Could not find|Browser was not found/i.test(e.message)) console.error('Chrome for Puppeteer is missing. Run: npx puppeteer browsers install chrome'); throw e; });
+
+// Open the reel page, draw frame 0, then wait for the brand fonts. document.fonts.ready alone is not enough:
+// it can resolve before anything has asked for the font, and frame 0 would render in a fallback font.
+async function openReel(browser, P, { allowFallback = false } = {}) {
+ const pg = await browser.newPage(), errs = [];
+ pg.on('pageerror', e => errs.push(e.message));
+ await pg.setViewport({ width: 1080, height: 1920, deviceScaleFactor: 1 });
+ await pg.goto('file://' + P.page, { waitUntil: 'load' });
+ if (errs.length) throw new Error('page error: ' + errs.join(' | '));
+ const fonts = await pg.evaluate(async () => {
+ seek(0);
+ await Promise.all(BRAND.fontChecks.map(f => document.fonts.load(f).catch(() => [])));
+ await document.fonts.ready;
+ return BRAND.fontChecks.map(f => { const fam = (f.match(/'([^']+)'/) || [])[1];
+ return { f, ok: [...document.fonts].some(x => x.family.replace(/["']/g, '') === fam && x.status === 'loaded') }; });
+ });
+ const bad = fonts.filter(x => !x.ok);
+ if (bad.length) {
+ const msg = `font not loaded: ${bad.map(x => x.f).join(', ')} (no network, or a wrong name in brand.js)`;
+ if (!allowFallback) throw new Error(msg + '. Pass --allow-fallback to render anyway.');
+ console.warn('WARN ' + msg);
+ }
+ return { pg, errs };
+}
+
+async function seekAndWait(pg, t) {
+ await pg.evaluate(async t => {
+ seek(t);
+ await Promise.all([...document.images].filter(i => i.getAttribute('src')).map(i => (i.complete && i.naturalWidth) ? 0 : i.decode().catch(() => 0)));
+ }, t);
+}
+
+// Face frames come from the RAW take at 30fps: frame k = raw time k/30. Two crops per frame:
+// split = the face card (1000x640, a little taller than the card so the head pop-out has room), portrait = full frame.
+// The crops are per recording. Set them in reel.config.json as ffmpeg crop values w:h:x:y.
+function extractFrames(P) {
+ if (!P.raw || !P.frames) return false;
+ if (!fs.existsSync(P.raw)) { console.error(`raw take not found: ${P.raw}`); process.exit(2); }
+ const stamp = JSON.stringify({ raw: P.raw, m: fs.statSync(P.raw).mtimeMs, s: P.cfg.splitCrop, p: P.cfg.portraitCrop });
+ const done = path.join(P.frames, '.done');
+ if (fs.existsSync(done) && fs.readFileSync(done, 'utf8') === stamp) return false;
+ for (const s of ['split', 'portrait']) { fs.rmSync(path.join(P.frames, s), { recursive: true, force: true }); fs.mkdirSync(path.join(P.frames, s), { recursive: true }); }
+ const sc = P.cfg.splitCrop || 'iw:iw*0.64:0:(ih-iw*0.64)/3', pc = P.cfg.portraitCrop || 'ih*9/16:ih:(iw-ih*9/16)/2:0';
+ const r = spawnSync('ffmpeg', ['-v', 'error', '-y', '-i', P.raw, '-filter_complex',
+ `[0:v]fps=30,split=2[a][b];[a]crop=${sc},scale=1000:640[s];[b]crop=${pc},scale=1080:1920[p]`,
+ '-map', '[s]', '-q:v', '3', '-start_number', '0', path.join(P.frames, 'split/%05d.jpg'),
+ '-map', '[p]', '-q:v', '3', '-start_number', '0', path.join(P.frames, 'portrait/%05d.jpg')], { stdio: 'inherit' });
+ if (r.status) { console.error('ffmpeg could not cut the face frames'); process.exit(1); }
+ fs.writeFileSync(done, stamp);
+ console.log(`face frames: ${fs.readdirSync(path.join(P.frames, 'split')).length} from ${path.basename(P.raw)}`);
+ return true;
+}
+
+module.exports = { loadProject, puppeteer, launch, openReel, seekAndWait, extractFrames };
diff --git a/skills/claude-reel-editor/scripts/make-data.js b/skills/claude-reel-editor/scripts/make-data.js
new file mode 100644
index 0000000..73c90b8
--- /dev/null
+++ b/skills/claude-reel-editor/scripts/make-data.js
@@ -0,0 +1,19 @@
+// make-data.js: write page/data.js from the cut transcript and the cut list, so the page knows every word time.
+// usage: node scripts/make-data.js <project dir>
+// Run it again every time the cut changes. Cuts move every later time, so every beat time moves with them.
+const fs = require('fs'), path = require('path'), { spawnSync } = require('child_process');
+const { loadProject } = require('./lib');
+const P = loadProject(process.argv[2]);
+const read = f => { if (!f || !fs.existsSync(f)) { console.error(`missing ${f}`); process.exit(2); } return JSON.parse(fs.readFileSync(f, 'utf8')); };
+let words = read(P.words); words = words.words || words;
+words = words.map(w => ({ word: String(w.word ?? w.w).trim(), start: +(w.start ?? w.s), end: +(w.end ?? w.e) })).filter(w => w.word);
+const segs = P.segs && fs.existsSync(P.segs) ? read(P.segs) : [];
+let dur = segs.length ? segs.reduce((s, [a, b]) => s + b - a, 0) : 0;
+if (P.audio && fs.existsSync(P.audio)) {
+ const r = spawnSync('ffprobe', ['-v', 'error', '-show_entries', 'format=duration', '-of', 'csv=p=0', P.audio], { encoding: 'utf8' });
+ if (+r.stdout > 0) dur = +r.stdout;
+}
+const out = path.join(path.dirname(P.page), 'data.js');
+fs.writeFileSync(out, `// written by scripts/make-data.js from ${path.basename(P.words)} and ${P.segs ? path.basename(P.segs) : 'no cut list'}. Do not edit by hand.\n` +
+ `window.CUT = ${JSON.stringify({ dur: +dur.toFixed(3), segs, words })};\n`);
+console.log(`${words.length} words, ${segs.length} segments, ${dur.toFixed(2)}s -> ${out}`);
diff --git a/skills/claude-reel-editor/scripts/matte.py b/skills/claude-reel-editor/scripts/matte.py
new file mode 100644
index 0000000..9717ff4
--- /dev/null
+++ b/skills/claude-reel-editor/scripts/matte.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env python3
+"""matte.py: cut the person out of every face-card frame, for the head pop-out. Optional.
+
+usage: python3 matte.py <frames dir> (the "frames" folder from reel.config.json, after a storyboard or render)
+Reads frames/split/NNNNN.jpg and writes frames/cutout/NNNNN.png: the same frame with the background made clear.
+Then set pop: true in REEL (beats.js) and the head breaks out over the top of the face card on every split beat.
+
+It uses Robust Video Matting (github.com/PeterL1n/RobustVideoMatting, GPL-3.0). The model downloads on first run,
+about 100 MB. Runs on an Apple GPU (mps), NVIDIA (cuda) or the CPU (slow).
+Needs: pip install torch torchvision numpy pillow
+Run it again every time the raw take or the crop changes, or the cut-out drifts off the head.
+"""
+import glob, os, sys
+try:
+ import numpy as np, torch
+ from PIL import Image
+except ImportError:
+ sys.exit('needs torch, torchvision, numpy and pillow: pip install torch torchvision numpy pillow')
+
+if len(sys.argv) != 2:
+ print(__doc__); sys.exit(2)
+D = sys.argv[1]; F = sorted(glob.glob(os.path.join(D, 'split', '*.jpg')))
+if not F:
+ sys.exit(f'no frames in {D}/split. Run the storyboard or the render first, it cuts them')
+os.makedirs(os.path.join(D, 'cutout'), exist_ok=True)
+dev = 'mps' if torch.backends.mps.is_available() else ('cuda' if torch.cuda.is_available() else 'cpu')
+m = torch.hub.load('PeterL1n/RobustVideoMatting', 'resnet50', trust_repo=True).eval().to(dev)
+rec = [None] * 4
+with torch.no_grad():
+ for i, f in enumerate(F):
+ im = np.asarray(Image.open(f).convert('RGB'))
+ x = torch.from_numpy(im.copy()).to(dev).permute(2, 0, 1).unsqueeze(0).float() / 255
+ fgr, pha, *rec = m(x, *rec, downsample_ratio=0.4)
+ al = (pha[0, 0].clamp(0, 1).cpu().numpy() * 255).astype(np.uint8)
+ Image.fromarray(np.dstack([im, al]), 'RGBA').save(os.path.join(D, 'cutout', os.path.basename(f)[:-4] + '.png'), compress_level=1)
+ if i % 300 == 0: print('matte', i, 'of', len(F), flush=True)
+print('done', len(F), 'frames on', dev)
diff --git a/skills/claude-reel-editor/scripts/motion-check.py b/skills/claude-reel-editor/scripts/motion-check.py
new file mode 100644
index 0000000..3e787eb
--- /dev/null
+++ b/skills/claude-reel-editor/scripts/motion-check.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python3
+"""motion-check.py: prove a rendered clip actually moves the whole way through.
+
+A clip whose animation finishes early and then holds is a still with an intro. It looks animated on one frame
+and reads as dead in the edit. Your eyes will not catch it. Frame differencing does.
+
+usage: python3 motion-check.py clip.mp4 [--step 0.25] [--threshold 0.35] [--allow-lead 0.5] [--max-still 1.5]
+Prints the change between samples. FAIL when the picture holds still for --max-still seconds or more.
+Exit 0 = moves throughout. Exit 2 = a static stretch: give that beat another hit on another word.
+Needs Pillow: pip install pillow
+"""
+import argparse, io, subprocess, sys
+try:
+ from PIL import Image, ImageChops
+except ImportError:
+ sys.exit('needs pillow: python3 -m pip install pillow')
+
+ap = argparse.ArgumentParser(); ap.add_argument('clip')
+ap.add_argument('--step', type=float, default=0.25); ap.add_argument('--threshold', type=float, default=0.35)
+ap.add_argument('--allow-lead', type=float, default=0.5); ap.add_argument('--max-still', type=float, default=1.5)
+a = ap.parse_args()
+dur = float(subprocess.run(['ffprobe', '-v', 'error', '-show_entries', 'format=duration', '-of', 'csv=p=0', a.clip], capture_output=True, text=True).stdout.strip())
+def frame(t):
+ out = subprocess.run(['ffmpeg', '-v', 'error', '-ss', f'{t:.3f}', '-i', a.clip, '-frames:v', '1', '-f', 'image2pipe', '-vcodec', 'png', '-'], capture_output=True).stdout
+ return Image.open(io.BytesIO(out)).convert('L').resize((270, 480)) if out else None
+prev, rows, t = None, [], 0.0
+while t < dur:
+ im = frame(t)
+ if im is not None:
+ if prev is not None: rows.append((t, sum(ImageChops.difference(im, prev).getdata()) / (270 * 480)))
+ prev = im
+ t += a.step
+print(f'{a.clip} ({dur:.1f}s, {len(rows)} samples)')
+runs, cur = [], []
+for t, m in rows:
+ still = m < a.threshold and t > a.allow_lead
+ print(f" {t:6.2f} {m:6.2f} {'#' * int(min(m, 30))}{' <-- still' if still else ''}")
+ if still: cur.append(t)
+ elif cur: runs.append(cur); cur = []
+if cur: runs.append(cur)
+long = [r for r in runs if len(r) * a.step >= a.max_still]
+if long:
+ for r in long: print(f'FAIL still from {r[0] - a.step:.2f}s to {r[-1]:.2f}s ({len(r) * a.step:.2f}s)')
+ sys.exit(2)
+print(f'PASS no still stretch of {a.max_still}s or more')
diff --git a/skills/claude-reel-editor/scripts/music-steady.py b/skills/claude-reel-editor/scripts/music-steady.py
new file mode 100644
index 0000000..4ac2a30
--- /dev/null
+++ b/skills/claude-reel-editor/scripts/music-steady.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python3
+"""music-steady.py: check a music bed plays at one level to the last frame.
+
+usage: python3 music-steady.py <music.wav> [--drop 6] [--skip 1.0]
+Run it on the MUSIC on its own, before the mix (the voice hides a fade in the mix).
+Measures 1s windows after the first --skip seconds (a fade in is fine). FAIL if any window sits more than --drop dB
+under the median, or goes silent. A track that fades out early fails: loop its own bars to fill the end instead.
+Exit 0 pass, 1 fail.
+"""
+import argparse, math, struct, subprocess, sys
+
+ap = argparse.ArgumentParser(); ap.add_argument('stem'); ap.add_argument('--drop', type=float, default=6.0); ap.add_argument('--skip', type=float, default=1.0)
+a = ap.parse_args()
+SR = 8000
+raw = subprocess.run(['ffmpeg', '-v', 'error', '-i', a.stem, '-ac', '1', '-ar', str(SR), '-f', 's16le', '-'], capture_output=True).stdout
+n = len(raw) // 2
+if n < SR * 2:
+ print(f'FAIL stem too short or unreadable ({n / SR:.2f}s)'); sys.exit(1)
+x = struct.unpack(f'<{n}h', raw[:n * 2])
+def db(seg):
+ r = math.sqrt(sum(v * v for v in seg) / len(seg)) / 32768
+ return 20 * math.log10(r) if r > 0 else -120.0
+wins = [(i / SR, db(x[i:i + SR])) for i in range(int(a.skip * SR), n - SR // 2, SR)]
+levels = sorted(l for _, l in wins); med = levels[len(levels) // 2]
+bad = [(t, l) for t, l in wins if l < med - a.drop or l < -60]
+print(f'music {n / SR:.2f}s, median {med:.1f} dBFS, lowest {levels[0]:.1f} dBFS, {len(wins)} windows of 1s')
+for t, l in bad: print(f'FAIL {t:6.2f}-{t + 1:6.2f}s at {l:.1f} dBFS ({med - l:.1f} dB under the median)')
+if bad: sys.exit(1)
+print(f'PASS every 1s window within {a.drop:.0f} dB of the median to the end')
diff --git a/skills/claude-reel-editor/scripts/new-reel.js b/skills/claude-reel-editor/scripts/new-reel.js
new file mode 100644
index 0000000..1ba97bb
--- /dev/null
+++ b/skills/claude-reel-editor/scripts/new-reel.js
@@ -0,0 +1,36 @@
+// new-reel.js: start a reel folder from the kit, so every reel carries its own copy of the engine and never breaks when the kit changes.
+// usage: node scripts/new-reel.js <folder> (put your raw take in that folder as raw.mp4)
+// Makes: reel.config.json, page/reel.html, page/beats.js (one starter beat), page/lib/ (engine + components).
+const fs = require('fs'), path = require('path');
+const KIT = path.resolve(__dirname, '..'), dir = process.argv[2];
+if (!dir) { console.error('usage: node scripts/new-reel.js <folder>'); process.exit(2); }
+const D = path.resolve(dir), LIB = path.join(D, 'page/lib');
+if (fs.existsSync(path.join(D, 'page/beats.js'))) { console.error(`${D} already has page/beats.js. Not touching it.`); process.exit(1); }
+fs.mkdirSync(LIB, { recursive: true });
+const engine = ['brand.js', 'motion.js', 'ui.js', 'engine.js'], comps = fs.readdirSync(path.join(KIT, 'components')).filter(f => f.endsWith('.js')).sort();
+for (const f of engine) fs.copyFileSync(path.join(KIT, 'engine', f), path.join(LIB, f));
+for (const f of comps) fs.copyFileSync(path.join(KIT, 'components', f), path.join(LIB, f));
+fs.writeFileSync(path.join(D, 'reel.config.json'), JSON.stringify({ page: 'page/reel.html', raw: 'raw.mp4', segs: 'segs.json', audio: 'cut-audio.wav', words: 'cut-words.json', frames: 'page/frames',
+ splitCrop: 'iw:iw*0.64:0:(ih-iw*0.64)/3', portraitCrop: 'ih*9/16:ih:(iw-ih*9/16)/2:0', fps: 60, workers: 4, out: 'out/reel.mp4' }, null, 2) + '\n');
+fs.writeFileSync(path.join(D, 'page/reel.html'), `<!doctype html><html><head><meta charset="utf-8"><title>${path.basename(D)}</title></head><body>
+${[...engine, ...comps].map(f => `<script src="lib/${f}"></script>`).join('\n')}
+<script src="data.js"></script>
+<script src="beats.js"></script>
+<script>startPage();</script>
+</body></html>
+`);
+fs.writeFileSync(path.join(D, 'page/beats.js'), `// One beat per spoken line. Times come from word() so every hit lands on its word. See the kit's example/page/beats.js.
+const REEL = {
+ title: '${path.basename(D)}',
+ frames: 'frames',
+ audio: '../cut-audio.wav',
+ spell: {}, // caption fixes: { 'twenty': '20' }
+ // pop: true, // head pop-out, after scripts/matte.py
+ // cta: { at: 12.0, label: 'Comment', word: 'EDIT' },
+ beats: [
+ { a: 0, b: 2.0, lay: 'split', still: 1.8, move: 'HOOK: the title cascades in over a scrolling edit timeline',
+ draw: (t) => timelineHook(t, { lines: ['Your hook', 'goes here'], cuts: [0.5, 1.0, 1.5] }) },
+ ],
+};
+`);
+console.log(`new reel at ${D}\nNext: put your raw take in it as raw.mp4, then follow the steps in SKILL.md.`);
diff --git a/skills/claude-reel-editor/scripts/qa.py b/skills/claude-reel-editor/scripts/qa.py
new file mode 100644
index 0000000..5261a05
--- /dev/null
+++ b/skills/claude-reel-editor/scripts/qa.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python3
+"""qa.py: the measured check on the finished file, before it goes anywhere.
+
+usage: python3 qa.py <reel-ig.mp4> [--out DIR]
+Writes DIR/qa.md, DIR/sheet.jpg (one frame a second) and DIR/deadzone.jpg (Instagram's covered zones in red).
+Every line prints PASS, FAIL or NOT RUN. A model cannot hear lip sync or judge taste, so those print NOT RUN:
+watch the file yourself, full size, with sound. Exit 1 if any line FAILs.
+Needs numpy and Pillow: pip install numpy pillow
+"""
+import argparse, io, json, os, re, subprocess, sys
+import numpy as np
+from PIL import Image, ImageDraw
+
+ap = argparse.ArgumentParser(); ap.add_argument('mp4'); ap.add_argument('--out')
+a = ap.parse_args()
+OUT = a.out or os.path.splitext(a.mp4)[0] + '-qa'; os.makedirs(OUT, exist_ok=True)
+run = lambda *c: subprocess.run(c, capture_output=True, text=True)
+lines, fails = [], []
+def rep(name, ok, msg):
+ tag = 'PASS' if ok is True else ('NOT RUN' if ok is None else 'FAIL')
+ s = f'- [{tag}] {name}: {msg}'; lines.append(s); print(s)
+ if ok is False: fails.append(s)
+
+p = json.loads(run('ffprobe', '-v', 'error', '-count_frames', '-show_entries', 'stream=codec_type,codec_name,color_range,pix_fmt,nb_read_frames,width,height,r_frame_rate,duration:format=duration,size', '-of', 'json', a.mp4).stdout)
+v = next(s for s in p['streams'] if s['codec_type'] == 'video'); au = next((s for s in p['streams'] if s['codec_type'] == 'audio'), None)
+num, den = map(int, v['r_frame_rate'].split('/')); fps = num / den; vd = int(v['nb_read_frames']) / fps
+rep('format', v['codec_name'] == 'h264' and v.get('pix_fmt') == 'yuv420p', f"{v['codec_name']}, {v.get('pix_fmt')}")
+rep('colour range', v.get('color_range') == 'tv', f"{v.get('color_range')} (Instagram wants limited range: tv)")
+rep('size', (int(v['width']), int(v['height'])) == (1080, 1920), f"{v['width']}x{v['height']}, {v['nb_read_frames']} frames at {fps:g}fps = {vd:.3f}s, {int(p['format']['size']) / 1e6:.1f} MB")
+if au:
+ ad = float(au.get('duration') or p['format']['duration'])
+ rep('audio length', abs(ad - vd) <= .05, f'audio {ad:.3f}s vs video {vd:.3f}s')
+ # the container duration can hide missing audio packets, so count DECODED samples and look for gaps
+ dec = len(subprocess.run(['ffmpeg', '-v', 'error', '-i', a.mp4, '-vn', '-ac', '1', '-ar', '8000', '-f', 's16le', '-'], capture_output=True).stdout) / 16000
+ rep('decoded audio', abs(dec - vd) <= .05, f'{dec:.3f}s decoded vs video {vd:.3f}s (drift here means the voice runs ahead of the lips)')
+ pts = [float(m) for m in re.findall(r'^(-?[\d.]+)', run('ffprobe', '-v', 'error', '-select_streams', 'a:0', '-show_packets', '-show_entries', 'packet=pts_time', '-of', 'csv=p=0', a.mp4).stdout, re.M)]
+ gaps = [f'{q:.2f}-{r:.2f}' for q, r in zip(pts, pts[1:]) if r - q > .03]
+ rep('audio gaps', not gaps, f'{len(gaps)} packet gaps' + (f" at {', '.join(gaps[:6])}" if gaps else ''))
+ o = run('ffmpeg', '-hide_banner', '-nostats', '-i', a.mp4, '-af', 'ebur128=peak=true', '-f', 'null', '-').stderr
+ I = float(re.findall(r'I:\s+(-?[\d.]+) LUFS', o)[-1]); TP = float(re.findall(r'Peak:\s+(-?[\d.]+) dBFS', o)[-1])
+ rep('loudness', -15 <= I <= -13, f'{I} LUFS (target -14)')
+ rep('true peak', TP <= -1.5, f'{TP} dB (limit -1.5)')
+else:
+ rep('audio', False, 'no audio stream')
+rep('lip sync', None, 'play it with sound and watch three joins. A model cannot hear it')
+
+# frozen picture: 6 samples a second, a run of 1.5s or more with no change fails
+W, H = 180, 320
+raw = subprocess.run(['ffmpeg', '-v', 'error', '-i', a.mp4, '-vf', f'fps=6,scale={W}:{H}', '-f', 'rawvideo', '-pix_fmt', 'gray', '-'], capture_output=True).stdout
+fr = np.frombuffer(raw, np.uint8).reshape(-1, H, W).astype(np.int16)
+d = np.abs(np.diff(fr, axis=0)).mean(axis=(1, 2)); runs, cur, st = [], 0, 0
+for i, s in enumerate(d < .35):
+ if s: cur += 1; st = st if cur > 1 else i
+ else:
+ if cur: runs.append((st / 6, cur / 6)); cur = 0
+if cur: runs.append((st / 6, cur / 6))
+long = [(round(t, 1), round(l, 1)) for t, l in runs if l >= 1.5]
+rep('frozen picture', not long, 'stretches of 1.5s or more: ' + (', '.join(f'{t}s for {l}s' for t, l in long) or 'none'))
+cuts = int((d > 25).sum()); rep('pace', None, f'{cuts} hard cuts ({cuts / vd * 60:.0f} a minute). Judge it on the sheet')
+
+# empty band: a flat light strip of 20% or more of the frame height, from y220 down, held 1.5s or more = a blank panel
+bw, bh = 108, 192; bs = 1920 / bh
+braw = subprocess.run(['ffmpeg', '-v', 'error', '-i', a.mp4, '-vf', f'fps=2,scale={bw}:{bh}:flags=area,gblur=sigma=1.5', '-f', 'rawvideo', '-pix_fmt', 'gray', '-'], capture_output=True).stdout
+bf = np.frombuffer(braw, np.uint8).reshape(-1, bh, bw).astype(np.float32)[:, int(220 / bs):]
+pct = []
+for f in bf:
+ flat = (np.abs(np.diff(f, axis=1)).max(axis=1) < 3) & (f.mean(axis=1) > 170); best = c = 0
+ for x in flat: c = c + 1 if x else 0; best = max(best, c)
+ pct.append(best * bs / 1920 * 100)
+bad, k = [], 0
+while k < len(pct):
+ if pct[k] >= 20:
+ j = k
+ while j < len(pct) and pct[j] >= 20: j += 1
+ if (j - k) / 2 >= 1.5: bad.append((k / 2, (j - k) / 2, max(pct[k:j])))
+ k = j
+ else: k += 1
+rep('empty band', not bad, 'blank strips of 20%+ held 1.5s: ' + (', '.join(f'{t:g}s for {l:g}s ({m:.0f}%)' for t, l, m in bad) or 'none'))
+
+# sheets
+def grab(t):
+ png = subprocess.run(['ffmpeg', '-v', 'error', '-ss', f'{t:.2f}', '-i', a.mp4, '-frames:v', '1', '-f', 'image2pipe', '-vcodec', 'png', '-'], capture_output=True).stdout
+ return Image.open(io.BytesIO(png)).convert('RGB')
+ts = [t + .5 for t in range(int(vd))]; ims = [grab(t) for t in ts]
+Z = [(0, 0, 1080, 210), (0, 1520, 1080, 1920), (950, 960, 1080, 1520)]
+def sheet(name, zones):
+ tw, th, cols = 216, 384, 10; rows = (len(ims) + cols - 1) // cols
+ c = Image.new('RGB', (cols * (tw + 4), rows * (th + 24)), 'white'); dr = ImageDraw.Draw(c)
+ for k, (t, im) in enumerate(zip(ts, ims)):
+ im = im.copy()
+ if zones:
+ ov = Image.new('RGBA', im.size); o = ImageDraw.Draw(ov)
+ for z in Z: o.rectangle(z, fill=(255, 0, 0, 70), outline=(255, 0, 0, 255), width=5)
+ im = Image.alpha_composite(im.convert('RGBA'), ov).convert('RGB')
+ x, y = (k % cols) * (tw + 4), (k // cols) * (th + 24)
+ c.paste(im.resize((tw, th)), (x, y + 22)); dr.text((x + 4, y + 4), f'{t:.1f}s', fill=(0, 0, 0))
+ c.save(os.path.join(OUT, name))
+sheet('sheet.jpg', False); sheet('deadzone.jpg', True)
+rep('dead zones', None, f'look at {OUT}/deadzone.jpg: nothing you need to read inside the red')
+rep('the look', None, f'look at {OUT}/sheet.jpg tile by tile: caption over a graphic, anything cropped, a small object in an empty panel')
+open(os.path.join(OUT, 'qa.md'), 'w', encoding='utf-8').write(f'# qa {os.path.basename(a.mp4)}\n\n' + '\n'.join(lines) + '\n')
+print(f'\n{len(fails)} FAIL · report {OUT}/qa.md')
+sys.exit(1 if fails else 0)
diff --git a/skills/claude-reel-editor/scripts/render.js b/skills/claude-reel-editor/scripts/render.js
new file mode 100644
index 0000000..bb542ff
--- /dev/null
+++ b/skills/claude-reel-editor/scripts/render.js
@@ -0,0 +1,57 @@
+// render.js: record the reel page frame by frame in headless Chrome, then join the frames with ffmpeg.
+// usage: node scripts/render.js <project dir> [--workers 4] [--fps 60] [--from 0 --to 120] [--allow-fallback]
+//
+// 1 cuts the face frames from the raw take (lib.extractFrames), once per raw take and crop
+// 2 renders frame n = seek(n / fps) in several Chrome workers at once. The page swaps in the face frame from the TRUE
+// raw time for that cut time (the cut list), so lip sync never drifts across a join
+// 3 blends frame pairs 60 -> 30fps (a light motion blur) and encodes H.264, 1080x1920, limited range, bt709, with the cut audio
+// The output has your voice only. Add music and set loudness with scripts/export.sh.
+const fs = require('fs'), path = require('path'), { spawn, spawnSync } = require('child_process');
+const { loadProject, launch, openReel, seekAndWait, extractFrames } = require('./lib');
+const argv = process.argv.slice(2), flag = (k, d) => { const i = argv.indexOf('--' + k); return i < 0 ? d : (argv[i + 1] && !argv[i + 1].startsWith('--') ? argv[i + 1] : true); };
+const P = loadProject(argv[0]);
+const FPS = +flag('fps', P.fps), allowFallback = !!flag('allow-fallback', false);
+const TMP = path.join(path.dirname(P.out), 'frames-' + path.basename(P.out, '.mp4'));
+
+async function worker(a, b) {
+ const br = await launch();
+ try {
+ const { pg, errs } = await openReel(br, P, { allowFallback });
+ for (let n = a; n < b; n++) {
+ await seekAndWait(pg, n / FPS);
+ await pg.screenshot({ path: path.join(TMP, `f${String(n).padStart(5, '0')}.jpg`), type: 'jpeg', quality: 94 });
+ }
+ if (errs.length) throw new Error('page error: ' + errs[0]);
+ } finally { await br.close(); }
+}
+
+async function main() {
+ if (!P.audio || !fs.existsSync(P.audio)) { console.error(`cut audio not found: ${P.audio}. Run scripts/cut/make-cut.py first.`); process.exit(2); }
+ extractFrames(P);
+ const dur = +spawnSync('ffprobe', ['-v', 'error', '-show_entries', 'format=duration', '-of', 'csv=p=0', P.audio], { encoding: 'utf8' }).stdout;
+ const N = Math.floor(dur * FPS), from = +flag('from', 0), to = Math.min(N, +flag('to', N));
+ const W = Math.max(1, Math.min(+flag('workers', P.workers), to - from)), step = Math.ceil((to - from) / W);
+ fs.rmSync(TMP, { recursive: true, force: true }); fs.mkdirSync(TMP, { recursive: true });
+ console.log(`rendering frames ${from}-${to} of ${N} (${dur.toFixed(2)}s at ${FPS}fps) in ${W} workers`);
+ const t0 = Date.now();
+ const jobs = Array.from({ length: W }, (_, i) => [from + i * step, Math.min(to, from + (i + 1) * step)]).filter(([a, b]) => b > a)
+ .map(([a, b]) => new Promise(res => { const c = spawn(process.execPath, [__filename, argv[0], '--worker', a, b, ...(allowFallback ? ['--allow-fallback'] : []), '--fps', FPS], { stdio: 'inherit' }); c.on('exit', res); }));
+ const codes = await Promise.all(jobs);
+ const got = fs.readdirSync(TMP).filter(f => f.endsWith('.jpg')).length;
+ console.log(`frames: ${got} of ${to - from} in ${((Date.now() - t0) / 1000).toFixed(1)}s`);
+ if (codes.some(c => c) || got !== to - from) { console.error('FAIL a worker died or frames are missing. Nothing encoded.'); process.exit(1); }
+ if (from !== 0 || to !== N) { console.log(`partial render: frames kept in ${TMP}`); return; }
+ fs.mkdirSync(path.dirname(P.out), { recursive: true });
+ const vf = (FPS >= 50 ? 'tmix=frames=2,fps=30,' : '') + 'scale=1080:1920:in_range=full:out_range=limited,format=yuv420p';
+ const r = spawnSync('ffmpeg', ['-v', 'error', '-y', '-framerate', String(FPS), '-i', path.join(TMP, 'f%05d.jpg'), '-i', P.audio,
+ '-filter_complex', `[0:v]${vf}[v]`, '-map', '[v]', '-map', '1:a', '-c:v', 'libx264', '-profile:v', 'high', '-preset', 'slow',
+ '-b:v', '14M', '-maxrate', '16M', '-bufsize', '24M', '-color_range', 'tv', '-colorspace', 'bt709', '-color_primaries', 'bt709', '-color_trc', 'bt709',
+ '-c:a', 'aac', '-b:a', '128k', '-ar', '44100', '-movflags', '+faststart', '-shortest', P.out], { stdio: 'inherit' });
+ if (r.status) { console.error('FAIL ffmpeg encode'); process.exit(1); }
+ if (!flag('keep-frames', false)) fs.rmSync(TMP, { recursive: true, force: true });
+ const pr = spawnSync('ffprobe', ['-v', 'error', '-select_streams', 'v:0', '-show_entries', 'stream=codec_name,width,height,pix_fmt,color_range,nb_frames', '-of', 'default=nw=1', P.out], { encoding: 'utf8' }).stdout.trim().replace(/\n/g, ' ');
+ console.log(`DONE ${P.out}\n${pr}`);
+}
+
+if (argv[1] === '--worker') worker(+argv[2], +argv[3]).then(() => process.exit(0)).catch(e => { console.error('FAILED', e.message); process.exit(1); });
+else main().catch(e => { console.error('FAILED', e.message); process.exit(1); });
diff --git a/skills/claude-reel-editor/scripts/storyboard.js b/skills/claude-reel-editor/scripts/storyboard.js
new file mode 100644
index 0000000..e85b648
--- /dev/null
+++ b/skills/claude-reel-editor/scripts/storyboard.js
@@ -0,0 +1,71 @@
+// storyboard.js: one still per beat on one page, BEFORE any video is rendered. Nothing renders until you say yes.
+// usage: node scripts/storyboard.js <project dir> [--allow-fallback]
+// Writes <project>/storyboard/STORYBOARD.html: each card has the still, the time, the exact words, the layout and the one move.
+// Click a card and that beat plays with sound in the player. One notes bar at the bottom: pick a beat, type or dictate, Add,
+// then "Copy all feedback" and paste it to Claude.
+const fs = require('fs'), path = require('path');
+const { loadProject, launch, openReel, seekAndWait, extractFrames } = require('./lib');
+const P = loadProject(process.argv[2]), allowFallback = process.argv.includes('--allow-fallback');
+const esc = s => String(s ?? '').replace(/[&<>"']/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
+
+(async () => {
+ extractFrames(P);
+ const OUT = path.join(P.dir, 'storyboard'); fs.mkdirSync(path.join(OUT, 'stills'), { recursive: true });
+ const br = await launch();
+ const { pg, errs } = await openReel(br, P, { allowFallback });
+ const info = await pg.evaluate(() => ({ title: REEL.title || document.title, dur: REEL.dur, words: CUT.words,
+ beats: REEL.beats.map(b => ({ a: b.a, b: b.b, lay: b.lay, move: b.move || '', still: b.still ?? b.a + (b.b - b.a) * .75 })) }));
+ const cards = [];
+ for (const [i, b] of info.beats.entries()) {
+ await seekAndWait(pg, b.still);
+ const f = path.join(OUT, 'stills', `s${String(i).padStart(2, '0')}.jpg`);
+ await pg.screenshot({ path: f, type: 'jpeg', quality: 86 });
+ const words = info.words.filter(w => w.start >= b.a && w.start < b.b).map(w => w.word).join(' ');
+ const head = `${String(i + 1).padStart(2, '0')} · ${b.a.toFixed(1)}-${b.b.toFixed(1)}s · ${b.lay.toUpperCase()}`;
+ cards.push(`<div class=c data-t="${b.a}" data-h="${esc(head)}"><div class=im><img src="stills/${path.basename(f)}"><span class=pb>▶ Play</span></div><div class=m><b>${esc(head)}</b><p class=w>“${esc(words)}”</p><p>${esc(b.move)}</p><div class=mine></div></div></div>`);
+ }
+ await br.close();
+ if (errs.length) { console.error('page errors:\n' + errs.join('\n')); process.exit(1); }
+ const player = path.relative(OUT, P.page).split(path.sep).join('/') + '#play';
+ const opts = info.beats.map((b, i) => `<option>${esc(`${String(i + 1).padStart(2, '0')} · ${b.a.toFixed(1)}-${b.b.toFixed(1)}s · ${b.lay.toUpperCase()}`)}</option>`).join('');
+ const key = 'storyboard:' + path.basename(P.dir);
+ const html = `<!doctype html><html lang="en-GB"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${esc(info.title)} storyboard</title><style>
+body{margin:0;background:#fff;color:#1d1d1f;font:15px/1.45 system-ui,-apple-system,sans-serif}main{max-width:1240px;margin:0 auto;padding:36px 16px 260px}
+h1{font-size:36px;letter-spacing:-.03em;margin:0 0 6px}.lede{color:#6e6e73;margin:0 0 20px}
+.top{display:grid;grid-template-columns:400px 1fr;gap:28px;align-items:start;margin-bottom:34px}
+.fr{width:400px;height:711px;overflow:hidden;border-radius:24px;box-shadow:0 20px 50px rgba(0,19,47,.18);position:sticky;top:16px}iframe{width:1080px;height:1920px;border:0;transform:scale(.37037);transform-origin:0 0}
+.how{background:#f5f5f7;border-radius:18px;padding:18px 22px}.how li{margin:4px 0}
+.g{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:18px}.c{border:1.5px solid #e5e5ea;border-radius:18px;overflow:hidden;cursor:pointer}
+.c.sel{border-color:#0071E3;box-shadow:0 0 0 3px rgba(0,113,227,.18)}.im{position:relative}.c img{width:100%;display:block}
+.pb{position:absolute;left:12px;top:12px;background:#1d1d1f;color:#fff;border-radius:980px;padding:6px 14px;font-weight:600;font-size:13px}
+.m{padding:12px 14px}.m b{font-size:13px}.w{font-weight:600}.mine p{background:#f2f8ff;border-left:3px solid #0071E3;padding:8px 10px;border-radius:8px;margin:6px 0 0}
+.bar{position:fixed;left:0;right:0;bottom:0;background:rgba(255,255,255,.97);border-top:1px solid #e5e5ea;padding:12px 16px;z-index:9}
+.row{max-width:1240px;margin:0 auto;display:flex;gap:10px;align-items:flex-end}
+select{font:600 15px system-ui,sans-serif;padding:12px;border-radius:12px;border:1.5px solid #d2d2d7;background:#fff;max-width:230px}
+#fb{flex:1;min-height:56px;max-height:200px;border:1.5px solid #d2d2d7;border-radius:14px;padding:14px 16px;font:16px/1.4 system-ui,sans-serif;resize:vertical;box-sizing:border-box}
+button{background:#1d1d1f;color:#fff;border:0;border-radius:980px;padding:14px 22px;font:600 15px system-ui,sans-serif;cursor:pointer;white-space:nowrap}button.g2{background:#f5f5f7;color:#1d1d1f}
+.st{max-width:1240px;margin:6px auto 0;color:#6e6e73;font-size:13px}
+@media(max-width:800px){.top{grid-template-columns:1fr}.fr{position:static;width:100%;max-width:400px;height:auto;aspect-ratio:9/16}.row{flex-wrap:wrap}}</style>
+<main><h1>${esc(info.title)}: storyboard</h1><p class=lede>${info.dur.toFixed(1)}s, ${info.beats.length} beats. No video has been rendered yet.</p>
+<div class=top><div class=fr><iframe id=pl allow="autoplay" src="${esc(player)}"></iframe></div><div class=how><b>How to use this page</b><ol>
+<li>Click a card. That beat plays with sound in the player.</li><li>Type or dictate a note in the bar at the bottom, then press Add.</li>
+<li>Press Copy all feedback and paste it to Claude. Claude changes the beats and makes a new storyboard.</li><li>When it is right, type YES under Overall. Only then does Claude render the video.</li></ol></div></div>
+<div class=g>${cards.join('')}</div></main>
+<div class=bar><div class=row><select id=to><option value="Overall">Overall</option>${opts}</select><textarea id=fb placeholder="Type or dictate your note, then press Add (or Cmd+Enter)"></textarea><button id=add>Add</button><button id=cp>Copy all feedback</button><button class=g2 id=clr>Clear</button></div><div class=st id=cnt></div></div>
+<script>
+const K=${JSON.stringify(key)},$=id=>document.getElementById(id),fb=$('fb'),to=$('to');
+let N=[];try{N=JSON.parse(localStorage.getItem(K)||'[]')}catch(e){}
+const save=()=>{try{localStorage.setItem(K,JSON.stringify(N))}catch(e){}};
+function draw(){document.querySelectorAll('.c').forEach(c=>{c.querySelector('.mine').innerHTML=N.filter(n=>n.h===c.dataset.h).map(n=>'<p>'+n.x.replace(/[<&]/g,s=>s=='<'?'&lt;':'&amp;')+'</p>').join('')});
+ $('cnt').textContent=N.length?N.length+' note'+(N.length>1?'s':'')+' saved. Press Copy all feedback, then paste it to Claude.':'No notes yet. Type YES under Overall to approve the storyboard.'}
+function add(){const x=fb.value.trim();if(!x)return;N.push({h:to.value,x});fb.value='';save();draw();fb.focus()}
+$('add').onclick=add;fb.addEventListener('keydown',e=>{if(e.key==='Enter'&&(e.metaKey||e.ctrlKey)){e.preventDefault();add()}});
+document.querySelectorAll('.c').forEach(c=>c.onclick=()=>{document.querySelectorAll('.c').forEach(x=>x.classList.remove('sel'));c.classList.add('sel');to.value=c.dataset.h;try{$('pl').contentWindow.postMessage({t:+c.dataset.t},'*')}catch(e){};fb.focus()});
+$('cp').onclick=async e=>{if(fb.value.trim())add();if(!N.length)return;const t='Storyboard feedback:\\n'+N.map(n=>'- '+n.h+': '+n.x).join('\\n');
+ try{await navigator.clipboard.writeText(t)}catch(x){const a=document.createElement('textarea');a.value=t;document.body.append(a);a.select();document.execCommand('copy');a.remove()}
+ e.target.textContent='Copied';setTimeout(()=>e.target.textContent='Copy all feedback',2000)};
+$('clr').onclick=()=>{N=[];save();draw()};draw();
+</script></html>`;
+ fs.writeFileSync(path.join(OUT, 'STORYBOARD.html'), html);
+ console.log(`storyboard: ${info.beats.length} stills -> ${path.join(OUT, 'STORYBOARD.html')}`);
+})().catch(e => { console.error('FAILED', e.message); process.exit(1); });