ra

Visual QA for coding agents

For web pages, ra uses Chromium to measure layout and contrast. For native apps, ra walk runs your project’s UI tests and keeps their screenshots and logs.

Get startedNative app guide

Version 0.4.1 · MIT licence · Node 22.18 or later

What it finds

ra detects responsive layout bugs such as clipped text, overlap and sideways scrolling, along with low contrast, covered buttons and missing accessible names. Each finding names the element and gives the measurement when it can.

A phone screenshot of ra's broken fixture page with seven numbered problems, beside the sentences ra printed for them: the page scrolls sideways by 531px, a button's label is cut off by 84px, a long word runs 119px past its box, two lines are drawn over each other, a Pay now button is covered by another element, two tap targets are 18 by 18 pixels, and grey text has 1.9:1 contrast.

That is ra look broken --at phone on a fixture page of planted problems. It printed 37 findings, and the picture shows seven. There are 19 kinds:

  • Layout
    • page-scroll: the page scrolls sideways.
    • cut-off: text or a control is clipped by a box that hides overflow.
    • spill: text runs out of its box.
    • overlap: two pieces of text are painted over each other.
    • covered: something sits on top of a control, so a click would land on that instead.
  • Reading and reaching
    • contrast: text has too little contrast with what is painted behind it.
    • small-target: tap targets on touch views are small and crowded.
    • no-name: a control has no accessible name, or an image has no alt text.
  • Content
    • image: an image did not load, or is stretched.
    • blank: the page shows nothing.
    • document: there is no title or viewport, or the status is unexpected.
    • error-overlay: a dev-server error overlay is showing.
  • Behaviour
    • console: an error was logged.
    • request: a request failed or answered 4xx/5xx.
    • outside: a request left the world.
    • load: the page did not load.
    • busy: the page never went quiet.
    • expect and steps: your own checks or steps failed.

A false alarm sends an agent to change a page that was right, so ra counts one as a bug. Its twin fixture, tricky.html, holds 14 sections of things that only look wrong, such as deliberate ellipses, line clamps, scrolling strips, off-screen drawers, and screen-reader-only text. ra's tests fail if it reports anything there, at desktop or phone size, in dark mode, with scripts off, or after a jump down the page. docs/findings.md says how each kind is decided, what it deliberately leaves alone, and how to accept one.

Replay web and native user journeys

Put ra.journeys.json in your project to give an agent a design map of key user flows and a command to replay each one. Each journey lists the user's goal, where to start, what to do, what should happen, and where to find the implementation and tests.

Can ra test a native app?

Yes. On macOS, for example, ra walk can run a Swift test on a Mac. The Swift test opens the native window, drives the controls, checks the result and captures screenshots. ra starts that test, checks its exit status and the declared images, then keeps the screenshots and test log. The native test owns the assertions. Use the screenshots to review what the user sees.

Try a working walkthrough

This repository has a journey that opens the coding agent guide and follows its link to a worked example. In a clone, install the locked dependencies with bun install, then run the example:

Terminal
node node_modules/playwright-core/cli.js install chromium
bun run site
node src/cli.ts map find-the-journey-recipe
node src/cli.ts walk find-the-journey-recipe

Replay web and native user journeys in full

For coding agents

The bundled ra skill shows coding agents how to check the rendered UI, replay user journeys and verify a fix. Copy skills/ra/SKILL.md and its directory to where your agent reads skills. For example, Claude Code reads project skills from .claude/skills/.

For coding agents in full

How it works

ra opens the real web app in Chromium and measures what the browser renders. You can give each test state its own fixtures for network replies, storage, cookies and time. The browser reports requests that the fixture rules leave unanswered.

The world: the mocking half

The world is everything outside your app, and you describe it in ra.config.ts. It decides what each request gets, in this order:

  1. A reply you wrote (replies) answers in the server's place.
  2. A host you block (block), such as analytics, is dropped quietly.
  3. The app itself answers its own paths.
  4. A host you allow (allow), such as a font CDN, is really reached.
  5. Anything else is stopped and reported as an outside finding.

The look: the perception half

The look reads the page five ways, and no model takes part in any of them:

ReadingHow ra takes itWhat it finds
BoxesThe layout engine's own rectangles for each element and each line of text, set against the screen, the boxes that clip them, each other, and each image's own size.page-scroll, cut-off, spill, overlap, small-target, image, blank
What is on topThe element the browser reports on top at the centre of each control, tested as ra scrolls down the page in half-screen steps, up to 40 screens.covered
Two picturesThe page as it is, and the page with every glyph made transparent, which shows the true background under each line of text, whatever painted it: a gradient, a photo, an overlay, or a blend.contrast
Roles, names, and the documentEach control's role and accessible name, which ra also prints as the outline, and the page's title, viewport, and response status.no-name, document, error-overlay
The console and the networkEvery error logged and every request made, until the network has been quiet for 200 ms or 5 seconds have passed.console, request, outside, load, busy

How it works in full

How it compares

ra combines measured visual findings, repeatable browser states and user journey replays in one CLI. Each browser state can name its own network replies, storage, cookies and clock, so the agent can open a specific error or empty state on demand.

How it compares in full

When to use it

Use ra when a change needs to be checked against what a user can see or do. Each browser look loads the real page and waits for it to settle.

Use ra when

  • The question is “what does a person see here?”
  • The state is expensive to reach by hand.
  • A change has a visual blast radius.
  • An agent is changing UI.
  • A fix spans several steps.

Do not use ra for

  • Logic.
  • Restating the implementation.
  • Proving a live system works.
  • Pixel baselines in CI, or coverage ledgers.
  • Cross-browser matrices.
  • A full accessibility audit.

When to use it in full

Start

Run a visual check on a page of your running web app with one command after installing ra from GitHub. You’ll need Node 22.18 or later on macOS or Linux and a Playwright Chromium install.

Terminal
npm install -D https://github.com/hraness/ra/releases/download/v0.4.1/hraness-ra-0.4.1.tgz playwright-core
npx playwright-core install chromium
npx ra look http://127.0.0.1:3000/ --at phone

If your project already has playwright or @playwright/test, leave playwright-core out and install the browser with npx playwright install chromium.

That first look needs no config. It prints the findings, an outline of the page, a sketch of its layout, and where it saved two pictures. Name your app’s states to check them together with ra check, or map a user journey to review a task from start to finish. Install the skill to give your coding agent the same workflow.