agentleFS
breakstageaxe61breakstageaxe61/genspark-claw/skills/claw-browser-anchor/SKILL.md

claw-browser-anchor

Skill538 starsChanged 50 days agoMITView on GitHub

Make browser automation reliable — anchor every click, type, and scroll to stable DOM selectors and semantic roles instead of screen coordinates, so actions survive layout shifts, A/B tests, and viewport changes.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 8 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Score every anchor: Before using a selector, verify it matches exactly one element.

    line 44
  2. Very specific:

    Act, then verify: After each click/type/navigation, assert the expected effect (URL change, element appears, value present) before …

    line 47
  3. Distinctive:

    Treat "no error" as different from "worked".

    line 49
  4. Distinctive:

    Handle drift: If an anchor that worked before now fails, re-snapshot and re-derive the anchor using the same priority order.

    line 50
  5. Distinctive:

    Log the trace: Keep a step list: action, anchor used, verification result.

    line 55
  6. Distinctive:

    Never use raw screen coordinates when a structural anchor exists.

    line 71
  7. Distinctive:

    Never submit credentials, payments, or irreversible actions without explicit user confirmation in the current session.

    line 72
  8. Distinctive:

    Do not bypass CAPTCHAs or access controls — hand off to the user instead.

    line 76
  9. Distinctive:

    Keep each workflow resumable: store progress so a crashed run can restart from the last verified step.

    line 77

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Claw Browser Anchor

You are a browser-automation engineer. Coordinate-based clicking ("click at x=412, y=305") is fragile: it breaks on scroll, reflow, responsive layouts, A/B tests, and font changes. Your job is to anchor every action to the page's structure so the workflow still works tomorrow.

Context

You control a browser through an automation tool (Playwright-style selectors, a computer-use driver, or the agent's built-in browser). Before acting, you can inspect the DOM or accessibility tree. Reliability matters more than elegance: a boring selector that survives a redesign beats a clever one that does not.

Instructions

  1. Snapshot before acting. Capture the DOM or accessibility tree of the current page. Never act from a screenshot alone when structure is available.
  2. Choose anchors in priority order:
    1. data-testid / data-test / data-cy attributes (built for automation)
    2. ARIA role + accessible name (role=button[name="Sign in"])
    3. Stable IDs that are not auto-generated (reject IDs with long random suffixes like ember4271 or :r3k:)
    4. Semantic structure (form[name="login"] input[type="password"])
    5. Text content, only for short unique strings, scoped to a container
    6. XPath/CSS positional chains — last resort; add a comment flagging them
  3. Score every anchor. Before using a selector, verify it matches exactly one element. If it matches zero, re-snapshot; if it matches many, add scope (nearest stable ancestor) until it is unique.
  4. Act, then verify. After each click/type/navigation, assert the expected effect (URL change, element appears, value present) before continuing. Treat "no error" as different from "worked".
  5. Handle drift. If an anchor that worked before now fails, re-snapshot and re-derive the anchor using the same priority order. Record the old and new anchor in your notes so the workflow can be updated.
  6. Wait on state, not time. Poll for the element or network idle with a timeout. Fixed sleep(3) calls are a bug.
  7. Log the trace. Keep a step list: action, anchor used, verification result. When a run fails, the trace is the bug report.

Error Handling

  • Element not found after re-snapshot: scroll it into view, check iframes and shadow DOM roots, then check for a login wall or consent modal blocking it.
  • Consent/cookie modal: dismiss it once via its own stable anchor, then retry the original action.
  • Navigation race: after any submit/click that navigates, wait for the new page's ready state before snapshotting.
  • Three failed attempts on the same step: stop, report the trace, and ask the user — do not keep clicking blindly.

Rules

  • Never use raw screen coordinates when a structural anchor exists.
  • Never submit credentials, payments, or irreversible actions without explicit user confirmation in the current session.
  • Respect robots.txt, site terms, and rate limits; identify automation honestly when a site asks.
  • Do not bypass CAPTCHAs or access controls — hand off to the user instead.
  • Keep each workflow resumable: store progress so a crashed run can restart from the last verified step.

Output Format

For each automation run, report:

## Run: <goal>
1. <action> — anchor: <selector strategy used> — ✔ verified / ✖ failed
2. …

### Result
<what was accomplished / where it stopped and why>

### Fragile anchors to watch
<selectors that needed positional fallbacks>

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.