# My 4-Layer Claude Code Playwright CLI Skill (Agentic Browser Automation)
<!--
ref: @content/youtube/indy-dev-dan/my-4-layer-claude-code-playwright-cli-skill-agentic-browser-automation
tags: [agent skills, sub-agents, slash commands, playwright, browser automation, ui testing, just]
version: 2
updated_at: 2026-11-24T06:07:58.294Z
-->

**[Watch on YouTube](https://www.youtube.com/watch?v=efctPj6bjCY)**

# My 4-Layer Claude Code Playwright CLI Skill (Agentic Browser Automation)

*Synthesized from IndyDevDan, 2026-02-16.*

IndyDevDan presents solo, walking through a browser-automation codebase he built for Claude Code. He does not name any guests.

## Core Thesis
IndyDevDan argues that the durable advantage in agentic engineering is a layered, reusable stack that automates whole classes of work, because generating code is no longer a differentiator. He shows browser automation and agentic UI testing built from four layers: skills, sub-agents, slash-command orchestration, and a `just` task runner.

## Key Insights
- **Two workloads.** One is a personal Amazon workflow that fills a cart through Claude's `--chrome` flag. The other is UI testing against Hacker News, where three browsers run user stories in parallel and each report success.
- **CLI over MCP.** He prefers the Playwright CLI because MCP servers consume tokens and are rigid. His Playwright skill runs headless by default, supports parallel sessions, and keeps named sessions with persistent profiles for logged-in flows.
- **Layer 1, skills.** Two skills: a Playwright skill and a Claude-browser skill whose main job is to check that the `--chrome` flag is on and resize the browser.
- **Layer 2, sub-agents.** A Playwright browser agent for arbitrary browser work, and a QA agent that parses a user story into steps, creates an output directory, takes screenshots, reports pass or fail, and closes the browser. Each UI run used about 40K tokens, per the on-screen figure.
- **Layer 3, commands.** A UI review slash command reads user-story files (name, URL, workflow steps) and starts an agent team that runs them in parallel. The orchestrating prompt also tells the primary agent how to prompt its sub-agents.
- **Higher-order prompts.** A prompt that takes another prompt as a parameter, so a fixed browser workflow wraps variable steps stored in a directory.
- **Layer 4, `just`.** A task runner file holds every command with variable defaults. His default example checks a blog for its latest post and rates it.
- **Limits he names.** The `--chrome` approach cannot run in parallel. The Amazon run took about 20 minutes and stopped just short of placing the order, which he presents as the desired behavior.

## Actionable Takeaways
1. Build the stack in order: a skill for the capability, a sub-agent that uses it, a command that orchestrates agents, and a `just` entry point.
2. Choose a CLI wrapper over an MCP server for browser work to save tokens and keep the workflow editable.
3. Write each user story as a short file with a name, a URL and numbered steps, so the same runner works on localhost or staging.
4. Save a screenshot at each step of every browser run, so passing and failing runs both leave a trail.
5. Keep automated purchase flows short of the final irreversible action, as his run did.

## Notable Quotes
> "You want to be using CLIs, not MCP servers." — IndyDevDan

> "Code is fully commoditized. Anyone can generate code." — IndyDevDan

---

*Related: `@content/youtube/yifan-bth/i-reverse-engineered-claude-code-learn-these-agent-tricks` · `@content/youtube/langchain/how-toyota-uses-deep-agents-to-speed-up-r-d-and-manufacturing-research` · `@content/youtube/every-inc/we-tested-claude-opus-5-its-frustrating-with-flashes-of-brilliance` · `@content/youtube/nate-herk/i-deleted-all-my-claude-skills-and-claude-got-smarter` · `@content/youtube/nate-herk/build-sell-with-codex-5-hour-course`*

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*