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.
npx agentmods add commands/anhtester/claude-testing-kit/generate_locatorgit clone --depth 1 https://github.com/anhtester/claude-testing-kitWhat 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 | $0.00020 | $0.03012 |
| Opus 5 | $0.00010 | $0.01506 |
| Sonnet 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 3d 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.
- 3d 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 (49 stars, last pushed 25d ago), licensed MIT. It adds 20 tokens to every session and 3,012 once invoked, about $0.0001 per session on Opus 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
generate_automation_from_testcases
Convert manual test cases into automation scripts autonomously using the 6-step AI-RBT Framework via Antigravity Capabilities.
generate_automation_from_ui_flow
Thực thi UI flow trực tiếp trên browser, thu thập locators từ DOM thực tế, và sinh automation scripts. Hỗ trợ Playwright, Selenium, Appium.
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…
stark-quality-gate
Use this command when a web UI should be maintained, released, compared across runs, or used as public proof. It turns visual QA into a repeatable local/CI gate instead of a one-off screenshot check.
open
SoDam-Design-Kit open 대시보드 — 검증 이력·판정서·스크린샷을 브라우저로 열람 + 재검증.
playwright-cli
Use this skill whenever the user wants to automate a browser, scrape web content, take screenshots or PDFs of pages, fill out forms, click through UI flows, or run end-to-end tests — without using an MCP server. This skill drives Playwright directly from the bashtool via Node.js scripts. Trigger whenever the user says…