selector-drift-recovery

selector-drift-recovery is a skill for Claude Code, Codex from petrkindlmann/qa-skills. It costs 218 tokens per session (4,874 once invoked), scanned A, original, MIT.

A tool for updating many automated browser-test selectors after a user-interface redesign. Selectors are the rules tests use to find buttons, fields, and other page elements.

In plain words
What is it for?
Use it when a UI refactor breaks many selectors across test files and you have references to both the old and new page structure.
Why use it?
It reduces manual repair when a redesign changes the page structure but keeps the same user interactions. It compares the old and new page structures, proposes replacements, checks them, and groups the updates into a pull request.

Skill for Claude CodeCodex

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

Good fit Use it when a UI refactor breaks many selectors across test files and you have references to both the old and new page structure.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/petrkindlmann/qa-skills/selector-drift-recovery
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 petrkindlmann/qa-skills --skill selector-drift-recovery
Clone the repo
git clone --depth 1 https://github.com/petrkindlmann/qa-skills

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 selector-drift-recovery

README.md
[![agentmods](https://agentmods.dev/badge/skills/petrkindlmann/qa-skills/selector-drift-recovery/github.svg)](https://agentmods.dev/skills/petrkindlmann/qa-skills/selector-drift-recovery)
Your own site
<a href="https://agentmods.dev/skills/petrkindlmann/qa-skills/selector-drift-recovery"><img src="https://agentmods.dev/badge/skills/petrkindlmann/qa-skills/selector-drift-recovery/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 selector-drift-recovery

Your own site · 80×15
<a href="https://agentmods.dev/skills/petrkindlmann/qa-skills/selector-drift-recovery"><img src="https://agentmods.dev/badge/skills/petrkindlmann/qa-skills/selector-drift-recovery.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 218 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,874 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
  • Socket pass 13 Jun 2026
  • Snyk pass 13 Jun 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 3 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 81
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 225
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 241
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
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.00218 $0.04874
Opus 5 $0.00109 $0.02437
Sonnet 5 $0.00044 $0.00975
Haiku 4.5 $0.00022 $0.00487

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

Security

Grade A, and why

selector-drift-recovery 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 12d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (references/score-candidates.mjs), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/selector-drift-recovery/SKILL.md · 256 lines

How it starts

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

This is the bulk, offline, batch counterpart to test-reliability. They share the multi-attribute locator + confidence scoring primitives but run in opposite directions: test-reliability heals one selector at runtime behind a guarded threshold; selector-drift-recovery regenerates N selectors offline against the new DOM and bundles them into a PR. If you are doing the second workflow inside test-reliability, switch here.

Quick Route

Situation Go to
One broken test, not a refactor Stop — use test-reliability instead
200+ broken selectors across many files Split by area first (one PR per page/dir), then Phase 1
Refactor changed flows/semantics, not just structure Stop — rewrite from specs with playwright-automation
Framework switch (Selenium → Playwright) Stop — use test-migration, not drift recovery
No old-DOM reference exists anywhere Capture one (Phase 1) or scope down — without it this is "rewrite tests"
Have old + new DOM, ready to map Phase 1 → 6 below

Discovery Questions

Check .agents/qa-project-context.md first — if it exists, use it and skip anything answered there. It identifies your E2E framework, selector strategy, and known fragile areas. Then:

  1. What triggered the drift? A planned refactor (Storybook can show the new DOM before merge), a shipped redesign (new DOM is in main), a dependency upgrade, or a Tailwind/CSS migration? The trigger decides whether you run pre-emptively or react to CI failures.
  2. What is the blast radius? A single component, a page, or the whole app? Single component: scope recovery to the test files that touch it. Global: budget half a day to a day, and decide which tests should be rewritten rather than re-selected.
  3. What is your current selector strategy? If selectors are mostly data-testid and the refactor preserved testids, recovery is trivial. If they are CSS-class or XPath based, expect 30–60% to need a new strategy, not just a new locator.
  4. Is there a passing baseline? You need the old DOM somewhere: a previous CI trace artifact, a deployed staging build, a Storybook story, or git history of the components. No old-DOM reference means this degrades to "rewrite tests."
  5. Are the broken locators inline or wrapped in a Page Object? The JSON reporter's error.location points at the failing line. For inline locators that is the locator itself; for POM-wrapped locators it points at the POM helper, not the test. Know this before you trust the auto-extracted line numbers (see Failure Modes).
  6. Who reviews the resulting PR? Confidence-scored updates need a human signoff. Decide upfront whether the PR goes to the test author, the engineer who did the refactor, or the QA lead.

Read the full file on GitHub · 256 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago First seen · 256 lines · 218 tokens per session scan A e9311d1d10f2

Subscribe to this mod's changes

selector-drift-recovery is a skill published in the GitHub repository petrkindlmann/qa-skills (118 stars, last pushed 3mo ago), licensed MIT. It adds 218 tokens to every session and 4,874 once invoked, about $0.0011 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

Console Error Hunter

Systematically detect, capture, and categorize browser console errors, warnings, and unhandled exceptions during automated test execution.

PramodDutta/qaskills · 26 tokens

Geb Testing

Browser automation testing with Geb framework for Groovy/JVM using jQuery-like content DSL, Page Object pattern, Spock integration, and WebDriver abstraction.

PramodDutta/qaskills · 34 tokens

playwright-e2e

Comprehensive end-to-end testing skill using Playwright for web applications, covering page objects, selectors, assertions, waits, fixtures, and test organization.

PramodDutta/qaskills · 36 tokens

e2e-testing-claude-code

Make Claude Code write and maintain end-to-end tests like a senior SDET — Playwright and Cypress flows with stable locators, the Page Object Model, fixtures, reused auth state, network mocking, and flake-free CI. Claude Code E2E testing, done right.

PramodDutta/qaskills · 65 tokens

Browser Agent QA Testing

Teach agents to use AI browser agents for exploratory and smoke QA with step budgets, evidence-based assertions, guardrails, and Playwright conversion.

PramodDutta/qaskills · 33 tokens

playwright-execute

Run Playwright tests or suites and upload the resulting report to Katalon True Platform. Use when you need to execute Playwright scripts, package scripts, spec files, projects, or suites, configure or verify @katalon/playwright-reporter, upload Playwright reports with Katalon CLI/reporter commands, and verify uploaded…

katalon-labs/true-skills · 122 tokens