This file is the router. Architecture and data flow are in ARCHITECTURE.md. Path-scoped rules are in .claude/rules/ and load when a matching file is read. Package history and debt are in each packages/<pkg>/CLAUDE.md.
A devtools dashboard for end-to-end browser tests: WebdriverIO, Nightwatch and Selenium adapters push one normalized event stream through a backend into a Lit UI.
Run from repo root unless noted.
| Command | What it does |
|---|---|
pnpm install |
Install workspace dependencies. |
pnpm build |
Build all packages (pnpm -r build). |
pnpm typecheck |
Type-check all packages (four tsc --noEmit programs). CI build job gate. |
pnpm test |
Run the vitest suite once (no coverage). |
pnpm test:watch |
Run vitest in watch mode. |
pnpm test:coverage |
Run vitest with v8 coverage. Not a CI gate; see Known debt. |
pnpm test:ui |
Component tests (wdio run packages/app/wdio.conf.ts). CI component-tests job. |
pnpm lint |
Lint all packages in parallel, including eslint-plugin-security. |
pnpm demo:wdio / :nightwatch / :selenium / :python:pytest |
Run the per-framework examples. Default modes and DEVTOOLS_MODE behaviour: examples/CLAUDE.md |
pnpm demo:wdio:mobile / :selenium:mobile / :nightwatch:mobile / :python:mobile |
The same against Appium. Details: examples/CLAUDE.md, examples/MOBILE.md |
pnpm dev |
Run all packages in parallel dev mode. |
pnpm smoke:fixtures [--port N] |
Serve the local fixture site the desktop examples drive (default http://127.0.0.1:4567). Details: .claude/rules/examples-smoke.md |
pnpm smoke:assert --expect <name> ... |
Check trace zips against packages/conformance/smoke/expectations/<name>.json. Details: packages/conformance/CLAUDE.md |
pnpm player:hosted |
Build and serve the hosted trace player at http://localhost:4173. Details: .claude/rules/hosted-player.md |
pnpm player:e2e [--headed] [--port N] |
Hosted-player check in headless Chrome. Details: packages/conformance/CLAUDE.md, .claude/rules/hosted-player.md |
pnpm docs:capabilities |
Render the capability tables into README.md (--website, --check, --parity). Details: .claude/rules/capability-tables.md |
python3 packages/selenium-devtools-py/scripts/changes.py next-version |
Version a Python-adapter release would publish. Details: .claude/rules/releasing.md |
selenium-devtools per-runner variants: pnpm --filter @wdio/selenium-devtools example:mocha / :mocha:allure / :jest / :cucumber.
Defined in root tsconfig.json:
| Alias | Resolves to |
|---|---|
@/* |
packages/app/src/* |
@components/* |
packages/app/src/components/* |
@core/* |
packages/app/src/core/* (app-internal — not the framework-agnostic packages/core) |
@wdio/devtools-backend / * |
packages/backend/src/... |
@wdio/devtools-script / * |
packages/script/src/... |
@wdio/devtools-script/types |
packages/script/types.d.ts |
@wdio/devtools-service / * |
packages/service/src/... |
@wdio/selenium-devtools / * |
packages/selenium-devtools/src/... |
@wdio/nightwatch-devtools/* |
packages/nightwatch-devtools/src/* (subpaths only, for type imports such as the option types) |
@wdio/devtools-shared / * |
packages/shared/src/... |
@wdio/devtools-core / * |
packages/core/src/... |
@wdio/devtools-trace / * |
packages/trace/src/... |
@wdio/elements / * |
packages/elements/src/... |
These exist so imports stay short and grep-able. Long relative paths (../../../components/…) aren't used.
The @core/* name is a historical alias for app-internal helpers and predates packages/core. They don't collide because they resolve to different roots, but the names are confusable.
sharedowns every shared type, constant, schema and HTTP/WS contract. No package re-declares one.traceholds the pure transforms from captured events to trace zips, and the zip reader. It imports onlyshared.backendmay importtrace; it may not importcore.coreholds framework-agnostic capture, parsing and transport.- Adapters (
service,nightwatch-devtools,selenium-devtools,selenium-devtools-py) are thin: framework hooks, driver patching, config. - The JS adapters import
sharedandcore.selenium-devtools-pyimports neither (it ships no Node); its shared logic is mirrored and held equal bypackages/shared/mirror-vectors.json(.claude/rules/mirror-vectors.md). - No adapter imports another (enforced by
eslint.config.cjs). Only examples and conformance scenarios import adapters at runtime;packages/conformance/src/capability-options.tsusesimport typeonly. backendandappimportsharedand each other over WS/HTTP. Neither imports an adapter.appmay also import@wdio/devtools-trace/trace-reader, the reader the hosted player runs in the browser; no other trace module.otelimportssharedand@wdio/devtools-trace/trace-readeronly. It is not an adapter and imports neithercorenor an adapter; no ESLint rule enforces this.- Boundaries are typed: every
fetchandws.sendhas asharedtype, and noanycrosses a package boundary. shared,traceandcoreare bundled into their consumers, never externalised: .claude/rules/bundling.md.- Files own one concern. Size caps and style: .claude/rules/code-style.md.
max-lines(500),max-lines-per-function(50) andno-explicit-anyarewarnineslint.config.cjs, sopnpm lintpasses with violations; size caps are not a CI gate. - A helper that is framework-agnostic but used by one adapter stays in that adapter until a second consumer appears, then moves to
core. - A duplicate is consolidated into
sharedby the next change that touches either copy; adapters re-export shared definitions when a local name must stay stable (e.g. nightwatch'sTEST_FILE_PATTERN). SocketMessage<T extends WsMessageScope>is the canonical WS wire format; receivers narrow onscope.- A framework-forced
anyis cast to a typed shape immediately at the boundary, with the cast site saying why. traceimportingcoreis an ESLint error (eslint.config.cjs).
Tests run with vitest at the root (pnpm test).
sharedandcore: unit tests for every exported function and type guard. These are the foundation; regressions cascade.- Bug fixes (any package): a regression test that fails before the fix and passes after. When a real test is genuinely impossible (e.g. requires a live browser the infra doesn't have), the PR description says so.
- New HTTP/WS contracts: a test that exercises the contract end-to-end at least once.
Non-trivial parsing or transformation logic in adapters has unit tests. Hook wiring is verified manually via examples/<framework>/. backend and app test their non-UI logic (parsers, transforms, state reducers); UI verification is manual.
For UI or runtime changes, examples/<framework>/ is the verification harness. Type-checks and unit tests verify code correctness, not feature correctness — claiming a UI change works on the basis of tsc --noEmit alone misses the point.
When CI can't run an example (no real browser), the PR description says so explicitly.
packages/core/tests/script-loader.test.ts is gated by it.skipIf(!scriptPackageAvailable) and needs @wdio/devtools-script built first.
The decision tree from ARCHITECTURE.md "Where things live" is the starting point. The general shape:
- Shared concept →
shared. - Pure transform producing trace-zip content →
trace. - Framework-agnostic capture/reporting logic →
core. - Framework-specific glue → the matching adapter.
- Server route/WS handler →
backend(contract insharedfirst). - UI →
app. - Code that runs in the browser under test →
script.
When the right place is ambiguous (something between shared and core, or between core and an adapter), the question that resolves it is: who else would want this? If the answer is "any future adapter would," it's core. If "only the framework with X-specific API does," it's the adapter. If "the backend would, to build a zip for an adapter that can't," it's trace.
- Leave touched code more aligned with these conventions than you found it; cleanup scope matches change scope.
- New code does not copy existing violations; those are documented debt (§ Known debt).
- CI jobs are defined in
.github/workflows/ci.yml(build,component-tests,hosted-player,examples-smoke,wdio-peer). Don't push red. - A changeset for a published npm package, or a
changes/fragment for the Python adapter — see.claude/rules/releasing.md. - For UI or runtime changes: verify in
examples/<framework>/. - Deeper security findings (taint flow, polynomial-redos with adjacent quantifiers) surface on the PR's CodeQL scan; review and fix those before merge.
- Small, focused. Don't bundle unrelated changes.
- Imperative mood. The commit message explains why; the diff shows what.
- New commits, not amends to pushed/shared commits.
- No
--no-verifyto skip hooks. If a hook fails, the underlying issue gets fixed.
- One concern per PR. A refactor and a feature are two PRs.
- A PR touching more than one adapter package answers in its description: why isn't this in
core?
README and webpage mirror rules, and generated capability tables: .claude/rules/capability-tables.md.
Read a package's CLAUDE.md before changing it; codegraph reads do not auto-load it.
shared: types, constants, schemas, HTTP/WS contracts. Notes: packages/shared/CLAUDE.mdcore: framework-agnostic capture, normalisation and transport for the adapters. Notes: packages/core/CLAUDE.mdtrace: trace-zip writer and reader. Notes: packages/trace/CLAUDE.mdscript: the page-injected collector bundle. Notes: packages/script/CLAUDE.mdservice: WebdriverIO service adapter. Notes: packages/service/CLAUDE.mdnightwatch-devtools: Nightwatch plugin adapter. Notes: packages/nightwatch-devtools/CLAUDE.mdselenium-devtools: Selenium adapter for mocha, jest and cucumber. Notes: packages/selenium-devtools/CLAUDE.mdselenium-devtools-py: Python pytest and Selenium adapter; ships no Node. Notes: packages/selenium-devtools-py/CLAUDE.mdbackend: Node dashboard server (WS/HTTP, reruns, zip serving). Notes: packages/backend/CLAUDE.mdapp: Lit dashboard UI and the hosted trace player. Notes: packages/app/CLAUDE.mdconformance: smoke assertions, capability tables, hosted-player e2e,KNOWN_GAPS. Notes: packages/conformance/CLAUDE.mdotel:@wdio/opentelemetry, thewdio-otelCLI that pushes artifacts manifests and retained traces to an OTLP collector. No CLAUDE.md.elements:@wdio/elements, element detection scripts for WebdriverIO. No CLAUDE.md.examples/: runnable demos per framework, fixture site, mobile. Notes: examples/CLAUDE.md
Debt and design history live in the owning package's CLAUDE.md, not here.
- Architecture and capture debt: the CLAUDE.md of the package whose files an entry names; a cross-adapter entry sits in
core,sharedortrace. - File-size overruns: packages/service, nightwatch-devtools, selenium-devtools and selenium-devtools-py CLAUDE.md.
- Coverage gaps (worst first): packages/service and nightwatch-devtools CLAUDE.md.
- The coverage thresholds in
vitest.config.ts(85/77/86/85) are not a CI gate: CI'spnpm testcollects no coverage.
When a convention proves wrong in practice, update it here rather than breaking it silently.