agentleFS
PixiBixiPixiBixi/claude-skills/skills/auditing-mobile-layout/SKILL.md

auditing-mobile-layout

Skill0 starsChanged 10 days agoApache-2.0View on GitHub

Play a web app or browser game through on emulated iPhone and Android, portrait and landscape, and measure the layout.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Write ${AUDIT}/game.spec.ts from references/game-bot.md, the only game-specific file.

    line 33

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

Auditing a mobile layout

Overview

Plays the app on six emulated phones and records geometry, never pixels: overflow, tap targets, text size, dialogs that do not fit, controls covered by others, and how far apart two things the player must see together are. An audit records every breach and keeps going; a regression spec fails on the first. Measure first, then pick which breaches deserve a spec.

Profiles

iPhone SE (320x568), iPhone 15, iPhone 15 landscape on WebKit; Galaxy S9+ (320 wide), Pixel 7, Pixel 7 landscape on Chromium. The 320px and landscape profiles are where layouts break: a 390px-only check misses them. For a multiplayer game, use the largest table size, so every rail has its real height.

Run

The specs need the app's own @playwright/test, so they run from a directory inside the repo, never committed.

REPO=/path/to/the/app
AUDIT=${REPO}/.mobile-audit                 # specs, excluded from git
OUT=/path/to/scratchpad/mobile-audit        # rows, progress, screenshots
mkdir -p "${AUDIT}" "${OUT}"
cp "${CLAUDE_SKILL_DIR}"/scripts/*.ts "${AUDIT}/"
cd "${REPO}"
echo '.mobile-audit/' >> "$(git rev-parse --git-path info/exclude)"   # also right in a worktree
npx playwright install webkit chromium-headless-shell
  1. Build the app and start its production server in the background on a port of its own, keeping its PID, then until nc -z 127.0.0.1 <port>; do sleep 0.5; done. A stale build is an old app under a new test. Stop it with kill <pid>: a pkill -f on the server's path also kills the server of any other session working on a sibling app.
  2. Write ${AUDIT}/game.spec.ts from references/game-bot.md, the only game-specific file. Skip it for an app with no flow beyond its URLs.
  3. In the background, first one profile, then all six:
cd "${REPO}"
AUDIT_DIR="${OUT}" AUDIT_BASE_URL=http://127.0.0.1:<port> AUDIT_PATHS=/ \
  npx playwright test -c .mobile-audit/playwright.config.ts --project 'iPhone SE'
  1. "Is it stuck?": tail -1 "${OUT}/progress.log", one line per move. A loop that stops writing for 30s throws with the move number.
  2. bash "${CLAUDE_SKILL_DIR}/scripts/summary.sh" "${OUT}", then stop the server.
  3. Move ${AUDIT} to the scratchpad (mv "${AUDIT}" "${OUT}/specs") before any lint or commit: a linter run over . (eslint .) parses it and fails. Copy it back to rerun.

What counts

MeasureBreach
overflowXany element past the viewport edge
covereda tap on a control lands on another element
dialoga button of the dialog is off screen
turnsthe move and its target never on one screen (together = 0)
text inputsunder 16px: iOS Safari zooms on focus
smallTargets, tinyTextunder 40px, under 12px: report, rarely blocking

Emulation does not cover the Safari URL bar, the virtual keyboard, safe areas, real touch latency or sound (headless). Say so in the report.

Report

A table, one row per breach and one column per profile, ranked by impact on play: covered controls and unreachable actions first, sizes last. Then the screens the bot never reached (unseen). Numbers from the rows, never read off a screenshot.

Turning a finding into a spec

A regression spec asserts one number on one viewport (page.setViewportSize) in the app's own e2e suite. Adding a WebKit or phone project to the app's CI config changes its pipeline: ask first.

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.