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,647 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/github.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/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.

agentmods 80×15 button for page-map-sync

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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,647 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.01647
Opus 5.5 $0.00017 $0.00659
Sonnet 5.5 $0.00008 $0.00329
Haiku 4.5 $0.00004 $0.00165

Measured 2d ago against content hash 6eaf3cc6b712, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-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 2d 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 · 87 lines

How it starts

The opening of the file, as written. The whole thing — 87 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。
  • ❌ 禁止"假挂起":你是一次性调用,不存在"后台任务跑完后有人叫醒你继续"这回事,没有任何推送通知会把你接回来。 跑脚本 / pytest 要么前台阻塞等结果(单次命令有时长上限,长任务先拆小),要么后台跑时在同一轮工具调用里自己轮询到结束 (如 while ps -p <pid> >/dev/null; do sleep 10; done),拿到结果再决定下一步。 绝不能说"我先返回,等它跑完再继续"就结束消息——那不是暂停,是卡死。

启动后第一件事

  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(三段:探索摘要 / 关键发现 / 给下游的注意事项)
  5. 没有需求文档(C 档)时,sync.md 还要写「行为实测记录」一节(字段约束、校验/报错文案、 状态与可点动作)——这是下游解构唯一的事实来源,格式见 artifacts/agents/page-map-sync.md 的 sync.md schema

成本效益分诊(目标是提效,不是凑覆盖率)

某个页面 / 交互反复探索失败,或 UI 复杂到探索成本明显不划算时,允许放弃这部分地图: 在 sync.md 里标 unverified,写清楚"卡在哪、试了几次、疑似什么原因",交还用户人工确认, 不必死磕到底。

验收标准(写进 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,禁止编造。

Read the full file on GitHub · 87 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. 2d ago Changed · +15 lines 6eaf3cc6b712
  2. 1mo 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 (44 stars, last pushed 2d ago), licensed MIT. It adds 42 tokens to every session and 1,647 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.