browser-screenshot-diff
它能做什么
这项技能通过步骤 ID 配对两个已录制的浏览器会话,并检查截图和页面结构。适合需要发现两次运行之间视觉或内容变化的测试人员。
适用场景
- ✓当界面改动本不应改变页面外观时。
- ✓当你想确认重放的运行结果与原始记录一致时。
- ✓当你想比较同一表单流程的两个版本时。
技能链接
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-browser/skills/browser-screenshot-diff/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请比较改版前后的两段录制,并告诉我页面在哪些地方有差异。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体将两个会话的步骤配对,在每一步比较截图和页面结构,并报告第一处差异以及总体相似度得分。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Browser Screenshot Diff
Compare two recorded sessions step-by-step. Pairs each step in session A to the same step-id in session B, diffs the captured screenshot and accessibility snapshot, reports the first divergence and an aggregate similarity score.
When to use
- Visual regression after a UI change (record before, record after, diff).
- Verifying a
browser-replayrun matches the parent session within tolerance. - Comparing two A/B variants of the same form flow.
Steps
- Locate both RVF containers:
npx -y ruvector@0.2.27 rvf status <session-id-a>.rvf npx -y ruvector@0.2.27 rvf status <session-id-b>.rvf - Load both trajectories from
trajectory.ndjson. Build astep-id → (screenshot_path, snapshot_path)map for each. - Pair steps by
step-id. Steps that exist on only one side are flagged asunmatchedand contribute to the divergence score. - Pixel diff (
--mode pixel|both): compare the two PNGs at each step. Reportmse,psnr, and the bounding box of the largest diff cluster. Threshold default0.02(2% of pixels). - DOM diff (
--mode dom|both): compare the accessibility snapshots node-by-node. Report added / removed / changed nodes with their accessible names. - Aggregate similarity: weighted average across matched steps, weighted by step duration. Verdict goes into a new
findings.mdunder a fresh RVF container so the diff itself is replayable. - Persist the diff verdict in
browser-sessionsunder both source ids' tags so future searches surface "ran a diff against session X".
Caveats
- Pixel diff is sensitive to font hinting, antialiasing, and scrollbar position. Keep viewport pinned across both sessions.
- DOM diff over Playwright's accessibility tree is more stable than HTML diff. Prefer it.
- This skill does not handle dynamic content (clocks, ads); add ignore regions to the field map or pre-process snapshots before diffing.
- The
browser_screenshot_diffMCP tool is not planned (ADR-0001 §7); the skill operates against locally-saved RVF artifacts and usesbrowser_evalonly for live verification.
常见问题
它比较什么?
它逐像素比较截图,并逐个节点比较页面结构。
如果某一步只出现在一个会话中怎么办?
这项技能会将其标记为未匹配,并计入相似度得分的扣分。
结果会保存在哪里?
这项技能会把发现报告写入会话容器中。
详情
作者的原始描述
Visual + DOM diff between two recorded sessions at matching trajectory step ids; used for visual regression and replay verification
repo: ruvnet/ruflo
热度
- GitHub 星标
- 81k
- 排名
- #1582
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-adaptive-coordinator
81k帮你的智能体在工作量变化时拆分和重新平衡一组 AI 智能体,并选择适合任务的分工方式。
agent-agent
81k教你的智能体把一个大目标拆成有顺序的行动计划,并在情况变化时重新规划。
agent-agentic-payments
81k帮你的智能体管理 AI 购物的消费授权,包括消费上限、时间窗口、商户规则和签名审批。
agent-analyze-code-quality
81k帮你的智能体检查代码质量,找出代码异味、技术债务和重构建议,且不改动文件。