agentleFS
troyjthomastroyjthomas/ios-agent-skills/skills/verification-loop/SKILL.md

verification-loop

Skill2 starsChanged 8 months agoMITView on GitHub

How to actually prove a UI change works before claiming it does. Covers AX-coordinate snapshots over screenshots, tap-by-label over coordinates, simulator state resets between iterations, and the build → screenshot → AX → math-check loop. Use this skill alongside testing-strategy whenever you're verifying a UI fix on simulator. Required reading before claiming any visual fix is "done.

53 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use springboot-tdd, django-verification and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • FaisalAlqarniSkill

    springboot-tdd

    Test-driven development for Spring Boot using JUnit 5, Mockito, MockMvc, Testcontainers, and JaCoCo. Use when adding features, fixing bugs, or refactoring.

    Also in 9 projects that use this

  • FaisalAlqarniSkill

    django-verification

    Verification loop for Django projects: migrations, linting, tests with coverage, security scans, and deployment readiness checks before release or PR.

    Also in 9 projects that use this

  • joneqianSkill

    continuous-learning-v2

    Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents.

    Also in 13 projects that use this

  • saxon-ySkill

    configure-ecc

    Interactive installer for Everything Claude Code — guides users through selecting and installing skills and rules to user-level or project-level directories, verifies paths, and optionally optimizes installed files.

    Also in 6 projects that use this

  • Microsoft AzureSkill

    iterative-retrieval

    Max-3-cycle protocol for agent sub-tasks with WHY context and coordinator validation. Use when spawning sub-agents to complete scoped work.

    Also in 15 projects that use this

  • johnrtiptonSkill

    django-security

    This skill should be used when conducting security reviews, auditing Django applications, hardening security settings, implementing OWASP Top 10 protections, managing secrets, or ensuring multi-tenant security isolation. Provides automated security auditor that scans settings, code, dependencies, and multi-tenant configurations with auto-fix capabilities.

    Also in 10 projects that use this

  • +1 more from FaisalAlqarni

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 7 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 49 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before claiming any UI fix is "done" — required reading

    line 17
  2. Distinctive:

    After every UI change, before claiming a fix is done:

    line 31
  3. Distinctive:

    If the math doesn't check out, the fix isn't done.

    line 73
  4. Distinctive:

    When automating taps to verify a flow:

    line 85
  5. Distinctive:

    When AX targeting fails (rare), THEN fall back to coordinates — but treat that as a temporary fallback, not a default.

    line 98
  6. Distinctive:

    If in doubt, run the AX step.

    line 150
  7. Distinctive:

    If they disagree, the loop just paid for itself

    line 167

“Common” is measured: kept by at least 6 in 10 of the 49 edited versions of this file we could read. “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

Verification Loop

The testing-strategy skill covers automated build verification, unit tests, and manual testing — three layers that prove the code is correct, the logic is correct, and the user experience is correct on a real device.

This skill covers the layer in between: the visual verification loop you run on simulator while iterating. It's where most "I fixed it!" → "actually no you didn't" cycles happen, because eyeballing a screenshot is unreliable for layout bugs.

When to Use

  • Iterating on a layout, padding, alignment, or sizing fix
  • Hooking up a new gesture and need to confirm it fires
  • Diagnosing a visual bug from a user screenshot
  • Before claiming any UI fix is "done" — required reading

Why Screenshots Alone Aren't Enough

Humans cannot reliably eyeball:

  • 16pt vs 21pt padding
  • 2pt off-center drift
  • 40pt vs 44pt button heights
  • A view extending 4pt past where it should

Every one of those is a real bug that ships in apps that "looked fine on simulator." The verification loop replaces "looks fine" with "the AX frame says width 396.66pt, parent says width 402, so right margin is 5.34pt — symmetric with the left's 24pt? No, off by 19pt — fix it."

The Four-Step Loop

After every UI change, before claiming a fix is done:

1. Build clean

Build with XcodeBuildMCP. If status is SUCCEEDED with zero errors,
proceed. If SourceKit reports phantom diagnostics that don't show
up in the actual build log (e.g. "Cannot find type X" while the
build log shows zero errors), ignore them — see the
xcode-integration skill for the SourceKit-lag distinction.

2. Screenshot

Capture the screen state. Useful for "does it look right?" gut-check
but NEVER sufficient on its own for layout claims.

3. AX snapshot — the critical step

XcodeBuildMCP's snapshot_ui returns the accessibility tree with every visible element's AXFrame (x, y, width, height) in real screen coordinates. Use this to verify layout numerically:

Get the AX snapshot. For the view you changed, locate its frame
in the output. Compare against:
- The parent's frame (is the child centered? offset? overlapping?)
- Sibling frames (is spacing equal? is alignment matching?)
- Screen bounds (is anything off-screen?)
- The expected values from the design (does padding match the spec?)

Worked example — verifying a button is centered on a 402pt-wide screen:

Button AXFrame: x=80, width=242
- Right edge: 80 + 242 = 322
- Distance from screen right (402): 402 - 322 = 80
- Distance from screen left: 80
- Difference: 0 → centered ✓

If the math doesn't check out, the fix isn't done. No "looks centered enough" — center is a number.

4. Math-check, then commit

If the AX numbers match the design spec, commit. Push. Open the PR.
If they don't match, the fix isn't done — go back to step 1 with
the next iteration.

Tap by Label / ID, Never by Coordinates

When automating taps to verify a flow:

Prefer:
  tap by accessibility id (AXUniqueId)
  tap by accessibility label (AXLabel)

Avoid:
  tap at coordinates (x, y)

Coordinates break the moment layout changes. Labels survive layout changes — if the user-facing label is the same after your fix, the test still works. If the label changed, that's a UX-meaningful change worth a separate review.

When AX targeting fails (rare), THEN fall back to coordinates — but treat that as a temporary fallback, not a default.

Resetting Simulator State Cleanly

Many UI flows (welcome screens, first-run prompts, onboarding) only fire on first launch. Verifying them iteratively means resetting the launch flag between iterations.

# Terminate the running app
xcrun simctl terminate <SIMULATOR_UDID> <BUNDLE_ID>

# Relaunch with a UserDefaults override that resets the first-run flag
xcrun simctl launch --terminate-running-process <SIMULATOR_UDID> <BUNDLE_ID> -hasSeenWelcome NO

@AppStorage keys can be overridden as launch arguments by prefixing with -. Use the same keys your @AppStorage properties use. The override only applies to the current launch — your normal first-launch detection logic still runs.

For state that's NOT in @AppStorage (in-memory state, SwiftData), use xcrun simctl uninstall followed by a fresh install — heavier, but guarantees a clean slate.

A Verification-Loop Template

A reusable prompt to give your coding agent at the end of any UI fix:

Before claiming this fix is done:

1. Build with XcodeBuildMCP. Confirm SUCCEEDED with zero errors.
   (Phantom SourceKit diagnostics that don't appear in the build
   log are SourceKit lag — ignore.)
2. Screenshot the screen state. Attach to the verification report.
3. Run snapshot_ui. For each view you changed, report the AXFrame
   coordinates. Verify against the design spec or the parent
   container math (centered? aligned? padded equally?).
4. If the math doesn't check out, iterate. Don't claim "done" on
   a fix that hasn't been numerically verified.

Verification report format:
- Build status: [SUCCEEDED / FAILED]
- Screenshot path: [path]
- Modified view AXFrame: [x, y, width, height]
- Math check: [show your work — what was the expected number, what
  was the actual number, by how much do they differ]
- Result: [PASS / FAIL with next steps]

When to Skip the AX Step

The AX step is required for layout claims (padding, alignment, sizing, position). It's optional for:

  • Pure logic changes that don't touch layout (e.g. a state-management refactor)
  • Non-UI changes (data layer, networking)
  • Fixes where the visual result is binary (a view either appears or it doesn't)

If in doubt, run the AX step. It costs 30 seconds and catches bugs that ship.

Anti-Patterns

TemptationWhy It Fails
Eyeballing the screenshot to decide if padding is symmetricHumans see 16pt and 21pt as the same. The user reports the bug a week later
Tapping by coordinates because "label targeting is fiddly"Layout changes break the test; labels survive layout changes
Skipping the AX step on "obvious" fixesThe "obvious" fix is where regressions hide
Claiming a fix is done before pushingReviewer can't reproduce; you've shipped a half-fix
Running verification only on the simulator you usually useMini, SE, and 17 Pro Max have different widths; layout bugs love smaller screens

Verification

For this skill itself:

  1. Pick a recent UI fix you made and re-verify it using the four-step loop
  2. Compare what the AX numbers tell you to what your initial gut-check said
  3. If they disagree, the loop just paid for itself

Time Estimate

The loop adds 1–3 minutes per iteration. Saves 30+ minutes of "I shipped it and the user found the bug" debugging downstream.

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.