Skip to content

webkubor/ui-craft / skills/browser-verify

browser-verify

Verified

UI 视觉验证方法论(截图取证/双主题/移动端/白屏诊断/读屏上值的 DoD 流程)。使用当前环境可用的浏览器能力,本 skill 提供验收清单与诊断技巧;browser-harness(CDP) 是可选驱动示例。触发:"看渲染 / 截图验证 / UI DoD / 双主题核对 / 白屏排查"。

通用前端研发唯一入口:ui-design。项目品牌、组件库、域名和发布规则从项目读取。

浏览器控制 / UI 可视化验证(browser-harness)

优先使用当前环境提供的浏览器能力;以下 fallback 示例使用 browser-harness(CDP 直控本机 Chrome)。它是命令行工具,Claude / Codex / Gemini 都能 shell 调用——不绑定某个 Agent 专属的浏览器 MCP,所以跨 Agent。

何时用

  • UI 改动的视觉验收(DoD):亲眼看渲染(明暗 / 移动宽度),不靠猜。线上改动要看部署后的真实环境(test/prod),不是只看 localhost。
  • 排查「空白 / 没数据」:区分是数据问题还是渲染问题(先看接口/日志,再看渲染)
  • 确认交互、布局、配色的实际效果

调用形态(heredoc,python 内核)

代理配置影响本地连接时,按当前环境设置 NO_PROXY;以下仅为 browser-harness 可用时的示例:

NO_PROXY=127.0.0.1,localhost browser-harness <<'PY'
new_tab("http://localhost:5173/dashboard")   # 首次导航用 new_tab;别用 goto(会抢用户当前标签页)
wait_for_load()
import time; time.sleep(2)                    # SPA 数据异步,留一点渲染时间
p = capture_screenshot()                      # 截图落 /tmp/shot.png,再用 Read 工具看图下结论
print("SHOT:", p)
PY
  • 读 DOM 文本/值:js("(()=>{ ...return 字符串... })()")——比截图快,适合核对具体数值/文案
  • 点击:先截图读坐标 → click_at_xy(x, y) → 再截图验证(命中走 Chrome 合成层,穿透 iframe/shadow)
  • 滚动到元素:js("document.querySelector('.sel')?.scrollIntoView({block:'center'})")
  • 输入:type_text("...") / press_key("Enter")

验证纪律

  • 部署后在项目实际目标环境复测,记录构建版本;本地验证不替代线上。
  • 登录、账号和权限策略从项目读取;没有可用会话时明确阻塞,不擅自注册或更换账号。
  • 空白页面先看前端错误、请求和资源状态,区分后端不可用与渲染缺陷。
  • 截图后实际打开检查,记录观察,不能裸报「渲染正常」。

工具调用以当前浏览器工具的帮助为准;上面的 browser-harness 示例仅为 fallback,不是强制环境。完整验收走 frontend-e2e,阶段与交付走 ui-design。

brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 318kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 196kUpdated Claude CodeCodexVerifiedInstall