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

browser浏览器

Agent Skill

browser 用于处理浏览器自动化、网页检查和页面信息提取,适合在 Codex、Claude、Cursor、Gemini CLI 中需要让 Agent 打开页面、读取网页或验证前端流程时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,421

周安装

97

GitHub Stars

11,921

下载量

784
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/danielmiessler/personal_ai_infrastructure --skill Browser

简介

浏览器技能用于网页自动化和页面信息提取,支持多种浏览器操作。

  • 适用于网页测试、数据抓取和前端验证等场景。
  • 在使用前会检查用户自定义配置,发送语音通知,然后执行相应操作。
  • 使用时需要确保本地8888端口可用,并正确配置浏览器驱动。
  • browser 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Customization

Before executing, check for user customizations at: ~/.claude/PAI/USER/SKILLCUSTOMIZATIONS/Browser/

If this directory exists, load and apply any PREFERENCES.md, configurations, or resources found there. These override default behavior. If the directory does not exist, proceed with skill defaults.

MANDATORY: Voice Notification (REQUIRED BEFORE ANY ACTION)

You MUST send this notification BEFORE doing anything else when this skill is invoked.

  1. Send voice notification: curl -s -X POST http://localhost:8888/notify \ -H "Content-Type: application/json" \ -d '{"message": "Running the WORKFLOWNAME workflow in the Browser skill to ACTION"}' \ > /dev/null 2>&1 &
  2. Output text notification: Running the **WorkflowName** workflow in the **Browser** skill to ACTION...

This is not optional. Execute this curl command immediately upon skill invocation.

Browser v3.3.0 — CLI-First Browser Automation

playwright-cli first. Agents only when reasoning is needed. Stories and Recipes for composable automation.


Workflow Routing (READ THIS FIRST)

Trigger WordsWorkflowWhat It Does
"review stories", "run stories", "ui review", "validate stories"Workflows/ReviewStories.mdFan out YAML stories to parallel UIReviewers
"automate", "recipe", "template", or a recipe nameWorkflows/Automate.mdLoad and execute a parameterized recipe template
"update", "check version"Workflows/Update.mdVerify browser tools are current and working

If the user's request matches a trigger above, route to that workflow. Otherwise, use the decision tree below.


CLI-First Decision Tree

Every browser task enters this tree. Pick the FIRST match:

TaskToolTimeTokensCost
Multi-step interaction (navigate, click, fill, assert)playwright-cli -s=<name>~3s0Free
Screenshot a URLbunx playwright screenshot "<url>" <file>~2s0Free
Save page as PDFbunx playwright pdf <url> <file>~2s0Free
Dump page HTMLChrome --headless=new --dump-dom <url>~1s0Free
Check if page loadscurl -sf <url> > /dev/null<1s0Free
Verify after code changeplaywright-cli or bunx playwright screenshot + Read~3s0Free
Extract text contentplaywright-cli -s=<name> snapshot~2s0Free
AI-driven multi-step interaction (needs reasoning about what to do)BrowserAgent~30s~30K~$0.09
Structured test validation (user stories with assertions)UIReviewer~30s~30K~$0.09
Parallel page checks (8+ pages)Multiple BrowserAgents~30s~30K eachScales
Authenticated session (SSO, cookies, extensions)Headed Chrome via claude --chrome~6s0Free

The rule: playwright-cli handles most multi-step work for FREE. BrowserAgent costs 30K tokens — only pay for it when you need AI decision-making about what to click/type next.


Philosophy

Browser automation should use standard CLI tools, not custom code. playwright-cli provides named sessions with ref-based interaction for multi-step work. bunx playwright handles one-shot screenshots and PDFs. BrowserAgent provides AI reasoning for complex tasks. No custom code to maintain.

Headless by default. All automation runs headless. When the user says "show me", open the URL in their preferred browser from ~/.claude/PAI/USER/TECHSTACKPREFERENCES.md:

open -a "$BROWSER" "<url>"  # BROWSER from tech stack prefs

Tier 1: playwright-cli (Primary Tool — Zero Tokens)

playwright-cli (@playwright/cli) provides named sessions, accessibility snapshots, and ref-based element interaction. This is the PRIMARY browser tool for all multi-step work.

Session Lifecycle (CRITICAL)

Every playwright-cli session MUST follow this pattern:

# 1. OPEN a named session (--persistent keeps browser alive between commands)
playwright-cli -s=my-session open https://example.com --persistent

# 2. WORK — snapshot, click, fill, screenshot, etc.
playwright-cli -s=my-session snapshot
playwright-cli -s=my-session click e12
playwright-cli -s=my-session fill e15 "hello"
playwright-cli -s=my-session screenshot --filename=/tmp/shot.png

# 3. CLOSE — ALWAYS close when done. Non-negotiable.
playwright-cli -s=my-session close

If you don't close your session, you leave a zombie browser process.

Core Commands

# Navigation
playwright-cli -s=<name> open <url> --persistent   # Open URL in named session
playwright-cli -s=<name> goto <url>                 # Navigate within session

# Inspection (zero tokens — machine-readable)
playwright-cli -s=<name> snapshot                   # Accessibility tree with refs
playwright-cli -s=<name> screenshot --filename=<path>  # Visual capture

# Interaction (use refs from snapshot)
playwright-cli -s=<name> click <ref>                # Click element by ref
playwright-cli -s=<name> fill <ref> "<value>"       # Fill input by ref
playwright-cli -s=<name> type "<text>"              # Type text (keyboard)
playwright-cli -s=<name> press <key>                # Press key (Enter, Tab, etc.)
playwright-cli -s=<name> select <ref> "<value>"     # Select dropdown option
playwright-cli -s=<name> hover <ref>                # Hover over element

# JavaScript
playwright-cli -s=<name> eval "<js>"                # Execute JavaScript

# Session management
playwright-cli -s=<name> close                      # ALWAYS close when done

Ref-Based Interaction Pattern

The snapshot command returns an accessibility tree where every interactive element has a ref (e.g., e12, e34). Use these refs for reliable interaction:

# 1. Get the page structure
playwright-cli -s=login snapshot
# Output: heading "Login" [ref=e3], textbox "Email" [ref=e12], textbox "Password" [ref=e15], button "Sign In" [ref=e18]

# 2. Interact using refs
playwright-cli -s=login fill e12 "user@example.com"
playwright-cli -s=login fill e15 "password123"
playwright-cli -s=login click e18

# 3. Verify result
playwright-cli -s=login snapshot  # Check new page state

Named Sessions for Parallelism

Each -s=<name> creates an isolated browser instance. Run multiple sessions simultaneously:

# Parallel: 3 independent browser sessions
playwright-cli -s=page-a open http://localhost:3000/page-a --persistent &
playwright-cli -s=page-b open http://localhost:3000/page-b --persistent &
playwright-cli -s=page-c open http://localhost:3000/page-c --persistent &

Environment Variables

VariablePurpose
PLAYWRIGHT_MCP_VIEWPORT_SIZESet viewport: 1440x900
PLAYWRIGHT_MCP_HEADLESSSet to false for headed mode
# Custom viewport
PLAYWRIGHT_MCP_VIEWPORT_SIZE=1440x900 playwright-cli -s=wide open https://example.com --persistent

Tier 1b: bunx playwright (Quick One-Shot Commands)

For simple one-shot operations where you don't need a session:

# Screenshot a page (no session needed)
bunx playwright screenshot "https://example.com" /tmp/screenshot.png

# Screenshot with options
bunx playwright screenshot --browser chromium --full-page "https://example.com" /tmp/full.png

# Save as PDF
bunx playwright pdf "https://example.com" /tmp/page.pdf

# Wait for network idle before screenshot
bunx playwright screenshot --wait-for-timeout 3000 "https://example.com" /tmp/loaded.png

Chrome Headless CLI

# Dump DOM (raw HTML)
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
  --headless=new --dump-dom "https://example.com"

# Screenshot
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
  --headless=new --screenshot=/tmp/chrome-shot.png "https://example.com"

# Print to PDF
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
  --headless=new --print-to-pdf=/tmp/page.pdf "https://example.com"

Quick Checks

# Does the page load?
curl -sf "https://example.com" > /dev/null && echo "UP" || echo "DOWN"

# What status code?
curl -so /dev/null -w "%{http_code}" "https://example.com"

# Page title extraction
curl -s "https://example.com" | grep -o '<title>[^<]*</title>'

VERIFY Phase (CLI-First Pattern)

The mandatory verification loop for web development:

1. Make code change
2. Build
3. playwright-cli -s=verify open <url> --persistent
4. playwright-cli -s=verify screenshot --filename=/tmp/verify.png
5. Read /tmp/verify.png (visual inspection via Read tool)
6. If defect → fix → go to step 2
7. If clean → playwright-cli -s=verify close → report with screenshot evidence

This replaces the old pattern of spawning a BrowserAgent for every verification. BrowserAgent verification is only needed when you need the agent to check console errors, network requests, AND interact with the page — not for simple visual checks.


Tier 2: BrowserAgent & UIReviewer (When AI Reasoning Is Needed)

For tasks requiring AI decision-making about what to do next. Both agents use playwright-cli internally.

When to use BrowserAgent:

  • Complex flows where you need to inspect the page to decide the next action
  • Combined check: screenshot + console errors + network requests + diagnosis
  • Tasks requiring adaptive navigation (SPAs, dynamic content)

When to use UIReviewer:

  • Structured user story validation with defined steps and assertions
  • Parallel test execution (one UIReviewer per story)

Agent definitions: ~/.claude/agents/BrowserAgent.md and ~/.claude/agents/UIReviewer.md

Usage:

# Multi-step interaction needing AI reasoning (worth the 30K token cost)
Task(subagent_type="BrowserAgent", prompt="
  Navigate to http://localhost:3000/login.
  Type 'admin' into the username field.
  Type 'password' into the password field.
  Click 'Sign In'.
  Wait for the dashboard to load.
  Take a screenshot.
  Check console for errors.
  Report: screenshot path, any errors, dashboard content summary.
")

# Structured test validation
Task(subagent_type="UIReviewer", prompt="
  URL: http://localhost:3000.
  Steps: 1. Click 'Blog'. 2. Assert: blog listing visible. 3. Click first article. 4. Assert: article content visible.
")

# Parallel verification (8 pages at once)
Task(subagent_type="BrowserAgent", prompt="Check http://localhost:3000/page1")
Task(subagent_type="BrowserAgent", prompt="Check http://localhost:3000/page2")

Tier 3: Headed Chrome (Authenticated Sessions)

For tasks requiring your logged-in browser state, extensions, or cookies.

How it works: Claude Code's --chrome flag connects to your actual Chrome browser. Single session, not parallelizable, but has access to all your cookies, sessions, and extensions.

When to use:

  • Sites requiring login you can't easily replicate (SSO, 2FA)
  • Tasks that need browser extensions (Claude extension, password managers)
  • Shopping, booking, account management
  • Any task where "use my Chrome" makes sense

Usage:

# Proper way: launch Claude Code with Chrome integration
claude --chrome

Mid-session workaround (when you need headed Chrome without restarting):

# Launch Chrome with remote debugging on your profile
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
  --remote-debugging-port=9222 \
  --user-data-dir="$HOME/Library/Application Support/Google/Chrome" \
  --profile-directory="Default" \
  --no-first-run \
  "<url>" &

Limitations:

  • Single session only (bound to your physical browser)
  • NOT parallelizable
  • Visible browser window required

Accessibility Snapshots (Token-Efficient Browsing)

The playwright-cli snapshot command returns a structured accessibility tree. This is:

  • Zero tokens — runs as a CLI command, no AI needed
  • Machine-readable — elements have refs you can click/fill directly
  • Better for content extraction — structured text, not pixels

Use snapshots when you need to read page content or interact with elements. Use screenshots when you need visual verification.


Debugging Workflow

Scenario: "Why isn't the user list loading?"

Step 1 (CLI — free):

# Quick check: does the page load at all?
curl -so /dev/null -w "%{http_code}" "http://myapp.com/users"

# Visual check
playwright-cli -s=debug open http://myapp.com/users --persistent
playwright-cli -s=debug screenshot --filename=/tmp/debug.png
playwright-cli -s=debug snapshot  # Check page structure
playwright-cli -s=debug close

Step 2 (only if CLI isn't enough — 30K tokens):

Task(subagent_type="BrowserAgent", prompt="
  Navigate to http://myapp.com/users.
  Take a screenshot.
  Check console for errors.
  Check network requests for failed calls (4xx, 5xx).
  Summarize: what's working, what's broken.
")


Stories — YAML User Story Validation

Define user stories in YAML format and validate them in parallel with UIReviewer agents.

Directory: skills/Utilities/Browser/Stories/

name: App Name
url: https://example.com
stories:
  - name: Story name
    steps:
      - action: click
        target: "LLM-readable description"
    assertions:
      - type: snapshot_contains
        text: "expected text"

Run with: "review stories" or "run stories in HackerNews.yaml"

See Stories/README.md for full format documentation.


Recipes — Parameterized Workflow Templates

Reusable Markdown templates with {PROMPT} injection and frontmatter defaults.

Directory: skills/Utilities/Browser/Recipes/

RecipeDescriptionTool
SummarizePage.mdNavigate to URL and extract content summaryBrowserAgent
ScreenshotCompare.mdBefore/after screenshot comparisonplaywright-cli
FormFill.mdFill form fields with provided dataplaywright-cli

Run with: "automate SummarizePage for https://example.com"

See Recipes/README.md for full format documentation.


Last Updated: 2026-02-17

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

Claude Code

25.89%
按下载量换算203

Gemini CLI

21.17%
按下载量换算166

OpenCode

18.13%
按下载量换算142

Cursor

12.97%
按下载量换算102

Codex

8.78%
按下载量换算69

github-copilot

3.63%
按下载量换算28

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

敏感数据

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills