Borrowing it
Nothing to install: this file belongs to anhtester/ClaudeCode_Playwright_Demo. 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/ClaudeCode_Playwright_Demo/main/.claude/commands/generate_locator.mdgit clone --depth 1 https://github.com/anhtester/ClaudeCode_Playwright_DemoWrote 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/claudecode_playwright_demo/generate_locator)<a href="https://agentmods.dev/commands/anhtester/claudecode_playwright_demo/generate_locator"><img src="https://agentmods.dev/badge/commands/anhtester/claudecode_playwright_demo/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/claudecode_playwright_demo/generate_locator"><img src="https://agentmods.dev/badge/commands/anhtester/claudecode_playwright_demo/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.02998 |
| Opus 5.5 | $0.00008 | $0.01199 |
| Sonnet 5.5 | $0.00004 | $0.00600 |
| Haiku 4.5 | $0.00002 | $0.00300 |
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.
This is a copy
98% identical to generate_locator — 18 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
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:
.agent/skills/smart_locator_agent/SKILL.md— Quy trình sinh locator- Skill:
.agent/skills/ui_debug_agent/SKILL.md— Quy trình inspect DOM- Rule:
.agent/rules/locator_strategy.md— Bản đồ ưu tiên locator- Rule:
.agent/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 .agent/rules/playwright_rules.mdSelenium .agent/rules/selenium_rules.mdAppium .agent/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 c995317aa04a
generate_locator is a command published in the GitHub repository anhtester/ClaudeCode_Playwright_Demo (3 stars, last pushed 5mo ago), licensed MIT. It adds 20 tokens to every session and 2,998 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 98% identical to generate_locator, differing in 18 lines, and is treated as a copy.
Other commands, from other repositories
auto-browse
Auto-browse — learn, optimize, and graduate browser operations or web data-mining workflows.
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.
verify-pr
Verify a PR's frontend changes through browser automation.
gh-issue-use-cypress
Like /gh-issue-use-browser, but pinned to the Cypress MCP — use when your project runs the Cypress MCP for browser automation. Example — /gh-issue-use-cypress "Composer > Save" saving toasts failure but the record persists.
can-i-use
Check browser support for web platform features against the project's browser targets.
qa
Smoke or browser-walk a running app. Report only. Do not implement. Do not merge.