agentleFS
flurdyflurdy/agent-skills/skills/browser-screenshot/SKILL.md

browser-screenshot

Skill9 starsChanged 4 months agoMITView on GitHub

Take a screenshot of the running web application for visual verification of UI/CSS changes. Use when iterating on frontend changes and need to see the result.

  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

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

    If $ARGUMENTS contains a URL, use it

    line 69
  2. Very specific:

    If $ARGUMENTS contains mobile, use mobile viewport (375x812)

    line 74
  3. Very specific:

    If $ARGUMENTS contains tablet, use tablet viewport (768x1024)

    line 75
  4. Very specific:

    If $ARGUMENTS contains a custom size like 1024x768, use those dimensions

    line 76
  5. Distinctive:

    Default: desktop viewport (1280x900)

    line 77
  6. Very specific:

    If $ARGUMENTS contains both, take two screenshots (desktop and mobile)

    line 78
  7. Distinctive:

    Keep both dimensions under 2000px to avoid image limit errors

    line 79
  8. Distinctive:

    Run the screenshot script via the project symlink:

    line 81
  9. Distinctive:

    If the symlink doesn't exist yet, create it first (see Setup above).

    line 87
  10. Distinctive:

    If the user asked you to fix a specific CSS issue, compare what you see against their description and suggest or apply fixes.

    line 99

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “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

Browser Screenshot

Capture screenshots of the web application for visual verification during UI/CSS iteration.

Setup

  1. Install playwright in the project (if not already):
npm install playwright
npx playwright install chromium
  1. Symlink the screenshot script into the project's scripts/ directory:

Resolve resources in Bash first. A nonempty absolute SKILLS_DIR is authoritative; never replace an invalid override silently. Otherwise prefer the canonical root, falling back to the Claude alias root only when this skill unit is absent. Legacy Codex-only roots require explicit SKILLS_DIR.

set -eu
if [[ -z "${SKILLS_DIR:-}" ]]; then
  SKILLS_DIR="$HOME/.agents/skills"
  if [[ ! -d "$SKILLS_DIR/browser-screenshot" ]]; then
    SKILLS_DIR="${CLAUDE_SKILLS_DIR:-${CLAUDE_HOME:-$HOME/.claude}/skills}"
  fi
fi
[[ "$SKILLS_DIR" = /* ]] || { echo "SKILLS_DIR must be absolute" >&2; exit 1; }
for resource in SKILL.md scripts/screenshot.sh; do
  [[ -f "$SKILLS_DIR/browser-screenshot/$resource" && -r "$SKILLS_DIR/browser-screenshot/$resource" ]] || {
    echo "Missing browser-screenshot resource: $resource" >&2; exit 1;
  }
done
[[ -x "$SKILLS_DIR/browser-screenshot/scripts/screenshot.sh" ]] || { echo "screenshot.sh is not executable" >&2; exit 1; }

Missing resources stop before linking. Preview actual source/destination paths and obtain setup approval; never overwrite an existing destination implicitly. Reuse the verified absolute root across tool calls (shell variables may not persist). Repeat approved setup after root migrations.

[[ ! -e scripts/screenshot && ! -L scripts/screenshot ]] || { echo "Destination exists: scripts/screenshot" >&2; exit 1; }
mkdir -p scripts
ln -s "$SKILLS_DIR/browser-screenshot/scripts/screenshot.sh" scripts/screenshot

Usage

/browser-screenshot
/browser-screenshot http://localhost:3000
/browser-screenshot http://localhost:3000 mobile

Instructions

  1. Determine the URL to screenshot:
    • If $ARGUMENTS contains a URL, use it
    • Otherwise use the SCREENSHOT_URL env var if set
    • Default: http://localhost:3000
  2. Determine the viewport:
    • If $ARGUMENTS contains mobile, use mobile viewport (375x812)
    • If $ARGUMENTS contains tablet, use tablet viewport (768x1024)
    • If $ARGUMENTS contains a custom size like 1024x768, use those dimensions
    • Default: desktop viewport (1280x900)
    • If $ARGUMENTS contains both, take two screenshots (desktop and mobile)
    • Keep both dimensions under 2000px to avoid image limit errors
  3. Run the screenshot script via the project symlink:
scripts/screenshot <url> <viewport>

If the symlink doesn't exist yet, create it first (see Setup above).

Screenshots are saved to a fresh private directory (mode 0700) created per run, unless you pass an explicit output path as the third argument. The script prints the full path it wrote — read it from the output rather than assuming a location. Screenshots may capture authenticated pages, which is why the directory is not a predictable shared one.

  1. Read the screenshot using the available image-reading tool to view the captured image. This is the critical step because the model can inspect the captured UI directly.
  2. Analyze the screenshot and report what you see, especially:
    • Layout issues (overlapping elements, alignment problems)
    • Spacing/margin problems
    • Color or styling discrepancies
    • Responsive behavior (if both viewports captured)
  3. If the user asked you to fix a specific CSS issue, compare what you see against their description and suggest or apply fixes.

Notes

  • The script uses waitUntil: 'networkidle' with a 15s timeout — if the page loads async content, the screenshot will wait for it.
  • Screenshots capture the viewport only (not full-page scroll) to stay within the 2000px image dimension limit.
  • For rapid iteration: make the CSS change, then run /browser-screenshot to verify, repeat.

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.