Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计异常

localhost-screenshots本地主机截图

Agent Skill

localhost-screenshots 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

509

周安装

21

GitHub Stars

公开资料未说明

下载量

166
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:localhost-screenshots(本地主机截图)
来源仓库:https://github.com/t4sh/skills4sh
仓库路径:skills/localhost-screenshots
安装命令:
npx skills add https://github.com/t4sh/skills4sh --skill localhost-screenshots
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/t4sh/skills4sh --skill localhost-screenshots

简介

localhost-screenshots 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合整理项目状态和变更事项。

  • 适用于围绕仓库状态、代码变更或协作事项进行信息梳理的场景。
  • 通过安装命令添加到宿主环境后,可结合原始 README 核验具体用法。
  • 安装前需确认权限范围、维护状态,避免触发联网或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Localhost Screenshots

Installation

npx skills add t4sh/skills4sh --skill localhost-screenshots

This skill captures screenshots of locally running websites. It supports two primary approaches depending on the task:

  • Chrome MCP — for quick debugging, single screenshots, and interactive verification
  • Playwright — for systematic multi-breakpoint screenshot sets and visual regression

For niche scenarios (CDP attach, persistent sessions, AI snapshots, CI workflows), see the Reference Files section.

Tool Decision Matrix — Read This First

NeedToolWhy
Quick visual check / debugChrome MCPAlready connected to user's real browser, sees localhost
Verify a JS fixChrome MCPExecute JS in live page context
One or two screenshotsChrome MCPInstant, no setup
Interactive debuggingChrome MCPClick, fill, inspect state in real browser
Systematic multi-breakpoint setPlaywrightAutomated viewport resizing across 8 breakpoints
Before/after comparisonPlaywrightStructured comparison HTML output
Visual regression testingPlaywrightRepeatable, scriptable, consistent

Chrome MCP — Quick Screenshots & Debugging

Use a Chrome-connected MCP for one or two screenshots or interactive debugging. It drives the user’s real browser, which can already reach their localhost dev server. No Playwright install required.

MCP tool names (map to the host's server)

Identifiers differ by host. Map capabilities to the host server's actual tools:

StepCapabilityClaude Chrome MCP (example)Cursor cursor-ide-browser
TabCreate or select tab…tabs_context_mcp({createIfEmpty: true})browser_tabs (per server docs)
NavigateOpen URL…navigate({url})browser_navigate
ScreenshotCapture viewport…computer({action: "screenshot"})browser_take_screenshot
ResizeViewport / window…resize_window({width, height})Resize tools if available, or devtools
Run JSEvaluate in page…javascript_tool({action: "javascript_exec", text})Follow the server's evaluate / snapshot workflow

Follow the MCP server's lock/snapshot rules (e.g. Cursor: snapshot before structural changes).

Prerequisites

The user's dev server must be running (e.g., npx @11ty/eleventy --serve --port=3000).

Quick screenshot flow (pattern)

  1. Ensure a browser tab (create if empty).
  2. Navigate to http://localhost:<port>/<path>.
  3. Take a viewport screenshot.
  4. Optionally resize, then screenshot again.

Example: Claude Chrome MCP

mcp__Claude_in_Chrome__tabs_context_mcp({ createIfEmpty: true })
mcp__Claude_in_Chrome__navigate({ url: "http://localhost:3000/dashboard/" })
mcp__Claude_in_Chrome__computer({ action: "screenshot" })
mcp__Claude_in_Chrome__resize_window({ width: 375, height: 812 })
mcp__Claude_in_Chrome__computer({ action: "screenshot" })

Example: Cursor IDE browser

Navigate with browser_navigate, then browser_take_screenshot. Use browser_snapshot before interactions; follow cursor-ide-browser server instructions for lock/unlock if required.

Debugging patterns (run JS in page)

Payload examples (wrap in the MCP's JS action):

JSON.stringify(Object.keys(window.MyApp || {}))
JSON.stringify(getComputedStyle(document.querySelector('.target')).background)
JSON.stringify(document.querySelector('.target').getBoundingClientRect())
JSON.stringify({ title: document.title, url: location.href, stylesheets: document.querySelectorAll('link[rel=stylesheet]').length })

Claude Chrome MCP shape:

mcp__Claude_in_Chrome__javascript_tool({
  action: "javascript_exec",
  text: "<escaped one-line string>"
})

When NOT to Use Chrome MCP for Screenshots

  • When all 8 breakpoints need capture systematically — use Playwright
  • When repeatable, scriptable visual regression is required — use Playwright
  • When generating a before/after comparison HTML — use Playwright

Playwright — Systematic Multi-Breakpoint Screenshots

Use Playwright for automated, repeatable screenshot sets across all breakpoints. This is the right tool for visual regression testing and comprehensive responsive documentation.

Golden Rules

  1. Always use Playwright’s bundled Chromium. Never use Puppeteer, Selenium, or system Chrome. Do not check for installed browsers.
  2. Prefer HTTP; file:// only for self-contained static HTML. Serve over HTTP whenever a dev server, build output, or npx serve is available. file:// is acceptable *only* when the page has no fetch/XHR to sibling files, no <script type="module">, no service workers, and no absolute /asset paths — otherwise those will break silently. When in doubt, serve over HTTP.

Setup (run once per session)

node -e “require(‘playwright’)” 2>/dev/null || npm install playwright 2>/dev/null
npx playwright install --with-deps chromium

Do not use @latest — let the project’s lockfile control the version.

Quick workflow

  1. Ensure the site is served over HTTP (user’s dev server, or npx serve _site -l 3000 &).
  2. Verify the server responds before screenshotting (see playwright-patterns.md § “Verifying the Server”).
  3. Capture all 8 standard breakpoints (320–1920px) unless the user asks for specific sizes. Check the project’s CSS/Tailwind config for custom breakpoints first.
  4. Save to _screenshots/ in the project folder.

For the canonical screenshot script, standard breakpoints array, serving patterns, server verification, waiting for dynamic content, element screenshots, persistent sessions, and when the dev server isn’t running — see references/playwright-patterns.md.

Output structure

_screenshots/
  home/
    mobile-sm-320x568.png
    mobile-375x812.png
    ...
    wide-1920x1080.png
  about/
    ...

Before/after visual comparison

Run the canonical script twice (_screenshots/before, _screenshots/after), then generate a comparison HTML. For the comparison script and pixel-diff scoring, see references/visual-regression.md.

Key API notes

  • chromium.launch() — no arguments, uses Playwright’s bundled Chromium
  • waitUntil: ‘networkidle’ — good for static sites. SPAs with analytics/websockets may never go idle — use load + waitForSelector instead
  • fullPage: true — captures entire scrollable page
  • Create a new page per breakpoint — avoids leftover state
  • page.setViewportSize() — set before navigating for accurate responsive rendering

What NOT to Do

See references/troubleshooting.md § "What NOT to Do" for the full list. Key items: no Puppeteer, no JSDOM, no system Chrome binaries, no file:// paths, always capture all breakpoints.


Related Skills

Built-in (Claude Code):

  • dev-browser — browser automation with persistent page state. Useful for interactive captures and manual navigation before screenshotting

On skills.sh:

  • screenshot-local — shot-scraper (Playwright-based) for localhost captures with custom viewports, element targeting, and batch YAML configs. Lighter-weight alternative when a full regression pipeline isn't needed
  • visual-regression-tester — automated visual regression via Playwright, Chromatic, or Percy with multi-viewport and CI/CD. Complements the pixel-diff reference in this skill
  • playwright-responsive-screenshots — MCP-only responsive captures at 3 breakpoints (mobile/tablet/desktop). Lighter scope; localhost-screenshots is a superset: two tracks (Chrome MCP for debug + Playwright for regression), 8 breakpoints with Tailwind/media-query detection, guided Playwright setup, in-page JS debugging, pre-flight checks, persistent sessions, visual-regression pipeline with pixel-diff, and framework-specific troubleshooting

Reference Files

For advanced patterns (CDP attach, persistent sessions, pixel-diff, AI snapshots, CI workflows), read these files from the references/ directory:

FileContents
references/playwright-patterns.mdPre-flight checks, serving patterns, persistent sessions, breakpoint detection, stdin-friendly script templates
references/visual-regression.mdPixel-diff scoring, comparison HTML generation, GitHub Actions CI/CD workflow
references/interaction-templates.mdAuth flows, e-commerce flows, state variations, interactive mode, core interaction primitives
references/ai-snapshots.mdAccessibility tree, DOM snapshots, interactive element maps, incremental DOM diff
references/troubleshooting.mdCommon issues by project type (SSG, Next.js, Tailwind, WordPress)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.25%
按下载量换算63

Claude

30.89%
按下载量换算51

Cursor

19.76%
按下载量换算33

Gemini CLI

8.96%
按下载量换算15

安全审计

Gen Agent Trust Hub

未通过

Socket

可疑

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills