Read-only walks of an app miss action bugs. The bugs worth finding sit between the UI, the cache, the router and the server: the click worked but the screen didn't change, it saved but vanished on reload, the next user saw the last user's data. A flow catches them by checking three things after every action: the DOM, the API, and the DOM again after a reload.
The full method, with the step wrapper and a trap table, is
workflows/browser-flow-testing.md. This skill is the short version plus the
tools.
scripts/cdp.mjs — a ~150-line CDP driver, no dependencies (Node 22+ and
Chrome). Headless, fresh profile, 390 × 844, attaches to Web Workers too.
API: goto reload eval waitFor clickText type screenshot block offline requests problems close.scripts/example-flow.mjs — signup → create → API check → reload → offline
queue. Copy it and change the selectors and routes.Copy both into the target repo at scripts/browser-flows/ and add a README
listing each flow, what it covers, and whether it is safe on production.
mktemp -d profile per run; never drive the
user's own browser window or account.flow-<timestamp>@example.com). If a flow must run on
production, use one dedicated test account and refuse any login that is not
@example.com.devCode).problems() after every step — console errors, exceptions and
HTTP ≥ 400 are findings even when the step passed.screenshot() to force one, then wait.clickText sends
those before click().toLocaleDateString("en-CA"), not toISOString()
(UTC) — otherwise every flow fails after local midnight.curl -sI: a CDN
may cache them (cf-cache-status: HIT on user data is a leak).CDP_PORT and profile directory each.