Recording Feature Demos
Record a captioned MP4 with the Chrome DevTools MCP screencast. An injected page overlay renders captions and click rings, so the recording captures them. Narration is optional. File paths below are relative to this skill's base directory.
Preflight (stop on any failure, no fallbacks)
screencast_start/screencast_stopavailable (load via ToolSearch if deferred). Missing: user adds--experimentalScreencast=trueto the chrome-devtools MCP args and restarts.which ffmpeg. Missing:brew install ffmpeg.curl -sI <url>succeeds. Failing: ask for the URL or to start the dev server.
Captions come only from the overlay: ffmpeg drawtext/subtitles are often not compiled in, and GitHub ignores soft subtitle tracks.
1. Storyboard (approval REQUIRED before recording)
Source the flow:
- Feature built in this session: from the diff and conversation.
- Existing feature: from the user's description, then the relevant routes/components in the code and a
take_snapshotof the running app.
If any row would lack a concrete start URL, action target, or visible result, ask before drafting. Use one AskUserQuestion with only the questions whose answers are still unknown:
| Header | Question | Options |
|---|---|---|
| Audience | Who is the video for? | PR reviewers · Team/stakeholders · End users (how-to) |
| Scope | How much should it cover? | Happy path · Happy path + one edge case · Full tour |
| Length | How long? | Short (~20 s) · Medium (~45 s) |
| Start | Which starting state? | Current data · Specific account or data (user types it) |
Steps of the flow still unclear: ask in plain text. Then draft the storyboard. Present this table:
| # | Caption (≤ 8 words) | Actions | Hold (minimum) |
|---|
Target 20–60 s. List the starting data the take needs. Ask before seeding or clearing persisted data.
Every element a scene clicks must already exist at the Setup snapshot: uids are fixed before the take, so an item created mid-take can't be clicked. Seed such items in Setup; creating new ones on camera is fine as long as nothing clicks them later.
Then call AskUserQuestion once with exactly these two questions and options:
| Header | Question | Options |
|---|---|---|
| Storyboard | Record this storyboard? | Approve · Revise |
| Audio | Captions only, or a voice? | Captions only · Captions + female voice (af_heart) · Captions + male voice (am_michael) · Captions + British voice (bf_emma) |
Revise → update the table and ask again. Any voice option, or another Kokoro voice name typed in → follow reference/narration.md with that voice before step 2.
2. Setup (not recorded)
Every chrome-devtools call takes the pageId from new_page/list_pages.
new_pageorselect_page, then reload for clean state. Never callresize_page: the video keeps the current window size.- Seed the starting data, then
take_snapshotfor uids. Never guess selectors. Re-snapshot after any reload: uids change. - Read
scripts/demo-overlay.jsand pass its contents unchanged as theevaluate_scriptfunction. Re-running is safe; it works under strict CSP. - Smoke test:
() => __demo.caption('Test'), thentake_screenshot. If the caption covers key UI,() => __demo.position('top'). () => window.innerWidthgives<width>, the encode width in CSS pixels. Don't resize the window from here until the take ends.- Pre-set scene 1's caption:
() => __demo.caption('…').mark()logs it at offset 0.
3. Record: one message, in this order
Tool calls in one message run sequentially without model latency in between, so the whole take goes in a single message:
screencast_startwithoutfilePath(paths outside the MCP workspace roots are rejected).() => __demo.mark()() => __demo.hold(<scene 1 hold>), scene 1's actions, then per later scene:() => __demo.caption('…', <hold>)sets the caption and resolves after the hold.- Actions by uid (
click,fill,press_key). For on-camera typing,clickthe input, thentype_text(types key by key;fillsets the value instantly). () => __demo.hold(2000)on the result. Skip it when a transient state (toast) needs the next caption right away.
() => __demo.caption('', 1000), thenscreencast_stop.
Copy the file screencast_stop reports to the scratchpad as raw.mp4.
Hash or History API route changes keep the overlay. A full page load or reload mid-take wipes it: end the message there, re-snapshot, re-inject, continue. Wrong click or missed state: reset and re-record the whole take. Never splice.
4. Verify and encode
ffprobe -v error -show_entries format=duration -of csv=p=0 raw.mp4
ffmpeg -v error -y -i raw.mp4 -vf "fps=1,scale=320:-1,tile=6x10" -frames:v 1 sheet.png # Read it
mkdir -p ~/Documents/Screencasts
ffmpeg -v error -y -i raw.mp4 -vf scale=<width>:-2 -c:v libx264 -crf 28 -preset slow \
-pix_fmt yuv420p -movflags +faststart -an ~/Documents/Screencasts/<project>-<feature>-<YYYYMMDD>.mp4
The sheet holds one frame per second for up to 60 s; black cells are padding. It must show legible captions from the first frame and every key state. Click rings last 0.8 s and may fall between sampled frames.
With narration, replace the last command with scripts/mix-narration.sh (see the reference).
For a PR, the file must be < 10 MB (GitHub free-plan limit). Raw frames are devicePixelRatio× the window (2× on Retina), hence the scale back to <width>. Still over: a smaller width (e.g. 75% of <width>) or a shorter storyboard.
5. Report
Give the path, duration, size, and caption list. Never commit the file.
For a PR, ask before uploading: an attachment is visible to everyone who can see the PR. On approval, append it to the description with gh pr edit <number> --attach <file>, or post it as a comment with gh pr comment <number> --attach <file>. --attach needs gh ≥ 2.99.0 (gh --version). On older versions, the user drags the file into the description.
Common Mistakes
| Mistake | Fix |
|---|---|
| Long frozen opening | screencast_start belongs in the same message as the take |
| Captions vanish mid-video | A navigation wiped the overlay. Re-inject after it. |
click fails with an unknown uid | A reload or re-render changed uids. Re-snapshot. |
| Target created during the take | It has no uid yet. Seed it in Setup instead. |
| Overlay retyped with edits | Pass the file contents unchanged |