AGENT SKILL

webwright

Drive a local Playwright browser through a Roder-owned Webwright workspace with plan, final script, screenshots, logs, and verification evidence.

License 许可
MIT
所属仓库
RoderAI/roder
最近更新
2026-11-13
Stars
★ 9
Forks
1

01 前言 Front Matter

name
webwright
exposure
direct_only
metadata
{ "short-description": "Browser automation" }
description
Drive a local Playwright browser through a Roder-owned Webwright workspace with plan, final script, screenshots, logs, and verification evidence.

03 SKILL.md 正文

Use this skill for browser tasks that need durable evidence, repeatable Playwright scripts, screenshots, logs, or reusable CLI automation.

Modes

  • /webwright:run <task>: solve the literal task values supplied by the user.
  • /webwright:craft <task>: create a parameterized Python CLI where concrete task values become defaults and --help documents how to reuse it.

Workspace Contract

Create or use one Webwright workspace under .roder/webwright/<task-id>/ unless the user gives a scoped output directory.

Required artifacts:

  • plan.md with # Critical Points and one independently verifiable checklist item per user constraint.
  • final_script.py at the workspace root.
  • final_runs/run_<id>/final_script.py for each clean execution.
  • final_runs/run_<id>/screenshots/final_execution_<step>_<label>.png for constraint-relevant evidence.
  • final_runs/run_<id>/final_script_log.txt with one step <n> action: line per constraint-relevant action and the final datum at the end.

Use viewport={"width": 1280, "height": 1800} for Playwright screenshots. Do not use page.screenshot(full_page=True).

Roder Tools

Prefer Webwright helper tools for setup and checks:

  • webwright.prepare_workspace
  • webwright.allocate_run
  • webwright.lint_script
  • webwright.run_script
  • webwright.list_artifacts
  • webwright.read_log_tail
  • webwright.verify_run
  • webwright.summarize_verification

Use normal Roder file, edit, shell, media, and artifact tools for the actual code-as-action loop. Keep generated files inside the Webwright workspace.

If local Playwright dependencies are missing, ask the user to run roder webwright setup --browser firefox or the selected browser (chromium or webkit). webwright.run_script uses the managed setup runtime automatically when no python override is supplied.

Verification

Only mark the task done when every critical point is checked and backed by a screenshot path or exact log line from the latest run. If evidence is ambiguous, fix the script and rerun in the next run_<id> directory.

webwright.run_script reports an outcome class (ok, nonzero_exit, signaled, timeout, launch_failed), the elapsed time, the first error line and a redacted stderr tail. Fix the script from that text before rerunning. A run executed through webwright.run_script that does not exit 0 fails webwright.verify_run even if its log has a final datum: line and its screenshots exist; a run executed outside that tool has no recorded exit status, so check its exit status yourself.

For /webwright:craft, also verify:

  • The reusable function is import-safe and does not launch a browser at import time.
  • python final_runs/run_<id>/final_script.py succeeds with no arguments.
  • python final_runs/run_<id>/final_script.py --help shows the user-facing argument contract.

04 同仓库更多 Skills