claude-testing-kit: Skill for Claude Code

.claude/skills/skills-smart-locator-agent/SKILL.md

skills-smart-locator-agent is a skill for Claude Code from anhtester/claude-testing-kit. It costs 30 tokens per session (788 once invoked), scanned A, original, MIT.

A skill for creating stable selectors, also called locators, that UI tests use to find elements. It works with Playwright, Selenium, and Appium and inspects the page or mobile UI instead of guessing.

In plain words
What is it for?
Use it to create selectors for new buttons or fields, review existing selectors, or move selectors between supported testing frameworks.
Why use it?
It reduces test failures caused by selectors tied to changing page details. It checks that the chosen selector is unique and can identify a fallback when needed.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is anhtester/claude-testing-kit's own configuration. It tells Claude Code how to work on claude-testing-kit itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-testing-kit configures →

Reuse

Borrowing it

Nothing to install: this file belongs to anhtester/claude-testing-kit. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/anhtester/claude-testing-kit/main/.claude/skills/skills-smart-locator-agent/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/anhtester/claude-testing-kit

Made for: Claude Code.

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 skills-smart-locator-agent

README.md
[![agentmods](https://agentmods.dev/badge/skills/anhtester/claude-testing-kit/skills-smart-locator-agent/github.svg)](https://agentmods.dev/skills/anhtester/claude-testing-kit/skills-smart-locator-agent)
Your own site
<a href="https://agentmods.dev/skills/anhtester/claude-testing-kit/skills-smart-locator-agent"><img src="https://agentmods.dev/badge/skills/anhtester/claude-testing-kit/skills-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 skills-smart-locator-agent

Your own site · 80×15
<a href="https://agentmods.dev/skills/anhtester/claude-testing-kit/skills-smart-locator-agent"><img src="https://agentmods.dev/badge/skills/anhtester/claude-testing-kit/skills-smart-locator-agent.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 788 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.00030 $0.00788
Opus 5 $0.00015 $0.00394
Sonnet 5 $0.00006 $0.00158
Haiku 4.5 $0.00003 $0.00079

Measured 9d ago against content hash e5c8dec8a34b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

skills-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 9d 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.

.claude/skills/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 .claude/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 .claude/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 .claude/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. 9d ago First seen · 146 lines · 30 tokens per session scan A e5c8dec8a34b

Subscribe to this mod's changes

skills-smart-locator-agent is a skill published in the GitHub repository anhtester/claude-testing-kit (53 stars, last pushed 1mo ago), licensed MIT. It adds 30 tokens to every session and 788 once invoked, about $0.0002 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.