1 / 3 · Book 1 · What Are Agent Skills? · drill: interview Q&A⊞ allnext →Get the book →
1.5The Skill-Based Browser Automation Stack
Here is the architecture we build throughout this book:
+-------------------------------------------------------+
| Test Definitions |
| (Markdown/YAML plans with natural-language steps) |
+-------------------------------------------------------+
|
v
+-------------------------------------------------------+
| AI Agent Layer (Claude Code, Cursor, ...) |
| |
| +--------------+ +--------------+ +--------------+ |
| | playwright- | | Custom Test | | Reporting | |
| | cli skill | | Skills | | Skill | |
| +------+-------+ +------+-------+ +------+-------+ |
| | | | |
+---------+-----------------+-----------------+---------+
| | |
v v v
+-------------------------------------------------------+
| Bash Tool |
+-------------------------------------------------------+
|
v
+-------------------------------------------------------+
| playwright-cli (@playwright/cli) |
| |
| - Disk-first snapshots (.playwright-cli/) |
| - Element refs (e8, e14, ...) |
| - Named parallel sessions |
| - Auth state save/load |
+-------------------------------------------------------+
|
v
+-------------------------------------------------------+
| Playwright engine |
| (auto-waiting, actionability, browser lifecycle) |
+-------------------------------------------------------+
|
v
+-------------------------------------------------------+
| Chromium / Firefox / WebKit |
+-------------------------------------------------------+
Each layer has one responsibility:
- Test Definitions describe what to test in human-readable form
- The AI Agent decides how to test; the skill lives inside this layer and supplies the domain knowledge (the CLI command surface)
- The Bash Tool is the execution bridge to the operating system
- playwright-cli is the agent-facing command surface -- it writes page snapshots to disk as compact YAML with element refs, so the agent reads state on demand instead of receiving it on every action
- The Playwright engine handles browser mechanics: launching, auto-waiting, actionability checks, session management
- The browser (Chromium, Firefox, or WebKit) is what gets automated
Notice what this stack does NOT trade away. Underneath the AI layer sits the same battle-tested Playwright engine that runs millions of conventional test suites. The agent gets flexibility; the engine keeps reliability.