Borrowing it
Nothing to install: this file belongs to anhtester/claude-testing-kit. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/anhtester/claude-testing-kit/main/.claude/commands/generate_locator.mdgit clone --depth 1 https://github.com/anhtester/claude-testing-kitWrote 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/commands/anhtester/claude-testing-kit/generate_locator)<a href="https://agentmods.dev/commands/anhtester/claude-testing-kit/generate_locator"><img src="https://agentmods.dev/badge/commands/anhtester/claude-testing-kit/generate_locator/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/commands/anhtester/claude-testing-kit/generate_locator"><img src="https://agentmods.dev/badge/commands/anhtester/claude-testing-kit/generate_locator.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.00020 | $0.03012 |
| Opus 5.5 | $0.00008 | $0.01205 |
| Sonnet 5.5 | $0.00004 | $0.00602 |
| Haiku 4.5 | $0.00002 | $0.00301 |
Grade A, and why
generate_locator 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 1mo 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.
Copies of this mod
1 near-identical copy found in the catalogue:
- generate_locator — 98% identical, 18 lines differ
How it starts
The opening of the file, as written. The whole thing — 334 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/generate_locator — Sinh Locator Ổn Định Cho UI Automation
User cung cấp element cần tìm locator (mô tả, screenshot, URL, hoặc HTML snippet). AI inspect DOM/UI hierarchy thực tế, sinh locator ổn định theo priority chuẩn, verify uniqueness, trả về kết quả.
BẮT BUỘC (MANDATORY): Trước khi bắt đầu, PHẢI nạp và đọc kỹ:
- Skill:
.claude/skills/skills-smart-locator-agent/SKILL.md— Quy trình sinh locator- Skill:
.claude/skills/skills-ui-debug-agent/SKILL.md— Quy trình inspect DOM- Rule:
.claude/rules/locator_strategy.md— Bản đồ ưu tiên locator- Rule:
.claude/rules/<framework>_rules.md— Quy tắc riêng framework đang dùng
Input cần từ User
| Input | Bắt buộc | Mô tả |
|---|---|---|
| Mô tả element | ✅ | VD: "nút Login", "dropdown chọn Country", "ô nhập Email" |
| URL trang chứa element | ✅ | Để AI navigate và inspect DOM thực tế |
| Framework | ✅ | playwright, selenium, hoặc appium |
| HTML snippet | ❌ | Nếu User đã có sẵn DOM context — AI dùng để phân tích nhanh |
| Page class đích | ❌ | File Page class mà locator sẽ được thêm vào |
| Login yêu cầu | ❌ | Nếu trang yêu cầu đăng nhập — User cho biết cách login |
Lưu ý về Login: Nếu trang yêu cầu đăng nhập, User PHẢI chỉ rõ cách login (fixture, script, URL login...). AI KHÔNG ĐƯỢC tự đọc
.envhay đoán credentials.
Các bước thực hiện
Phase 1: Phân tích yêu cầu
-
Hiểu element cần tìm — Xác định rõ:
- Loại element: button, input, link, dropdown, dialog, table row, checkbox, radio...
- Context: Nằm trong page chính, dialog/modal, sidebar, table, iframe?
- Thao tác: click, fill, select, hover, verify text, verify visibility?
-
Xác định framework và đọc rules tương ứng:
Framework Rule file Playwright .claude/rules/playwright_rules.mdSelenium .claude/rules/selenium_rules.mdAppium .claude/rules/appium_rules.md -
Kiểm tra Page class hiện tại (nếu User chỉ định):
- Đọc file Page class → biết locator đã có sẵn
- Tránh trùng lặp hoặc xung đột naming
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.
- 1mo ago First seen · 334 lines · 20 tokens per session scan A c7a93d37cf43
generate_locator is a command published in the GitHub repository anhtester/claude-testing-kit (61 stars, last pushed 2mo ago), licensed MIT. It adds 20 tokens to every session and 3,012 once invoked, about $0.0001 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.
Other commands, from other repositories
expect
Diff-aware AI browser testing — reads the git diff, maps changes to affected pages via the route map, generates a targeted test plan, and executes it via agent-browser (Rust daemon + CDP, ARIA-tree-first) with pass/fail reporting. Use when testing UI changes, verifying PRs before merge, or running regression checks on…
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
record
Record a browser walkthrough of a URL using Antigravity (agy). Generates .webm video, screenshots, and a report. Auto-converts to MP4 if ffmpeg is available.
amazing-e2e-check
Run explicitly requested E2E, browser, device, or installed-deployment scenarios in an independent verification workflow.
verify-pr
Verify a PR's frontend changes through browser automation.
monobrowse
Launch monomind browse for web UI testing and automation — native TypeScript CDP client, no external binary needed.