playwright-recording
Skill5 starsChanged 8 months agoMITView on GitHub
Record browser interactions as video using Playwright. Capture demo videos, app walkthroughs, and UI flows. Includes cursor highlighting, click ripple effects, cookie banner dismissal, and window scaling patterns. Use when: record demo, capture browser video, screen recording, walkthrough footage.
- Installs packages
5 other projects use a version of this, 5 of them edited.
Adopted by
Most recently taken up by
- OpenMontageInc/OpenMontageedited, first seen Nov 8, 2026
- digitalsamba/claude-code-video-toolkitedited, first seen Nov 8, 2026
- calesthio/OpenMontageedited, first seen Nov 8, 2026
- Gopyr/gopyr-skills-hubedited, first seen Oct 11, 2026
- LinHao-city/StoryMindedited, first seen Jun 30, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 5
- calesthio/OpenMontage★ 78k24% same
- OpenMontageInc/OpenMontage★ 78k24% same
- digitalsamba/claude-code-video-toolkit★ 2.5k24% same
- LinHao-city/StoryMind★ 1024% same
- Gopyr/gopyr-skills-hub★ 013% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository29 other files it gives its agents.
- skills/architect/CLAUDE.mdCLAUDE.md
- skills/council/CLAUDE.mdCLAUDE.md
- agent-browserSkill
- app-store-screenshotsSkill
- architectSkill
- architecture-reviewerSkill
- c-cpp-analyzerSkill
- councilSkill
- c-to-rust-migrationSkill
- demo-pipelineSkill
- e2e-pipelineSkill
- founder-modeSkill
- full-evalSkill
- hackathon-jurySkill
- idea-labSkill
- ios-glass-ui-designerSkill
- learn-by-mistakeSkill
- maestro-mobile-testingSkill
- migration-validatorSkill
- mobile-design-systemSkill
- noricum-devSkill
- oss-readinessSkill
- pdf-presentationSkill
- post-run-analysisSkill
- rust-migrationSkill
- ui-ux-polishSkill
- vc-evaluatorSkill
- webreelSkill
- youtube-devrelSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Use this skill when you need a fast, scriptable way to capture browser video without the overhead of a full production pipeline.
- Distinctive: line 36
Create a TypeScript file that launches a browser context with video recording enabled:
- Very specific: line 199
Chromium not installed: Run npx playwright install chromium.
- Very specific: line 201
Black/empty video: Ensure context.close() is called before browser.close() — the video is finalized on context close.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Playwright Video Recording
Record browser interactions as video using Playwright — quick capture of demos, walkthroughs, and UI flows during development.
When to Use This vs Other Recording Skills
| Need | Use |
| Scripted demos with cursor animation, overlays, themes | webreel |
| Quick browser capture during development | playwright-recording (this skill) |
| Natural language -> automated recording pipeline | demo-pipeline |
| Live browser interaction with element refs | agent-browser |
Use this skill when you need a fast, scriptable way to capture browser video without the overhead of a full production pipeline. Write a TypeScript script, run it, get a .webm file.
Workflow
Step 1: Setup
npm init -y
npm install -D playwright @playwright/test
npx playwright install chromiumStep 2: Write Recording Script
Create a TypeScript file that launches a browser context with video recording enabled:
import { chromium } from 'playwright';
async function record() {
const browser = await chromium.launch({ slowMo: 50 });
const context = await browser.newContext({
viewport: { width: 1920, height: 1080 },
recordVideo: {
dir: './recordings',
size: { width: 1920, height: 1080 }
}
});
const page = await context.newPage();
// Recording actions
await page.goto('https://example.com');
await page.waitForTimeout(2000);
await page.click('button.demo');
await page.waitForTimeout(3000);
// Close to save video
await context.close();
await browser.close();
console.log('Recording saved to ./recordings/');
}
record();Step 3: Run
npx tsx scripts/record-demo.tsStep 4: Convert (optional)
Playwright outputs WebM. Convert to MP4 if needed:
ffmpeg -i recording.webm -c:v libx264 -crf 20 -preset medium -movflags faststart output.mp4Recording Patterns
Viewport Sizes
// Standard 1080p (recommended)
viewport: { width: 1920, height: 1080 }
// 720p (smaller files)
viewport: { width: 1280, height: 720 }
// Square (social media)
viewport: { width: 1080, height: 1080 }
// Mobile
viewport: { width: 390, height: 844 } // iPhone 14Cursor Highlighting
Playwright does not show a cursor by default. Inject one:
await page.addStyleTag({
content: `
* { cursor: none !important; }
.playwright-cursor {
position: fixed;
width: 24px; height: 24px;
background: rgba(255, 100, 100, 0.5);
border: 2px solid rgba(255, 50, 50, 0.8);
border-radius: 50%;
pointer-events: none;
z-index: 999999;
transform: translate(-50%, -50%);
transition: transform 0.1s ease;
}
.playwright-cursor.clicking {
transform: translate(-50%, -50%) scale(0.8);
background: rgba(255, 50, 50, 0.8);
}
`
});
await page.evaluate(() => {
const cursor = document.createElement('div');
cursor.className = 'playwright-cursor';
document.body.appendChild(cursor);
document.addEventListener('mousemove', (e) => {
cursor.style.left = e.clientX + 'px';
cursor.style.top = e.clientY + 'px';
});
document.addEventListener('mousedown', () => cursor.classList.add('clicking'));
document.addEventListener('mouseup', () => cursor.classList.remove('clicking'));
});Note: Injected DOM elements appear in the video. Re-inject after navigation since they reset on page load.
Cookie Banner Dismissal
const COOKIE_SELECTORS = [
'#onetrust-accept-btn-handler',
'#CybotCookiebotDialogBodyButtonAccept',
'.cc-btn.cc-dismiss',
'[class*="cookie"] button[class*="accept"]',
'button:has-text("Accept all")',
'button:has-text("Got it")',
];
async function dismissCookieBanners(page) {
await page.waitForTimeout(500);
for (const selector of COOKIE_SELECTORS) {
try {
const btn = page.locator(selector).first();
if (await btn.isVisible({ timeout: 100 })) {
await btn.click({ timeout: 500 });
return;
}
} catch { /* try next */ }
}
}Window Scaling for Laptops
Record at full 1080p while showing a smaller window:
const scale = 0.75;
const context = await browser.newContext({
viewport: { width: 1920 * scale, height: 1080 * scale },
deviceScaleFactor: 1 / scale,
recordVideo: { dir: './recordings', size: { width: 1920, height: 1080 } },
});Example Output
Running a recording script produces:
$ npx tsx scripts/record-homepage.ts
Starting recording: homepage-walkthrough
Navigating to https://myapp.com ...
Clicking "Get Started" ...
Filling demo form ...
Submitting ...
Recording saved: ./recordings/abc123def456.webm (14.2s, 1920x1080, 8.3MB)
Convert to MP4:
ffmpeg -i ./recordings/abc123def456.webm -c:v libx264 -crf 20 -movflags faststart ./recordings/homepage-walkthrough.mp4The output is a .webm video file in the configured directory. The filename is auto-generated by Playwright — rename or move it in your script using page.video()?.saveAs('desired-name.webm').
Tips
- Use slowMo — 50-100ms makes actions visible to viewers
- Add waitForTimeout — pause between actions for comprehension
- Wait for animations — use
waitForLoadState('networkidle') - Test without recording first — debug before final capture
- Clear browser state — use fresh context for clean demos
- Use headless: false for debugging, headless: true for final capture
Error Handling
- Chromium not installed: Run
npx playwright install chromium. If on CI, add to setup step. - Video codec issues: Playwright outputs VP8 in WebM. If your player can't handle it, convert with
ffmpeg -i input.webm -c:v libx264 output.mp4. - Black/empty video: Ensure
context.close()is called beforebrowser.close()— the video is finalized on context close. - Recording too large: Reduce viewport size or use shorter
waitForTimeoutdurations. - Injected elements lost after navigation: Re-inject cursor/overlays in a
page.on('load')handler. - Permission denied on Linux: Playwright may need
--no-sandboxflag:chromium.launch({ args: ['--no-sandbox'] }).
Structure
playwright-recording/
├── SKILL.md # This file
└── reference.md # Full API reference, selectors, timing utilitiesDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

