agentleFS
5uck1ess5uck1ess/devkit/skills/screenshot/SKILL.md

screenshot

Skill4 starsChanged 4 months agoMITView on GitHub

Capture a screenshot or PDF of a web page — use when asked to screenshot a URL, capture a page, take a picture of a website, generate a visual snapshot, or save a page as PDF. Supports full page, element selector, device emulation, and custom viewport.

51 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use spreadsheet, obsidian-vault and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • JetBrainsSkill

    spreadsheet

    Use when tasks involve creating, editing, analyzing, or formatting spreadsheets (`.xlsx`, `.csv`, `.tsv`) with formula-aware workflows, cached recalculation, and visual review.

    Also in 3 projects that use this

  • simo97Skill

    obsidian-vault

    Also in 4 projects that use this

  • JetBrainsSkill

    slides

    Create and edit presentation slide decks (`.pptx`) with PptxGenJS and render/validation utilities. Use when tasks involve building a new PowerPoint deck, recreating slides from screenshots/PDFs/reference decks, modifying slide content while preserving editable output, adding charts/diagrams/visuals, or diagnosing layout issues such as overflow, overlaps, and font substitution.

    Also in 5 projects that use this

  • simo97Skill

    edit-article

    The user will invoke this skill to help them edit an article.

    Also in 3 projects that use this

  • LesaniSkill

    writing-beats

    Shape an article as a journey of beats, choose-your-own-adventure style. The user picks a starting beat from the raw material, you write only that beat, then offer options for where to pivot next, beat by beat, until the article reaches a natural end. Use when the user has raw material and wants to assemble it as a narrative rather than an argument.

    Also in 3 projects that use this

  • LesaniSkill

    writing-shape

    Take a markdown file of raw material and shape it into an article through a conversational session — drafting candidate openings, growing the piece paragraph by paragraph, arguing about format (lists, tables, callouts, quotes) at each step. Use when the user has a pile of notes, fragments, or a rough draft and wants help turning it into something publishable.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 47 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run npx playwright --version.

    line 12
  2. Distinctive:

    If the page failed to load, report the error clearly with the HTTP status or timeout reason.

    line 96

“Common” is measured: kept by at least 6 in 10 of the 47 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Web Page Screenshot

Capture screenshots and PDFs of web pages using Playwright.

Step 1: Verify Playwright

Run npx playwright --version. If it fails, stop and tell the user: Playwright required — install with: npx playwright install chromium. Do not attempt workarounds.

Step 2: Parse and Validate

Extract from the user's request:

  • URL — required; validated below
  • Output path — default ./screenshot-{timestamp}.png in cwd
  • Capture mode — viewport (default), full-page, element selector
  • Device / viewport — optional emulation or custom size
  • Format — PNG (default) or PDF

Validate the URL (see Rules for the full list): only http(s), no private/reserved IPs or cloud metadata, no @. On rejection, report the exact reason and stop — never silently skip in a batch.

Step 3: Execute

Choose the command that matches the capture mode. Always quote the URL and output path.

Viewport screenshot:

npx playwright screenshot "{url}" "{output}"

Full-page screenshot:

npx playwright screenshot --full-page "{url}" "{output}"

Custom viewport (format is W,H with no spaces, e.g. 1280,800):

npx playwright screenshot --viewport-size=1280,800 "{url}" "{output}"

Device emulation:

npx playwright screenshot --device="{device}" "{url}" "{output}"

PDF output:

npx playwright pdf "{url}" "{output}.pdf"

Element selector (Playwright CLI doesn't expose this directly, so write a script file and pass args via process.argv — never interpolate user strings into node -e):

cat > /tmp/devkit-shot-element.mjs <<'EOF'
import { chromium } from 'playwright';

const [, , url, selector, output] = process.argv;
if (!url || !selector || !output) {
  console.error('usage: node devkit-shot-element.mjs <url> <selector> <output>');
  process.exit(2);
}

const browser = await chromium.launch();
try {
  const page = await browser.newPage();
  await page.goto(url, { waitUntil: 'networkidle', timeout: 30000 });
  await page.locator(selector).screenshot({ path: output });
  console.log(output);
} catch (err) {
  console.error('screenshot failed:', err.message);
  process.exit(1);
} finally {
  try { await browser.close(); } catch (e) { /* suppress close errors */ }
}
EOF

node /tmp/devkit-shot-element.mjs "$URL" "$SELECTOR" "$OUTPUT"

Pass all user values via shell variables. The .mjs reads them from process.argv so quoting, $(), and backticks in the input can't escape.

Step 4: Report

Output the absolute path and any metadata:

Screenshot saved: /abs/path/to/file.png
Size: 342 KB
Mode: full-page

If the page failed to load, report the error clearly with the HTTP status or timeout reason.

Rules

  • URL validation — only http:// and https://. Reject file://, ftp://, data:, and all other schemes. Reject private/reserved IPs: localhost, 127.0.0.1, 0.0.0.0, 10.x.x.x, 172.16-31.x.x, 192.168.x.x, 169.254.x.x (cloud metadata — AWS/GCP/Azure), [::1] — unless user explicitly tests localhost. Reject URLs with @. On rejection: report exact reason and stop, never silently skip.
  • No raw interpolation — for the element-selector script, pass values via shell variables and process.argv, never via node -e "..." with user input.
  • Headless only — never open a visible browser window.
  • Respect gated content — don't screenshot login-walled or paywalled content the user doesn't own.
  • Default to cwd — put output files in the current working directory unless the user specifies otherwise.
  • Close safely — when using an inline script, wrap browser.close() in its own try/catch inside finally so a close-time error can't mask the real error.

Download now (ZIP)

Does 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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.