Communitygithub.com

David-Li0406/meta-skill-evloving

瀏覽器自動化,保持頁面狀態持續。當使用者要求導航網站、填寫表單、截圖、擷取網頁資料、測試網路應用或自動化瀏覽器工作流程時使用。觸發詞包括「前往 [網址]」、「點擊」、「填寫表單」、「截圖」、「爬取」、「自動化」、「測試網站」、「登入」或任何瀏覽器互動請求。

meta-skill-evloving 是什麼?

此技能提供一個強大的瀏覽器自動化解決方案,能夠在多個腳本執行之間保持頁面狀態,特別適合逐步完成複雜任務。它支援兩種模式:Standalone 模式(獨立啟動 Chromium 瀏覽器)和 Extension 模式(連接到使用者現有的 Chrome 瀏覽器,可用於需要登入驗證的情境)。主要功能包括導航、填寫表單、點擊元素、截圖、擷取資料以及透過 ARIA 快照(getAISnapshot)進行元素探索與互動。技能基於 Playwright 開發,腳本需從 `skills/dev-browser/` 目錄執行,並使用 `@/` 匯入別名。核心工作流程是撰寫小而專注的腳本,逐步完成任務,並在結束時透過 `client.disconnect()` 斷開連線,而頁面狀態會保留在伺服器上以便後續使用。

相容平台~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 技能

瀏覽器自動化,可在腳本執行之間保持頁面狀態。編寫小而專注的腳本,逐步完成任務。一旦驗證了工作流程的一部分,並且有重複的工作要做,就可以編寫一個腳本,在單次執行中完成重複的工作。

選擇你的方法

  • 本地/原始碼可取得的網站:先閱讀原始碼,直接編寫選擇器
  • 未知的頁面佈局:使用 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/ 目錄執行。 @/ 匯入別名需要此目錄的配置。

使用 heredocs 內聯執行腳本:

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 中使用純 JavaScript: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();

// 取得或建立具名頁面(viewport 僅適用於新頁面)
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:

  • [ref=eN] – 用於互動的元素參考(僅限可見、可點擊的元素)
  • [checked]、[disabled]、[expanded] – 元素狀態
  • [level=N] – 標題層級
  • /url:、/placeholder: – 元素屬性

與 ref 互動:

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

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".

相關技能