Skip to content
Back to search

browser-verify

MarketplaceWorks with Claude CodeGitHub

Verify frontend changes in a real browser with measured numbers, not eyeballed screenshots. Playwright toolbox + Claude Code skill.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/ljh1595149587--browser-verify/badge.svg)](/listings/ljh1595149587--browser-verify)

HTML

<a href="/listings/ljh1595149587--browser-verify"><img src="/api/listings/ljh1595149587--browser-verify/badge.svg" alt="findsafeskills safety rating" /></a>

Install

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

git clone https://github.com/ljh1595149587/browser-verify.git
cd browser-verify
npm install
node bin/verify.mjs examples/demo-check.mjs   # 7 pass, 1 deliberate fail

Requires Node 18+ and Google Chrome. No Chrome? Use Playwright's bundled Chromium:

npx playwright install chromium
BV_CHANNEL=chromium node bin/verify.mjs examples/demo-check.mjs

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 11 lines
  1. {
  2. "name": "browser-verify",
  3. "owner": { "name": "ljh1595149587" },
  4. "plugins": [
  5. {
  6. "name": "browser-verify",
  7. "source": "./",
  8. "description": "Verify frontend changes in a real browser with measured numbers, not eyeballed screenshots."
  9. }
  10. ]
  11. }
README.md · README · 139 lines
  1. # browser-verify
  2. **Verify frontend changes in a real browser with measured numbers, not by eyeballing screenshots.**
  3. [中文说明](README.zh-CN.md)
  4. A tiny Playwright-based toolbox plus a [Claude Code](https://claude.com/claude-code) skill that
  5. teaches the agent to check its own UI work before saying "done".
  6. ```
  7. PASS grid → list switch works — grid=[296px 296px 296px 296px] list=[1232px]
  8. PASS dark token applies — light=rgb(252, 252, 251) dark=rgb(13, 13, 13)
  9. FAIL badge has accent background — badge bg=rgba(0, 0, 0, 0)
  10. demo: 7 passed / 1 failed (0.8s)
  11. ```
  12. ## Why
  13. There is a family of bugs where **the code is there but the effect isn't**. `typecheck` and
  14. `build` are green, the screenshot looks roughly fine, and yet:
  15. - a CSS variable name is misspelled → silently falls back to nothing
  16. - two rules have equal specificity → the winner depends on load order
  17. - a media query can't beat `.x.y`
  18. - the enter animation runs on the skeleton, so the real content appears at its final frame
  19. - an else-if chain in a template misses a branch
  20. - a token cleanup collapses `base` and `hover` to the same value
  21. The only reliable way to catch these is to **measure**: computed styles, bounding boxes,
  22. grid columns, overflow, sampled animation frames. Every check in this toolbox records the
  23. number it measured, so a failure explains itself.
  24. Installing Playwright into every project is heavy (deps, config, directory conventions,
  25. browser downloads in CI). Instead: **install once, call it from any project, throw scripts away freely.**
  26. ## Install
  27. ```bash
  28. git clone https://github.com/ljh1595149587/browser-verify.git
  29. cd browser-verify
  30. npm install
  31. node bin/verify.mjs examples/demo-check.mjs # 7 pass, 1 deliberate fail
  32. ```
  33. Requires Node 18+ and Google Chrome. No Chrome? Use Playwright's bundled Chromium:
  34. ```bash
  35. npx playwright install chromium
  36. BV_CHANNEL=chromium node bin/verify.mjs examples/demo-check.mjs
  37. ```
  38. ## Usage
  39. ```bash
  40. node path/to/browser-verify/bin/verify.mjs ./my-check.mjs # headless
  41. node path/to/browser-verify/bin/verify.mjs ./my-check.mjs --headed # watch it run
  42. node path/to/browser-verify/bin/verify.mjs ./my-check.mjs --slow=300
  43. ```
  44. A check script exports one function. It receives the toolbox and returns the failure count,
  45. which becomes the process exit code:
  46. ```js
  47. export default async function ({ Report, launch, login, until, shot, measure }) {
  48. const r = new Report('accounts page')
  49. const { browser, page, errors } = await launch({ width: 1280 })
  50. await login(page, { url: 'http://localhost:5173/login', email: 'a@b.c', password: '…' })
  51. await page.goto('http://localhost:5173/accounts', { waitUntil: 'networkidle' })
  52. r.check('cards rendered', await page.locator('.acc-card').count() > 0)
  53. const cols = await measure.gridColumns(page.locator('.wall'))
  54. r.check('grid is multi-column', cols.count > 1, `grid-template-columns=[${cols.value}]`)
  55. r.check('no page errors', errors.length === 0, errors.slice(0, 3).join(' | '))
  56. await shot(page, './out/accounts.png')
  57. await browser.close()
  58. return r.finish()
  59. }
  60. ```
  61. See [`examples/demo-check.mjs`](examples/demo-check.mjs) for a complete, self-contained example.
  62. ## API
  63. | | |
  64. |---|---|
  65. | `launch({ width, height, headless, slowMo, channel })` | Opens a page and returns `{ browser, page, errors, requests }`. `errors` collects `pageerror` and console errors automatically. `--headed`/`--slow` are applied by default. |
  66. | `new Report(title)` | `.check(name, ok, evidence)` records one criterion; `.finish()` prints a summary and returns the failure count. |
  67. | `shot(page, path)` | Screenshot, creates directories as needed. |
  68. | `until(fn, { timeout, interval })` | Polls until `fn()` is truthy. **On timeout it returns the last value**, so you can put it in the evidence string. |
  69. | `login(page, { url, email, password, ... })` | Fills a typical login form and waits until the URL leaves `/login`. |
  70. | `measure.style(el, prop)` | Computed style, including custom properties. Catches misspelled variables. |
  71. | `measure.visible(el)` | Exists **and** has non-zero size. |
  72. | `measure.gridColumns(el)` | Number of resolved grid columns. |
  73. | `measure.overlaps(a, b)` | Do two boxes overlap? (A shared edge counts as overlap, so don't use it on adjacent cells.) |
  74. | `measure.sampleTransition(el, { prop, ms })` | Samples a property over time. `changed: true` means it is really animating. |
  75. | `measure.rect(el)` | Rounded bounding box. |
  76. Plain Playwright is fully available through `page`, so use `page.evaluate()` for anything else.
  77. ## The discipline
  78. **The third argument of `check()` is not decoration.**
  79. `PASS list view is single-column` says nothing.
  80. `PASS list view is single-column — grid=[404px 404px 404px] list=[1250px]` is evidence.
  81. If you can't write the evidence string, the check didn't verify anything.
  82. ## Claude Code skill
  83. [`skills/browser-verify/SKILL.md`](skills/browser-verify/SKILL.md) tells Claude Code when to
  84. verify (proactively, after CSS/theme/SVG/template changes), how to write measured criteria,
  85. and which pitfalls to avoid.
  86. **As a plugin** (recommended):
  87. ```
  88. /plugin marketplace add ljh1595149587/browser-verify
  89. /plugin install browser-verify@browser-verify
  90. ```
  91. Then run `npm install` once inside the installed plugin directory, or let Claude do it on
  92. first use; the skill tells it how.
  93. **As a plain skill:** clone the repo, run `npm install`, and copy or symlink
  94. `skills/browser-verify` into `~/.claude/skills/`. Set `BROWSER_VERIFY_HOME` to the clone path
  95. so the skill can find the runner.
  96. Then just ask "verify the page in the browser", or let Claude do it on its own after a style change.
  97. ## Recipes
  98. `recipes/` is git-ignored. Keep project-specific scripts (local URLs, test accounts) there
  99. and rerun them after each change.
  100. ## License
  101. [MIT](LICENSE)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.