Agentic Playwright CLI

A Playwright and TypeScript project template with rules and 17 skills so Claude Code, Codex and Cursor write tests to a standard

  • 262 ★ on the repository
  • Last commit
  • MIT
CLI

Extended access

Why this level

  • The installer downloads dependencies and a browser, and the Claude Code hook runs `python3` on every write
  • Tests can call sites and APIs with the addresses and credentials from `env/.env.*`
All reasons and checks

idavidov13/agentic-playwright

Install

Manual install

npm create agentic-playwright@latest . -- --demo

Run in an empty directory. A variant without the demo: `npm create agentic-playwright@latest . -- --bare`. Needs Node.js 22, npm 10 and `python3`.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • The installer downloads dependencies and a browser, and the Claude Code hook runs `python3` on every write
  • Tests can call sites and APIs with the addresses and credentials from `env/.env.*`

This is third-party code. Review the repository files before installing.

What it does

The `npm create agentic-playwright@latest` command creates a working Playwright and TypeScript test scaffold along with a rule set for an AI agent. The project has page objects with dependency injection, API contracts with Zod schema checks, data factories, a multi-browser config, ESLint, Prettier, Husky hooks and CI. The no-question `--demo` mode takes you to a green smoke test against a live demo application. The main artifact for the agent is the `AGENTS.md` file. It holds a Constitution of 36 one-line rules, a proceed-verify-commit workflow and an index of 17 skills. Codex, Cursor and Copilot read `AGENTS.md` directly, and Claude Code imports it through `CLAUDE.md`. Skills live in `.claude/skills/` and are copied to `.agents/skills/` with `npm run skills:sync`. The rules are enforced mechanically. In Claude Code a `PreToolUse` hook blocks writes of forbidden constructs: XPath, hard waits, the `any` type. In every tool the same rules are scanned before a commit and in CI, and the `pr-reviewer` skill checks changes at review. The paid Pro version adds the full hook suite and custom AST lint rules for ESLint.

Who it is for. QA engineers and developers who build Playwright tests with an AI agent and want one set of rules instead of correcting every test by hand.

Good fit when

  • A new test project where the agent needs ready page objects, data factories and a structure instead of improvising
  • The agent writes tests with hard waits and XPath and those constructs must be blocked at write time
  • A team uses Claude Code, Codex and Cursor at once and the rules must be the same for all of them
  • Every change in the repository has to be checked against the rules before a commit and in CI

Not a fit when

  • Tests already exist in a large project: the template writes its own structure into an empty directory and does not migrate an existing one
  • You need a Python or Java framework: the scaffold is built on TypeScript and Playwright
  • The machine has no `python3`: the Constitution hook runs on it, and without it Claude Code blocks every write
  • You need the full hook suite and AST rules: they exist only in the paid Pro version

Example request

Scaffold an Agentic Playwright project in this empty folder in demo mode, then write a product search test following the rules in AGENTS.md

Limitations

  • It needs Node.js 22 or newer, npm 10 and `python3`. On Windows the python.org installer provides only `python` and `py`, and then the hook blocks every Claude Code write, so use a Dev Container or WSL.
  • The target directory must be empty apart from bookkeeping files like `.git`.
  • Codex has no write-time hook, so protection comes from pre-commit and CI scans. In the macOS sandbox it cannot launch Chromium without `--sandbox danger-full-access`.
  • It is a template: replace the example pages and tests with your own.
  • The paid Pro version contains extra hooks and rules.

How to disable. The template lands in the project as ordinary files, so delete `AGENTS.md`, `CLAUDE.md`, the `.claude/` and `.agents/` folders, the Husky hooks and the extra scripts in `package.json`. To disable just the hook in Claude Code, remove the `PreToolUse` entry from `.claude/settings.json`.

FAQ

How do I create an Agentic Playwright project?

Run `npm create agentic-playwright@latest . -- --demo` in an empty directory. The installer lays down the scaffold, installs dependencies and a browser and runs a smoke test against the demo app.

Which agents are supported?

Claude Code, Codex, Cursor and GitHub Copilot. Codex, Cursor and Copilot read `AGENTS.md` directly and Claude Code imports it through `CLAUDE.md`. The `--no-claude` and `--no-agents` flags drop what you do not need.

What does the Constitution forbid?

Among its rules: XPath, hard waits, `any`, magic timeouts and more than one tag per test. Tests are written with page objects, Given, When, Then steps and web-first assertions.

How does the free version differ from Pro?

The free version includes the scaffold, `AGENTS.md`, 17 skills, the Claude Code write hook and the pre-commit scan. Pro adds the full hook suite, AST rules for ESLint, parity proofs and continuous skill evaluation.

Why is python3 needed?

The Constitution hook, its pre-commit scan and three skill gates run on it. Without `python3` the Claude Code hook blocks every write and edit.

Discussion

No questions or reviews yet.

CLI tools

57 reference files on Playwright tests in TypeScript: the agent pulls the one that fits the task, from locators to CI sharding

SkillMinimal access417Repository stars

Seven QA agents and ten skills for test automation: Playwright in TypeScript, Selenium in Java, API, accessibility and ISTQB.

PluginExtended access262Repository stars

Playwright CLI

playwright-cli

Official

Microsoft's official Playwright CLI with an agent skill: drive a browser through short commands without heavy MCP schemas

CLIExtended access15KRepository stars

A skill that lets an agent write and run Playwright scripts: page tests, forms, screenshots and link checks

SkillBroad access3.3KRepository stars

Guides for agents writing and fixing Playwright tests, with advice on locators, waiting and diagnosing CI failures

SkillMinimal access412Repository stars

A skill that tests your agent's code in a real browser: reads your changes, builds a test plan and runs it through Playwright with your own cookies

SkillBroad access3.6KRepository stars

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialRepository starsMain difference
Agentic Playwright (this card)no262
Playwright Best Practices Skillno417a single skill with Playwright advice, without a project scaffold, hooks or commit-time checks
Playwright Skillno3,266teaches an agent to write Playwright scripts but does not create a project or enforce rules

README in short

The README contrasts a test an agent writes without rules with one written under the Constitution, and explains the quick start via npm, Dev Container and a setup script, the project structure, tags, API and data handling. Separate sections cover the AI rules architecture and the paid Pro version.

README badge

Report a problem

Foxx AIAgentic Playwright
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.