Borrowing it
Nothing to install: this file belongs to anhtester/ClaudeCode_Playwright_Demo. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/anhtester/ClaudeCode_Playwright_Demo/main/.claude/skills/smart_locator_agent/SKILL.mdgit clone --depth 1 https://github.com/anhtester/ClaudeCode_Playwright_DemoWrote 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.
[](https://agentmods.dev/skills/anhtester/claudecode_playwright_demo/smart_locator_agent)<a href="https://agentmods.dev/skills/anhtester/claudecode_playwright_demo/smart_locator_agent"><img src="https://agentmods.dev/badge/skills/anhtester/claudecode_playwright_demo/smart_locator_agent.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00028 | $0.00778 |
| Opus 5 | $0.00014 | $0.00389 |
| Sonnet 5 | $0.00006 | $0.00156 |
| Haiku 4.5 | $0.00003 | $0.00078 |
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 8d 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.
This is a copy
100% identical to Smart Locator Agent — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
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:
- Inspect the DOM or mobile UI hierarchy (NEVER guess)
- Identify stable attributes
- Generate a reliable locator
- Validate locator uniqueness
- Provide fallback locator if primary is fragile
Locator Priority
Use the following priority order:
- Accessibility attributes (aria-label, role)
data-testid/data-test/data-qaidname- Framework semantic locator
css selectorxpath(last option)
Note: For detailed rules, refer to
.agent/rules/locator_strategy.md.
Playwright Locators
Preferred locator methods:
getByRole()— Best for semantic elementsgetByLabel()— Best for form fields with labelsgetByPlaceholder()— Best for inputs with placeholder textgetByText()— Best for text contentgetByTestId()— 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:
iddata-testidnamecssSelectorxpath
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:
accessibility idresource-ididiOS predicate stringclass chainxpath
Example:
driver.findElement(AppiumBy.accessibilityId("login_button"));
driver.findElement(AppiumBy.id("com.app:id/login_button"));
driver.findElement(AppiumBy.iOSNsPredicateString("label == 'Login'"));
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.
- 8d ago First seen · 146 lines · 28 tokens per session scan A 4e7d04a5ec38
Smart Locator Agent is a skill published in the GitHub repository anhtester/ClaudeCode_Playwright_Demo (2 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. A static security scan graded it A with 0 findings. It is 100% identical to Smart Locator Agent, differing in 0 lines, and is treated as a copy.
Other skills, from other repositories
android-unit-test
Guide for writing and converting Chromium Android unit tests across host Robolectric (chromejunittests) and on-device (chromepublicunittestapk) suites.
android-test-batching
Guide for auditing and applying batching annotations (@Batch) and AutoReset rules (AutoResetCtaTransitTestRule) to Android javatests in Chromium. Use this skill when optimizing Java instrumentation test runtimes, resolving test state leaks, or migrating tests to batched execution.
java-memory-leaks
How to identify and fix Java memory leaks in Android Chrome using LeakCanary traces.
loadline
Running and analyzing LoadLine 1 and 2 benchmarks on Android using Crossbench. Use when you need to measure page loading performance, evaluate performance-related changes in Chrome, or collect Perfetto traces with realistic Chrome workload.
accessibility-cleanup
Finds common violations of the Android accessibility API in the Clank App Java code and attempts to address them (e.g. hardcoded state change announcements, missing events, focus moving, assertive live regions, etc).
remove-unused-object-overrides
Identify and safely remove unreferenced Java Object overrides (equals, hashCode, toString) in Clank to eliminate dead virtual methods from release DEX bytecode while strictly preserving equals/hashCode symmetry.