RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/CLAUDE.md/microsoft/playwright

CLAUDE.md

CLAUDE.md
CLAUDE.mdroot

Quality

100/100

Scores the file, not the repository.

Length

939 words

17 headings · 4 code blocks

Repository

94k

— · pushed 0 days ago

Last changed

3 days ago

First indexed 3 days ago.
microsoft/playwright/CLAUDE.mdRawGitHub
1### Monorepo Packages
2 
3| Package | npm name | Purpose |
4|---------|----------|---------|
5| `playwright-core` | `playwright-core` | Browser automation engine: client, server, dispatchers, protocol |
6| `playwright` | `playwright` | Test runner + browser automation (public package) |
7| `playwright-test` | `@playwright/test` | Test runner entry point |
8| `playwright-client` | `@playwright/client` | Standalone client package |
9| `protocol` | *(internal)* | RPC protocol definitions (`protocol.yml` → generated `channels.d.ts`) |
10 
11### Browser Packages
12 
13`playwright-chromium`, `playwright-firefox`, `playwright-webkit` — per-browser distributions.
14`playwright-browser-chromium`, `playwright-browser-firefox`, `playwright-browser-webkit` — binary packages.
15 
16### Tooling Packages
17 
18| Package | Purpose |
19|---------|---------|
20| `html-reporter` | HTML test report viewer |
21| `trace-viewer` | Trace viewer UI |
22| `recorder` | Test recorder |
23| `web` | Shared web UI components |
24| `injected` | Scripts injected into browser pages |
25 
26### Component Testing
27 
28`playwright-ct-core`, `playwright-ct-react`, `playwright-ct-vue`
29 
30### Key Directories
31 
32| Directory | Purpose |
33|-----------|---------|
34| `tests/` | All test suites (page, library, playwright-test, mcp, components, etc.) |
35| `docs/src/` | API documentation — **source of truth** for public TypeScript types |
36| `docs/src/api/` | Per-class API reference (`class-page.md`, `class-locator.md`, etc.) |
37| `utils/` | Build scripts, code generation, linting, doc tools |
38| `browser_patches/` | Browser engine patches |
39 
40## Build
41 
42```bash
43npm run build # Full build
44npm run watch # Watch mode (recommended during development)
45```
46 
47Assume watch is running and code is up to date. Generated files (types, channels, validators) are produced by watch automatically.
48 
49## Lint and type check
50 
51```bash
52npm run flint
53```
54 
55Runs all lint checks in parallel: eslint, tsc, doclint, check-deps, generate_channels, generate_types, lint-tests, test-types, lint-packages, code-snippet linting.
56 
57**Always run `flint` before committing.** Do not use `tsc --noEmit` or individual lint commands separately.
58 
59## Test Commands
60 
61| Command | Scope |
62|---------|-------|
63| `npm run ctest <filter>` | Chromium only library tests — **use during development** |
64| `npm run test <filter> -- --project=<chromium,firefix,webkit>` | All library / per project |
65| `npm run ttest <filter>` | Test runner (`tests/playwright-test/`) |
66| `npm run ctest-mcp <filter>` | Chromium only MCP tools (`tests/mcp/`) |
67| `npm run test-mcp <filter> -- --project=<chromium,firefox,webkit>` | MCP tools (`tests/mcp/`) |
68 
69 
70### Filtering
71 
72```bash
73npm run ctest tests/page/locator-click.spec.ts # Specific file
74npm run ctest tests/page/locator-click.spec.ts:12 # Specific location
75npm run ctest -- --grep &quot;should click&quot; # By test name
76npm run ctest-mcp snapshot # By file name part
77```
78 
79### Test Directories and Fixtures
80 
81| Directory | Import | Key Fixtures | What to Test |
82|-----------|--------|--------------|--------------|
83| `tests/page/` | `import { test, expect } from './pageTest'` | `page`, `server`, `browserName` | User interactions: click, fill, navigate, locators, assertions |
84| `tests/library/` | `import { browserTest, expect } from '../config/browserTest'` | `browser`, `context`, `browserType` | Browser/context lifecycle, cookies, permissions, browser-specific features |
85| `tests/playwright-test/` | `import { test, expect } from './playwright-test-fixtures'` | test runner fixtures | Test runner: reporters, config, annotations, retries |
86| `tests/mcp/` | `import { test, expect } from './fixtures'` | `client`, `server` | MCP tools via `client.callTool()` |
87 
88**Decision rule**: Does the test need `browser`/`browserType`/`context` → `tests/library/`. Just needs `page` + `server` → `tests/page/`.
89 
90## DEPS System
91 
92Import boundaries are enforced via `DEPS.list` files (52+ across the repo), checked by `npm run flint`.
93 
94**Key rule**: Client code NEVER imports server code. Server code NEVER imports client code. Communication is only through the protocol.
95When creating or moving files, update the relevant `DEPS.list` to declare allowed imports. Files marked `"strict"` can only import what is explicitly listed.
96 
97## Coding Convention
98 
99For exported classes:
100- `private _method()` — only used within the class itself
101- `_method()` (no `private`) — used by other code in the same file, but not outside the file
102- `method()` (public) — used in other files
103 
104Non-exported classes have no naming convention; they are internal implementation details.
105 
106## Commit Convention
107 
108Before committing, run `npm run flint` and fix errors.
109 
110Semantic commit messages: `label(scope): description`
111 
112Labels: `fix`, `feat`, `chore`, `docs`, `test`, `devops`
113 
114```bash
115git checkout -b fix-39562
116# ... make changes ...
117git add &lt;changed-files&gt;
118git commit -m &quot;$(cat &lt;&lt;'EOF'
119fix(proxy): handle SOCKS proxy authentication
120 
121Fixes: https://github.com/microsoft/playwright/issues/39562
122EOF
123)&quot;
124# **Never `git push` without an explicit instruction to push.**
125git push origin fix-39562
126gh pr create --repo microsoft/playwright --head username:fix-39562 \
127 --title &quot;fix(proxy): handle SOCKS proxy authentication&quot; \
128 --body &quot;$(cat &lt;&lt;'EOF'
129## Summary
130- &lt;describe the change very! briefly&gt;
131 
132Fixes https://github.com/microsoft/playwright/issues/39562
133EOF
134)&quot;
135```
136 
137Never add Co-Authored-By agents in commit message.
138Never add "Generated with" in commit message.
139Never add test plan to PR description. Keep PR description short — a few bullet points at most.
140Branch naming for issue fixes: `fix-<issue-number>`
141 
142**Never amend commits.** Always create a new commit for follow-up changes, even when iterating on an open PR. Amending rewrites history and forces a force-push, losing the incremental review trail. Only amend if the user explicitly says so.
143 
144**Never `git push` without an explicit instruction to push.** Applies even when a PR is already open for the branch — additional commits are immediately visible to reviewers. Commit locally, report what was committed, and wait. Only push when the user's message contains "push", "upload", "create PR", "ship it", or equivalent.
145 
146## Development Guides
147 
148Detailed guides for common development tasks:
149 
150- **[Architecture: Client, Server, and Dispatchers](.claude/skills/playwright-dev/library.md)** — package layout, protocol layer, ChannelOwner/SdkObject/Dispatcher base classes, DEPS rules, end-to-end RPC flow, object lifecycle
151- **[Adding and Modifying APIs](.claude/skills/playwright-dev/api.md)** — 6-step process: define docs → implement client → define protocol → implement dispatcher → implement server → write tests
152- **[MCP Tools and CLI Commands](.claude/skills/playwright-dev/tools.md)** — `defineTool()`/`defineTabTool()`, tool capabilities, CLI `declareCommand()`, config options, testing with MCP fixtures
153- **[Vendoring Dependencies](.claude/skills/playwright-dev/vendor.md)** — bundle architecture, esbuild setup, typed wrappers, adding deps to existing bundles
154 

Commands it names

  • npm run build
  • npm run watch
  • npm run flint
  • npm run ctest tests/page/locator-click.spec.ts
  • npm run ctest tests/page/locator-click.spec.ts:12
  • npm run ctest -- --grep "should click"
  • npm run ctest-mcp snapshot
  • git checkout -b fix-39562
  • git add <changed-files>
  • git commit -m "$(cat <<'EOF'
  • git push origin fix-39562
  • gh pr create --repo microsoft/playwright --head username:fix-39562 \
  • playwright-core
  • playwright
  • playwright-test
  • playwright-client
  • playwright-chromium
  • playwright-firefox
  • playwright-webkit
  • playwright-browser-chromium
  • playwright-browser-firefox
  • playwright-browser-webkit
  • playwright-ct-core
  • playwright-ct-react
  • playwright-ct-vue
  • tsc --noEmit
  • npm run ctest <filter>
  • npm run test <filter> -- --project=<chromium,firefix,webkit>
  • npm run ttest <filter>
  • npm run ctest-mcp <filter>
  • npm run test-mcp <filter> -- --project=<chromium,firefox,webkit>
  • git push

Sections

  • Monorepo Packages
  • Browser Packages
  • Tooling Packages
  • Component Testing
  • Key Directories
  • Build
  • Lint and type check
  • Test Commands
  • Filtering
  • Test Directories and Fixtures
  • DEPS System
  • Coding Convention
  • Commit Convention
  • ... make changes ...
  • **Never `git push` without an explicit instruction to push.**
  • Summary
  • Development Guides

What it covers

buildtestlint-formatcode-stylearchitecturetypesgit-prdependenciesuimonorepodo-not

Stack — with the evidence

typescript

(1.00)

javascript

(1.00)

csharp

(1.00)

eslint

(1.00)

desktop-app

(1.00)

node

(0.95)

playwright

(0.95)

react

(0.70)

vite

(0.70)

swift

(0.60)

dotnet

(0.60)

github-actions

(0.60)

Format

CLAUDE.md

Claude Code's memory file. Shaped like AGENTS.md but with two things it lacks: @path imports, so shared rules live in one place, and a user-scope layer that follows the developer across repos rather than shipping with the code.

What the corpus says about it

Repository

Owner
microsoft
Language
—
License
—
Archived
no

All configs in this repo

Also in microsoft/playwright

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
microsoft/playwright.github/copilot-instructions.md · 94kCopilot instructionstypescriptjavascript+10git16/1003 days ago
Diff against .github/copilot-instructions.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
dotCMS/corecore-web/CLAUDE.md · 950CLAUDE.mdjavanode+13teststylearchtesting-strategy+3100/1003 days ago
Adit-Jain-srm/NightmareNetCLAUDE.md · 45CLAUDE.mdtypescriptpython+18buildtestlint-formatstyle+6100/1003 days ago
nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.4kCLAUDE.mdtypescriptnode+16setupbuildstylearch+2100/1003 days ago
filamentphp/filamentCLAUDE.md · 32kCLAUDE.mdphplaravel+5buildtestlint-formatstyle+7100/1003 days ago
bagisto/bagistoCLAUDE.md · 28kCLAUDE.mdphplaravel+8setupbuildteststyle+5100/1003 days ago
livewire/livewireCLAUDE.md · 24kCLAUDE.mdphpvitest+4setupbuildteststyle+4100/1003 days ago
dotCMS/coreCLAUDE.md · 950CLAUDE.mdjavanode+9setupbuildteststyle+799/1003 days ago
lollipopkit/flutter_server_boxCLAUDE.md · 8.3kCLAUDE.mddartflutter+8buildteststylearch+298/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack