tune-crawler
Skill2 starsChanged 18 days agoMITView on GitHub
Diagnose and fix AppScreenMap exploration quality problems — duplicate or merged screens, wasted/repeated taps, wrong element kinds or titles, navigation/replay failures, the crawl leaving the app, slow crawls. Use after a crawl or `appscreenmap report` shows findings, or when the user says the map looks wrong.
In this repository22 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- a11y-auditSkill
- adaptiveSkill
- add-a11y-ruleSkill
- add-exporterSkill
- android-intent-securitySkill
- android-permissions-securitySkill
- crawl-appSkill
- design-systemSkill
- edge-to-edgeSkill
- extend-crawlerSkill
- ios-a11y-rulesSkill
- ios-simulatorSkill
- maintain-crawlerSkill
- play-policy-insightsSkill
- security-auditSkill
- security-rulesSkill
- stack-iosSkill
- stack-rulesSkill
- store-requirementsSkill
- wcag-mobile-rulesSkill
- web-uiSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
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 8
Never fix exploration by guessing.
- Distinctive: line 26
Use synthetic data only; never commit real app dumps, since they contain user content.
- Very specific: line 29
Verify: Run uv run pytest -q && uv run ruff check && uv run ruff format, then re-crawl the Playground with --clear-data and compare report …
- Very specific: line 73
When the app leaves the foreground, check logcat -b crash for Process: <pkg>, before calling it "left the app".
- Distinctive: line 79
Add new lessons here when a fix teaches something general.
≈ “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
Tune the crawler: evidence → failing test → fix → re-crawl
Never fix exploration by guessing. Each fix follows this loop:
- Evidence. Get the run's health report and find the steps where it went wrong.
The hierarchy of every screen is inuv run appscreenmap-engine report runs/<project>/<run-id> grep -n '"effect": "same_screen"' runs/<project>/<run-id>/trace.jsonl | head # wasted tapsruns/<project>/<run-id>/screens/<sid>.xml. To capture the live screen:
To print the tree with groups, walkuv run python -c " from appscreenmap.drivers.android import AdbDriver; from appscreenmap.core.analyzer import analyze d=AdbDriver(); s=d.snapshot(); w,h=d.screen_size(); o=analyze(s.xml,None,s.activity,w,h) print(o.title, o.patterns, o.signature) for e in o.elements: print(e.kind, e.action, repr(e.label), e.group, e.key)"parse_hierarchy()+_mark_repeats(); see howpackages/testkit/src/appscreenmap/testkit/helpers.pymodels Compose output. - Failing test. Reproduce the structure in
packages/core/tests/(screen identity) orpackages/crawler/tests/(exploration) with thenode()/hierarchy()helpers. Use synthetic data only; never commit real app dumps, since they contain user content. - Fix in the right layer (map below). Keep the change minimal and explain why in a comment only where it's non-obvious.
- Verify. Run
uv run pytest -q && uv run ruff check && uv run ruff format, then re-crawl the Playground with--clear-dataand comparereportnumbers before and after (steps/screen, no-ops, near-duplicates, nav failures). Then add the re-run to the Playground canvas (merge --into <canvas> <run> --move, see thecrawl-appskill) instead of leaving a new run behind.
iOS crawl? Start with the
ios-simulatorskill: its table of symptoms (missing tab bar, in-app browser, blank trees) separates app accessibility gaps from crawler bugs before you change any code.
Symptom → where to look
| Symptom (report / trace) | Likely cause | Code |
| Same screen appears as 2+ ids (near-duplicate pair) | Dynamic text leaking into tokens; threshold too strict | analyzer.analyze() token rules, normalize_text, CrawlConfig.similarity, Explorer.identify() |
| Different screens share one id; "crowded" screen | Tokens too coarse (Compose: every node is View) | text tokens, layout_fingerprint, identify() |
Wrong variant_of | Layout similarity too loose / wrong trigger | AppMap.mark_variant, LAYOUT_VARIANT |
| Same element tapped on many screens, no effect | Global element not inferred | AppMap.infer_global_nav (nav/tab kinds), _kind() |
| Distinct buttons collapsed / missing | Key collision after normalization | _elements() key + ordinal logic |
Element keys change between visits → not_found, re-explored | Key built from dynamic text or position | _elements() key rules (scroll keys are positional) |
| Header/buttons treated as list rows (and capped) | Over-eager repeat detection | _mark_repeats() (leaf rule, grid rule) |
| Whole list explored one row at a time | Rows not grouped, or outcomes not judged "same" | _mark_repeats, AppMap.apply_list_cap, _same_outcome |
nav_failed, many restarts | History-dependent back edges, start screen varies | Explorer.routes() costs, navigate(), follow() |
| Typing navigates away / closes screen | Keyboard handling | Explorer.autofill(), AdbDriver.hide_keyboard() (ESC, never BACK) |
left_app, x: screens | Pinning failed or disabled | AdbDriver.pin(), Explorer.restart(), stay_in_app |
| Title is the activity name | No title heuristic matched | _title(), the fallback in Explorer.record() |
| Slow (>4 s/step) | Device I/O, not Python | settle_seconds; future uiautomator2 driver (extend-crawler) |
Lessons already learned (don't regress)
- Compose flattens LazyColumn rows into leaf siblings, so leaves are only list rows inside real
ListView/RecyclerView/GridView. - Digits are normalized (
10:15→##:##) for identity. Colliding element keys get#2,#3instead of being dropped. - Nested controls inside list rows (a card's "MORE") form their own group.
- ListView rows are often not
clickable; they're treated as implicitly clickable. - BACK can close search screens, so the keyboard is hidden with ESC.
- BACK at the app's root exits the app, so the app is pinned via
am task lock. A force-stop unpins, sorestart()re-pins. - A screen first seen outside a recorded action has
origin: unknownand gets a path the first time a known screen leads there. Onlyrestart()may markorigin: launch(an empty path means "launch lands here"). The viewer builds its tree fromreach_path, so never leave a pathless screen looking like a root. - An action that only changes scrolled content (a tap that scrolls the list, a WebView exposing its text)
must not create a new screen.
identify(obs, hint=src)keeps the source screen when the fixed part (fixed_tokens: outside scrollers/WebViews: title, toolbar, nav) is unchanged. - Android 10+ often shows no crash dialog: the app just disappears and another app comes to the front.
When the app leaves the foreground, check
logcat -b crashforProcess: <pkg>,before calling it "left the app". - First-run screens (sign-in, onboarding) disappear once the app saves state. With
--clear-datathe crawler maypm clearonce to get back (data_resetevent, max 5 per crawl). - Pinning shows an "App pinned" toast;
restart()waits it out so screenshots (and visual diffs) stay clean. - Stdout must be line-buffered, or background logs stay empty.
Add new lessons here when a fix teaches something general.
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.

