code-game-trailer
Turn a browser game or three.js / WebGL scene an agent built into a cinematic trailer MP4: a virtual clock injected before the page's scripts makes every frame exact at 30 or 60 fps, a director JSON scripts each shot (key and mouse inputs, game setup, trailer camera paths, slow motion, HTML titles a…
Install / Use
npx skills add hashgraph-online/awesome-codex-plugins --skill code-game-trailerInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
OtherSupported Platforms
Tags
Our assessment of code-game-trailer
code-game-trailer scores 85/100 on our quality scale, 221st of 329 Other skills we index.
Its SKILL.md is 18 KB long, well organised into 16 sections with 3 code examples: a thorough specification that gives an agent plenty to work with.
With 1,075 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so code-game-trailer is actively maintained.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
code-game-trailer compared with similar skills
All 4 of these similar skills score higher than code-game-trailer; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| code-game-trailer (this skill)by hashgraph-online | 85 | 1.1k | 56d ago | SKILL.md |
| algorithmic-artby anthropics | 100 | 177.9k | 58d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 58d ago | SKILL.md |
| prospectingby coreyhaines31 | 100 | 60.1k | 8d ago | SKILL.md |
| ad-creativeby coreyhaines31 | 100 | 60.1k | 8d ago | SKILL.md |
Frequently asked questions
- How do I install code-game-trailer?
- Run
npx skills add hashgraph-online/awesome-codex-plugins --skill code-game-trailer. The install tabs above show the steps for each supported agent. - Which AI agents does code-game-trailer work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is code-game-trailer safe to use?
- It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is code-game-trailer still maintained?
- The repository was last updated about 2 months ago, so code-game-trailer is actively maintained.
Skill content
View source on GitHubname: code-game-trailer description: >- Turn a browser game or three.js / WebGL scene an agent built into a cinematic trailer MP4: a virtual clock injected before the page's scripts makes every frame exact at 30 or 60 fps, a director JSON scripts each shot (key and mouse inputs, game setup, trailer camera paths, slow motion, HTML titles and end cards), headless Chrome captures 1920x1080 frames, ffmpeg cuts them on the beat, a music bed (code-written or from varg) is normalised to -14 LUFS, and a checker measures frozen frames, loudness, debug text, third-party names and claims. Includes a tested example game. Use when someone asks for a game trailer, to record my three.js game, a gameplay video, a trailer for my browser game, a Fable 5.2 game video or a fake AAA gameplay trailer. Not for HTML motion graphics (hyperframes), 3D previz for AI video (threejs-animatic), AI-generated footage (varg-ai) or editing existing footage (short-form-ffmpeg-cookbook). license: MIT metadata: author: vargHQ version: "1.0.0" compatibility: >- Bun, ffmpeg (libx264, aac, loudnorm; drawtext not needed) and Google Chrome or Chromium; no npm packages (a 150-line CDP client is included). Measured 2026-11-10 on an Apple M4 Pro, headless Chrome on the GPU (ANGLE Metal): 50-68 ms per 1920x1080 frame, 558 frames in 33.5 s including 8 page loads; software WebGL (SwiftShader, no GPU) 509 ms per frame. Cut 9.7 s, check 9 s for an 18.6 s trailer. Free locally; an optional varg music track needs the varg MCP or a VARG_API_KEY. allowed-tools: Bash(bun:) Bash(ffmpeg:) Bash(ffprobe:) Bash(magick:) Read Write Edit
Code game trailer: record the game, cut it like a trailer
On launch day of Claude Fable 5.2 (2026-11-09) the most-watched thing people made with it was a browser game built from one brief: 3.45M views across 18 posts. What travelled was not the game but the video of the game. A screen recording of a game drops frames, drifts from the music and shows a cursor and a debug counter. A trailer needs exact frames, chosen moments, a camera that moves like a film camera, a title, a beat and an end card. This skill does that for any HTML/WebGL game an agent wrote.
The example in examples/lantern-canyon/ (an original game made for this skill, one HTML file) went
from director JSON to an 18.6 s 1080p trailer in 56 s on a laptop (stills, capture, score, cut and check), with
no credits spent: the full trailer
(1920×1080, 19 MB). Your own runs write it to examples/<game>/master.mp4.
When to use it
| request | use |
|---|---|
| "make a trailer / gameplay video of my browser game", "record my three.js game" | this skill |
| a game that does not exist yet ("make a game and a trailer for it") | brief the game first ("Making the game in the first place" below), then this skill |
| the video is HTML motion graphics, captions, a launch film | hyperframes |
| a 3D grey-box previz that will feed Seedance video-to-video | threejs-animatic |
| footage from AI video models | varg-ai |
| cutting, captioning or reformatting existing footage | short-form-ffmpeg-cookbook |
Quick start
S=<this skill>
bun $S/scripts/capture.ts $S/examples/lantern-canyon/director.json --stills # 3 stills per shot, ~6 s: LOOK at them
bun $S/scripts/capture.ts $S/examples/lantern-canyon/director.json # all frames -> examples/lantern-canyon/capture/
bun $S/scripts/score.ts $S/examples/lantern-canyon/director.json # music.wav + sfx.wav (written in code, free)
bun $S/scripts/cut.ts $S/examples/lantern-canyon/director.json --music $S/examples/lantern-canyon/music.wav \
--sfx $S/examples/lantern-canyon/sfx.wav --grade # -> examples/lantern-canyon/master.mp4
bun $S/scripts/check.ts $S/examples/lantern-canyon/director.json # measurements + contact sheet to look at
For your own game: copy examples/lantern-canyon/director.json next to the game's index.html, point
"url" at it, rewrite the shots. Local paths are served over http://127.0.0.1 for the run (ES
modules and CDN imports need http, not file://).
The workflow
1. Make the game capturable (5 minutes, once)
The recorder needs three things from the page. Add them to the game (or ask the agent that wrote it):
window.__game = {
ready: false, // set true after assets loaded AND the first frame rendered
renderer, camera, // the THREE.WebGLRenderer and the camera the game renders with
player, // optional Object3D the trailer camera can follow or look at
anchor, // optional Object3D: the player's position with the level's heading, no roll
setup(opts) { ... }, // reset to a known state: level, distance, score, autopilot, hud on/off
get events() { ... }, // optional: drain [{ type: 'pickup' | 'hit' | ... }] for sound effects
};
Rules that make the capture exact (details: references/virtual-clock.md):
- All motion from
requestAnimationFrametime orperformance.now()deltas (the clock controls both). - The level layout uses its own seeded random stream, never
Math.randomand never the stream that cosmetic effects use (see gotchas). - HUD in HTML with
vhunits and ≥ 6vh side margins; no FPS counter or debug text unless?debug. - An attract-mode autopilot (the game plays itself) makes every non-hero shot easy to direct.
2. Shot list: 4-8 shots plus title and end card
Write it before any camera work. Roles drive the music and the checks:
| role | shows | camera that works | length |
|---|---|---|---|
| establishing | the world, the mood, the player arriving | crane down from above, player rising into frame | 2.5-3.5 s |
| mechanic | the core verb, with the HUD so people see it is a game | the game's own camera + scripted keys | 2.5-3 s |
| mechanic (detail) | the hero object up close | low tracking shot in __game.anchor space | 1.5-2 s |
| escalation | more speed, more enemies, more particles | game camera with boost, or a world-fixed fly-by | 1-2.5 s each |
| hero | the one moment people screenshot | world-fixed camera, speed: 0.5 slow motion | 2.5-3 s |
| title | the name over the game world | slow drift, HTML overlay, HUD hidden | 2-2.5 s |
| end | where to play, what it is made of | card page | 1.5-2 s |
Cut on beats: give shots "beats" and the director a "bpm". At 100 BPM a beat is 0.6 s.
Order: wide → close → fast → faster → hero → title → end. Quick shots (1-1.5 s) belong in the
escalation; the hero shot gets room.
3. Director JSON
{ "url": "index.html", "fps": 30, "width": 1920, "height": 1080, "seed": 7, "bpm": 100,
"ready": "window.__game && window.__game.ready", "probe": "window.__game.state.score",
"shots": [
{ "id": "s2_mechanic", "role": "mechanic", "beats": 5,
"setup": "__game.setup({distance: 286, lat: 2.5, h: 2.0, score: 37})",
"inputs": [ { "at": 0.35, "key": "ArrowRight", "hold": 0.4 }, { "at": 1.1, "key": "ArrowLeft", "hold": 0.9 } ] },
{ "id": "s6_gate", "role": "hero", "beats": 5, "speed": 0.5,
"setup": "__game.setup({distance: 1226, autopilot: true, hud: false})",
"camera": { "space": "__game.place(1240)", "lookAt": "__game.player", "ease": "linear",
"keys": [ { "pos": [5, 0.5, -16], "fov": 52 }, { "pos": [3, 1.5, -19], "fov": 58 } ] } },
{ "id": "s8_end", "role": "end", "beats": 3, "card": "cards/card.html?title=MY%20GAME&sub=Play%20in%20your%20browser", "fade_out": 0.6 }
] }
(Copy cards/ next to your game for the end card; the example points at ../../cards/card.html.)
Every shot is a fresh page load (deterministic start), then setup, then warmup seconds stepped
without recording, then the frames. Camera keys are positions in the space object's frame (three.js
convention: +x right, +y up, −z forward); the trailer camera replaces the game camera only inside
renderer.render and is restored after, so gameplay never sees it. All fields, inputs and overlays:
references/director-format.md.
4. Stills first, then verify
capture.ts … --stills writes the first, middle and last frame of every shot into capture/stills/ in
a few seconds (stepping costs 4-6 ms per frame without screenshots). Look at them with the Read tool
(montage them: magick montage *_b.jpg -tile 2x4 -geometry 960x540+4+4 sheet.jpg). Fix the camera,
the setup distance and the inputs here, where a try costs seconds. The probe value printed per shot
(the score, here) tells you whether scripted inputs actually did something.
Then capture.ts … --verify --only <shot> renders the first 45 frames twice from fresh loads and
compares PNG hashes. Measured: 45/45 identical with scripted keys and in slow motion. Anything less
means a clock, Math.random or load timing leaks into the picture.
5. Capture
capture.ts director.json writes capture/<shot>/00000.jpg … (JPEG q92; --format png for
lossless) and capture/manifest.json (frames, ms per frame, game events per frame, the visible text,
the probe). --only s2,s4 re-records some shots and keeps the rest.
6. Sound
- Free, in code:
score.ts director.jsonwritesmusic.wav(pad, bass, drums by role, a riser that lands on the hero shot's first game event, impacts on the gate and the title) andsfx.wav(a chime per pickup that climbs with the chain, a whoosh per gate, a thud per hit) placed on the exact frames the capture saw them. The Fable 5.2 games that spread generated all their sound in code too. - A real composition from varg: price it first, then generate an instrumental of the trailer's length:
estimate_cost({ tool: "music", input: { model: "mureka_9_5", prompt: "...", duration: 20 } }), show the price, and only after a yesgenerate_music({ model: "mureka_9_5", prompt: "dark cinematic trailer bed, 100 BPM, low drone, pulse, riser, one big hit at 0:11, instrumental, no vocals", duration: 20, instrumental: true }). Name the model: the tool's default is a much pricier one (varg-ailists mureka ~25 credits vs ~158). Thenbeats.ts music.mp3finds BPM and the first beat (measured: 99.79 BPM on a 100 BPM bed, first beat within 30 ms); put both in the director ("bpm","music": {"file", "offset"}) and re-time the shots in beats. Keepsfx.waveither way.
7. Cut
cut.ts director.json --music … --sfx … --grade builds the master: shots in order, fades
(fade_in, fade_out, flash_in), gentle contrast and vignette, the mix trimmed to the picture,
two-pass loudnorm to -14 LUFS / -1.5 dBTP, H.264 crf 18 + AAC 192k, +faststart. It also writes
master.cuts.json (where every shot sits). Text is never drawn by ffmpeg: titles are HTML in the
capture (this ffmpeg had no drawtext), so they get real fonts, tracking and CSS animation.
Preview for a gallery card (1280x720, 6-10 s, 0.4-2 MB):
ffmpeg -ss 11.4 -i master.mp4 -t 6.6 -vf scale=1280:-2:flags=lanczos -c:v libx264 -preset slow -crf 20 -pix_fmt yuv420p -an -movflags +faststart preview.mp4.
Measure the bitrate per shot first: dense particles cost 721 KB/s at these settings, an end card 86
KB/s, so a 2 MB preview cannot hold an 8 s ember storm.
8. Check, then look
check.ts director.json measures and prints: duplicate and frozen frames per shot (from the captured
frames, before grading), black frames outside fades, size/fps/codec, integrated loudness and true
peak, a contact sheet (every 15th frame, with a tile → time → shot legend), and every visible string
with flags for debug words, third-party names and claims. Then open the sheet and look at every tile:
the numbers do not see a camera inside a wall or a lantern that never enters the frame.
Before anyone sees it:
- [ ] no third-party IP: no franchise names in titles, captions, HUD, file names; no lookalike ch
Truncated for display — read the full file on GitHub.
Related Skills
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
prospecting
60.1kWhen the user wants to find and qualify prospects for outbound, or asks who to target first, which signal to prioritize, or where to spot buyers with the problem: buying signals, enrichment, verification, account research.
ad-creative
60.1kWhen the user wants to write or judge ad creative, or asks which ad, hook, or angle to run or kill: headlines, primary text, and variations for Google, Meta, LinkedIn, and TikTok, fresh angles when creative fatigues. Test hypotheses name the metric, comparison, and expected direction.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
