Communitygithub.com

David-Li0406/meta-skill-evloving

浏览器自动化,保持页面状态持久化。当用户需要导航网站、填写表单、截图、提取网页数据、测试 Web 应用或自动化浏览器工作流时使用。触发短语包括“打开 [url]”、“点击”、“填写表单”、“截图”、“抓取”、“自动化”、“测试网站”、“登录”或任何浏览器交互请求。

meta-skill-evloving 是什么?

此技能提供浏览器自动化能力,能够在脚本执行之间保持页面状态。它支持编写小而专注的脚本来逐步完成任务,并在有重复性工作时将其封装为单一执行的脚本。技能提供两种模式:独立模式(启动全新的 Chromium 浏览器)和扩展模式(连接到用户已有的 Chrome 浏览器,适用于需要已登录状态的场景)。核心 API 基于 Playwright,包括 `page.goto()`、`page.click()`、`page.fill()`、`page.screenshot()` 和 `page.evaluate()` 等常见操作,同时提供了 `getAISnapshot()` 方法用于发现页面元素并通过 `selectSnapshotRef()` 进行交互。工作流遵循“编写脚本 → 执行 → 评估状态 → 决定下一步 → 重复”的模式,非常适合需要逐步验证的复杂自动化任务。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/David-Li0406/meta-skill-evloving/tree/HEAD/AgentSkillOS/data/skill_seeds/dev-browser

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Dev Browser Skill

浏览器自动化,能够跨脚本执行保持页面状态。编写小而专注的脚本逐步完成任务。一旦您验证了某个工作流的部分内容并且有重复工作需要完成,您可以编写一个脚本以单次执行完成重复工作。

选择方法

  • 本地/源代码可访问的站点:先阅读源代码以直接编写选择器
  • 未知页面布局:使用 getAISnapshot() 发现元素,然后使用 selectSnapshotRef() 与之交互
  • 视觉反馈:截图以查看用户所见内容

设置

提供两种模式。如果不确定使用哪种,请询问用户。

独立模式(默认)

启动一个新的 Chromium 浏览器以进行全新的自动化会话。

./skills/dev-browser/server.sh &

如果用户请求,添加 --headless 标志。在运行脚本之前等待 Ready 消息。

扩展模式

连接到用户现有的 Chrome 浏览器。在以下情况下使用:

  • 用户已登录某些网站,希望您在其认证体验下执行操作(非本地开发环境)。
  • 用户要求您使用扩展。

重要:核心流程仍然相同。您在他们的浏览器中创建命名页面。

启动中继服务器:

cd skills/dev-browser && npm i && npm run start-extension &

等待控制台中出现 Waiting for extension to connect... 后跟 Extension connected。这表明客户端已连接,浏览器已准备好被控制。 工作流程:

  1. 脚本调用 client.page("name"),就像普通模式一样创建新页面/连接到现有页面。
  2. 自动化在用户的实际浏览器会话上运行

如果扩展尚未连接,请告知用户启动并激活它。下载链接:https://github.com/SawyerHood/dev-browser/releases

编写脚本

所有脚本从 skills/dev-browser/ 目录运行。 @/ 导入别名要求此目录的配置。

使用 heredoc 内联执行脚本:

cd skills/dev-browser && npx tsx <<'EOF'
import { connect, waitForPageLoad } from "@/client.js";

const client = await connect();
// 创建具有自定义视口大小的页面(可选)
const page = await client.page("example", { viewport: { width: 1920, height: 1080 } });

await page.goto("https://example.com");
await waitForPageLoad(page);

console.log({ title: await page.title(), url: page.url() });
await client.disconnect();
EOF

仅当脚本需要重用、复杂或用户明确请求时才写入 tmp/ 文件。

关键原则

  1. 小脚本:每个脚本只做一件事(导航、点击、填写、检查)
  2. 评估状态:在脚本末尾记录/返回状态,以决定下一步操作
  3. 描述性页面名称:使用 "checkout"、"login",而不是 "main"
  4. 断开连接以退出:await client.disconnect() - 页面在服务器上持久化
  5. 在 evaluate 中使用纯 JS:page.evaluate() 在浏览器中运行 - 不支持 TypeScript 语法

工作流循环

对于复杂任务,遵循以下模式:

  1. 编写一个脚本执行一个操作
  2. 运行它并观察输出
  3. 评估 - 它起作用了吗?当前状态是什么?
  4. 决定 - 任务是否完成,还是需要另一个脚本?
  5. 重复直到任务完成

浏览器上下文中无 TypeScript

传递给 page.evaluate() 的代码在浏览器中运行,它不理解 TypeScript:

// ✅ 正确:纯 JavaScript
const text = await page.evaluate(() => {
  return document.body.innerText;
});

// ❌ 错误:TypeScript 语法将在运行时失败
const text = await page.evaluate(() => {
  const el: HTMLElement = document.body; // 类型注解在浏览器中会出错!
  return el.innerText;
});

抓取数据

对于抓取大型数据集,请拦截并重放网络请求,而不是滚动 DOM。请参阅 references/scraping.md 获取完整指南,涵盖请求捕获、模式发现和分页 API 重放。

客户端 API

const client = await connect();

// 获取或创建命名页面(视口仅适用于新页面)
const page = await client.page("name");
const pageWithSize = await client.page("name", { viewport: { width: 1920, height: 1080 } });

const pages = await client.list(); // 列出所有页面名称
await client.close("name"); // 关闭一个页面
await client.disconnect(); // 断开连接(页面保留)

// ARIA 快照方法
const snapshot = await client.getAISnapshot("name"); // 获取无障碍树
const element = await client.selectSnapshotRef("name", "e5"); // 通过引用获取元素

page 对象是标准的 Playwright Page。

等待

import { waitForPageLoad } from "@/client.js";

await waitForPageLoad(page); // 导航后
await page.waitForSelector(".results"); // 等待特定元素
await page.waitForURL("**/success"); // 等待特定 URL

检查页面状态

截图

await page.screenshot({ path: "tmp/screenshot.png" });
await page.screenshot({ path: "tmp/full.png", fullPage: true });

ARIA 快照(元素发现)

使用 getAISnapshot() 发现页面元素。返回 YAML 格式的无障碍树:

- banner:
  - link "Hacker News" [ref=e1]
  - navigation:
    - link "new" [ref=e2]
- main:
  - list:
    - listitem:
      - link "Article Title" [ref=e8]
      - link "328 comments" [ref=e9]
- contentinfo:
  - textbox [ref=e10]
    - /placeholder: "Search"

解释引用:

  • [ref=eN] - 用于交互的元素引用(仅限可见、可点击的元素)
  • [checked]、[disabled]、[expanded] - 元素状态
  • [level=N] - 标题级别
  • /url:、/placeholder: - 元素属性

与引用交互:

const snapshot = await client.getAISnapshot("hackernews");
console.log(snapshot); // 找到你需要的引用

const element = await client.selectSnapshotRef("hackernews", "e2");
await element.click();

错误恢复

页面状态在失败后保持。使用以下方法调试:

cd skills/dev-browser && npx tsx <<'EOF'
import { connect } from "@/client.js";

const client = await connect();
const page = await client.page("hackernews");

await page.screenshot({ path: "tmp/debug.png" });
console.log({
  url: page.url(),
  title: await page.title(),
  bodyText: await page.textContent("body").then((t) => t?.slice(0, 200)),
});

await client.disconnect();
EOF

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

David-Li0406/meta-skill-evloving

Create technical diagrams using Mermaid syntax for architecture, sequences, ERDs, flowcharts, and state machines. Use for visualizing system design, data flows, and processes. Triggers: diagram, mermaid, architecture diagram, sequence diagram, flowchart, ERD, entity relationship, state diagram, C4 model, component diagram, visualize, draw.

David-Li0406/meta-skill-evloving

Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks

David-Li0406/meta-skill-evloving

Complete color manipulation and green screen effects system. PROACTIVELY activate for: (1) Green screen/chromakey removal, (2) Color grading with LUTs, (3) Color correction (levels, curves, white balance), (4) Colorkey/color removal effects, (5) Hue/saturation manipulation, (6) Color space conversions (BT.709, BT.2020, HDR), (7) Color isolation effects, (8) Teal and orange look, (9) Vintage/film looks, (10) Color keying for transparency. Provides: chromakey and colorkey filters, LUT application (lut3d), curves and levels adjustment, color balance, selective color manipulation, color space handling, HDR tone mapping, professional color grading chains.

David-Li0406/meta-skill-evloving

Convert files and office documents to Markdown. Supports PDF, DOCX, PPTX, XLSX, images (with OCR), audio (with transcription), HTML, CSV, JSON, XML, ZIP, YouTube URLs, EPubs and more.

David-Li0406/meta-skill-evloving

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

David-Li0406/meta-skill-evloving

Build with OpenAI's stateless APIs - Chat Completions (GPT-5, GPT-4o), Embeddings, Images (DALL-E 3), Audio (Whisper + TTS), and Moderation. Includes Node.js SDK and fetch-based approaches for Cloudflare Workers. Use when: implementing chat completions with GPT-5/GPT-4o, streaming responses with SSE, using function calling/tools, creating structured outputs with JSON schemas, generating embeddings for RAG (text-embedding-3-small/large), generating images with DALL-E 3, editing images with GPT-Image-1, transcribing audio with Whisper, synthesizing speech with TTS (11 voices), moderating content (11 safety categories), or troubleshooting rate limits (429), invalid API keys (401), function calling failures, streaming parse errors, embeddings dimension mismatches, or token limit exceeded.

David-Li0406/meta-skill-evloving

Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.

David-Li0406/meta-skill-evloving

Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks

David-Li0406/meta-skill-evloving

Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas

David-Li0406/meta-skill-evloving

Download YouTube videos with customizable quality and format options. Use this skill when the user asks to download, save, or grab YouTube videos. Supports various quality settings (best, 1080p, 720p, 480p, 360p), multiple formats (mp4, webm, mkv), and audio-only downloads as MP3.

David-Li0406/meta-skill-evloving

Best practices for Remotion - Video creation in React

David-Li0406/meta-skill-evloving

Provides bidirectional translation (Chinese/English), grammar checking, and sentence polishing. Supports specific tense constraints, context-aware tone adjustment, and natural expression optimization. Outputs direct text without formatting.

David-Li0406/meta-skill-evloving

指导如何通过自定义注解(如@Unicom)标识Dubbo接口,利用BeanDefinitionRegistryPostProcessor在启动时扫描并动态注册ReferenceBean,实现RPC调用的封装。

David-Li0406/meta-skill-evloving

生成Python脚本,利用FFmpeg将图片序列按3x3布局合并,或将合并图拆分。要求使用subprocess模块执行命令,并支持用户交互式输入路径。

David-Li0406/meta-skill-evloving

SOP for extracting and analyzing promotional activity details, handling time formatting, location mapping, payment logic, and step-by-step process validation.

David-Li0406/meta-skill-evloving

Specializes in creating TikTok short video scripts using an anthropomorphic 'Chef' perspective to explain wildlife food chains and survival environments, utilizing real field footage.

David-Li0406/meta-skill-evloving

针对TikTok平台,以拟人化视角(如动物作为厨师)创作系列短视频脚本。重点介绍野生动物、食物链及生态环境,要求使用野外实拍素材,风格幽默且具有教育意义。

David-Li0406/meta-skill-evloving

Generates KWL (Know, Want to know, Learned) charts for educational videos, specifically BrainPOP, using simple 7th-grade language and short, concise bullet points.

David-Li0406/meta-skill-evloving

Develops DAX measures to calculate promo and regular volumes and generates a calculated table of dates excluding continuous promo date ranges, handling multiple periods and nulls.

David-Li0406/meta-skill-evloving

Tracks complex, multi-session work using the Beads issue tracker and dependency graphs, and provides persistent memory that survives conversation compaction. Use when work spans multiple sessions, has complex dependencies, or needs persistent context across compaction cycles. Trigger with phrases like "create task for", "what's ready to work on", "show task", "track this work", "what's blocking", or "update status".

相关技能