Agent Skillsdifferent-ai/openwork › browser-automation

browser-automation

GitHub

用于本地 Electron 应用开发中的浏览器自动化,通过 CDP 驱动 UI 进行探索、调试及冒烟测试。

.opencode/skills/browser-automation/SKILL.md different-ai/openwork

Trigger Scenarios

驱动本地 Electron 应用 UI 执行本地 UI 冒烟测试 调试 Composer 交互流程

Install

npx skills add different-ai/openwork --skill browser-automation -g -y
More Options

Non-standard path

npx skills add https://github.com/different-ai/openwork/tree/dev/.opencode/skills/browser-automation -g -y

Use without installing

npx skills use different-ai/openwork@browser-automation

指定 Agent (Claude Code)

npx skills add different-ai/openwork --skill browser-automation -a claude-code -g -y

安装 repo 全部 skill

npx skills add different-ai/openwork --all -g -y

预览 repo 内 skill

npx skills add different-ai/openwork --list

SKILL.md

Frontmatter
{
    "name": "browser-automation",
    "description": "Local OpenWork Electron browser automation with CDP. Use when driving a local Electron dev app, browser_list, browser_snapshot, browser_eval, composer automation, or local UI smoke tests."
}

Browser Automation

For verdicts, do not drive CDP by hand — write or run an evals/specs test (write-a-spec, run-tests). This skill is for exploration and debugging only.

What I Do

  • Attach OpenCode browser tools to the OpenWork Electron app during local development.
  • Drive the app UI through Electron's Chrome DevTools Protocol endpoint.
  • Send a task/session from the composer and confirm the response in the UI.

Local Dev Setup

pnpm dev enables Electron CDP by default:

OPENWORK_ELECTRON_REMOTE_DEBUG_PORT=${OPENWORK_ELECTRON_REMOTE_DEBUG_PORT:-9823}

The default browser URL for OpenCode browser tools is:

http://127.0.0.1:9823

The app UI normally loads at:

http://localhost:5173/

To use a different CDP port, launch with an override:

OPENWORK_ELECTRON_REMOTE_DEBUG_PORT=9830 pnpm dev

To disable Electron CDP for a run:

OPENWORK_ELECTRON_REMOTE_DEBUG_PORT=0 pnpm dev

Background Launch

Use a detached launch when the user wants the app running in the background:

nohup pnpm dev > /tmp/openwork-dev.log 2>&1 &

Then wait for the CDP port:

lsof -nP -iTCP:9823 -sTCP:LISTEN

Browser Tool Flow

  1. List targets with browser_list using browser_url: "http://127.0.0.1:9823".
  2. Select the OpenWork target ID.
  3. Read state with browser_eval or browser_snapshot.
  4. Fill the Lexical composer by targeting [contenteditable="true"][data-lexical-editor="true"].
  5. Click the Run task button.
  6. Confirm the session response by checking document.body.innerText or the current URL.

Send A Session

Use this browser_eval pattern after selecting the OpenWork target:

(() => {
  const editor = document.querySelector('[contenteditable="true"][data-lexical-editor="true"]');
  if (!editor) return { ok: false, reason: 'editor not found' };

  editor.focus();
  const data = new DataTransfer();
  data.setData('text/plain', 'Say hello from the Electron browser test.');
  editor.dispatchEvent(new ClipboardEvent('paste', {
    bubbles: true,
    cancelable: true,
    clipboardData: data,
  }));

  const run = Array.from(document.querySelectorAll('button'))
    .find((button) => button.innerText.trim() === 'Run task');
  if (!run) return { ok: false, reason: 'Run task not found', inserted };
  if (run.disabled) return { ok: false, reason: 'Run task disabled', inserted, text: editor.innerText };

  run.click();
  return { ok: true, inserted: true, text: editor.innerText };
})()

Notes

  • Electron CDP is used for development test tooling. User browser tasks should use the built-in OpenWork Browser target.
  • A successful local attach should show an OpenWork target at http://127.0.0.1:9823.
  • The known-good smoke prompt is Say hello from the Electron browser test. and the expected response is Hello from the Electron browser test.

Version History

  • c26be48 Current 2026-09-23 01:44

    将日志路径从机器特定路径替换为可移植的 /tmp 路径;添加 YAML frontmatter 以增强技能可发现性。

  • ff5d298 2026-08-20 11:35

Same Skill Collection

.opencode/skills/agent-first-screenshots/SKILL.md
.opencode/skills/build-a-witness/SKILL.md
.opencode/skills/cloud-dashboard-walkthrough/SKILL.md
.opencode/skills/create-plugin/SKILL.md
.opencode/skills/daytona-chrome-cdp/SKILL.md
.opencode/skills/daytona-cloud-instance/SKILL.md
.opencode/skills/daytona-cloud-server/SKILL.md
.opencode/skills/daytona-dev/SKILL.md
.opencode/skills/daytona-electron-den/SKILL.md
.opencode/skills/daytona-electron-test/SKILL.md
.opencode/skills/daytona-flow-validator/SKILL.md
.opencode/skills/daytona-recording-artifacts/SKILL.md
.opencode/skills/daytona-secrets-volume/SKILL.md
.opencode/skills/daytona-seeded-cloud-demo/SKILL.md
.opencode/skills/daytona-windows-cert/SKILL.md
.opencode/skills/daytona/SKILL.md
.opencode/skills/diagnose-a-red-run/SKILL.md
.opencode/skills/fraimz/SKILL.md
.opencode/skills/get-env-var/SKILL.md
.opencode/skills/hunt-a-prod-error/SKILL.md
.opencode/skills/open-a-pr/SKILL.md
.opencode/skills/openwork-models/SKILL.md
.opencode/skills/preview-my-work/SKILL.md
.opencode/skills/product-tutorial-pipeline/SKILL.md
.opencode/skills/prove-a-pr/SKILL.md
.opencode/skills/publish-evidence/SKILL.md
.opencode/skills/record-a-demo/SKILL.md
.opencode/skills/release/SKILL.md
.opencode/skills/review-a-contributor-pr/SKILL.md
.opencode/skills/run-evals/SKILL.md
.opencode/skills/run-tests/SKILL.md
.opencode/skills/shadcn/SKILL.md
.opencode/skills/upload-photo/SKILL.md
.opencode/skills/validate-a-release/SKILL.md
.opencode/skills/write-a-spec/SKILL.md
.warden/skills/confidentiality-review/SKILL.md
.warden/skills/design-spec-review/SKILL.md
.warden/skills/desktop-den-sync-review/SKILL.md
.warden/skills/diff-security-review/SKILL.md
.warden/skills/spec-provenance-review/SKILL.md
integrations/agent-plugins/openwork-connect/skills/openwork-connect/SKILL.md

Metadata

Files
0
Version
c26be48
Hash
a30dd6e0
Indexed
2026-08-20 11:35

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-23 06:32
浙ICP备14020137号-1