--- name: kirupa-article-trailer description: Make a short, movie-trailer-style promo video for a kirupa.com article from its live examples, in Kirupa's approved light-blue-and-yellow pixel style. Use it when Kirupa asks for a trailer, promo, teaser, or social video for an article, a tweet/X video with the link in the reply, or Instagram Reels and TikTok versions plus their post copy. It captures scripted cursor runs of the article's interactive demos, builds a timed shot list with slam cards, article illustrations, KIRUPAicons, a typed code card, a title card and an end card, renders 1920x1080 and 1080x1920 at 60fps, synthesizes a synced trailer soundtrack at -14 LUFS, and writes the X post, X reply, Reels and TikTok copy. --- # KIRUPA article trailer A 30-40 second, movie-trailer-paced video that sells one article by showing its live examples doing their thing. The View Transitions API and Collision Detection trailers (November 2026) are the reference set, plus the KIRUPAicons MCP server launch; their shot lists are the worked examples in `scripts/timelines.mjs`, and their post copy is in `references/example-posts/`. This skill's home is `skills/kirupa-article-trailer/` in kirupaWWW, published at https://www.kirupa.com/skills/kirupa-article-trailer/SKILL.md so any agent can fetch it. Edit it there; `.github/skills/kirupa-article-trailer/` is a generated mirror for Copilot's skill loader and Nightowl (`python3 tools/skills/sync_public_skills.py`). In the kirupaWWW repo, read `skills/kirupa-house-rules/SKILL.md` before writing any on-screen text or post copy, and follow [kirupa-seo-aeo](https://www.kirupa.com/skills/kirupa-seo-aeo/SKILL.md) (`skills/kirupa-seo-aeo/SKILL.md`) for the launch: problem-first hooks, one verifiable proof number per post, release timing, and the rest of the distribution kit. The ROFL entry for this format is the "Article trailers" part of [Video & Podcasts](https://www.kirupa.com/design/sections/media.md). Run every command from a scratch work folder outside the repository (your session folder is fine). Set `SK` to this skill's `scripts/` folder: ```sh SK=/skills/kirupa-article-trailer/scripts # or a downloaded copy of this skill's scripts/ mkdir -p ~/trailer-work && cd ~/trailer-work ``` Captures, frames, previews, renders, and WAVs are generated there. Never commit them or the finished MP4s. ## What you need - Node with Playwright. The scripts use `.github/tools/node_modules/playwright` (`npm ci --prefix .github/tools` from the repo root) or `PLAYWRIGHT_PATH`. - `ffmpeg`/`ffprobe`, and Python 3 with `numpy` and `scipy`. - Born2bSportyV10 for captions, at `~/Library/Fonts/Born2bSportyV10.ttf` or `TRAILER_CAPTION_FONT`. It isn't in the repository. It's the same caption font as the podcast clip engine. Everything else comes from the repository through the renderer's `/site/` route, with a fallback to the live kirupa.com copy (a standalone copy of the scripts outside the repo uses the live site for everything): Born2bSporty v2 (`fonts/born2bsportyv2-webfont.woff2`), the header clouds and stars (`images/cloud1a.png`, `cloud2b.png`, `cloud3a.png`, `stars.png`), the orange (`pixel_icons/orange.gif`), KIRUPAicons (`icon/pixel-twemoji-24/png-192/.png`), and the article's own illustrations (for example `animations/images/vt_steps.png`). ## Workflow ### 1. Read the article and pick the moments Open the article and every live example it embeds (usually `/animations/examples/*.htm` or similar). List the two or three things a viewer should *see*: a before/after (snap vs. glide), a hit lighting up, a slow-motion run, a count dropping. The trailer is built around those moments, not around the article's outline. Sketch the beats before writing any code. Both reference trailers follow this arc: 1. `presents`: the orange, a "kirupa.com" highlighter block, "presents" (1.6s). 2. A hook card that states the problem in a few words ("Every web page changes.", "Two shapes." / "One question."). 3. The problem, shown in a clip with a caption ("Most of them just... snap.", "Are they touching?"). 4. The turn: a question card and the payoff clip ("What if they could glide?" then "Same click. Now it glides."). 5. Variety: quick labeled clips or a burst of 0.6s article-illustration cards, each with its icon and a hit. 6. The mechanism in one beat: a typed code card ("One function call.") or a "No pixel peeking. / Just math." card. 7. The escalation: slow motion, chaos, the big number ("276 checks. / Every. Frame.") and its fix. 8. A short black beat with a riser, then the `title` card on a braam, with the subtitle and a hopping icon row. 9. `end`: the orange, "Read the full article", and the kirupa.com highlighter. No article path: the post carries the link. Keep text cards to two short lines. Captions are full sentences or fragments in Kirupa's voice, never hype words ("Revolutionary", "Game-changing"). The problem has to be on screen within the first 3 seconds (beats 1-2 together), and the big number in beat 7 must be one the article's demo actually produces. #### Product launches The same arc sells a tool, not just an article. The `mcp` timeline (the KIRUPAicons MCP server launch) is the worked example: a hook card, an agent getting a plain request, the tool call as a code card, then the thing it built and quick labeled cuts of its variations. The agent session is a prop, `scripts/props/mcp_agent_console.html`, that replays real responses from the live server, so every name and icon on screen is what the tool returned; `play(scene)` starts a scene. The finished build is a real page (`/mcp/icons/example.htm`), captured like any demo. A clip's `vclip`/`vfrom` swap in a capture from a narrower viewport for the vertical cut, and the end card's `lines` replace "Read the full article" with a short call to action (still no URL or path). The posts file's `Article:` line points at the product's page. ### 2. Capture the live examples Edit `clips` and `setup` in `scripts/capture.mjs` for the new article. Each clip is a small script of cursor moves, clicks, and drags. Then run: ```sh node $SK/capture.mjs # every clip node $SK/capture.mjs vt_slow # one clip, by name prefix ``` That gives `clips/.mp4` (CFR 60fps) and `frames//00001.jpg...` for the renderer. How capture works, so you don't fight it: - It drives headless Chromium with `--force-device-scale-factor=2`. That flag is required: without it the CDP screencast records at 1x even when the context's `deviceScaleFactor` is 2. - An init script draws a visible arrow cursor with an orange click ripple, hides the real cursor, and seeds `Math.random` so ball layouts repeat from take to take. - Cursor paths are eased with a slight arc. Leave a beat (`wait`) before and after each action so the trailer has room to cut. - `Page.startScreencast` frames are written with their timestamps, then concatenated with their real durations and resampled to 60fps. Watch a clip or two before moving on. If the demo's starting state is wrong (wrong tab, scrolled, layout shifted), fix `setup` or the clip script, not the trailer. ### 3. Write the timeline Add a key to `scripts/timelines.mjs`: `duration`, `soundtrack` (a preset, below), `shots`, and `cues`. The header comment lists the shot types and fields. A clip shot's `from` is seconds into its captured clip, so you can start right before the action; `rate` speeds a clip up and `zoom` pushes in on a point. Cues drive the soundtrack and the visuals: `boom`, `hit`, and `braam` also flash and shake the frame. Put booms on card slams, hits on illustration flashes and on-screen impacts, a `pulse` under montage stretches, a `riser` into the black beat, `braam` on the title, and `shimmer` on the end card. ### 4. Check sync before rendering anything long ```sh python3 $SK/analyze.py ``` For every clip shot this prints where the motion starts and where the demo's red "hit" state appears, already mapped to trailer time, next to the cues you placed in that shot. Move `from` or the cue until a hit cue lands on the frame where the contact happens. The red test fits the collision demos; for other demos, read motion-start or add a colour test for that demo's highlight. ### 5. Preview stills and a contact sheet ```sh node $SK/render.mjs h sheet # preview/_h_sheet.jpg, one still per shot node $SK/render.mjs v sheet node $SK/render.mjs h preview 4.6 13.4 # exact moments ``` Look at both sheets before the full render. Check the style list below, that no text is clipped, that icons don't cover text or demo content, and in the vertical sheet that nothing important sits in the bottom ~20% or under the right-side TikTok/Reels buttons. A full render takes about a minute per format, so iterate on stills. ### 6. Render, score, and mux ```sh node $SK/render.mjs h && node $SK/render.mjs v # out/__video.mp4 (silent) python3 $SK/audio.py # audio_.wav, using the timeline's preset python3 $SK/audio.py --preset trailer # or pick one explicitly python3 $SK/mux.py h && python3 $SK/mux.py v # out/_.mp4 ``` The renderer is deterministic: `trailer.html` exposes `setup(timeline, fmt)` and `render(t)`, `render.mjs` steps `t` at 1/60s, waits for each clip frame to decode, and pipes CDP screenshots to x264. The same timeline always gives the same frames. `audio.py` synthesizes everything with numpy/scipy, from the cue sheet, with one of two soundtrack presets. The timeline's `soundtrack` field picks it and `--preset` overrides it: - **`chiptune`** (the default, and what both reference trailers use now): Kirupa asked for "mega man x style background music that is comically awesome!" It's an original SNES-era rock chiptune in D minor at 150 bpm (`scripts/chiptune.py`): a stage-intro fanfare over `presents` with a drum fill into the groove, a two-bar riff, then an eight-bar heroic hook on a square lead with echo, a 16th-note octave bass, palm-muted power-chord "guitar", and snappy drums. `pulse` spans add 16th hats and a 32nd-note arpeggio, `boom`/`hit` become crashes and chord stabs on their exact times, and `riser` turns into a "boss approaching" two-tone alarm with a climbing bass and a speeding heartbeat kick, cut to silence just before the title. `braam` is the title fanfare (a bVII-I cadence into D major), and `shimmer` is the end-card victory jingle. Every note is written for these trailers: never quote or approximate a real game melody, and never sample game audio. - **`trailer`**: the original cinematic score: ticks, booms, hits, snaps, whooshes, a low drone, a 120bpm pulse ostinato, a riser that cuts to silence before the title, the braam, and an end-card shimmer. Both run through one reverb and a soft saturator. To add a preset, add a module that returns `(music, fx)` stereo buffers for a timeline, like `chiptune.score`, and list it in `PRESETS`. Keep it synced to the same cues: hits on slams, a build into the black beat, a big moment on the title, and a closer on the end card. `mux.py` sets the level with `loudnorm=I=-14:TP=-1.5`, holds peaks with an oversampled limiter, encodes AAC 256k at 48kHz, and steps the limit down until the encoded file measures at or under -1.5 dBTP. (loudnorm alone overshot to -0.2 dBTP on the first trailers, and AAC adds about 1.5 dB.) It prints the result's size, frame rate, duration, loudness, and true peak. ### 7. Watch it, then deliver Watch both finished files with sound, start to finish, and scrub the clip shots frame by frame around each hit cue. Write the posts file (below), then deliver with `deliver.py`, which copies everything to `~/Dropbox/Assets/Videos/` (or a per-article folder there) and adds the trailer to the dashboard's To do list: ```sh python3 $SK/deliver.py --folder "Konami Code" # --folder is optional; omit it for the top level ``` It writes: - `_trailer_x.mp4` (1920x1080) - `_trailer_vertical.mp4` (1080x1920, for both Instagram Reels and TikTok) - `_trailer_posts.txt` (the copy below; it reads `./_trailer_posts.txt`, or `--posts `) `` is the article's file name, such as `view_transitions` or `collision_detection`. The posts file's second line must be `Article: https://www.kirupa.com/...`, since that's how the To do list links the trailer to its article. Every delivery has to reach the To do list (https://www.kirupa.com/dashboard/todo.htm), where Kirupa picks up the files and copy and checks off X, Reels, TikTok, YouTube Shorts, and the forum. `deliver.py` does that by running kirupaWWW's `tools/video_inventory.py`, which scans `~/Dropbox/Assets/Videos` for every `*_trailer_*.mp4` since 2026-11-20 and pushes the list to the server over SSH. The push merges: new trailers are added, re-rendered ones are refreshed, and nobody's checkboxes, notes, or Done state are touched. If you copied files some other way, or re-rendered over an old file, run it yourself from the repo: `python3 tools/video_inventory.py` (`--dry-run` prints what it found). When it can't reach the server it prints `VIDEO INVENTORY NOT PUSHED` and exits 3; treat that as unfinished delivery. Outside the repo, set `KIRUPA_REPO` to a kirupaWWW checkout. ## The approved style (author-confirmed) Kirupa approved this look through feedback on the first two trailers. Treat these as his decisions, not suggestions: - He rejected a dark cinematic look, then rainbow per-letter text: "Don't make it rainbow colored. The kirupa style is solid colors with bold text but not colorful." and "The main color scheme for kirupa.com is light blue and/or yellow. Keep it creative." Earlier: "Make the title text more colorful, use the pixel font, use kirupaicons, and make it playful." - **Background:** the kirupa sky, a vertical gradient `#AADCFF` -> `#EAF7FF` -> white, with the header's pixel clouds drifting at different speeds and `stars.png` twinkling. No dark frames except the short black beat before the title. - **Titles and cards:** the kirupaPixel face (Born2bSporty v2), mixed case like site headings, solid `#0798FF` with a hard black offset shadow. Accent words sit on a solid `#FFE561` highlighter block with dark `#1e2933` text, a black border, and a hard offset shadow, tilted slightly. Letters pop in one after another with a bouncy overshoot, then keep a gentle wave. - **KIRUPAicons:** pixel icons from `icon/pixel-twemoji-24/png-192/` pop in and bob around titles, label clips and illustrations, and hop in a row under the title card. In all on-screen text and copy about them, they're icons, never emoji. - **Panels:** demo clips and article illustrations sit in white panels with a 6px `#1e2933` border, rounded corners, and a 16px `#0267AF` hard offset shadow. - **Captions:** Born2bSportyV10 in dark text on white chips with a black border and a blue offset shadow. - **Code card:** dark `#1e2933` box, bold monospace with syntax colours, typed out with a yellow caret. - **Vertical only:** a small kirupa.com watermark chip near the top during clips and cards. Content stays clear of the right-side buttons and the bottom ~20%. - **End card:** the orange, "Read the full article", and the kirupa.com highlighter. Never the full article URL or path ("don't post the full URL at the end"); the link lives in the post copy. - **Motion:** quick, punchy cuts on booms and hits with a short white flash and a small shake. Clips push in slowly; nothing drifts aimlessly. ## Format | | X | Instagram Reels / TikTok | | --- | --- | --- | | Size | 1920x1080 (16:9) | 1080x1920 (9:16), one file for both | | Video | H.264 High, yuv420p, 60fps, CRF 16, `+faststart` | same | | Audio | AAC 256k, 48kHz stereo, about -14 LUFS integrated, at most -1.5 dBTP | same | | Length | about 30-40s (the references are 32s and 37.4s) | same edit | | Link | not in the post: it goes in the follow-up reply | in the caption as plain text | ## Post copy Write one `_trailer_posts.txt` with four blocks, following `references/example-posts/`: 1. **X post** (attach the 16:9 file): two short paragraphs. A hook that names what the viewer sees ("Most web pages just snap from one view to the next."), then one or two sentences on what the article covers, with a playful aside. One or two emoji characters at most per paragraph. No link. 2. **X follow-up reply**: one sentence listing what's inside the article, ending with 👇, then the full `https://www.kirupa.com/...` URL on its own line. 3. **Instagram Reels** (attach the vertical file): the hook, a short paragraph that actually explains the idea, "Read the full article at kirupa.com/ 🍊", then six or seven lowercase hashtags. 4. **TikTok** (attach the vertical file): one or two punchy sentences, "Full article at kirupa.com 🍊", then five or six lowercase hashtags. Keep the voice casual, curious, and specific: Kirupa's voice (see the `konvo` skill), no hype words, no "In this video". ## Before you call it done - Both sheets were reviewed and match the style list. - `analyze.py` output shows each hit cue on its impact frame, and a frame-by-frame scrub agrees. - `mux.py` reports 1920x1080 and 1080x1920 at 60fps, h264 + aac, -14 LUFS within about 1 LU, true peak at or under -1.5 dBFS. - Both files were watched with sound; no clipped text, stray real cursor, or missing icon (the renderer logs every 404). - The end card shows no article URL or path. - The soundtrack's big moments land where they should: a stab on every slam, silence just before the title, the fanfare on the title card, and the jingle on the end card. - The posts file has all four blocks, the link only in the X reply, and icons are never called emoji. - `deliver.py` (or `tools/video_inventory.py`) reported the trailer pushed, and it shows up on the dashboard's To do list.