# Web Task Automation

Automates a web task in a local browser and saves screenshots and logs as evidence.

- Repository: https://github.com/microsoft/CUAWright (6080 stars)
- Category: Testing
- License: MIT
- Last updated: 2026-10-27
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add microsoft/CUAWright --skill cuawright-web -g -a claude-code -y`
Codex: `npx skills add microsoft/CUAWright --skill cuawright-web -g -a codex -y`
Cursor: `npx skills add microsoft/CUAWright --skill cuawright-web -g -a cursor -y`
Gemini CLI: `npx skills add microsoft/CUAWright --skill cuawright-web -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add microsoft/CUAWright`

## Description

Solve a user-specified web task code-as-action style by driving a local Playwright browser through one bash command at a time, saving screenshots and an action log into `final_runs/run_<id>/`, and visually verifying the result. Use when the user asks to automate a web task (search, filter, form-fill, multi-step flow, data extraction) and wants reusable scripts plus screenshot evidence rather than a one-shot answer.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# CUAWright browser skill

This skill drives the Webwright browser subsystem in `cuawright.webwright`.
For OSWorld desktop tasks, use the separate `cuawright-desktop` runtime described
in `docs/desktop.md` at the repository root.

You are the Webwright agent. Webwright is normally an LLM-driven loop that
emits one JSON-wrapped `bash_command` per turn against a local terminal +
Playwright workspace. In Claude Code, **you replace that loop directly**: use
the `Bash` tool the same way the `bash_command` field is used in
`src/cuawright/webwright/config/base.yaml`. You do NOT need to wrap your
output in JSON, that constraint only existed because the original harness
parsed model output.

This skill keeps the *workspace contract* (plan.md, `final_runs/run_<id>/`
folders, instrumented `final_script.py`, screenshots, action log) but
**replaces the OpenAI-backed `image_qa` and `self_reflection` tools with your
own native abilities**: you read PNGs with `Read` and verify success against
`plan.md` yourself. No `OPENAI_API_KEY` or other model API keys required.

## Modes

- **Default (one-shot).** `final_script.py` solves the task for the literal
  values the user provided. Triggered by a plain prompt or by
  `/cuawright:run <task>`.
- **CLI tool (parameterized).** `final_script.py` is a reusable CLI: one
  function with a Google-style `Args:` docstring + an `argparse` wrapper
  whose flags default to the concrete task values, so the user can rerun
  it later with different arguments. Triggered by `/cuawright:craft <task>`
  or when the user asks to "parameterize", "make it reusable", "turn this
  into a CLI", etc. See `reference/cli_tool_mode.md`.

## Prerequisites (one-time)

From the CUAWright repo root:

```bash
pip install -e .
playwright install firefox
```

No API keys needed for this skill.

## Workspace Contract

Mirror what `base.yaml`'s `instance_template` requires:

The rest: https://github.com/microsoft/CUAWright/blob/HEAD/skills/cuawright-web/SKILL.md
