Smart Locator Agent

Smart Locator Agent is a skill for Claude Code, Codex from anhtester/antigravity-testing-kit. It costs 28 tokens per session (778 once invoked), scanned A, original, MIT.

A tool for creating stable selectors for UI automation with Playwright, Selenium, or Appium. It examines the page or mobile app structure instead of guessing.

In plain words
What is it for?
Use it to create or review selectors, move them between supported automation tools, and receive a primary locator plus a fallback when needed.
Why use it?
It reduces fragile tests that break when page structure or styling changes and checks that a selector identifies the intended element.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/anhtester/antigravity-testing-kit/smart_locator_agent
Any agent
npx skills add anhtester/antigravity-testing-kit --skill smart_locator_agent
Clone the repo
git clone --depth 1 https://github.com/anhtester/antigravity-testing-kit

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Smart Locator Agent

README.md
[![agentmods](https://agentmods.dev/badge/skills/anhtester/antigravity-testing-kit/smart_locator_agent.svg)](https://agentmods.dev/skills/anhtester/antigravity-testing-kit/smart_locator_agent)
Your own site
<a href="https://agentmods.dev/skills/anhtester/antigravity-testing-kit/smart_locator_agent"><img src="https://agentmods.dev/badge/skills/anhtester/antigravity-testing-kit/smart_locator_agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 778 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00028 $0.00778
Opus 5 $0.00014 $0.00389
Sonnet 5 $0.00006 $0.00156
Haiku 4.5 $0.00003 $0.00078

Measured 5d ago against content hash 4e7d04a5ec38, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

Smart Locator Agent scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.agent/skills/smart_locator_agent/SKILL.md · 146 lines

How it starts

The opening of the file, as written. The whole thing — 146 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Smart Locator Agent

Purpose: Generate stable and maintainable locators for UI automation.

Applicable frameworks:

  • Playwright
  • Selenium
  • Appium

When to Use

Use this skill when:

  • Generating locators for new UI elements
  • Reviewing existing locators for stability
  • Migrating locators between frameworks

Responsibilities

The agent must:

  1. Inspect the DOM or mobile UI hierarchy (NEVER guess)
  2. Identify stable attributes
  3. Generate a reliable locator
  4. Validate locator uniqueness
  5. Provide fallback locator if primary is fragile

Locator Priority

Use the following priority order:

  1. Accessibility attributes (aria-label, role)
  2. data-testid / data-test / data-qa
  3. id
  4. name
  5. Framework semantic locator
  6. css selector
  7. xpath (last option)

Note: For detailed rules, refer to .agent/rules/locator_strategy.md.


Playwright Locators

Preferred locator methods:

  1. getByRole() — Best for semantic elements
  2. getByLabel() — Best for form fields with labels
  3. getByPlaceholder() — Best for inputs with placeholder text
  4. getByText() — Best for text content
  5. getByTestId() — Best when data-testid is available

Example:

page.getByRole("button", { name: "Submit" })
page.getByLabel("Email")
page.getByPlaceholder("Enter your password")

Note: For detailed rules, refer to .agent/rules/playwright_rules.md.


Selenium Locators

Preferred order:

  1. id
  2. data-testid
  3. name
  4. cssSelector
  5. xpath

Example:

driver.findElement(By.id("login-button"));
driver.findElement(By.cssSelector("button[data-testid='submit-btn']"));

Note: For detailed rules, refer to .agent/rules/selenium_rules.md.


Appium Locators

Preferred order:

  1. accessibility id
  2. resource-id
  3. id
  4. iOS predicate string
  5. class chain
  6. xpath

Example:

driver.findElement(AppiumBy.accessibilityId("login_button"));
driver.findElement(AppiumBy.id("com.app:id/login_button"));
driver.findElement(AppiumBy.iOSNsPredicateString("label == 'Login'"));

Read the full file on GitHub · 146 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 146 lines · 28 tokens per session scan A 4e7d04a5ec38

Subscribe to this mod's changes

Smart Locator Agent is a skill published in the GitHub repository anhtester/antigravity-testing-kit (131 stars, last pushed 1mo ago), licensed MIT. It adds 28 tokens to every session and 778 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

skills-smart-locator-agent

Skill sinh locator ổn định và dễ bảo trì cho UI automation, hỗ trợ Playwright, Selenium và Appium.

anhtester/claude-testing-kit · 30 tokens

browser-testing-with-devtools

Tests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data. Requires the chrome-devtools MCP server to be…

addyosmani/agent-skills · 68 tokens

keploy-e2e-test

End-to-end verification of a change to keploy/keploy using keploy's own record/replay against a real sample application. Use whenever the user asks to test a change, verify a fix, prove that a modification works in practice, add e2e coverage for a PR, reproduce a bug against a sample app, or wire a behavior into CI.…

keploy/keploy · 118 tokens

web-test

Тестирование 1С через веб-клиент — автоматизация действий в браузере. Используй когда пользователь просит проверить, протестировать, автоматизировать действия в 1С через браузер.

Nikolay-Shirokov/cc-1c-skills · 44 tokens

Katalon Studio Testing

Comprehensive testing patterns for Katalon Studio including codeless record-and-playback, Groovy scripted testing, custom keywords, data-driven testing, cross-browser execution, and CI/CD integration with Katalon TestOps.

PramodDutta/qaskills · 51 tokens

browser-automation

Playwright browser automation via MCP. Covers E2E testing, UI review, web scraping, screenshot capture, and general browser interaction. MCP-first — CLI is fallback only.

irahardianto/awesome-agv · 39 tokens