agentleFS
PL-Coding-GmbHPL-Coding-GmbH/Skills/skills/android-ui-screenshot-verify/SKILL.md

android-ui-screenshot-verify

Skill18 starsChanged 4 months agoMITView on GitHub

Visually verify a single Android Compose screen against a Figma design using the Android CLI's annotated screenshot tools (`android screen capture --annotate`, `android screen resolve`). Catches overlap, clipping, truncation, color drift, wrong icon shape, broken contrast, and visual misalignment that the structural `android-ui-verify` skill cannot see. Single screen, single viewport, live device/emulator only. Reports a pass/fail verdict plus a lean issue list — does not edit code. Trigger on: "verify the screen visually", "screenshot verify against Figma", "annotated screenshot verify", "does it look right", "compare what I built to Figma visually", or after building a Compose screen from a Figma design when the calling agent wants visual (not structural) verification. For structural / hierarchy / dp-sizing checks, use `android-ui-verify` instead.

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. About 0 are common, 16 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Verify a single running Compose screen against a Figma design using annotated screenshots from the Android CLI.

    line 20
  2. Very specific:

    Call mcp__plugin_figma_figma__get_design_context with fileKey and nodeId.

    line 89
  3. Distinctive:

    If the Figma MCP call fails or the URL is malformed, stop and report the error.

    line 105
  4. Distinctive:

    Read the step (e.g., "tap the Sign In button", "enter test@example.com in the email field") and find which numbered label corresponds to it.

    line 126
  5. Distinctive:

    If a step cannot be executed — the target label is not on screen, the tap does not change the screen after one settle, or the app crashes — …

    line 161
  6. Distinctive:

    Do NOT continue to subsequent navigation steps.

    line 170
  7. Distinctive:

    Use the fallback if any of these is true:

    line 184
  8. Distinctive:

    Do NOT auto-retry the annotated capture.

    line 204
  9. Distinctive:

    Every Figma element exists somewhere on the target screen.

    line 216
  10. Distinctive:

    Every visible text string matches exactly (case-sensitive).

    line 217
  11. Very specific:

    When reporting an issue, reference the element by its label number from the annotated screenshot, e.g.

    line 250
  12. Distinctive:

    When uncertain — annotation is ambiguous, element identity unclear, or the mismatch could plausibly be intended — stay silent.

    line 256
  13. Distinctive:

    Not a screenshot-testing framework.

    line 323
  14. Distinctive:

    Not pixel-perfect. The bar is "obviously wrong to a human".

    line 325
  15. Distinctive:

    Not a code fixer. Reports only.

    line 326
  16. Distinctive:

    Not preview-capable. Live device only.

    line 327
  17. Distinctive:

    Not multi-screen. One screen per invocation.

    line 328
  18. Distinctive:

    Not a navigator. Navigation steps come from the calling agent verbatim.

    line 329

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Android UI Screenshot Verification

Verify a single running Compose screen against a Figma design using annotated screenshots from the Android CLI. The calling agent invokes this skill after implementing the screen and wants a visual sanity check — overlap, clipping, color drift, wrong icon shape, misalignment — things that uiautomator XML cannot see.

This skill reports only. It does not edit Compose code. The calling agent revises the implementation based on the report and re-invokes if needed.

This skill coexists with android-ui-verify. They serve different purposes:

android-ui-verifyandroid-ui-screenshot-verify (this)
Mechanismuiautomator XML dumpandroid screen capture --annotate + visual reasoning
CatchesHierarchy, text, dp sizing, spacingOverlap, clipping, colors, icon shape, alignment
StrengthsStructural, deterministic, dp tolerancesVisual, sees what XML can't

Prerequisites

The calling agent MUST provide:

  1. Figma URL with node ID — the design to compare against.
  2. Navigation steps from current state — natural-language list of taps, text entries, or key events to reach the target screen. May be empty if the app is already on the target screen.

The calling agent does NOT pass: a description of what was built, dynamic-content notes, expected element list, or source files. The skill works from the Figma design context plus what it sees on the device.

The environment MUST have:

  • android CLI installed (android --version works).
  • adb on PATH.
  • Figma MCP server configured (the mcp__plugin_figma_figma__get_design_context tool must be callable).
  • Exactly one device/emulator connected.
  • The app launched on that device in some prior state.

The skill does NOT install, build, or launch the app.


Step 1: Device check

adb devices
  • 0 devices — stop. Report: "No Android device connected. Connect a device or start an emulator and re-invoke."
  • 2+ devices — stop. Report: "Multiple devices connected: <list>. Pass a serial via the calling agent's input." Do NOT auto-pick.
  • 1 device — continue. All subsequent adb commands run against it without needing -s.

Step 2: Fetch Figma design context

Parse the Figma URL to extract fileKey and nodeId:

  • figma.com/design/:fileKey/:fileName?node-id=:nodeId → convert - to : in the nodeId.
  • figma.com/design/:fileKey/branch/:branchKey/:fileName → use branchKey as the fileKey.

Call mcp__plugin_figma_figma__get_design_context with fileKey and nodeId. Do NOT call get_screenshot — get_design_context is the source of truth. Figma screenshots are lossy and add no information that the structured context doesn't already carry.

From the response, build a mental checklist of what should be on the target screen:

  • Component hierarchy (parent → children nesting).
  • Element types and any Code Connect mappings.
  • Text content of every text node, exact strings.
  • Frame dimensions (Figma logical px ≈ dp).
  • Layout direction (row/column) and spacing between siblings.
  • Colors / design tokens.
  • Iconography (which icon, not just "an icon is here").

If the Figma MCP call fails or the URL is malformed, stop and report the error.


Step 3: Navigate to target screen

Skip this step if the navigation list is empty.

For each navigation step:

3a. Capture the current state with annotation

android screen capture --annotate -o /tmp/uiverify-nav-<N>.png

Visually examine the resulting PNG. Each interactive element has a numbered bounding box.

3b. Identify the target label

Read the step (e.g., "tap the Sign In button", "enter test@example.com in the email field") and find which numbered label corresponds to it. Use the visible text, position, and shape to disambiguate.

3c. Execute the interaction

  • Tap:
    adb shell input $(android screen resolve --screen /tmp/uiverify-nav-<N>.png --string "tap #X")
    Replace X with the identified label number.
  • Text input: tap the field first (as above). Then verify the field has focused="true" by running android layout --pretty | grep -A2 focused or by re-capturing and checking. Then:
    adb shell input text "<value>"
    For spaces use adb shell input keyevent 62. For enter use keyevent 66.
  • Back: adb shell input keyevent 4.
  • Home: adb shell input keyevent 3.
  • Swipe / scroll (if explicitly part of the navigation steps): adb shell input swipe <x1> <y1> <x2> <y2> 800.

3d. Wait for UI to settle

sleep 0.5

before the next step.

Failure handling

If a step cannot be executed — the target label is not on screen, the tap does not change the screen after one settle, or the app crashes — stop. Capture the current state:

android screen capture --annotate -o /tmp/uiverify-nav-failed.png

Return immediately with Verdict: NAV_FAILED (see Step 6). Do NOT auto-retry. Do NOT continue to subsequent navigation steps.


Step 4: Capture the target screen

android screen capture --annotate -o /tmp/uiverify-target.png

Visually examine the PNG.

Annotate-failure fallback

Use the fallback if any of these is true:

  • The command fails or produces an empty/0-byte file.
  • The PNG opens but no numbered boxes are visible (e.g., the screen is a WebView, a custom Canvas-only view, or an animation in progress where uiautomator cannot resolve elements).
  • The labels are so dense or overlapping that elements cannot be reliably identified.

Fallback commands:

android screen capture -o /tmp/uiverify-target-plain.png
android layout --pretty -o /tmp/uiverify-target-layout.json

Verification then reasons over the plain screenshot + the layout JSON together. Element references in the report use either text content or resourceId from the layout JSON instead of label numbers.

Do NOT auto-retry the annotated capture.


Step 5: Compare against the Figma design context

Walk every element in the design context as a checklist. For each, look at the annotated screenshot and decide whether it is present and correct. Check four dimensions:

5a. Element presence + text content

  • Every Figma element exists somewhere on the target screen.
  • Every visible text string matches exactly (case-sensitive).
  • Missing elements and wrong text are always real issues.

5b. Layout / arrangement / ordering

  • Rows vs columns match the design's layout direction.
  • Sibling order matches.
  • Alignment within each parent matches (start / center / end / baseline).

5c. Visual sizing & spacing — proportional only

  • Padding, margins, gaps, and element sizes look proportionally right.
  • This is not pixel-perfect and not dp-tolerance comparison — that is what android-ui-verify is for.
  • The bar is "obviously wrong to a human glancing at this". A button that looks ~20% too tall does not get reported. A button that takes up half the screen when it should be a chip does.

5d. Visual-only issues

These are the issues unique to this skill — XML cannot see them:

  • Overlap between elements.
  • Clipping (an element cut off by its parent's bounds).
  • Text truncation / unintended ellipsis.
  • Elements off-screen that should be visible.
  • Broken / missing images.
  • Wrong colors (background, text, button, border, icon tint).
  • Wrong icon shape (chevron vs caret, filled vs outlined, wrong glyph).
  • Broken contrast (text the same color as its background, etc.).

Identification rule

When reporting an issue, reference the element by its label number from the annotated screenshot, e.g. "#7 (the Sign In button)". If the fallback was used, reference by text or resourceId from the layout JSON instead.

Precision over recall

When uncertain — annotation is ambiguous, element identity unclear, or the mismatch could plausibly be intended — stay silent. The output must be high-precision so the calling agent can trust every reported issue. False positives waste a revision cycle and erode trust in the skill.

Note: data-dependent differences (a list shows 3 items vs. 8 in the design because the test data has 3) are NOT issues. The calling agent already knows what's data-dependent. Do not report list-count mismatches, dynamic timestamp text, or counter values unless they reveal a structural bug (wrong template, wrong format, etc.).


Step 6: Report

Output exactly this format. Lean. No "all the things that passed" enumeration.

Verdict: PASS | ISSUES_FOUND | NAV_FAILED

Issues:
  - <issue 1, with element reference>
  - <issue 2, ...>

Evidence:
  - Annotated screenshot: /tmp/uiverify-target.png
  - (if fallback used) Plain screenshot: /tmp/uiverify-target-plain.png
  - (if fallback used) Layout JSON: /tmp/uiverify-target-layout.json
  - (if NAV_FAILED) Failure-state screenshot: /tmp/uiverify-nav-failed.png
  - Figma reference: <original URL>

Verdict definitions

  • PASS — checklist walked, no issues found. Issues: is empty.
  • ISSUES_FOUND — one or more confirmed issues. List each one.
  • NAV_FAILED — could not reach the target screen. Issues: describes which step failed (verbatim) and what was on screen instead.

Issue writing style

  • Reference the labeled element: "#7 overlaps #9 (the Save button is on top of the Cancel button)".
  • Be specific about what is wrong, not just that something is wrong: ✅ "#3 (Continue button) text is white on a white background — invisible" ❌ "button has wrong color"
  • One issue per bullet. Group related issues only if they share a single root cause (e.g., "all four #4–#7 list items have their leading icon clipped").

Quick reference

StepCommand
Check devicesadb devices
Get Figma contextFigma MCP get_design_context(fileKey, nodeId)
Annotated screenshotandroid screen capture --annotate -o <path>
Resolve label to coordsandroid screen resolve --screen <path> --string "tap #N"
Tapadb shell input tap <x> <y> (or piped from screen resolve)
Type textadb shell input text "<value>"
Back / Home / Enter / Spaceadb shell input keyevent 4 / 3 / 66 / 62
Plain screenshot fallbackandroid screen capture -o <path>
Layout JSON fallbackandroid layout --pretty -o <path>
Settlesleep 0.5

What this skill is not

  • Not a screenshot-testing framework. No baselines, no PNG-diffing, no Paparazzi/Roborazzi. The "test" is the live Figma design.
  • Not pixel-perfect. The bar is "obviously wrong to a human".
  • Not a code fixer. Reports only.
  • Not preview-capable. Live device only.
  • Not multi-screen. One screen per invocation.
  • Not a navigator. Navigation steps come from the calling agent verbatim.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.