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

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create or review selectors, move them between supported automation tools, and receive a primary locator plus a fallback when needed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/anhtester/antigravity-testing-kit/smart_locator_agent
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.

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Smart Locator Agent

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00028 $0.00778
Opus 5.5 $0.00011 $0.00311
Sonnet 5.5 $0.00006 $0.00156
Haiku 4.5 $0.00003 $0.00078

Measured 1mo ago against content hash 4e7d04a5ec38, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 (147 stars, last pushed 3mo ago), licensed MIT. It adds 28 tokens to every session and 778 once invoked, about $0.0001 per session on Opus 5.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

shaft-web-actions

Use when implementing SHAFT WebDriver or Playwright navigation, browser state, element interaction, upload, drag-and-drop, window, cookie, or screenshot behavior.

ShaftHQ/SHAFT_ENGINE · 36 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

awt-e2e-testing

AI-powered E2E web testing — eyes and hands for AI coding tools. Declarative YAML scenarios, Playwright execution, visual matching (OpenCV + OCR), platform auto-detection (Flutter/React/Vue), learning DB. Install: npx skills add ksgisang/awt-skill --skill awt -g.

sickn33/agentic-awesome-skills · 74 tokens

web-test

A browser-automation tool for testing the 1C:Enterprise web client. It uses Playwright to navigate sections, fill forms, read tables and reports, and perform user actions in a browser.

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

shaft-developer

Use when starting any SHAFT testing task to select exactly one lifecycle, implementation, or tool specialist before doing the work.

ShaftHQ/SHAFT_ENGINE · 28 tokens