A selector can pass today and break tomorrow because a layout class changed. Stable UI automation starts from user intent and component semantics, not from whichever CSS path was easiest to copy.
Why this Skill is needed
The UI Test Selector Review Skill reviews selectors using DOM and component code, accessible names, data-testid conventions, locator history, and failure evidence. It produces USR-## findings without executing tests or claiming coverage.
What the Skill does
The best selector describes the control a user or accessible interface exposes and survives irrelevant structure changes.
Use this Skill to identify brittle, ambiguous, inaccessible, or high-maintenance selectors in UI automation. It keeps source evidence, applicability, and the smallest validation action visible.
A good USR finding names the UI subject, precondition, selector concern, source evidence, impact, priority, owner, close condition, and validation method.
Use it when UI tests fail after harmless markup changes, selectors depend on styling classes or position, or teams need a consistent locator convention.
What it does not do
The UI Test Selector Review Skill can organize material, evidence, and next actions for Selector finding. It does not replace:
- Confirmation of rules, scope, and risk by the accountable domain owner.
- A real environment, account, dataset, log, or run record; static analysis does not become runtime evidence by itself.
- Authorization for release, compliance, production actions, or residual-risk acceptance.
- A Human decision when supplied sources conflict.
What it checks
The value of this Skill is not another keyword list. It connects each focus area to an observable input, a judgment, and a way to close the loop. Start with a small matrix based on the source Skill’s output contract:
| Focus | Question before analysis | Handoff output |
|---|---|---|
| Selector finding | Why the locator is stable, ambiguous, or brittle | USR ID and source |
| Semantic basis | Role, accessible name, test ID, or unsupported structure | Applicability |
| Maintenance impact | How markup changes or localization affect it | Priority and evidence |
| Validation action | Smallest check for a replacement locator | Owner and NOT_RUN boundary |
If a row has only a conventional expectation and no source or validation method, keep it open instead of turning it into a pass.
Audit inputs before you start
Before analyzing Selector finding, classify the input into six evidence states. A gap is not automatically a failure, but it must not disappear inside the conclusion.
| State | Meaning | How this Skill should handle it |
|---|---|---|
| known | Directly supported by the supplied material | Keep the source, version, and time with the judgment |
| missing | Needed for this pass but not supplied | Name the smallest evidence action and limit the conclusion |
| conflicting | Sources disagree | Show both sources and route the conflict to an owner |
| stale | Present but outside the relevant version or time window | Mark freshness; old evidence is not current proof |
| out_of_scope | Related but excluded from this pass | Keep the boundary explicit |
| assumptions | Temporarily adopted to continue analysis | State how and when the assumption will be checked |
Keep the input version, scope, environment, evidence locations, and accountable owner together. Without a run record, deliver analysis, design, or a validation plan—not an execution pass.
From problem to structured Finding
Connect the source, scope, evidence state, analysis, owner, action, close condition, and validation before writing the conclusion. The case below keeps this Skill’s identifier and domain context.
Keep the decision layers separate
For Selector finding, do not compress four different kinds of language into “recommended to pass”:
| Layer | How to write it | Application here |
|---|---|---|
| Fact | What the supplied material directly shows | Cite the source, version, input, or run record for the focus |
| Evidence-backed Inference | What several facts support together | Show the inference chain and retain uncertainty |
| Recommendation | The smallest next action | Name the evidence, review, execution, or regression path |
| Human Decision | What an accountable person must decide | Leave scope, risk acceptance, resources, and release meaning to the owner |
A complete case
This case follows Input, Analysis, Finding, Decision, and Validation. When material is incomplete, keep missing, conflicting, or assumptions visible instead of turning them into a pass.
Input
| Material | What to provide | What to do when it is missing |
|---|---|---|
| UI source | DOM snapshot, component code, accessible name, role, and data attributes | Mark missing semantics |
| Test code | Locator, action, assertion, page state, and helper | Do not infer intent from selector alone |
| Change evidence | Diff, locator history, failure screenshots, and reruns | Keep runtime unverified without a run |
| Boundary | Browser, locale, responsive mode, and owner convention | Preserve scope |
Use a request like this:
Use the ui-test-selector-review Skill.
Task: Review checkout UI selectors after a design-system button refactor.
Inputs: [component code, DOM snapshot, accessible roles and names, test code, failure screenshots, diff]
Scope: [checkout submit, coupon, and error controls]
Constraints: [do not execute tests or edit selectors]
Produce USR-## findings with subject, concern, source, evidence state, impact, owner, close condition, and validation method.
Analysis
Use the input, matrix, and evidence state to form the judgment before writing the Finding; keep missing material as a gap.
Finding
Focused example: Review a checkout button after a component refactor
A test locates the submit button by the third .btn element, while the component exposes an accessible name and a stable test ID. The Skill should flag positional and styling dependence, recommend validating the semantic locator, and preserve the fact that no test was executed.
The review identifies selector-quality candidates from supplied material. It cannot prove runtime stability, coverage, or a passing UI suite.
Example finding: turn one problem into a handoff
The field example below shows the recording pattern; it is not an execution result.
If the supplied material cannot prove that Selector finding meets its contract, write the finding like this. It does not invent the missing rule or turn missing evidence into a failure.
| Field | Example wording |
|---|---|
| Source and scope | Record the requirement, version, environment, and the concrete object for Selector finding |
| Finding | The condition or result for Selector finding is not yet traceable to evidence |
| Evidence state | missing / assumptions; use conflicting when sources disagree |
| Impact and priority | Name the affected user, journey, or delivery decision without inflating severity |
| Owner and Human decision | Ask the product, engineering, security, or test owner to confirm the rule and trade-off |
| Action and close condition | Add the smallest missing evidence; close only when source, judgment, and owner can be reviewed |
| Validation | Name one repeatable check, query, or run and retain the raw artifact |
The point is to let the next person walk from the finding back to the source and run an action that can change the decision.
Decision
The accountable owner confirms the decision question and risk trade-off; the Skill does not make that choice.
Validation
Before closing the finding, run the stated validation and retain the raw artifact. Without an execution record, the status remains unverified.
How a Finding enters the next stage
Handoff output
| Output field | Why it exists | Example status |
|---|---|---|
| Selector finding | Why the locator is stable, ambiguous, or brittle | USR ID and source |
| Semantic basis | Role, accessible name, test ID, or unsupported structure | Applicability |
| Maintenance impact | How markup changes or localization affect it | Priority and evidence |
| Validation action | Smallest check for a replacement locator | Owner and NOT_RUN boundary |
Every conclusion should point to a source, evidence state, and next action. If evidence is missing, use pending, blocked, unassessed, or NOT_SCORED instead of filling the gap with confidence.
Next-stage route
At minimum, hand off the source, evidence state, owner, close condition, and validation action; the next-stage conclusion remains bounded by the evidence state.
How to prepare better input
Provide component and DOM evidence, accessible names and roles, test code, locator convention, change history, failure artifacts, browser and locale scope. Missing semantics stay unassessed.
A useful handoff includes input versions, scope, time window, evidence index, assumptions, Human decision boundary, and the smallest validation action.
Working with other Skills
- UI Test Strategy:defines journeys, states, platforms, and risk.
- UI Test Wait Strategy Review:checks the wait needed after locating a control.
- Test Code Review:reviews assertions and isolation around the locator.
Common traps
- Choosing a selector only because it is short or passes the current DOM.
- Using visible text without considering localization or duplicate names.
- Treating a stable-looking data-testid as proof that the test is behaviorally meaningful.
Install and invoke
npx skills add https://github.com/naodeng/awesome-qa-skills/tree/main/skills/en/testing-types/ui-test-selector-review -g
Use the ui-test-selector-review Skill.
Include objective, scope, versions, evidence paths, constraints, and decision boundary.
Audit inputs first, preserve evidence states, and finish with owner, close condition, and validation method.
FAQ
Are data-testid selectors always best?
No. Prefer stable user-facing semantics when they are unique and intentional; use test IDs when the component needs an explicit automation contract.
Can this Skill change the test code?
No. It provides review findings and a validation action; implementation is a separate change.
The Skill is most useful when attached to one real project artifact and kept with its source evidence. Start narrow, validate the uncertain part, and expand only when evidence supports it.
References
Source Skill and execution contract
The complete execution contract lives in UI Test Selector Review prompt. The source directory may also contain evaluation cases and supporting material.
Static plans, file presence, and dry runs keep their evidence state. They do not become runtime proof, an all-passed claim, or release approval.
Reference links
- UI Test Selector Review prompt:https://github.com/naodeng/awesome-qa-skills/tree/main/skills/en/testing-types/ui-test-selector-review/prompts/ui-test-selector-review.md
- UI Test Selector Review Skill source:https://github.com/naodeng/awesome-qa-skills/tree/main/skills/en/testing-types/ui-test-selector-review
- UI Test Selector Review details:https://inaodeng.com/en/qaskills/ui-test-selector-review/
- Awesome QA Skills on GitHub:https://github.com/naodeng/awesome-qa-skills