con un clic
capture-playwright
// Use when a screenshot or short video needs to be captured with Playwright and saved to local disk, with optional upload through `gh image` (upload requires explicit user approval and must target a PR or issue).
// Use when a screenshot or short video needs to be captured with Playwright and saved to local disk, with optional upload through `gh image` (upload requires explicit user approval and must target a PR or issue).
Use when Go test wall time is too high, CI test duration regresses, a package needs trace-driven test performance analysis, or tests should be made safely parallel with t.Parallel, package splitting, subprocess isolation, semaphores, or Go built-in tracing.
Use when working on middleman local development sessions that need backend and frontend on ephemeral/free ports, isolated generated config, copied SQLite state, or dev-ephemeral status JSON/PIDs.
Use when making small or localized changes that could still affect user-visible behavior, API contracts, database queries, test runtime, CI, generated artifacts, or cross-layer data flow.
Use when creating, editing, fixing, or reviewing tests; when adding mocks, assertions, smoke tests, unit tests, integration tests, e2e tests, or changing tests after failures.
Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.
CLI tools for Svelte 5 documentation lookup and code analysis. MUST be used whenever creating, editing or analyzing any Svelte component (.svelte) or Svelte module (.svelte.ts/.svelte.js). If possible, this skill should be executed within the svelte-file-editor agent for optimal results.
| name | capture-playwright |
| description | Use when a screenshot or short video needs to be captured with Playwright and saved to local disk, with optional upload through `gh image` (upload requires explicit user approval and must target a PR or issue). |
Generate the artifact with Playwright and save it to local disk. Do not upload by default.
Reference session: http://127.0.0.1:8080/sessions/opencode%3Ases_2826059aeffeEtdyCVsVwnKi6R
tmp/ or artifacts/ unless the user explicitly wants them committed.await page.screenshot({ path: "tmp/capture.png", fullPage: true });
const context = await browser.newContext({
recordVideo: { dir: "tmp/video", size: { width: 1440, height: 900 } },
});
const page = await context.newPage();
// ... drive the page ...
await context.close();
const videoPath = await page.video()?.path();
Stop here by default. Report the local artifact path to the user and open the image / video using open or xdg-open so that user can see the image. Only proceed to upload if the user explicitly requests it.
If the user approves upload, confirm the target PR or issue number first. Never upload without attaching to a specific PR or issue. Upload the file with gh image (the command prints a markdown snippet whose links already point at the uploaded content), then immediately attach it to the PR or issue via a comment — gh image alone does not bind the upload to any target:
# Upload and capture the markdown link
IMAGE_MD=$(gh image --repo owner/repo "tmp/capture.png")
# Attach to a PR or issue so the image is not a standalone upload
gh pr comment <number> --repo owner/repo --body "$IMAGE_MD"
# or for issues:
gh issue comment <number> --repo owner/repo --body "$IMAGE_MD"
gh image --repo owner/repo <file> alone is insufficient — it uploads without binding to a PR or issue. Always follow up with a comment command to attach.
For screenshots, the emitted markdown can usually be pasted as-is.
For videos, gh image may still emit image-style markdown like . GitHub PR descriptions and comments do not reliably inline .webm attachments from that syntax, so normalize it to a plain link such as [demo.webm](...) or https://... before pasting into a PR description or comment, video links need to be on their OWN line.
If video upload is rejected, keep the local video file, say that gh image appears image-only in this environment, and ask whether a screenshot link or a different upload path is preferred.
Check whether the extension is available:
gh image --help
If it is missing, install the extension used in the reference session:
gh extension install drogers0/gh-image
The reference session established that gh image may depend on GitHub web-upload cookies from a local browser profile. If errors mention cookies, browser profiles, Local State, Cookies, Chrome, Brave, Edge, or Chromium, do not assume gh auth login is enough.
Tell the user to sign in to GitHub in Chrome, Brave, Edge, or Chromium on that machine, then rerun gh image.
Return:
gh image and the target PR/issue