agentleFS
jacksononjacksonon/skills/auto-uitest/SKILL.md

auto-uitest

Skill0 starsChanged 8 months agoMITView on GitHub

Drive a real iPhone or iPad through WebDriverAgent, including device discovery, device selection, installed-app lookup, WDA install/startup, UI tree capture, screenshot-assisted exploration, source-file hint extraction from iOS UI implementation files, and drafting iOS UI automation scripts. Use when Codex needs to explore a physical iOS device, pick from multiple connected phones, resolve a missing bundle identifier, bootstrap WDA from a prebuilt or source checkout, turn an observed flow into an Appium/XCUITest-style test script, or generate a UI testcase starting from iOS files such as ViewController.m, .swift, .xib, or storyboard files.

  • In this repositoryOne other file it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

44 rules. About 0 are common, 31 are distinctive, and 13 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈31

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 13

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create or load a testcase bundle under the target project.

    line 14
  2. Distinctive:

    Ensure WDA is installed and reachable.

    line 18
  3. Distinctive:

    Every conversation must map to one testcase bundle under the target project, not under the skill repo.

    line 24
  4. Distinctive:

    Start a new case:

    line 32
  5. Distinctive:

    If the user asks to continue or reuse a known flow, load the existing case first.

    line 51
  6. Distinctive:

    If multiple cases match a loose title, ask the user which one to reuse.

    line 52
  7. Distinctive:

    If this is a new flow, create a fresh case before touching the device.

    line 53
  8. Distinctive:

    Read references/testcase-bundles.md when you need the case directory schema or command patterns.

    line 54
  9. Very specific:

    If the user gives you xxViewController.m, xxViewController.swift, .xib, or .storyboard files, extract static hints before touching the …

    line 58
  10. Distinctive:

    Treat source-derived selectors and flows as hypotheses, not runtime truth.

    line 75
  11. Distinctive:

    Prefer extracted accessibility ids and visible text when drafting the first test version.

    line 76
  12. Very specific:

    Use extracted IBAction names to guess primary interactions that deserve a testcase.

    line 77
  13. Distinctive:

    If source hints are the only input, be explicit that the result is draft-quality until validated on-device.

    line 78
  14. Distinctive:

    Read references/source-driven-tests.md when the request starts from source files.

    line 79
  15. Very specific:

    If exactly one selectable=true device is returned, use it without asking.

    line 91
  16. Very specific:

    If multiple selectable devices are returned, ask the user to choose one.

    line 92
  17. Distinctive:

    If no selectable device is returned, stop and tell the user what is missing: trust pairing, Developer Mode, DDI, cable/tunnel, or host …

    line 93
  18. Distinctive:

    If the user already gave a bundle id, trust it unless the app lookup proves it is absent.

    line 108
  19. Distinctive:

    If the prompt does not contain a bundle id, run:

    line 110
  20. Distinctive:

    If the user named the app clearly and the lookup returns one obvious match, use that bundle id.

    line 118
  21. Distinctive:

    If the lookup is ambiguous, show the candidate bundle ids and ask the user to choose.

    line 119
  22. Distinctive:

    If the user gave only a product concept and not an app name, ask for the bundle id or the installed app name before exploring.

    line 120
  23. Very specific:

    If wdaInstalled=true and /status is reachable, proceed.

    line 132
  24. Very specific:

    If WDA is installed but /status is not reachable, start or repair the runner first.

    line 133
  25. Distinctive:

    If WDA is not installed, ask the user which bootstrap path is available:

    line 134
  26. Very specific:

    If source signing needs a provisioning profile, require the user to explicitly provide it.

    line 137
  27. Distinctive:

    Do not pretend WDA can be installed without signing context.

    line 138
  28. Distinctive:

    Read references/wda-setup.md when you need the real-device signing or prebuilt-WDA rationale.

    line 165
  29. Distinctive:

    Prefer the automatic case-aware mode:

    line 178
  30. Distinctive:

    If an external wrapper needs explicit filenames, you can still reserve them first:

    line 187
  31. Distinctive:

    Prefer the XML tree first.

    line 195
  32. Very specific:

    If the XML is incomplete or misleading, inspect the screenshot with view_image or another image-capable tool before guessing.

    line 196
  33. Very specific:

    Use tap, swipe, and type-text only to explore the real flow.

    line 197
  34. Distinctive:

    Keep a terse action log while exploring.

    line 198
  35. Very specific:

    After each important capture or action cluster, append one timeline event with testcase_artifacts.py log.

    line 199
  36. Distinctive:

    Read references/test-authoring.md before writing the final script.

    line 217
  37. Very specific:

    If the flow was explored through ios_wda.py, first export a replay script from the timeline:

    line 221
  38. Distinctive:

    If the target repo already has its own UI automation stack, you can still replace or adapt the generated replay script afterward.

    line 231
  39. Distinctive:

    When final evidence is ready, mark the case reusable:

    line 232
  40. Very specific:

    If the final result is partial or blocked, do not stop at the report alone.

    line 242
  41. Very specific:

    When the user agrees to remediation and the target project is available locally, use the case evidence (report/index.html, captures/, …

    line 243
  42. Distinctive:

    If source hints exist, merge them with runtime XML instead of choosing one source blindly.

    line 245
  43. Distinctive:

    Keep the setup notes in the test or adjacent documentation: device assumptions, bundle id, and WDA assumptions.

    line 247
  44. Distinctive:

    If WDA bootstrap was the blocker, report that explicitly instead of claiming the UI test script is validated.

    line 255

≈ “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

Auto Uitest

Overview

Use this skill to turn a vague “帮我在真机上探索并写 UI 自动化” request into a repeatable host-side workflow. It provides a fixed decision tree plus helper scripts for device/app discovery, testcase persistence inside the target project, and direct WDA control, so Codex does not have to rediscover the real-device plumbing every turn.

Workflow

  1. Create or load a testcase bundle under the target project.
  2. Extract source-driven UI hints when the user provides iOS files.
  3. Resolve the target device.
  4. Resolve the target bundle identifier.
  5. Ensure WDA is installed and reachable.
  6. Explore the app with XML plus screenshots.
  7. Export a reusable replay script into the testcase bundle, render a visual report page, and finalize the case.

1. Create Or Load A Testcase

Every conversation must map to one testcase bundle under the target project, not under the skill repo.

Default location:

<target-project>/.auto-uitest/cases/<case-id>/

Start a new case:

python3 scripts/testcase_artifacts.py init \
  --project-root /path/to/target-project \
  --title "<short case title>" \
  --prompt "<original user prompt>" \
  --bundle-id <optional bundle id>

Reuse an older case:

python3 scripts/testcase_artifacts.py list --project-root /path/to/target-project
python3 scripts/testcase_artifacts.py show --project-root /path/to/target-project --selector "<case-id-or-title>"

Apply these rules:

  • If the user asks to continue or reuse a known flow, load the existing case first.
  • If multiple cases match a loose title, ask the user which one to reuse.
  • If this is a new flow, create a fresh case before touching the device.
  • Read references/testcase-bundles.md when you need the case directory schema or command patterns.

2. Extract Source-Driven Hints

If the user gives you xxViewController.m, xxViewController.swift, .xib, or .storyboard files, extract static hints before touching the device:

python3 scripts/ios_source_hints.py /path/to/xxViewController.m --case-dir <case-dir>

For paired implementation + interface files:

python3 scripts/ios_source_hints.py \
  /path/to/xxViewController.m \
  /path/to/xxViewController.xib \
  --case-dir <case-dir>

Apply these rules:

  • Treat source-derived selectors and flows as hypotheses, not runtime truth.
  • Prefer extracted accessibility ids and visible text when drafting the first test version.
  • Use extracted IBAction names to guess primary interactions that deserve a testcase.
  • If source hints are the only input, be explicit that the result is draft-quality until validated on-device.
  • Read references/source-driven-tests.md when the request starts from source files.

3. Resolve Device

Run:

python3 scripts/device_inventory.py devices --json

Apply these rules:

  • If exactly one selectable=true device is returned, use it without asking.
  • If multiple selectable devices are returned, ask the user to choose one. Prefer request_user_input over a free-form multiple choice message.
  • If no selectable device is returned, stop and tell the user what is missing: trust pairing, Developer Mode, DDI, cable/tunnel, or host permissions.
  • Ignore paired-but-unusable devices unless the user explicitly wants to debug connection state. Use --include-disconnected only for diagnosis.

Log important decisions back to the testcase:

python3 scripts/testcase_artifacts.py log \
  --case-dir <case-dir> \
  --kind "device_selected" \
  --summary "Selected iPhone 13 mini for this case" \
  --data-json '{"udid":"<UDID>"}'

4. Resolve Bundle Identifier

If the user already gave a bundle id, trust it unless the app lookup proves it is absent.

If the prompt does not contain a bundle id, run:

python3 scripts/device_inventory.py apps --udid <UDID> --match "<app name guess>"

Apply these rules:

  • If the user named the app clearly and the lookup returns one obvious match, use that bundle id.
  • If the lookup is ambiguous, show the candidate bundle ids and ask the user to choose.
  • If the user gave only a product concept and not an app name, ask for the bundle id or the installed app name before exploring.

5. Ensure WDA

Inspect the device first:

python3 scripts/ios_wda.py status --udid <UDID> --probe-http

Then branch:

  • If wdaInstalled=true and /status is reachable, proceed.
  • If WDA is installed but /status is not reachable, start or repair the runner first. Usually this means iproxy is missing, the runner is not active, or the device trust state changed.
  • If WDA is not installed, ask the user which bootstrap path is available:
    • Preferred: a prebuilt .xctestrun bundle or bootstrapPath.
    • Fallback: a local WebDriverAgent source checkout plus a valid signing team.
  • If source signing needs a provisioning profile, require the user to explicitly provide it. Do not assume the skill bundle carries a reusable .mobileprovision file.
  • Do not pretend WDA can be installed without signing context. If neither a prebuilt bundle nor a signable source checkout exists, stop and ask for one.

Use these commands:

python3 scripts/ios_wda.py start-prebuilt \
  --udid <UDID> \
  --bootstrap-path /path/to/prebuilt-wda \
  --pid-file .tmp/wda-iproxy.pid \
  --log-file .tmp/wda-iproxy.log \
  --runner-pid-file .tmp/wda-runner.pid \
  --runner-log-file .tmp/wda-runner.log
python3 scripts/ios_wda.py start-source \
  --udid <UDID> \
  --wda-repo /path/to/WebDriverAgent \
  --team-id <TEAM_ID> \
  --provisioning-profile-specifier "<user-provided profile name if needed>" \
  --allow-provisioning-updates \
  --pid-file .tmp/wda-iproxy.pid \
  --log-file .tmp/wda-iproxy.log \
  --runner-pid-file .tmp/wda-runner.pid \
  --runner-log-file .tmp/wda-runner.log

Read references/wda-setup.md when you need the real-device signing or prebuilt-WDA rationale.

Log the chosen bootstrap path and attach any runner logs into the testcase with testcase_artifacts.py attach.

6. Explore The App

Launch the app and create a session:

python3 scripts/ios_wda.py launch-app --udid <UDID> --bundle-id <BUNDLE_ID>
python3 scripts/ios_wda.py open-session --udid <UDID> --session-file .tmp/wda-session.json

Prefer the automatic case-aware mode:

python3 scripts/ios_wda.py open-session --case-dir <case-dir> --udid <UDID> --bundle-id <BUNDLE_ID>
python3 scripts/ios_wda.py snapshot --case-dir <case-dir> --label "login-home"

This automatically uses <case-dir>/session/wda-session.json, writes captures under <case-dir>/captures/, and appends timeline events.

If an external wrapper needs explicit filenames, you can still reserve them first:

python3 scripts/testcase_artifacts.py paths --case-dir <case-dir> --label "login-home"

Apply these rules:

  • Prefer the XML tree first. It exposes stable accessibility ids, labels, names, values, and hierarchy.
  • If the XML is incomplete or misleading, inspect the screenshot with view_image or another image-capable tool before guessing.
  • Use tap, swipe, and type-text only to explore the real flow. Do not ship coordinate-only logic as the final test unless the app truly exposes no stable accessibility hooks.
  • Keep a terse action log while exploring. The final test should reflect the observed flow, not a reconstructed narrative.
  • After each important capture or action cluster, append one timeline event with testcase_artifacts.py log.

Common exploration commands:

python3 scripts/ios_wda.py tap --session-file .tmp/wda-session.json --x 180 --y 640
python3 scripts/ios_wda.py swipe --session-file .tmp/wda-session.json --x1 200 --y1 700 --x2 200 --y2 250
python3 scripts/ios_wda.py type-text --session-file .tmp/wda-session.json --text "hello"

Close the session when done:

python3 scripts/ios_wda.py close-session --session-file .tmp/wda-session.json --delete-session-file

7. Export The Final Test

Read references/test-authoring.md before writing the final script.

Apply these rules:

  • If the flow was explored through ios_wda.py, first export a replay script from the timeline:
python3 scripts/render_case_script.py \
  --case-dir <case-dir> \
  --assert-text "<final success text>"
  • By default this writes a reusable Python replay script into <case-dir>/generated/.
  • testcase_artifacts.py finalize now also renders <case-dir>/report/index.html, which shows the timeline, screenshots, and whether the generated script passed an execution check.
  • If the target repo already has its own UI automation stack, you can still replace or adapt the generated replay script afterward.
  • When final evidence is ready, mark the case reusable:
python3 scripts/testcase_artifacts.py finalize \
  --case-dir <case-dir> \
  --status success \
  --script <case-dir>/generated/<rendered-script>.py \
  --summary "Validated on device and exported replay script."
  • If the final result is partial or blocked, do not stop at the report alone. Summarize the failure from the evidence, then ask the user whether Codex should patch the target project and rerun the same case until it passes.
  • When the user agrees to remediation and the target project is available locally, use the case evidence (report/index.html, captures/, timeline.jsonl, generated script) to drive the fix -> rerun -> verify loop.
  • Promote stable selectors from the XML tree into the final test.
  • If source hints exist, merge them with runtime XML instead of choosing one source blindly.
  • Downgrade coordinate taps to comments or temporary TODOs unless they are the only workable interaction.
  • Keep the setup notes in the test or adjacent documentation: device assumptions, bundle id, and WDA assumptions.
  • Copy the final script into <case-dir>/generated/ even if the target repo also stores it elsewhere.

8. Validate And Finalize

  • Re-run the explored flow or at least the key checkpoints after authoring the script.
  • Report exactly which parts were validated on-device and which parts were only inferred from XML or screenshots.
  • Report when any selector or assertion came only from source-file analysis.
  • If WDA bootstrap was the blocker, report that explicitly instead of claiming the UI test script is validated.
  • Finalize the case so later turns can reuse it directly:
python3 scripts/testcase_artifacts.py finalize \
  --case-dir <case-dir> \
  --status success \
  --script /path/to/final_test.py \
  --summary "<validated scope, selector notes, and known caveats>"

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.