simiancraft/simiancraft-skills/playwright-gif-capture
Claude Code and agent skill by simiancraft/simiancraft-skills
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Specialization of playwright-harness for capturing an ANIMATED GIF of web content: drive a page/canvas/WebGL animation, grab a sequence of frames, and encode a looping GIF. Use when the task is "make a gif of this", "grab a gif of the demo/animation/shader", "record the canvas as a gif", or "capture a looping clip for a PR/README/issue"; any time a still screenshot is not enough. Read playwright-harness FIRST for script conventions and execution. For the quality/size dials (preventing deep-fried color, janky frame rate, or oversized files) read references/gif-optimization.md rather than guessing. Validated on Linux/WSL, headless Chromium + ANGLE, against WebGL canvas content.
Install
npx vskill@latest install simiancraft/simiancraft-skills/playwright-gif-captureSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as simiancraft/simiancraft-skills/playwright-gif-capture.
GIF Capture: specialization of playwright-harness
Read `playwright-harness` first. The base owns prerequisites, the run pattern (write to /tmp/pw-*.mjs, run with playwright resolvable), and the drive/assert
- WebGL-GPU patterns. This skill changes only how you turn a running animation
into frames. Encoding and the quality/size tradeoffs live in `references/gif-optimization.md`; open it before tuning, since a deep-fried, janky, or oversized GIF is easy to make by accident.
Headless is required here (not just the default): the encode is offline and you want clean, chrome-free frames.
Prerequisites (in addition to the base)
ffmpegto encode frames/video into a GIF;npm i ffmpeg-staticin a /tmp dir
gives a binary path, no system install.
- For tuning,
gifski(best on gradients) andgifsicle(size reduction); see
references/gif-optimization.md. ImageMagick is an optional alternative.
Capture the frames. Two ways.
A. Frame-by-frame screenshots (default)
The default for canvas, WebGL, or any clock-driven animation. Drive the clock yourself, one frame at a time, and screenshot each step: deterministic (same frames every run), evenly spaced (no wall-clock jitter, so no jank), croppable to an element, and it sidesteps the recordVideo GPU-death trap below.
The clean version needs a render-at-time hook on the page (window.__renderAtTime(t) sets the clock and draws one frame). If the app only has a free-running requestAnimationFrame loop, either (a) add a tiny hook for the capture, or (b) fall back to wall-clock sampling: waitForTimeout(1000/FPS) between shots, accepting minor unevenness. Capture exactly one period of a periodic animation so it loops seamlessly.
B. Playwright recordVideo (DOM/CSS animations you cannot time-step)
Real-time, whole viewport, no hook needed. Two costs: it records wall-clock (so it inherits any jank), and under heavy GPU load it can kill the GPU process mid-record and the rest goes black (cranked WebGL + recordVideo is the known offender). For canvas/shader content prefer method A, or record at a light load.
Encode to a GIF
A sane default to get a watchable loop (ffmpeg-static via npm i in /tmp; npm, not bun, since the postinstall downloads the binary):
Then stop guessing and open `references/gif-optimization.md` for the color/fps/size tradeoff model, the tool matrix (ffmpeg vs gifski vs gifsicle vs ImageMagick), and the target-size loop. The short version: banding/deep-fried, raise the dither or switch to gifski; too large, trade dims, then duration, fps, colors, then a gifsicle lossy pass; janky, capture by method A at a fixed clock and encode at the capture fps (12 to 20 is the sweet spot).
Always print the output byte size and Read the GIF back (vision) before shipping.
GPU note (delta)
The base's WebGL/GPU caveat applies verbatim; the launch args above already use it. For shader content the ANGLE relaunch is mandatory (heavy shaders no-op under SwiftShader headless), and you must let the animation settle a second or two (PSO compile) before the first captured frame. See playwright-harness, "WebGL / GPU caveat".
Embedding the GIF in a GitHub PR / issue / README
GitHub's inline drag-and-drop upload (user-attachments) has no API, so an agent cannot post one that way. The working pattern: commit the GIF to a never-merge assets branch (e.g. evidence/issue-verification) and embed it by raw.githubusercontent URL (), which renders and animates inline. Push that branch from a detached worktree with --no-verify (an assets worktree has no node_modules, so a pre-commit hook manager such as lefthook or husky would fail). Never open a PR from the assets branch. For a committed README asset, a normal commit on the feature branch is fine; mind the repo's size budget.
Scope
- CAN: produce a reproducible, tight animated GIF of any web/canvas/WebGL
animation; crop to an element; control frame count, fps, size, and palette; capture the real deployed site (point TARGET_URL at it).
- CANNOT: prove real-time FPS/perf (frame-by-frame is a controlled
reconstruction at a chosen fps, not a measurement; use a GPU-time meter for cost); capture audio; or render a single frame so heavy it trips the OS GPU watchdog (split the work or lower the load first).
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/playwright-gif-capture/SKILL.md
Popularity
- Repository stars
- 8
- 7-day trend score
- 11
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/simiancraft/simiancraft-skills/playwright-gif-capture)