WebAgent for engineers
Check the live page matches the design, then let your agent fix it.
ui-vs-design renders your page at the size of the design, compares it with the reference image overall and component by component, and returns the components that differ as JSON your agent can act on. Fix, re-run, repeat.
ui-vs-designsmoke-uata11y-auditWhat you get
- Mismatch per component
- An overlay screenshot
- JSON your agent can act on
- A pass or fail for CI
Step by step
From an API key to a report, then onto every pull request.
- 1
Connect WebAgent
Create an API key in the dashboard, then export it for the
webagentCLI, or add the MCP server to Claude Code so your agent can callrun_skillitself.shexport WEBAGENT_API_URL=https://api.example.com WEBAGENT_API_KEY=… # or hand the browser to Claude Code claude mcp add webagent -e WEBAGENT_API_URL=$WEBAGENT_API_URL -e WEBAGENT_API_KEY=$WEBAGENT_API_KEY -- npx -y @webagent/mcp - 2
Export the design
Export the frame as a PNG at the size you want to match, for example 1280 × 720. The skill sets the viewport to
width×heightbefore it takes the screenshot. - 3
Name the components to check
List components by accessible name and role. Each one is cropped and compared on its own, so the report says which part drifted instead of a single percentage.
json{ "url": "https://staging.example.com/pricing", "reference": "data:image/png;base64,…", "threshold": 0.01, "components": [{ "name": "Start Pro", "role": "button" }, { "name": "Pricing", "role": "heading" }] } - 4
Run it from your own code
Every skill is also one HTTP call. The response has the status, a summary, findings by severity and a link to the HTML report.
shcurl -s -X POST $WEBAGENT_API_URL/v1/skills/ui-vs-design/run \ -H "authorization: Bearer $WEBAGENT_API_KEY" -H 'content-type: application/json' \ -d '{"inputs":{"url":"https://staging.example.com/pricing","reference":"data:image/png;base64,…"}}' # { "status": "failed", "summary": "…", "findings": [...], "reportUrl": "/v1/skill-runs/run_…/report" } - 5
Let your agent close the loop
In Claude Code with the WebAgent MCP server, ask for the check and the fix in one go. The agent runs
ui-vs-design, edits the components that differ and runs it again until it passes.textRun ui-vs-design on http://localhost:3000/pricing against design/pricing.png, fix the components that differ, and re-run until it passes.
Inputs
For ui-vs-design. Pass them as flags, JSON or in plain words to your agent.
| url | Page to render (required). |
|---|---|
| reference | Reference PNG as a data URI or base64 (required). |
| threshold | Max share of differing pixels that still passes, overall and per component (default 0.01). |
| components | Components to diff one by one, by accessible name, e.g. [{ "name": "Sign in", "role": "button" }]. |
| ignore | Regions to ignore, such as a carousel or a timestamp. |
| width / height | Viewport to match the design (default 1280 × 720). |
Related
Run your first check today.
Free plan: 20 credits, given once, no card.