Pr demo video

From SkillfulAgents/SuperAgent · View interactive version

Pr demo video is an AI agent skill from the GitHub repository SkillfulAgents/SuperAgent. Record a short demo video of a UI change with Playwright and embed it in the PR description or a PR comment with `gh --attach`. Use when a PR changes something a reviewer should see move, or when the user asks for a demo clip.

How to use this skill

Skill file

PR demo video

Record the flow once with Playwright (video is a config flag, no screen recorder), turn the recording into a small mp4, and upload it straight into the PR body with the GitHub CLI. Nothing is committed to the repo; the clip lives on GitHub's attachment CDN and renders as an inline player.

When to use

Prerequisites

1. Record

Playwright records one .webm per page when video is on. Use a dedicated config so the recording run never touches the normal suite's settings:

// playwright.<name>.config.ts
export default defineConfig({
  testDir: './e2e/<where the demo spec lives>',
  workers: 1, retries: 0,
  use: {
    baseURL,
    viewport: { width: 1440, height: 900 },
    video: { mode: 'on', size: { width: 1440, height: 900 } },
    trace: 'retain-on-failure',      // 'on' writes a large zip alongside the video
    screenshot: 'only-on-failure',
  },
})

Write the demo as a normal spec, then pace it for a viewer:

Run it and pipe the output through tee as usual:

E2E_MOCK=true npx playwright test --config playwright.<name>.config.ts 2>&1 | tee /tmp/demo-run.txt

The recordings land under the config's outputDir, in a folder named after the test: video.webm for the first page, video-1.webm for the second, and so on.

Popups and second pages

A window.open popup (OAuth login, external link) is its own page and gets its own video file. To fold it into one clip, note wall-clock marks in the spec (Date.now() at test start, at popup open, at test end), write them to test.info().outputDir (create the dir first: Playwright makes it lazily), and overlay the popup recording on the main one. e2e/live/mcp-hot-add/compose-video.mjs does exactly that with ffmpeg: it corrects for the main recording starting a few seconds after the test body, crops the popup to its centred content, and places it top-right so it never covers the composer area.

2. Convert

GitHub accepts webm, but mp4 plays everywhere and is smaller:

ffmpeg -y -loglevel error -i video.webm \
  -c:v libx264 -preset medium -crf 20 -pix_fmt yuv420p -r 25 -movflags +faststart -an \
  demo.mp4

Check the result before uploading: ffprobe -v error -show_entries format=duration -of csv=p=0 demo.mp4, and pull a couple of frames (ffmpeg -ss 12 -i demo.mp4 -frames:v 1 frame.png) and look at them. A clip that starts on a blank page or ends before the final state is worth re-recording.

Limits: 10 MB for images and GIFs; video is 10 MB on Free plans and 100 MB on paid plans. A 45 s 1440×900 clip at CRF 20 is about 1 MB.

3. Upload into the PR

Reference the local file in the PR body markdown and pass the same path to --attach. gh uploads the file and rewrites the reference in place to a https://github.com/user-attachments/assets/... URL, which GitHub renders as an inline player when it sits on its own line.

## Demo

One sentence on what the viewer will see, in order.

![Demo](./demo.mp4)
gh pr edit <number> --body-file pr-body.md --attach ./demo.mp4
# or on creation:
gh pr create --title "..." --body-file pr-body.md --attach ./demo.mp4
# or as a comment, e.g. a before/after on a follow-up push:
gh pr comment <number> --body "After the fix:" --attach ./after.mp4

Rules that bite:

Verify the rewrite happened:

gh pr view <number> --json body --jq .body | grep -n user-attachments

4. Say what the clip shows

In the PR body, above the player, describe the sequence in one or two sentences and name what the reviewer should notice (the thing that used to be there and is not, or the state that now appears). A video without that line is a puzzle.

Cleanup

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.