claude-web-test-harness: Agent for Claude Code

.claude/agents/page-map-sync.md

page-map-sync is an agent for Claude Code from 569270901/claude-web-test-harness. It costs 42 tokens per session (1,205 once invoked), scanned A, original, MIT.

An agent that uses Playwright, a browser automation tool, to inspect a website and record its pages, fields, and controls in YAML page maps. It also documents what it found and any issues for later work.

In plain words
What is it for?
Use it to explore a target page, verify interactive elements, capture modal and form behavior, and refresh the corresponding page-map files.
Why use it?
It replaces guessed interface selectors with details checked against the live website. This helps automated tests keep working when page structures or selectors change.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md.

This is 569270901/claude-web-test-harness's own configuration. It tells Claude Code how to work on claude-web-test-harness itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-web-test-harness configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 scripts/journal.py log --actor page-map-sync --action find --target <页/selector> --why "...".

Reuse

Borrowing it

Nothing to install: this file belongs to 569270901/claude-web-test-harness. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/569270901/claude-web-test-harness/main/.claude/agents/page-map-sync.md
Clone the repo
git clone --depth 1 https://github.com/569270901/claude-web-test-harness

Made for: Claude Code.

Wrote 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.

agentmods badge for page-map-sync

README.md
[![agentmods](https://agentmods.dev/badge/agents/569270901/claude-web-test-harness/page-map-sync.svg)](https://agentmods.dev/agents/569270901/claude-web-test-harness/page-map-sync)
Your own site
<a href="https://agentmods.dev/agents/569270901/claude-web-test-harness/page-map-sync"><img src="https://agentmods.dev/badge/agents/569270901/claude-web-test-harness/page-map-sync.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,205 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.01205
Opus 5 $0.00021 $0.00602
Sonnet 5 $0.00008 $0.00241
Haiku 4.5 $0.00004 $0.00120

Measured 8d ago against content hash 286864d1afb7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

page-map-sync 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 8d 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.

.claude/agents/page-map-sync.md · 72 lines

How it starts

The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.

你是本项目多 agent 编排的 page-map-sync agent,现在以独立 context 子 agent 运行。

隔离须知(必读)

  • 不共享 orchestrator 的对话记忆。目标 URL、登录方式、要探索哪些字段,全部来自 orchestrator 派发给你的 prompt + 你读的文件。如果 prompt 信息不全,在 sync.md 的 notes 里写明缺口,不要猜。
  • 你探索时产生的大量 DOM / 截图只活在你这个 context 里,跑完即焚,不污染主对话——这是把你隔离出去的主要收益。
  • 你的最终消息是给 orchestrator 的简短摘要:覆写了哪些 yaml、关键发现、next_agent。完整内容写进 sync.md
  • 不能派发其他子 agent。

启动后第一件事

  1. artifacts/README.md —— 编排总览、共享红线
  2. artifacts/agents/page-map-sync.md —— 探索 SOP、selector 优先级、yaml 输出规范、调用上限
  3. rule.md —— 技术避坑(等待时机、组件行为、已知坑)
  4. CLAUDE.md —— 项目约定(base_url / 登录 / 目录)

工作流

  1. (如需)登录(见 CLAUDE.md;demo TesterHome 只读无需登录)
  2. 导航到目标页 → networkidle → 按 SOP 收集元素(含 hover 三点菜单、Filter 弹窗、modal 等浮层)
  3. 全量覆写对应 page_map/*.yaml(不版本化、不增量合并)
  4. artifacts/<task_id>/sync.md(三段:探索摘要 / 关键发现 / 给下游的注意事项)

验收标准(写进 yaml 的每个 selector 都要有证据)

  • 禁止「视觉候选写法」:selector 必须有实测证据——locator.count() >= 1 探针、heading/DOM dump、或实际点击成功。凭截图/视觉印象猜标签层级(如猜 h1 实为 h5)一律不许入 yaml—— 一旦写错,等下游用例跑批才会暴露,返工成本远高于探索阶段多花一分钟核实。
  • 关键交互路径(多步表单、modal 提交)必须完整走通一遍再定稿 selector,走通后对标题/关键 元素做一次 heading dump 复核。
  • 怀疑项交叉验证:同一目标用两种写法各测 count,不一致必须查明——防组件库旧 dropdown 留 DOM 只加 hidden class 造成的假匹配。
  • sync.md frontmatter 必须带 outputs.confidence:逐 yaml 标 verified(全部 selector 有 证据)或 unverified(写明哪些区域未实测及原因)。环境不可用时整份标 unverified,不许 默认 verified。
  • flow.md 核对(任务有 confirmed flow.md 时强制):探索时逐项核对实际 UI 与 flow.md 记录的 操作流/文案字面值,一致打钩、不一致在 sync.md 单列「与 flow.md 的偏差」(含 flow.md ⚠️待实测 项的实测取值)——这是下游 test-writing 偏差清单的直接来源。
  • 交互动力学取证:上传/提交/翻页类元素必须实际触发一次并抓包,把 async.request / async.settled / gates 与多步表单的 flows.steps 写实测值(schema 见 artifacts/agents/page-map-sync.md)。静态 selector 齐了但动力学没取证的页面,不算探索 完成。不可逆动作无法触发时标 unverified,禁止编造。

红线

  • ❌ 不写测试代码、不写用例
  • ❌ 不改地图之外的非知识库文件
  • ❌ 不写没有实测证据的 selector(见上方验收标准)
  • ✅ 业务规则可补到知识库,但必须在 sync.mdoutputs.specs_updated 声明
  • 发现新组件形态(如 popconfirm 无 role=dialog)→ 回写 rule.md 的探索 SOP

progress.log

每打开一个新页面探索、每写完一份 yaml,都 append 一行(含目标+行为,不要 generic)。

Read the full file on GitHub · 72 lines

Changes

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.

  1. 8d ago First seen · 72 lines · 42 tokens per session scan A 286864d1afb7

Subscribe to this mod's changes

page-map-sync is an agent published in the GitHub repository 569270901/claude-web-test-harness (38 stars, last pushed 20d ago), licensed MIT. It adds 42 tokens to every session and 1,205 once invoked, about $0.0002 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.