Render and fix Jetpack Compose UI issues in a Claude Code loop

Android engineer Ashwin gave Claude Code a skill that renders Compose previews, checks clipping, touch targets, labels, contrast and RTL, then fixes and re-checks. It caught 10 of 11 planted bugs.

Done withClaude Code· Nov 18, 2026

What they did

Ashwin, an Android engineer, built verify-ui so a coding agent could see the Jetpack Compose screens it writes. It has two halves: a Gradle plugin that renders previews on the JVM with Robolectric (no emulator), including 2x font, dark theme and RTL variants, and checks the layout for clipped text, touch targets under 48dp, missing accessibility labels, low contrast and broken mirroring; and a Claude Code skill. Running /ui-verify on a composable has Claude Code read its parameters, generate previews for meaningful states, run the render, read the JSON report and fix what it finds, then run validation again until it is clean.

How it went

On a sample app with 11 planted bugs the loop flagged 10 with no false positives; the miss, a Switch with a null callback in a clickable row, needed a visual checklist added to the skill. The first evaluation was invalid because comments in the code gave the agent the answers. Claude Code once turned a Column into a LazyColumn to fix a clipped row, so the skill now asks for minimal, local fixes. On a production app it rendered first time but hit a manifest merge failure and missed text clipped by maxLines, which became a new rule in version 0.2.1.

Worth knowing

It is an early prototype. It cannot reach state held inside a composable with remember, covers about six control states per screen, and judges measurable faults only, not whether a design looks right. Projects without a Compose BOM must pin Compose test dependency versions themselves.

Try it

With Claude Code· 3 parts to fill in

Check the Jetpack Compose UI in [module name] before you call it done. For [composable name], read its parameters and write previews for the states that matter: default, selected, loading, disabled, empty and very long text. Render each one at normal and 2x font scale, in dark theme and in RTL using [verify-ui or my screenshot tool]. Look for clipped text, touch targets under 48dp, missing content descriptions, low contrast and layouts that do not mirror. Fix each finding with the smallest local change, without restructuring the layout, then render and check again. Stop when the report is clean and show me the before and after for every change.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related