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.
git clone --depth 1 https://github.com/azam-sdet/10xqualityWrote 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/rules/azam-sdet/10xquality/002-locator-strategy)<a href="https://agentmods.dev/rules/azam-sdet/10xquality/002-locator-strategy"><img src="https://agentmods.dev/badge/rules/azam-sdet/10xquality/002-locator-strategy/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.
<a href="https://agentmods.dev/rules/azam-sdet/10xquality/002-locator-strategy"><img src="https://agentmods.dev/badge/rules/azam-sdet/10xquality/002-locator-strategy.svg" alt="Reviewed on agentmods" width="80" 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.00000 | $0.01402 |
| Opus 5 | $0.00000 | $0.00701 |
| Sonnet 5 | $0.00000 | $0.00280 |
| Haiku 4.5 | $0.00000 | $0.00140 |
Grade A, and why
002-locator-strategy 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.
How it starts
The opening of the file, as written. The whole thing — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Locator Strategy for Playwright Tests
Follow this priority order when selecting locators. Prefer stable, semantic selectors over brittle CSS.
Priority Order
| Priority | Strategy | When to Use | Example |
|---|---|---|---|
| 1 | input[name="..."] |
Form inputs with name attribute |
input[name="email"] |
| 2 | #id |
Element has a unique ID | #submit-button |
| 3 | Label-based ancestor | Form fields with associated labels | getInputByLabel('Email') |
| 4 | [data-test="..."] |
Test IDs added for automation | [data-test="submit-btn"] |
| 5 | getByRole() / getByText() |
Text-unique elements | page.getByRole('button', { name: 'Submit' }) |
| 6 | CSS with :has-text() |
Last resort when above fail | button:has-text("Create") |
Ambiguity Rules
- NEVER use
.first()on ahas-textlocator without verifying uniqueness. If the recorded hint showsambiguity.sameText > 1, the same text appears in multiple elements. Use label-based disambiguation instead. - For dropdowns: Don't rely on the button/placeholder text (e.g., "Select..."). Multiple dropdowns may share the same placeholder. Always navigate from the field label.
- For buttons at the bottom of forms (Cancel, Submit, Create): These are usually unique.
button:has-text("Create")is safe whenambiguity.sameText === 1.
Label-Based Ancestor Navigation
Use label-based patterns when form fields have associated labels. This disambiguates elements that share the same data-test or placeholder text.
Input Fields
private getInputByLabel(labelText: string) {
const label = this.page.locator(`label:has-text("${labelText}")`).first();
return label.locator('xpath=ancestor::div[.//input][1]').locator('input');
}
// Usage
await this.getInputByLabel('Email').fill('[email protected]');
Dropdowns (Generic Pattern)
For dropdowns that use a trigger button (common in design systems), locate the trigger via the label's ancestor:
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.
- 9d ago First seen · 134 lines · 0 tokens per session scan A 650920be8942
002-locator-strategy is a cursor rule published in the GitHub repository azam-sdet/10xquality (2 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,402 tokens. 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-31.
Other cursor rules, from other repositories
puppeteer
This guide provides opinionated, actionable best practices for writing robust, performant, and maintainable Puppeteer scripts for web scraping, automation, and testing. It emphasizes modern patterns like page.locator() and efficient resource management.
vasu-playwright-utils
../../templates/cursor-rules/vasu-playwright-utils.mdc.
playwright
A set of guidelines for Playwright, a tool that controls a web browser to test websites and web applications.
playwright
Playwright: e2e testing, page objects, fixtures, assertions.
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.