65 / 168 · 01 Agent Skills for Browser Automation · Hybrid Strategies: Using Skills and MCP Together← prev⊞ allnext →☰ Read as one page
9.7Anti-Patterns to Avoid
Don't: Use MCP for Every Click When You Have a Filesystem
# BAD: Each action via MCP from inside Claude Code
browser_click(ref=e5) # tree streamed with the response
browser_type(ref=e3, "hi") # tree streamed again
browser_click(ref=e7) # and again
# Schemas every turn + a tree per action, for no benefit
Don't: Act on Guessed or Stale Refs
# BAD: refs from a page that has since changed
playwright-cli click e5 # ref belonged to the old snapshot
playwright-cli click e12 # guessing
# Wasted attempts + error handling
# GOOD: refs always come from a current snapshot
playwright-cli snapshot # refresh
# read YAML → button "Submit" [ref=e9]
playwright-cli click e9
Do: Match the Transport to the Environment
# GOOD
Filesystem available (Claude Code, CI) → playwright-cli + SKILL.md
No filesystem (hosted/sandboxed agent) → Playwright MCP
Both needed on one browser → browser.bind() shares the instance