browser-measurement

Validates frontend changes by measuring real browser behavior with Playwright and CDP.

Updated Aug 5, 2026
One-click install
npx skills add https://github.com/amirbiron/claude-skills --skill browser-measurement-amirbiron
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: browser-measurement
Source: https://github.com/amirbiron/claude-skills/tree/main/skills/browser-measurement
Command: npx skills add https://github.com/amirbiron/claude-skills --skill browser-measurement-amirbiron

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires playwright.

What problem does it solve? Frontend fixes are often declared done based on reading code, but browser behavior routinely contradicts what the code suggests — CSS rules get silently overridden, hidden images still download, and test servers keep serving stale code. This Skill replaces inference with measurement: it drives a real browser, verifies the server serves what is on disk, and proves the test itself can fail before trusting a pass. ## Core Features & Use Cases - Verified server restart: The restart_and_verify.sh script restarts a local test server and fails loudly if the served content does not match the edited file on disk, catching stale template caches and silent port conflicts. - Real input measurement: Uses CDP Input.dispatchTouchEvent for genuine touch gestures, network request counting, and sanity controls (scrollability, element presence, actual touch targets) before any claim. - Control runs and mutations: Re-runs the same test against pre-fix code and applies mutations to prove each assertion is capable of failing, turning a passing test into actual evidence. - Use Case: After fixing a CSS bug in a Flask app, restart the server with verification, measure the behavior in Chromium via Playwright, confirm the same test fails on the old code, and only then report the fix as working. ## Quick Start Ask the AI to verify your frontend fix in a real browser using the browser-measurement discipline before reporting that it works.

Frequently Asked Questions about browser-measurement

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I verify a frontend fix actually works in a browser?

Start a local test server, verify it serves the edited file from disk, then measure the behavior with Playwright or CDP rather than reading the code. Run the same test against the pre-fix code as a control to confirm the test detects the original bug.

How to simulate real touch events with Playwright?

Use the Chrome DevTools Protocol with Input.dispatchTouchEvent through a CDP session, with a context created using has_touch=True. TouchEvent objects constructed in JavaScript do not trigger native scrolling, so tests built on them cannot fail meaningfully.

Why does my Flask server serve stale templates after editing?

Flask caches templates when debug=False, so edits made while the server runs never reach the browser. Restart the server and verify the served page contains a marker string from the edited file before trusting any measurement.

Why does lsof return multiple PIDs for one port?

lsof -ti :PORT returns both the listening server and connected clients, such as the browser doing the measuring. Filter with lsof -tiTCP:PORT -sTCP:LISTEN to target only the listener and avoid killing the measurement browser.

When should I not use browser-based measurement?

Skip it for backend logic with no browser consumer, pure refactors that do not change behavior, and documentation changes. It is designed specifically for changes a browser renders or consumes, where code inspection is unreliable.