Skip to content
Solutions · by role

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.

Skills:ui-vs-designsmoke-uata11y-audit

What 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. 1

    Connect WebAgent

    Create an API key in the dashboard, then export it for the webagent CLI, or add the MCP server to Claude Code so your agent can call run_skill itself.

    sh
    export 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. 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 × height before it takes the screenshot.

  3. 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. 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.

    sh
    curl -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. 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.

    text
    Run 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.

urlPage to render (required).
referenceReference PNG as a data URI or base64 (required).
thresholdMax share of differing pixels that still passes, overall and per component (default 0.01).
componentsComponents to diff one by one, by accessible name, e.g. [{ "name": "Sign in", "role": "button" }].
ignoreRegions to ignore, such as a carousel or a timestamp.
width / heightViewport to match the design (default 1280 × 720).

Run your first check today.

Free plan: 20 credits, given once, no card.