agentleFS
maikotrindademaikotrindade/mobile-tester-agent/CLAUDE.md

mobile-tester-agent

CLAUDE.md98 starsChanged 6 months agoMITView on GitHub

AI-powered mobile UI test automation for Android, iOS, and React Native. A Kotlin/Ktor backend exposes an HTTP API that hands natural-language scenarios to a Koog-powered LLM agent, which drives a real device or emulator. A React/Vite dashboard under web/ lets users author scenarios and trigger runs. Full documentation lives in docs/. Start there for anything non-trivial. All implement ExecutorInfo in agent/executor/<provider>/. Selected via POST /config (executorInfoId string, case-sensitive). These behaviors are load-bearing — see docs/ai-agent.md and docs/tools.md for the full…

  • Reads credentials
  • Installs packages

The file

We split this CLAUDE.md into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are 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.

  • 2

    Very specific

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

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

    All implement ExecutorInfo in agent/executor/<provider>/.

    line 54
  2. Very specific:

    Status-prefixed tool returns: Every @Tool returns a String starting with one of OK | TAPPED | VISIBLE | NOT_VISIBLE | NOT_FOUND | AMBIGUOUS …

    line 70

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md 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
CLAUDE.md

mobile-tester-agent

AI-powered mobile UI test automation for Android, iOS, and React Native. A Kotlin/Ktor backend exposes an HTTP API that hands natural-language scenarios to a Koog-powered LLM agent, which drives a real device or emulator. A React/Vite dashboard under web/ lets users author scenarios and trigger runs.

Where to find things

Full documentation lives in docs/. Start there for anything non-trivial.

DocWhat it covers
docs/architecture.mdRuntime topology, request lifecycle, module map
docs/getting-started.mdPrerequisites, env, first run
docs/api.mdPOST /run-test, POST /stop-test, POST /config payloads + errors
docs/ai-agent.mdMobileTestAgent, strategy graph, system prompt, executors
docs/tools.mdTool catalog, status-prefix convention, utility layer
docs/frontend.mdReact/Vite dashboard internals
docs/dependencies.mdEvery third-party library, by reason

Project layout

src/main/kotlin/
├── server/                    # Ktor: Application, Routing, HTTP, Monitoring
│   └── model/                 # AgentRequest, MobileTesterConfigAPI (wire DTOs)
└── agent/
    ├── MobileTestAgent.kt     # Singleton — builds & runs the Koog AIAgent
    ├── strategy/              # TestingStrategy.kt — Koog graph
    ├── executor/              # Per-provider subfolders (anthropic, deepSeek, google, ollama, openRouter), each holding ExecutorInfo impls
    ├── model/                 # MobileTesterConfig, TestScenarioReport
    └── tool/
        ├── mobile/test/       # MobileTestTools, ReportingTools, utils/
        └── reporting/         # ReportingTools scaffolding (not yet wired)
web/                           # React 19 + Vite dashboard
docs/                          # Source of truth for design + API docs

Backend stack

  • JDK 21 (Amazon Corretto), Kotlin 2.3.0, Gradle wrapper (8.11+)
  • Ktor 3.1.3 (Netty) + kotlinx.serialization
  • Koog Agents 1.0.0 — AIAgent, strategy DSL, @Tool reflection
  • dotenv-kotlin — loads .env from project root

Frontend stack

  • React 19 + react-router-dom 7 on Vite 7 + TypeScript 5.8
  • axios for POST /run-test and POST /stop-test, native fetch for /config
  • Firebase Firestore for scenario persistence
  • mermaid for architecture diagram on About page
  • Vite dev server proxies /api/* → http://localhost:8080

LLM executors

All implement ExecutorInfo in agent/executor/<provider>/. Selected via POST /config (executorInfoId string, case-sensitive).

executorInfoIdClassEnv var
DeepSeekV4Flash (default)DeepSeekV4FlashExecutorDEEP_SEEK_KEY
Gemini3ProGemini3ProExecutor (Gemini 3 Pro Preview)GEMINI_API_KEY
Opus47Opus47Executor (Claude Opus 4.7)CLAUDE_API_KEY
GPT52ProGPT52ProExecutor (OpenRouter GPT-5.2 Pro)OPEN_ROUTER
QWEN36BQWEN36BExecutor (local Ollama, Qwen 3 0.6B)—
Llama4Llama4Executor (local Ollama)—
Grok8BExecutorGrok8BExecutor (local Ollama)—

Critical conventions

These behaviors are load-bearing — see docs/ai-agent.md and docs/tools.md for the full reasoning.

  • Status-prefixed tool returns. Every @Tool returns a String starting with one of OK | TAPPED | VISIBLE | NOT_VISIBLE | NOT_FOUND | AMBIGUOUS | ERROR | TIMEOUT. The system prompt tells the LLM to pattern-match the prefix. Preserve this when adding tools — return strings, never throw.
  • Device serial pinning. AdbUtils.runAdb() injects -s <serial> after connectDevice() picks a target. Don't bypass it with raw ProcessBuilder("adb", …) calls.
  • MAX_TOKENS_THRESHOLD = 8000 in TestingStrategy.kt. Lower values trigger compression too aggressively and the agent forgets which step it's on.
  • startTestingScenario once, first. The system prompt forbids any "tap launcher to open the app" recovery — launch is handled programmatically. The agent stops immediately after the final-step summary; there is no explicit close step.
  • hideKeyboard uses KEYCODE_BACK (4), not KEYCODE_ESCAPE. Empirically required on the target device; documented inline.

Common commands

./start.sh                          # Start backend (:8080) + web (:5173) and open browser
./gradlew run                       # Backend only
./gradlew compileKotlin             # Type-check Kotlin
adb devices                         # Confirm device/emulator visibility

cd web && npm install               # Frontend deps
cd web && npm run dev               # Vite dev server on :5173 (proxies /api → :8080)
cd web && npm run build             # tsc -b && vite build
cd web && npm run lint              # ESLint

Environment

.env at project root (loaded by dotenv-kotlin, gitignored). See .env.example for the template. At minimum one LLM key plus HOME_PATH (where screenshots/recordings are pulled to). For the dashboard, also VITE_FIREBASE_* keys.

Adding things

  • New @Tool — add a method to MobileTestTools with @Tool + @LLMDescription. Koog reflection picks it up; no registry edits needed. Return a status-prefixed string.
  • New executor — implement ExecutorInfo in agent/executor/, then add a when-branch in MobileTesterConfigAPI.toMobileConfig() and (optionally) an <option> in web/src/pages/settings/Settings.tsx.

Related repos

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.