A 2026 spike (Mr Onion’s TFP-036, full writeup at
skills/INTROSPECT_CRAWL_SPIKE.md if you have that repo open) checked this
directly against Playwright MCP’s real, complete 73-tool list rather than
assuming. The verdict, on both halves:
browser_navigate is explicitly
single-page. Nothing in the 73-tool list extracts hrefs, resolves them,
or walks a site. If the goal is “every page this app has,” there is no
ready-made tool for that — you have to drive it yourself.browser_snapshot gives you a real accessibility tree — and stops
there. It’s an honestly better source for element role and name than
guessing from tag name, because it reflects the browser’s actual computed
ARIA semantics. But nothing in it tells you which of those elements is
worth an assertion, what HTTP status a “Delete” button should produce,
whether a link needs a login first, or what section of the page a button
belongs to. Those are testing judgments, not DOM facts, and no
general-purpose browser-automation tool has a reason to make them.So: use browser_snapshot (or equivalent) as your raw material for this
page. Use the technique below to decide which pages to visit and what
each element on each page means for testing.
write-playwright-testwrite-playwright-test turns one described page or flow into one test
file. It assumes you already know what to test. This skill is the step
before that on a real, unfamiliar, multi-page app: build the page map,
then classify each page’s actionable surface, then hand pages one at a
time to write-playwright-test (or write tests directly from the
classification below).
Don’t run this on a single already-described page — that’s
write-playwright-test’s job and this skill adds nothing there.
There’s no single tool call for this; drive it as an explicit loop using
whatever navigation/evaluation tool you have (browser_navigate +
browser_evaluate, or repeated browser_snapshot calls after navigating).
The algorithm, taken directly from Mr Onion’s own crawl/route.ts:
discoveredFrom: null.a[href] on the page (browser_evaluate
running Array.from(document.querySelectorAll('a[href]')).map(a =>
a.href) is the direct equivalent of what the real code does in-page).mailto:, tel:, javascript:, or data:,pdf doc docx xls xlsx csv zip ppt pptx jpg jpeg png gif svg webp ico
css js json xml txt mp3 mp4 avi mov woff woff2 ttf eot (with an
optional trailing ?query or #hash)./ itself). Two
URLs that differ only by ?tab=2 or a trailing / are the same page.{path, url, title, discoveredFrom} for the page you just
visited, then continue from step 2.Report the resulting page list before moving to Step B — it’s a useful artifact on its own (a sitemap the user may not have had), and it’s the thing Step B iterates over.
For each page from Step A, extract and classify — this is the part with no
tool equivalent. Reproduce it with browser_evaluate (running the logic
below as in-page JS) or by applying this same judgment to a
browser_snapshot read; either way, the classification is the point, not
the extraction mechanism.
Every a, button, non-hidden input, select, textarea, form, and
[role=button]. For each, work out:
Role — from tag/type, not a guess at computed ARIA (that part
browser_snapshot already does better; use it if you have it):
| Element | Role |
|---|---|
a |
link |
button |
button |
select |
combobox |
textarea |
textbox |
input[type=checkbox] |
checkbox |
input[type=radio] |
radio |
input[type=submit\|button\|reset] |
button |
other input |
textbox |
form |
form |
Accessible name — in priority order: aria-label, an associated
<label> (via closest("label") or label[for=id]), element text (or
value/placeholder/name for inputs), first non-empty wins.
Container label — the answer to “what section is this in,” which
nothing in the DOM encodes directly. Walk up to 6 ancestor levels; at each
level, check the ancestor’s direct children for a heading/label
(h1-h6, p, legend, label, [role='heading']) — if that ancestor also
contains more than one link, treat its direct-child label as the
container’s label. Otherwise check each ancestor’s previous siblings for
the same selectors. If nothing found up the tree, check the element’s own
previous siblings. First match wins; empty string if none.
Interaction category — checked in this order against
(text + url + containerLabel).toLowerCase():
nav or [role='navigation'] → navigation/api call|api response|status code|send an api call|
created|no ?content|nocontent|moved|bad[-\s]?request|unauthorized|
forbidden|invalid[-\s]?url|not[-\s]?found/ → apiform/input/select/textarea → formbutton: text matches /submit|search|filter|save|login|
sign in|register|send|apply/ → form; matches /next|previous|back|
home|menu|open|continue|visit/ → navigation; otherwise → actiona → navigation, everything else → actionExpected HTTP status — only meaningful when category is api; match
(text + url + containerLabel).toLowerCase() against:
| Pattern | Status |
|---|---|
created |
201 |
no content / nocontent |
204 |
moved |
301 |
bad request |
400 |
unauthorized |
401 |
forbidden |
403 |
invalid url / not found |
404 |
This is a text-based guess, not an observed response — say so when you report it, and verify it against a real network call before asserting on it in a generated test.
For every a[href], beyond role/name/container above:
mailto: prefix → mailto; # prefix → anchor;
has a download attribute or matches
/\.(pdf|doc|docx|xls|xlsx|csv|zip|ppt|pptx)([?#].*)?$/i → download;
otherwise resolve the href and compare origins → internal or
external.target=_blank → new-tab; any other non-_self
target → new-window; otherwise → same-window.requiresAuth heuristic — (text + href + containerLabel)
matched against /login|sign in|signin|account|profile|admin|dashboard|
checkout|orders|billing|settings|my /. This is a heuristic, not a proof
of an auth wall — flag it as “looks auth-gated,” and confirm with a real
unauthenticated request before treating it as fact.display !== 'none', visibility !== 'hidden',
and a non-zero bounding-box size. Worth computing per link in one pass
rather than one at a time (a single-element visibility check tool, if
that’s all you have, doesn’t scale to “annotate every discovered link”).iframe/frame/img/script/link (stylesheet)/video/audio/
source/object/embed/form, plus a scan of [onclick] attributes for
location.href = / window.open( patterns, and data-href/data-url/
routerlink/ng-href/xlink:href attributes (classify these as data).
Record same-origin/visibility the same way as links.
Per page, produce something shaped like:
/pricing (discovered from /)
actionable elements: 12 (3 form, 4 navigation, 5 action)
links: 8 (6 internal, 2 external, 1 flagged requires-auth)
embedded: 2 iframes, 1 stylesheet
with the full per-element detail available on request — this is the
handoff artifact for write-playwright-test, a coverage plan, or a direct
answer to “what’s on this site.”
State plainly, in the report, that this was driven by iterating your own browser tool rather than a single built-in “crawl” or “classify” call — that’s the actual gap this skill closes (see the “Why” section above). If you don’t have a live browser tool available at all, say so and stop rather than fabricating a page map or element list.