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 skills add DanielSuo117/velocitai --skill locator-replacergit clone --depth 1 https://github.com/DanielSuo117/velocitaiWrote 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/skills/danielsuo117/velocitai/locator-replacer)<a href="https://agentmods.dev/skills/danielsuo117/velocitai/locator-replacer"><img src="https://agentmods.dev/badge/skills/danielsuo117/velocitai/locator-replacer/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/skills/danielsuo117/velocitai/locator-replacer"><img src="https://agentmods.dev/badge/skills/danielsuo117/velocitai/locator-replacer.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.00044 | $0.01319 |
| Opus 5.5 | $0.00018 | $0.00528 |
| Sonnet 5.5 | $0.00009 | $0.00264 |
| Haiku 4.5 | $0.00004 | $0.00132 |
Grade A, and why
locator-replacer 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 2mo 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 — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Locator Replacer — 定位符替换 Skill
适用场景
- 将页面对象中
text=占位定位符替换为真实选择器 - 前端构建后原有选择器失效,需要重新定位
- 新增页面元素需要选择最佳定位策略
定位符选择策略(六级优先级)
按优先级从高到低,逐级尝试,选中即停。优先使用页面上已有的语义化信息, 避免依赖需要前端额外配合的属性。
| 级别 | 策略 | 抗什么 | 代价 |
|---|---|---|---|
| P0 | ARIA role + 可见文本 | CSS 重构、构建哈希 | 文案变更需同步 |
| P1 | 可见文本 | CSS 重构、构建哈希 | 文案变更需同步、可能不唯一 |
| P2 | 表单特有属性(name/placeholder/type) | 样式与文案变更 | 仅适用于表单控件 |
| P3 | 语义化 CSS class / id | 文案变更 | 样式重构即失效 |
| P4 | data-testid |
几乎全部 | 需前端配合添加 |
| P5 | 相对 XPath / CSS 结构 | —— | 最脆弱,最后手段 |
完整写法、判断依据与代码示例 → references/priority-levels.md
执行流程
Step 1: 分析目标页面 DOM
使用 agent-browser 打开目标页面,获取交互元素信息(工具选型遵循 agent-behavior P0.4,agent-browser 未安装时降级到 Playwright MCP):
操作步骤:
1. browser_navigate → 访问目标页面(已认证状态)
2. browser_snapshot → 获取页面无障碍树(accessibility tree)
3. browser_evaluate → 执行 JS 提取元素属性:
- document.querySelectorAll('[data-testid]') → 已有 testid
- document.querySelectorAll('[role]') → ARIA role
- document.querySelectorAll('button, a, input') → 交互元素
Step 2: 为每个元素选择定位策略
对照页面对象中的每个占位定位符,按 P0→P5 逐级尝试,命中即停:
| 检查顺序 | 条件 | 使用 |
|---|---|---|
| P0 | 有 role + name | role=button[name='...'] |
| P1 | text= 唯一且稳定 | text=...(标记"已验证唯一") |
| P2 | 表单属性(placeholder/name/type) | [placeholder='...'] |
| P3 | 稳定 CSS class(非哈希) | css=.xxx |
| P4 | 有 data-testid | [data-testid='...'] |
| P5 | 以上均无 | 相对 XPath(≤3 层) |
Step 3: 更新页面对象
class <PageName>(BasePage):
# 定位符 — 已替换为真实选择器(<日期>)
<PRIMARY_ACTION_BTN> = "role=button[name='<按钮文案>']" # P0: ARIA role
<SECONDARY_LINK> = "text=<链接文案>" # P1: text(已验证唯一)
PAGE_IDENTIFIER = "role=heading[name='<页面标题>']" # P0: ARIA role
更新规则:
- 在定位符行尾注释标注选择级别(
# P0: ARIA role/# P1: text/ ... /# P4: testid/# P5: XPath) - 如果
text=经验证确实稳定且唯一,注释标记# P1: text(已验证唯一) - 删除原来的
# 定位符 — 后续替换为实际选择器注释 - 更新为
# 定位符 — 已替换为真实选择器(日期)
What ships with it
2 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.
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.
- 2mo ago Changed · -100 lines · +44 tokens per session ba7d3e27c6aa
- 3mo ago First seen · 207 lines · 0 tokens per session scan A 9d1eb6f47135
locator-replacer is a skill published in the GitHub repository DanielSuo117/velocitai (159 stars, last pushed 2mo ago), licensed MIT. It adds 44 tokens to every session and 1,319 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.
locator-replacer compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| locator-replacerDanielSuo117/velocitai | Skill | 159 | 2mo ago | MIT | A | 44 | Claude Code |
| cua-driverdavidondrej/skills | Skill | 4.4k | 2d ago | MIT | A | 68 | Claude Code, Codex |
| create-verification-skillget-bb/bb | Skill | 6.2k | today | MIT | A | 57 | Claude Code, Codex |
| codex-computer-usedavidondrej/skills | Skill | 4.4k | 2d ago | MIT | A | 53 | Claude Code, Codex |
| webapp-testinganthropics/skills | Skill | 202k | 14d ago | none | A | 35 | Claude Code |
| test-electron-appPostHog/posthog-foss | Skill | 733 | today | MIT | A | 112 | Claude Code |
| smoke-testSkyvern-AI/skyvern | Skill | 24k | today | AGPL-3.0 | A | 50 | Claude Code, Codex |