ClaudeCode_Playwright_Demo: Skill for Claude Code

.claude/skills/locator_healer_agent/SKILL.md

Locator Healer Agent is a skill for Claude Code from anhtester/ClaudeCode_Playwright_Demo. It costs 27 tokens per session (587 once invoked), scanned A, a copy of Locator Healer Agent, MIT.

An automation assistant that repairs test selectors, called locators, when a web page's structure changes.

In plain words
What is it for?
Use it to inspect the current page, replace outdated selectors, and rerun the failing browser test to check the repair.
Why use it?
It addresses failures where a test cannot find an element, loses it from the page, or selects the wrong element after a frontend update.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is anhtester/ClaudeCode_Playwright_Demo's own configuration. It tells Claude Code how to work on ClaudeCode_Playwright_Demo 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 ClaudeCode_Playwright_Demo configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/anhtester/ClaudeCode_Playwright_Demo/main/.claude/skills/locator_healer_agent/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/anhtester/ClaudeCode_Playwright_Demo

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 Locator Healer Agent

README.md
[![agentmods](https://agentmods.dev/badge/skills/anhtester/claudecode_playwright_demo/locator_healer_agent/github.svg)](https://agentmods.dev/skills/anhtester/claudecode_playwright_demo/locator_healer_agent)
Your own site
<a href="https://agentmods.dev/skills/anhtester/claudecode_playwright_demo/locator_healer_agent"><img src="https://agentmods.dev/badge/skills/anhtester/claudecode_playwright_demo/locator_healer_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 Locator Healer Agent

Your own site · 80×15
<a href="https://agentmods.dev/skills/anhtester/claudecode_playwright_demo/locator_healer_agent"><img src="https://agentmods.dev/badge/skills/anhtester/claudecode_playwright_demo/locator_healer_agent.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 587 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.
Origin 100% copy Near-identical to another mod 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.00027 $0.00587
Opus 5 $0.00014 $0.00293
Sonnet 5 $0.00005 $0.00117
Haiku 4.5 $0.00003 $0.00059

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

Security

Grade A, and why

Locator Healer 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.

Origin

This is a copy

100% identical to Locator Healer 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.

.claude/skills/locator_healer_agent/SKILL.md · 99 lines

How it starts

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

Locator Healer Agent

Purpose: Automatically repair broken locators when automation tests fail.


When to Use

Use this skill when:

  • A test fails with "element not found" or "element detached" errors
  • UI has changed and existing locators no longer work
  • After a frontend deployment that modifies DOM structure

Responsibilities

When a locator fails:

  1. Inspect current DOM or UI hierarchy
  2. Compare old locator with current page structure
  3. Identify updated attributes
  4. Generate a replacement locator
  5. Re-run test to verify the fix

Detection Strategy

Locator is considered broken when:

  • Element not found (NoSuchElementException / TimeoutError)
  • Element detached from DOM
  • Selector matches zero elements
  • Selector matches wrong element (different text/position)

Healing Workflow

Step 1: Analyze the Error

  • Read error log to identify which locator failed
  • Identify the Page Object file and line number

Step 2: Inspect Current DOM

  • Open the page using MCP tools
  • Navigate to the same state as the failing test
  • Inspect the target area in DOM

Step 3: Find Alternative Locator

Try the following in priority order:

  1. Accessibility attributes (aria-label, role)
  2. data-testid / data-test
  3. id (if stable, not auto-generated)
  4. Semantic locator (Playwright getByRole, getByLabel)
  5. css selector (stable attributes)
  6. xpath (relative, not positional)

Step 4: Validate & Replace

  • Verify the new locator matches exactly one element
  • Verify the element is the correct one (text, position, behavior)
  • Replace the broken locator in the Page Object class
  • Re-run the test

Difference from Smart Locator Agent

Aspect Locator Healer Smart Locator
Trigger Test failure (reactive) New element (proactive)
Input Broken locator + error log HTML/DOM element
Goal Fix existing locator Generate new locator
Workflow Error → Inspect → Replace → Verify Inspect → Generate → Validate

Read the full file on GitHub · 99 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 · 99 lines · 27 tokens per session scan A 92bfaa22676b

Subscribe to this mod's changes

Locator Healer Agent is a skill published in the GitHub repository anhtester/ClaudeCode_Playwright_Demo (2 stars, last pushed 3mo ago), licensed MIT. It adds 27 tokens to every session and 587 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 Locator Healer Agent, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories