Cutscene Script (in-engine cutscenes as checked data)
/cutscene-script
A GameSkill original for in-engine cutscenes in small 2D browser games: the scene is a list of beats (fade, move, say, camera, wait, cue, set) placed by time or after another beat. cutscene.js schedules them, computes the scene at any time t as a pure function, plays it with skip and seek and fires game cues exactly once. A Node checker prints the timeline and lints unreadable lines, overlapping moves, unknown actors and abrupt endings. Ships The Lantern Ferry, an original cutscene tested in headless Chrome.
- 许可证
- MIT
- 出品
- GameSkill 出品
我们测过
在 Canvas 2D in headless Chrome + Node 22 上通过 29/29 项检查(2026-11-09):能触发、有可运行示例、有截图和自检清单、单一职责、中英文文档齐全。触发检查是把提示词和 skill 描述做匹配,不是真实 agent 运行。
测试报告GameSkill 测过的版本
GameSkill 为 gameskill.dev 原创编写并测过。ZIP 里是完整的 skill:SKILL.md 及中文版、脚本、可运行示例、测试、自检清单和我们的测试报告。
GameSkill 原创,协议 MIT。ZIP 保留 LICENSE 和 CREDITS.md,里面列出了流程灵感来源、CC0 测试素材和第三方库及其协议。

自检清单
- cut_check --strict 通过:0 错误 0 警告 / cut_check --strict passes with 0 errors and 0 warnings
- 只根据 state 绘制,同一个 t 像素相同 / Drawing uses only the state; the same t gives the same pixels
- 跳过后事件只触发一次,并有跳过键 / A skip key exists and cues fire once after a skip
推荐搭配
中文指南
这个 skill 做什么
GameSkill 原创(MIT)。把小型 2D 网页游戏里的过场动画写成数据:一串节拍(淡入淡出、移动、台词、镜头、等待、事件、设置),按时间或"在某个节拍之后"安排。cutscene.js 排时间、把任意时刻的画面状态算成纯函数、播放(可跳过、可跳转),游戏事件只触发一次;Node 检查工具打印时间线,并检查读不完的台词、重叠的移动、未知角色和突兀的结尾。
什么时候用
- 网页游戏的开场、剧情节点和结局
- 台词消失太快、跳过时音效响两次
- agent 需要不看画面就测试过场
怎么装
下载本页的 ZIP,把 cutscene-script/ 文件夹放进 .claude/skills/(Claude Code)或 .agents/skills/(Codex、Cursor),重启 agent。检查工具需要 Node 22;自测需要 Chrome。
最小示例
node tools/cut_check.mjs example/lantern-ferry/ferry.cutscene.js --strict --at 9- 在
cutscene-script/目录起一个静态服务器,打开example/lantern-ferry/index.html,按 Esc 跳过。
我们怎么测的
示例是我们原创的 17 秒夜景过场 The Lantern Ferry:渡船靠岸,守夜人举灯,两句对话,镜头推近,旅人上岸,钟声响起,画面淡出。test/run_tests.mjs 共 17 项检查:示例在严格模式下 0 错误 0 警告;故意写坏的脚本报出 3 个错误和 4 个警告;超长会被发现;after: N 并行、台词阅读时间、状态函数纯净、目标到位、跳转和跳过时事件只触发一次都正确;在无界面 Chrome 里同一时刻渲染像素完全相同,对话框只在台词期间出现并逐字打出,开头淡入、结尾全黑,Esc 跳过后钟声事件只到达一次,没有控制台错误。截图是钟声那一拍。
致谢
"用编程 agent 编排游戏过场"的思路来自我们 11 月 5 日雷达里的一条 X 帖子(只借用思路,没有使用任何代码或文字)。代码、场景和文字都是我们自己的。
搭配
game-trailer-from-code:用代码做宣传片browser-game-input-check:网页游戏键盘输入自检code-sprites-16:用代码画 16 色精灵
安装
告诉你的 AI
Install the skill from https://gameskill.dev/skills/cutscene-script/install.md
GameSkill 测过的版本
mkdir -p .claude/skills
curl -fsSL https://gameskill.dev/dl/skills/cutscene-script.zip -o /tmp/gameskill-cutscene-script.zip
unzip -oq /tmp/gameskill-cutscene-script.zip -d .claude/skills
rm /tmp/gameskill-cutscene-script.zip包含内容
- cutscene.js: schedule, lint, pure stateAt(t), and a player with update, seek, skip and once-only cues
- tools/cut_check.mjs: the timeline with start and end of every beat, state at chosen times, FAIL/WARN with fixes
- The Lantern Ferry: an original 17 s scene with a ferry, a dock keeper, dialogue, a camera move, a bell cue and fades
- 17 checks in test/run_tests.mjs, including pixel-identical renders for the same t in headless Chrome
适合
- Intros, story beats and endings in browser games
- Dialogue that vanishes before it can be read, and cues that fire twice on skip
- Agents that need to test a cutscene without watching it
不适合
- Rendered trailers and marketing video: use game-trailer-from-code
- Branching dialogue trees and quest logic
- Godot AnimationPlayer or Unity Timeline scenes
试试这条提示词
Add a skippable 15-second intro to my original browser game: the hero arrives by boat, two lines of dialogue, a camera push-in and a fade, then hand control to the player.关于这个 Skill
A GameSkill original. Cutscenes built from ad-hoc timers break the same ways every time. A line disappears before anyone can read it, two moves fight over one character, a skip leaves the game mid-scene or fires a sound twice, and nobody can say what happens at second 9 without watching. Here the scene is data. cutscene.js computes the timing, makes the picture at any moment a pure function of t, and plays the scene with seek, skip and once-only cues. tools/cut_check.mjs prints the timeline and lints it before anyone watches.
Agent steps
- Write the scene as beats, with
dur: 'auto'for lines. - Check it with cut_check in strict mode and fix every FAIL and WARN.
- Play it with createPlayer, draw only from the state, bind a skip key, and test renders at chosen times.
Common problems it solves
- Dialogue shorter than its reading time, and lines that overlap.
- Moves on one character that overlap, and targets far off stage.
- Skips that leave the game half-way or fire cues twice.
Credits
The idea of orchestrating game cutscenes with a coding agent comes from a post on X in our 2026-11-05 radar (idea only; no code or text was used). The Lantern Ferry, the code and the text are ours.
环境要求
- Any browser for playback; cutscene.js has no dependencies
- Node 22+ for tools/cut_check.mjs (standard library only)
- Chrome or Chromium for the self-test
相关主题
常见问题
游戏打磨流程 Game Polish Workflow
让 AI 把游戏真正改好的可复用流程:10 步打磨循环、中英双语提示词、AI 做游戏常见问题排障清单,以及试玩和发布检查表。
搭配使用
作者标注的相关 Skills,或更适合相邻任务的 Skills。
Game Trailer from Code (Steam trailer and store images)
A GameSkill original: turn your own running game into a 15-second Steam gameplay trailer and every store image with code. Frame-exact capture, a JSON cut list, zh/en captions and SRT, a soundtrack synced to game events, an H.264/AAC encode, and a checker for Steam's trailer rules, loudness, the 6-second microtrailer and the capsule sizes. Version 1.1 adds a rhythm tool that finds every cut, dead air and black frames, matches cuts to the cut list and moves them onto the music's beat, plus stage-by-stage confirmation with the user.
Browser Game Input Check (keyboard that just works)
A GameSkill original for keyboard input in browser games: a drop-in input.js that binds physical keys, ignores OS repeats, stops page scrolling, releases keys on alt-tab, never loses quick taps, ignores text fields and leaves browser shortcuts alone, plus a checker that drives the game in headless Chrome and prints PASS / FAIL with a fix for 15 checks, including one press acting once through a slow frame.
Code Sprites 16 (pixel sprites drawn in code, locked palette)
A GameSkill original for browser games whose sprites are written in code: text rows of palette indices over a locked 16-colour palette, no image files. A dependency-free sprites.js validates, bakes and draws them crisp by origin; a Node checker fails ragged rows, illegal characters, empty or resized frames, extra colours and wrong sizes and writes a PNG contact sheet. Ships Seed Courier, an original 16-colour platformer tested in headless Chrome so every pixel on screen is a palette colour.
相似 skills
Awesome Gamedev Agent Skills
77 portable SKILL.md skills across 12 engines (Godot, Unity, Unreal, Phaser, PixiJS, three.js, Bevy, pygame, LÖVE, Roblox, Defold, Ebitengine), with a router.
Video to Game
Treat a short gameplay video as the design document: study its frames, palette and cuts, build one playable Three.js game around its one mechanic, then prove it with side-by-side frames and a recorded keyboard playtest. GameSkill tested the whole loop with code-made assets; the author's fal asset step is optional and paid.
FunPlay Skill
14 MIT agent skills for game development with scripts and tests: sprite-sheet slicing, normal maps, audio conversion, game concept briefs, browser game slices, Unity MCP workflow and Cocos/WeChat minigame rules.
open-game-skills
An MIT pack of about 190 SKILL.md agent skills for game design: combat feel, camera, traversal, world, validation, 2D/Spine and art pipeline, with a dispatcher and adapters for Three.js, PixiJS, Phaser, Cocos, Godot, Unity and Unreal.