agentleFS
zcorpan-aizcorpan-ai/web-platform-skills/skills/wpt/SKILL.md

wpt

Skill2 starsChanged 44 days agoMITView on GitHub

Use when writing, running, or debugging web-platform-tests (wpt), or when measuring how browsers actually behave (event and task ordering, timing, loading) with a throwaway test or by loading a page in Firefox, Chrome, or Safari, including before using the `firefox-nightly-mcp`, `chrome-canary-mcp`, or `safari-tp-mcp` browser tools. Triggers on "wpt", "web-platform-tests", "write a test", "./wpt run", "what do browsers do", "test this in Firefox/Chrome/Safari".

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 1

    1. zcorpan/web-platform-skills★ 2100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When many failures exist, baseline before attributing them to the change: git stash, run, git stash pop.

    line 13
  2. Very specific:

    Write a throwaway test in a scratch dir and dump observations with assert_true(false, '\n' + log.join('\n')).

    line 18
  3. Very specific:

    If browser MCP servers are configured, use them for interactive exploration only, and report results from ./wpt run:

    line 25
  4. Very specific:

    Before the reply that reports results, stop everything you started: ./wpt serve, background ./wpt run, WebDriver servers (geckodriver, …

    line 32
  5. Distinctive:

    If the user may want to test manually (e.g.

    line 37
  6. Distinctive:

    Prefer a sync point tied to the spec step over events (events are queued at a different step, and engines disagree on order).

    line 42
  7. Very specific:

    Don't listen for load on a parser-inserted iframe/img from a later script.

    line 47
  8. Very specific:

    Don't rely on named access on the global (iframe for id=iframe).

    line 48
  9. Distinctive:

    Don't add code comments unless really necessary for understanding.

    line 49

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

wpt

Running tests

  • ./wpt run --no-pause --yes --binary "<path>" <product> <paths> (--yes skips the webdriver prompt, --no-pause stops hanging).
  • Local browsers on macOS: /Applications/Firefox Nightly.app/Contents/MacOS/firefox (firefox), /Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary (chrome), --webkit-port=safari safari (Safari release), --webkit-port=safari --channel preview safari (Safari TP). Check the "Starting WebDriver:" line if unsure which channel ran.
  • Re-run timing-sensitive results ~3 times before reporting them as stable.
  • When many failures exist, baseline before attributing them to the change: git stash, run, git stash pop.
  • Re-run with an added settle delay to rule out artifacts from the load event or queued tasks.

Measuring browser behavior

  • Write a throwaway test in a scratch dir and dump observations with assert_true(false, '\n' + log.join('\n')). Record sync, microtask, task, rAF, and event handler timing in one run.
  • Afterwards, delete the scratch dir and verify with git status.

Driving a browser at an external URL

  • Chrome: chrome --headless --disable-gpu --virtual-time-budget=8000 --dump-dom "<url>".
  • Firefox/Safari: raw W3C WebDriver over HTTP (POST /session, /session/{id}/url, /session/{id}/execute/sync, DELETE /session/{id}). geckodriver is at _venv3/bin/geckodriver in a bootstrapped wpt checkout. If safaridriver hangs, fall back to ./wpt run --channel preview on a local equivalent.
  • If browser MCP servers are configured, use them for interactive exploration only, and report results from ./wpt run:
    • safari-tp-mcp: create_tab, navigate_to_url, evaluate_javascript, browser_console_messages, screenshot. evaluate_javascript takes a function body: use an explicit return or get null.
    • chrome-canary-mcp (isolated profile): new_page, evaluate_script, list_console_messages, take_screenshot. Every page tool needs pageId (from new_page/list_pages); evaluate_script takes a function (() => ...).
    • firefox-nightly-mcp (temp profile): new_page, evaluate_script, screenshot_page, close_firefox_session. evaluate_script takes a function (() => ...). No console tool by default.

Cleaning up

  • Before the reply that reports results, stop everything you started: ./wpt serve, background ./wpt run, WebDriver servers (geckodriver, chromedriver, safaridriver), and browsers. Quit each browser; closing tabs or pages leaves it running:
    • Firefox Nightly (firefox-nightly-mcp): close_firefox_session.
    • Chrome Canary (chrome-canary-mcp): kill the Canary main process that is a child of this session's chrome-devtools-mcp.
    • Safari TP (safari-tp-mcp, safaridriver): kill the --automation Safari TP process started (ps -o lstart) inside your test window; it's reparented to pid 1.
  • Other sessions' browsers and MCP servers may be running: kill only yours. This session's MCP servers are children of the agent's process (under Claude Code, claude) that is an ancestor of your shell. Check ps for leftovers afterwards.
  • If the user may want to test manually (e.g. you gave them a URL on a local server), leave it running and offer to stop it later.

Writing tests

  • Await events/callbacks (wrap in a promise) rather than polling. Poll with await t.step_wait(() => video.currentSrc == source.src, 'desc', 3000, 5) (adjust the 100ms default as needed) only for spec steps with no observable event, e.g. an algorithm resuming at a microtask checkpoint; don't sync those on a parse-time inline script (engines don't resume there).
  • Prefer a sync point tied to the spec step over events (events are queued at a different step, and engines disagree on order).
  • Sanity-check the sync point: assert the expected work is still pending, so the test fails loudly if the state is wrong.
  • New resources/ handler knobs: add an optional query param behind a presence check, so existing callers are unaffected.
  • A test that fails identically in all browsers for an unrelated reason is worse than no test. Verify it would pass if the feature were implemented correctly.
  • Give each media/image resource in a test a distinct URL (add a query string) so a cached copy can't make a lazy resource load eagerly.
  • Don't listen for load on a parser-inserted iframe/img from a later script; it may already have fired. Await the window load event instead (such elements delay it).
  • Don't rely on named access on the global (iframe for id=iframe); use document.querySelector()/getElementById().
  • Don't add code comments unless really necessary for understanding.
  • Opening a wpt PR together with a spec PR: follow file-issue's "Items that link to each other".

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.