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.
In this repository67 other files it gives its agents.
- agent-onboardingSkill
- android-backgroundSkill
- android-cliSkill
- android-compose-architectureSkill
- android-compose-componentsSkill
- android-data-layerSkill
- android-di-koinSkill
- android-error-handlingSkill
- android-integration-testingSkill
- android-jacoco-setupSkill
- android-jvm-test-coverageSkill
- android-module-structureSkill
- android-navigationSkill
- android-presentation-mviSkill
- android-preview-figma-verifySkill
- android-ui-testingSkill
- android-ui-verifySkill
- android-unit-testingSkill
- android-version-catalogSkill
- architecture-decision-recordSkill
- careful-planningSkill
- compose-adaptive-layoutsSkill
- figma-to-android-vectorSkill
- finalizeSkill
- git-commitSkill
- handoffSkill
- kmp-compose-architectureSkill
- kmp-compose-componentsSkill
- kmp-data-layerSkill
- kmp-di-koinSkill
- kmp-error-handlingSkill
- kmp-integration-testingSkill
- kmp-migration-analyzerSkill
- kmp-module-structureSkill
- kmp-navigationSkill
- kmp-presentation-mviSkill
- kmp-ui-testingSkill
- kmp-unit-testingSkill
- kotlin-coroutinesSkill
- kotlin-flowsSkill
- kotlin-mutation-testingSkill
- openspec-artifact-review-lightSkill
- openspec-artifact-reviewSkill
- project-breakdownSkill
- react-data-layerSkill
- react-error-handlingSkill
- react-integration-testingSkill
- react-presentation-mviSkill
- react-project-structureSkill
- react-routingSkill
- react-screen-architectureSkill
- react-securitySkill
- react-server-stateSkill
- react-ui-componentsSkill
- react-unit-testingSkill
- speckit-parallelize-agent-teamsSkill
- speckit-parallelize-subagentsSkill
- spring-api-layerSkill
- spring-di-configurationSkill
- spring-integration-testingSkill
- The first 60 shown.
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
- Distinctive: line 20
Verify a single running Compose screen against a Figma design using annotated screenshots from the Android CLI.
- Very specific: line 89
Call mcp__plugin_figma_figma__get_design_context with fileKey and nodeId.
- Distinctive: line 105
If the Figma MCP call fails or the URL is malformed, stop and report the error.
- Distinctive: line 126
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.
- Distinctive: line 161
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 — …
- Distinctive: line 170
Do NOT continue to subsequent navigation steps.
- Distinctive: line 184
Use the fallback if any of these is true:
- Distinctive: line 204
Do NOT auto-retry the annotated capture.
- Distinctive: line 216
Every Figma element exists somewhere on the target screen.
- Distinctive: line 217
Every visible text string matches exactly (case-sensitive).
- Very specific: line 250
When reporting an issue, reference the element by its label number from the annotated screenshot, e.g.
- Distinctive: line 256
When uncertain — annotation is ambiguous, element identity unclear, or the mismatch could plausibly be intended — stay silent.
- Distinctive: line 323
Not a screenshot-testing framework.
- Distinctive: line 325
Not pixel-perfect. The bar is "obviously wrong to a human".
- Distinctive: line 326
Not a code fixer. Reports only.
- Distinctive: line 327
Not preview-capable. Live device only.
- Distinctive: line 328
Not multi-screen. One screen per invocation.
- Distinctive: line 329
Not a navigator. Navigation steps come from the calling agent verbatim.
≈ “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.
Files
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-verify | android-ui-screenshot-verify (this) | |
| Mechanism | uiautomator XML dump | android screen capture --annotate + visual reasoning |
| Catches | Hierarchy, text, dp sizing, spacing | Overlap, clipping, colors, icon shape, alignment |
| Strengths | Structural, deterministic, dp tolerances | Visual, sees what XML can't |
Prerequisites
The calling agent MUST provide:
- Figma URL with node ID — the design to compare against.
- 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:
androidCLI installed (android --versionworks).adbon PATH.- Figma MCP server configured (the
mcp__plugin_figma_figma__get_design_contexttool 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
adbcommands 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→ usebranchKeyas 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>.pngVisually 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:
Replaceadb shell input $(android screen resolve --screen /tmp/uiverify-nav-<N>.png --string "tap #X")Xwith the identified label number. - Text input: tap the field first (as above). Then verify the field has
focused="true"by runningandroid layout --pretty | grep -A2 focusedor by re-capturing and checking. Then:
For spaces useadb shell input text "<value>"adb shell input keyevent 62. For enter usekeyevent 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.5before 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.pngReturn 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.pngVisually 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
uiautomatorcannot 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.jsonVerification 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-verifyis 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
| Step | Command |
| Check devices | adb devices |
| Get Figma context | Figma MCP get_design_context(fileKey, nodeId) |
| Annotated screenshot | android screen capture --annotate -o <path> |
| Resolve label to coords | android screen resolve --screen <path> --string "tap #N" |
| Tap | adb shell input tap <x> <y> (or piped from screen resolve) |
| Type text | adb shell input text "<value>" |
| Back / Home / Enter / Space | adb shell input keyevent 4 / 3 / 66 / 62 |
| Plain screenshot fallback | android screen capture -o <path> |
| Layout JSON fallback | android layout --pretty -o <path> |
| Settle | sleep 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.
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
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.

