Agent skill

Android Testing

by rcosteira79 in rcosteira79/android-skills

A skill your agent uses when writing, fixing, or refactoring Android/KMP code in Kotlin — a test-first (RED-GREEN-REFACTOR) foundation plus the Android/KMP test traps: Compose-test dispatching…

MITAuto-check passedTesting & QA

Install Android Testing

skills CLI
$ npx skills add rcosteira79/android-skills --skill android-testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install rcosteira79/android-skills android-testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/rcosteira79/android-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/android-skills/skills/android-testing .claude/skills/android-testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
android-testing
GitHub stars
150
Token cost
~2.1k tokens
SKILL.md length
808 words
Files
1
Skills in repo
21
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when writing, fixing, or refactoring Android/KMP code in Kotlin — a test-first (RED-GREEN-REFACTOR) foundation plus the Android/KMP test traps: Compose-test dispatching…

  • The two-schedulers trap)
  • SKILL.md covers Test-first (the foundation), commonTest names must survive…, Compose tests now default to… and Semantics first, testTag as…, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Semantics-first selectors

What it does

Android Testing is an agent skill from rcosteira79/android-skills. Use when writing, fixing, or refactoring Android/KMP code in Kotlin — a test-first (RED-GREEN-REFACTOR) foundation plus the Android/KMP test traps: Compose-test dispatching (StandardTestDispatcher default, the two-schedulers trap), semantics-first selectors, choosing the smallest test shape, test-clock vs wall-clock, animation/screenshot determinism, and a commonTest name that fails the iOS compile while jvmTest stays green.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Test-driven development and Android development. It works with Android, Kotlin and iOS. The repository describes itself as: Claude Code skills for Android & KMP development. The licence is MIT.

When your agent uses it

  • The two-schedulers trap)
  • Semantics-first selectors
  • Choosing the smallest test shape
  • Test-clock vs wall-clock

Example prompts

  • “/android-testing”

What it can do on your machine

Read from SKILL.md and the folder at commit 0f9af5a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are kotlin).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Android Testing loads about 2.1k tokens when it runs. Until then it costs about 112 tokens; SKILL.md has 808 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~112
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from rcosteira79/android-skills at commit 0f9af5a, republished under its MIT licence (© rcosteira79). 808 words, ~2,082 tokens.

Download SKILL.mdSave it as .claude/skills/android-testing/SKILL.md (or your agent's skills folder).
name
android-testing
description
Use when writing, fixing, or refactoring Android/KMP code in Kotlin — a test-first (RED-GREEN-REFACTOR) foundation plus the Android/KMP test traps: Compose-test dispatching (StandardTestDispatcher default, the two-schedulers trap), semantics-first selectors, choosing the smallest test shape, test-clock vs wall-clock, animation/screenshot determinism, and a `commonTest` name that fails the iOS compile while `jvmTest` stays green.

Android Testing

Android-specific testing on a test-first foundation. This reference focuses on the test-first discipline plus the Compose-test and KMP traps that are easy to get wrong, not the basics of the three tiers, fakes over mocks, runTest, or Given-When-Then naming — except where a name breaks one target's compile.

Test-first (the foundation)

  • No production code without a failing test first. Write the test, watch it fail (RED), write the minimal code to pass (GREEN), then refactor. A behaviour you never watched fail isn't proven.
  • A bug isn't fixed until a test that was red because of the bug is green.

This layers on top of any dedicated TDD discipline skill (superpowers:test-driven-development, ace:test-driven-development) but requires none. For bootstrapping the test stack from scratch (test DI, JUnit/Robolectric/Roborazzi/Paparazzi selection, the instrumented runner, Compose Preview Screenshot Testing, UI Automator, Jacoco), see Google's official testing-setup skill (android skills add testing-setup).

commonTest names must survive Kotlin/Native, not just the JVM

commonTest is compiled once per declared target, so a green jvmTest proves nothing about the iOS compile. Backticks themselves are fine on every target — they are escaping syntax, not part of the name — but Kotlin/Native's frontend rejects 24 characters inside them: . ; , ( ) [ ] { } / < > : \ $ & ~ * ? # | § % @ (FirNativeIdentifierChecker — an unconditional error since Kotlin 1.7; the set also reserves the IR mangler's own characters). Kotlin/JVM forbids only . ; [ ] / < > : \. The comma is the gap between the two lists; a space is in neither, so a Given-When-Then convention with commas fails every native target while CI stays green:

kotlin
// commonTest — compiles for jvm; fails compileTestKotlinIosSimulatorArm64 with
//   error: name contains illegal characters: ","
@Test fun `given an empty cart, when an item is added, then the total updates`() { … }

// commonTest — same sentence, commas dropped. Backticks and spaces compile everywhere.
@Test fun `given an empty cart when an item is added then the total updates`() { … }

Two rules follow. Keep , . ( ) : ? out of every commonTest declaration name — the check covers classes, properties, type aliases, value parameters and enum entries, not just funs. And verify a KMP test with allTests or <target>Test, never jvmTest, which depends only on compileTestKotlinJvm; a device-only target has no test task at all, so compile its test binary explicitly (linkDebugTestIosArm64).

Don't confuse this with the Android rule Kotlin's coding conventions cite: D8 rejects spaces below minSdk 30, which bites instrumented tests only — and never commas, which the DEX SimpleName grammar has never allowed at any API level.

Compose tests now default to StandardTestDispatcher

createComposeRule() / runComposeUiTest {} default to StandardTestDispatcher (matching kotlinx.coroutines.test.runTest) — there is no separate "v2" package. It's gated by androidx.compose.ui.test.ComposeUiTestFlags.isStandardTestDispatcherSupportEnabled (defaults to true), so the regular androidx.compose.ui.test.junit4.createComposeRule already uses it. To pin a scheduler, pass it through: createComposeRule(effectContext = StandardTestDispatcher()). Under this default, a LaunchedEffect that previously ran eagerly (the old UnconfinedTestDispatcher behaviour) may need an explicit mainClock.advanceTimeBy(0) / runCurrent() to drain queued work; set the flag false only to temporarily restore the legacy behaviour.

Two-schedulers trap (the one coroutine-test gotcha worth stating): a MainDispatcherRule's TestDispatcher and the dispatcher runTest { } creates have separate TestCoroutineSchedulers. Pass mainRule.dispatcher into runTest(mainRule.dispatcher) so Dispatchers.Main and the test body share one — otherwise advanceUntilIdle() flushes only one and assertions race the ViewModel.

Show full SKILL.md (355 more words)Show less

Semantics first, testTag as fallback

Prefer user-visible semantics over testTag — real users and screen readers see semantics; testTag is invisible to everyone except tests. Selector priority: (1) onNodeWithText; (2) onNodeWithContentDescription; (3) role/state matchers (hasClickAction(), isSelected(), isFocused(), isEnabled()); (4) onNodeWithTag only when there's no stable user-visible text or it's duplicated/ambiguous (lists of identical rows, per-locale copy, multiple instances). A text assertion survives refactors and exercises accessibility; a testTag assertion breaks the moment the tag changes and misses the user-facing regression.

(Counterview worth knowing: skydoves/android-testing-skills argues tag-first for i18n robustness, backed by androidx/material3's own 1825 : 424 : 46 testTag : onNodeWithText : onNodeWithContentDescription ratio. Defensible if you have separate accessibility coverage; this skill defaults to semantics-first because it catches a class of bugs testTag never can.)

Callbacks as test surfaces

A composable's contract is "render state, emit callbacks" — test exactly that; don't route the assertion through a ViewModel mock.

kotlin
@Test fun `tapping article row invokes onArticleClick with id`() {
    var clickedId: String? = null
    composeTestRule.setContent { ArticleRow(Article(id = "42", title = "Hello"), onArticleClick = { clickedId = it }) }
    composeTestRule.onNodeWithText("Hello").performClick()
    assertEquals("42", clickedId)
}

Choosing the test shape — the smallest contract that proves the behaviour

ProvingShape
Text rendered, conditional content, loading/error branches, callback wiringPlain UI Compose test (state + callbacks, no graph)
Focus navigation, keyboard, TV/D-padCompose test with performKeyInput + assertIsFocused() (see compose/references/focus-navigation.md)
Visual contract semantics can't prove — spacing, themed colour, typography, elevation, gradients, skeletonsScreenshot test, one per meaningful state
State holder updates UI correctlyState-holder unit test + ONE wiring smoke test
Lifecycle, navigation, or DI integration itselfIntegration test (createAndroidComposeRule, Hilt rule, real graph)

Test clock vs wall clock: for any Compose-state-observable condition use mainClock.advanceTimeUntil(ms) { state.value == Done } (deterministic, fast); use rule.waitUntil(ms) { … } only for non-Compose conditions (Job.isCompleted, an external counter). Mixing the two in one test is a common flake source.

Animation tests need mainClock.autoAdvance = false set before setContent — otherwise the framework's InfiniteAnimationPolicy throws CancellationException on indeterminate animations, and finite animations finish in one auto-advanced burst with no observable intermediate state. After pausing, drive frames with advanceTimeByFrame() (kick-off) then advanceTimeBy(durationMillis).

Screenshot determinism: fixed state data (no current time, random seeds, or remote URLs in the screenshot path); frozen clocks (Clock.fixed(...)) and animation progress; a fake image loader for image-heavy screens (Coil 3's test double: LocalImageLoader provides FakeImageLoader(LocalContext.current), or setContentWithFakeImageLoader { … }); one shot per meaningful state (loading / error / success / empty), not one per UI element.

© rcosteira79, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/android-skills/skills/android-testing of rcosteira79/android-skills.

Open the folder on GitHubat commit 0f9af5a

Compare with similar skills

Android Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Android Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Android Testing this skillrcosteira79/android-skills150—~2.1kAutomated safety check: PassMIT
Expo Brownfield Integrationmweinbach/agent-coworker1562 repos~900Automated safety check: NotesCustom licence
Jetpack Composedarriousliu/PiPixiv262—~1.5kAutomated safety check: PassApache-2.0
Simulator Audio E2Ehyochan/react-native-nitro-sound961—~1.1kAutomated safety check: PassMIT
Android Maps Ktxgooglemaps/android-maps-ktx360—~897Automated safety check: PassApache-2.0
Ksafeioannisa/KSafe332—~17kAutomated safety check: PassApache-2.0

Similar skills

  • Expo Brownfield Integration

    mweinbach/agent-coworker

    Helps add Expo and React Native to an existing native iOS or Android app, and choose between a prebuilt AAR or XCFramework and a fully integrated build.

    156 GitHub starsUsed in 2 repos~900 tokens
    MobileAuto-check: notes
  • Jetpack Compose

    darriousliu/PiPixiv

    Jetpack Compose expert skill for Android UI development. An agent skill from darriousliu/PiPixiv.

    262 GitHub stars~1.5k tokensUpdated yesterday
    MobileAuto-check passed
  • Simulator Audio E2E

    hyochan/react-native-nitro-sound

    Build and run repeatable react-native-nitro-sound recorder/player regression tests on an iOS Simulator or Android emulator, with explicit virtual-device selection, microphone permission, Maestro…

    961 GitHub stars~1.1k tokensUpdated 7 days ago
    MobileAuto-check passed
  • Android Maps Ktx

    googlemaps/android-maps-ktx

    Provides idiomatic Kotlin extension (KTX) patterns, reactive Flow event streams, and multi-subscriber shareIn rules for Google Maps SDK for Android and its Utility Library.

    360 GitHub stars~897 tokensUpdated yesterday
    MobileAuto-check passed
  • Ksafe

    ioannisa/KSafe

    Required before any reply that touches KSafe (by ksafe(...), ksafe.get/put, :ksafe-compose, :ksafe-biometrics), even a 'can KSafe do X?' question or a one-line change that looks like plain Kotlin.

    332 GitHub stars~17k tokensUpdated 4 days ago
    MobileAuto-check passed
  • Ktormonitor

    CosminMihuMDC/KtorMonitor

    KtorMonitor is a Kotlin Multiplatform library for real-time HTTP traffic monitoring.

    254 GitHub stars~2.5k tokensUpdated 24 days ago
    MobileAuto-check passed

More from rcosteira79/android-skills

All 21 skills in this repo
  • Guides writing correct, performant Compose and Compose Multiplatform UI across Android, desktop, iOS and web, from state and animation to design-to-code and crash fixes.

    150 GitHub stars~2.6k tokensUpdated 18 days ago
    Auto-check passed
  • Kotlin Multiplatform Boundaries

    rcosteira79/android-skills

    Helps choose how common Kotlin Multiplatform code reaches platform APIs: expect/actual, a common interface with platform bindings, or separate platform screens.

    150 GitHub stars~1.5k tokensUpdated 18 days ago
    Auto-check passed
  • Android Data Layer and Room in KMP

    rcosteira79/android-skills

    Sets out the repository pattern's error-propagation model for Android and Kotlin Multiplatform, plus the Room setup for commonMain.

    150 GitHub stars~1.2k tokensUpdated 18 days ago
    Auto-check passed
  • Android Debugging

    rcosteira79/android-skills

    Android and KMP debugging techniques for crashes, ANRs, memory leaks, R8 traces, Gradle failures and Compose recomposition, built on finding the root cause first.

    150 GitHub stars~2.6k tokensUpdated 18 days ago
    Auto-check passed
  • Android and KMP Baseline

    rcosteira79/android-skills

    Sets house defaults for Android and Kotlin Multiplatform work and routes to the right specialized skill for Compose, networking, testing or build tooling.

    150 GitHub stars~3k tokensUpdated 18 days ago
    Auto-check passed
  • Android Gradle Build Logic

    rcosteira79/android-skills

    Sets up Android Gradle convention plugins in a build-logic composite build, including the version catalog wiring and shared configuration that are easy to get wrong.

    150 GitHub stars~959 tokensUpdated 18 days ago
    Auto-check passed

Questions about Android Testing

What does Android Testing do?

A skill your agent uses when writing, fixing, or refactoring Android/KMP code in Kotlin — a test-first (RED-GREEN-REFACTOR) foundation plus the Android/KMP test traps: Compose-test dispatching…. Android Testing is an agent skill from rcosteira79/android-skills. Use when writing, fixing, or refactoring Android/KMP code in Kotlin — a test-first (RED-GREEN-REFACTOR) foundation plus the Android/KMP test traps: Compose-test dispatching (StandardTestDispatcher default, the two-schedulers trap), semantics-first selectors, choosing the smallest test shape, test-clock vs wall-clock, animation/screenshot determinism, and a commonTest name that fails the iOS compile while jvmTest stays green.

When should I use Android Testing?

Android Testing fits situations like: the two-schedulers trap); semantics-first selectors; choosing the smallest test shape; test-clock vs wall-clock.

How do I install Android Testing in Claude Code?

Run `npx skills add rcosteira79/android-skills --skill android-testing -a claude-code`. Or copy the skill folder (plugins/android-skills/skills/android-testing in rcosteira79/android-skills) into .claude/skills/android-testing in your project. Claude Code loads it when a task matches its description.

How do I install Android Testing in Codex?

Run `npx skills add rcosteira79/android-skills --skill android-testing -a codex`. Or copy the skill folder (plugins/android-skills/skills/android-testing in rcosteira79/android-skills) into .agents/skills/android-testing in your project. Codex loads it when a task matches its description.

Can I use Android Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add rcosteira79/android-skills --skill android-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/android-testing, .gemini/skills/android-testing, .github/skills/android-testing and .opencode/skills/android-testing in your project.

What does Android Testing need to run?

SKILL.md names no scripts, command-line tools or credentials: Android Testing is instructions for the agent only.

Does Android Testing access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Android Testing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Android Testing use?

Android Testing is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Android Testing use?

About 2.1k tokens (SKILL.md is roughly 8.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Android Testing?

Skills that share tags, products or a category with Android Testing: Expo Brownfield Integration (mweinbach/agent-coworker, 156 stars), Jetpack Compose (darriousliu/PiPixiv, 262 stars), Simulator Audio E2E (hyochan/react-native-nitro-sound, 961 stars) and Android Maps Ktx (googlemaps/android-maps-ktx, 360 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Android Testing?

rcosteira79 (a GitHub user) maintains it in rcosteira79/android-skills, which has 150 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on September 19, 2026.

Source: rcosteira79/android-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.