selectors

selectors is a skill for Claude Code, Codex from idavidov13/agentic-playwright. It costs 60 tokens per session (773 once invoked), scanned A, original, MIT.

A guide for choosing selectors, the ways automated browser tests identify buttons, fields, and other page elements.

In plain words
What is it for?
Use it when exploring a web app and writing or updating Playwright page objects, locators, forms, CRUD flows, and validation checks.
Why use it?
It reduces fragile tests caused by guessed names, styling changes, or selectors that do not match the real application.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it when exploring a web app and writing or updating Playwright page objects, locators, forms, CRUD flows, and validation checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/idavidov13/agentic-playwright/selectors
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 idavidov13/agentic-playwright --skill selectors
Clone the repo
git clone --depth 1 https://github.com/idavidov13/agentic-playwright

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 selectors

README.md
[![agentmods](https://agentmods.dev/badge/skills/idavidov13/agentic-playwright/selectors/github.svg)](https://agentmods.dev/skills/idavidov13/agentic-playwright/selectors)
Your own site
<a href="https://agentmods.dev/skills/idavidov13/agentic-playwright/selectors"><img src="https://agentmods.dev/badge/skills/idavidov13/agentic-playwright/selectors/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 selectors

Your own site · 80×15
<a href="https://agentmods.dev/skills/idavidov13/agentic-playwright/selectors"><img src="https://agentmods.dev/badge/skills/idavidov13/agentic-playwright/selectors.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 773 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.00060 $0.00773
Opus 5.5 $0.00024 $0.00309
Sonnet 5.5 $0.00012 $0.00155
Haiku 4.5 $0.00006 $0.00077

Measured 21d ago against content hash 104e595b378d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

selectors 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 21d 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.

.agents/skills/selectors/SKILL.md · 44 lines

How it starts

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

Selectors

Critical

  • Priority order: getByRole > getByLabel > getByPlaceholder > getByText > getByTestId. Move to the next option only when the previous one is not feasible. One exception: a labelled form field takes getByLabel('Email') over getByRole('textbox', { name: 'Email' }).

    // CORRECT
    page.getByRole('button', { name: 'Submit' });
    // WRONG
    page.locator('.btn-primary');
    
  • Never XPath (page.locator('//...'), 'xpath=...'). When no semantic option fits, ask for a test id and use getByTestId.

  • A CSS locator is an exception, not a tier: it ships only after the human confirms the app cannot take a test id, with the reason on the line (references/locator-choice.md).

    // eslint-disable-next-line playwright/no-raw-locators -- vendor grid: no role, name or test id
    page.getByRole('region', { name: 'Orders' }).locator('[data-row-id]');
    
  • Exploration with playwright-cli is mandatory before any selector is written. No guessing from wireframes, docs or screenshots. If the app cannot be reached or auth fails, stop and notify the human; never ship placeholder locators.

  • Strings inside getByText(...) come from enums/{area}/* (Messages.LOGIN_ERROR); the text is captured from the live app, never guessed (enums).

  • Every page object for a form or CRUD screen has feedback selectors: success, error, field validation, and toast, loading or empty state where the app shows them.

Procedure

  1. Read the URL: grep '^APP_URL' env/.env.${ENVIRONMENT:-dev}. No env file → ask the human for the URL.
  2. playwright-cli open <APP_URL>, then playwright-cli snapshot; commands in playwright-cli. Explore in the auth state the spec will run in: the chromium project starts signed in, so sign in through the login page first unless the spec calls resetStorageState(). The page fails to load or needs auth → stop per references/exploration-workflow.md.
  3. Walk the feature as a user: snapshot, act, snapshot. Trigger each form submit and CRUD action. Record every element's role, accessible name, label, placeholder or test id, and the exact text of every message.
  4. List the paths the page must support (happy, validation, error, edge); each path names the feedback locator that proves it.
  5. Choose each locator by the priority order (references/locator-choice.md), add the feedback locators (references/feedback-selectors.md), and write them into the class per page-objects.

Read the full file on GitHub · 44 lines

Files

What ships with it

3 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. 21d ago Changed · +7 lines 104e595b378d
  2. 1mo ago Changed · -131 lines · -76 tokens per session 6cd97ebc8257
  3. 3mo ago First seen · 168 lines · 136 tokens per session scan A 8f9811cf1a6d

Subscribe to this mod's changes

selectors is a skill published in the GitHub repository idavidov13/agentic-playwright (318 stars, last pushed 17d ago), licensed MIT. It adds 60 tokens to every session and 773 once invoked, about $0.0002 per session on Opus 5.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

selectors compared with skills from other repositories

selectors next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
selectorsidavidov13/agentic-playwrightSkill31817d agoMITA60Claude Code, Codex
vindicateOpenEvident/vindicateSkill453mo agoApache-2.0A77Claude Code, Codex
aif-web-testingainative-build/skillsSkill101mo agoMITA36Claude Code
ac-qa-e2e-reviewWaterplanAI/agentic-configSkill3124d agoMITA40Claude Code
ac-qa-test-e2eWaterplanAI/agentic-configSkill3124d agoMITA49Claude Code
ac-qa-browserWaterplanAI/agentic-configSkill3124d agoMITA47Claude Code
e2e-reviewWaterplanAI/agentic-configSkill3124d agoMITA37Claude Code