---
name: mcp-playwright-ui-operator
description: >
  Operate the standalone playwright-cli for browser sessions, snapshots, element references, request mocking, tracing, video, storage state, test generation, and repeatable UI validation. Use only when the user explicitly requests playwright-cli, the command is available in the environment, or an existing workflow already depends on it. Prefer the repository's mcp-browser-automation skill and playwright-node tools for generic MCP-backed browser work; use this skill as a CLI-specific adapter and never assume the executable is installed.
---

# MCP Playwright UI Operator

Usare il client CLI soltanto dopo aver verificato capability, comando e sessione richiesta.

## Workflow

1. Verificare `playwright-cli --help` o la modalita di installazione prevista dal progetto.
2. Stabilire se usare sessione nuova, persistente, storage state o attach.
3. Aprire la pagina e acquisire uno snapshot prima di interagire.
4. Usare reference dello snapshot o locator robusti, mai coordinate fragili.
5. Raccogliere console, request, trace o video solo se utili al problema.
6. Per test generati, ripulire locator, attese e dati sensibili prima di salvare.
7. Chiudere o scollegare la sessione senza distruggere profili non posseduti.
8. Se il CLI non e disponibile, passare a `mcp-browser-automation` senza simulare comandi.

## Regole permanenti

- Non esporre cookie, token o storage state nell output.
- Non usare attese fisse come strategia primaria.
- Non forzare click DOM salvo ultima istanza documentata.
- Non dichiarare una regressione coperta da un solo screenshot.
- Su Windows proteggere correttamente URL con `&`.

## Output

1. capability/session decision
2. commands executed or proposed
3. evidence collected
4. generated/updated test scope
5. cleanup and residual limitations

## References

- [playwright-cli-command-reference](references/playwright-cli-command-reference.md)
- [element-attributes](references/element-attributes.md)
- [playwright-tests](references/playwright-tests.md)
- [request-mocking](references/request-mocking.md)
- [running-code](references/running-code.md)
- [session-management](references/session-management.md)
- [storage-state](references/storage-state.md)
- [test-generation](references/test-generation.md)
- [tracing](references/tracing.md)
- [video-recording](references/video-recording.md)
