Compose Multiplatform Patterns
monta-app/ocpp-emulator
Compose Multiplatform and Jetpack Compose patterns for KMP projects — state management, navigation, theming, performance, and platform-specific UI.
A skill your agent uses to pick the correct Compose UI test entry point.
$ npx skills add skydoves/android-testing-skills --skill choosing-test-rule-vs-runtest -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install skydoves/android-testing-skills choosing-test-rule-vs-runtest --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/skydoves/android-testing-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/compose/setup/choosing-test-rule-vs-runtest .claude/skills/choosing-test-rule-vs-runtest && rm -rf skills-srcUse ~/.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/
Install the "choosing-test-rule-vs-runtest" agent skill from https://github.com/skydoves/android-testing-skills/tree/main/compose/setup/choosing-test-rule-vs-runtest into .claude/skills/choosing-test-rule-vs-runtest/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "choosing-test-rule-vs-runtest", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/skydoves/android-testing-skills/tree/main/compose/setup/choosing-test-rule-vs-runtestType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add skydoves/android-testing-skills --skill choosing-test-rule-vs-runtest -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install skydoves/android-testing-skills choosing-test-rule-vs-runtest --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/skydoves/android-testing-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/compose/setup/choosing-test-rule-vs-runtest .agents/skills/choosing-test-rule-vs-runtest && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "choosing-test-rule-vs-runtest" agent skill from https://github.com/skydoves/android-testing-skills/tree/main/compose/setup/choosing-test-rule-vs-runtest into .agents/skills/choosing-test-rule-vs-runtest/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "choosing-test-rule-vs-runtest", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add skydoves/android-testing-skills --skill choosing-test-rule-vs-runtest -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install skydoves/android-testing-skills choosing-test-rule-vs-runtest --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/skydoves/android-testing-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/compose/setup/choosing-test-rule-vs-runtest .cursor/skills/choosing-test-rule-vs-runtest && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "choosing-test-rule-vs-runtest" agent skill from https://github.com/skydoves/android-testing-skills/tree/main/compose/setup/choosing-test-rule-vs-runtest into .cursor/skills/choosing-test-rule-vs-runtest/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "choosing-test-rule-vs-runtest", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/skydoves/android-testing-skills.git --path compose/setup/choosing-test-rule-vs-runtest--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add skydoves/android-testing-skills --skill choosing-test-rule-vs-runtest -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install skydoves/android-testing-skills choosing-test-rule-vs-runtest --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/skydoves/android-testing-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/compose/setup/choosing-test-rule-vs-runtest .gemini/skills/choosing-test-rule-vs-runtest && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "choosing-test-rule-vs-runtest" agent skill from https://github.com/skydoves/android-testing-skills/tree/main/compose/setup/choosing-test-rule-vs-runtest into .gemini/skills/choosing-test-rule-vs-runtest/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "choosing-test-rule-vs-runtest", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install skydoves/android-testing-skills choosing-test-rule-vs-runtestInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add skydoves/android-testing-skills --skill choosing-test-rule-vs-runtest -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/skydoves/android-testing-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/compose/setup/choosing-test-rule-vs-runtest .github/skills/choosing-test-rule-vs-runtest && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "choosing-test-rule-vs-runtest" agent skill from https://github.com/skydoves/android-testing-skills/tree/main/compose/setup/choosing-test-rule-vs-runtest into .github/skills/choosing-test-rule-vs-runtest/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "choosing-test-rule-vs-runtest", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add skydoves/android-testing-skills --skill choosing-test-rule-vs-runtest -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install skydoves/android-testing-skills choosing-test-rule-vs-runtest --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/skydoves/android-testing-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/compose/setup/choosing-test-rule-vs-runtest .opencode/skills/choosing-test-rule-vs-runtest && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "choosing-test-rule-vs-runtest" agent skill from https://github.com/skydoves/android-testing-skills/tree/main/compose/setup/choosing-test-rule-vs-runtest into .opencode/skills/choosing-test-rule-vs-runtest/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "choosing-test-rule-vs-runtest", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
choosing-test-rule-vs-runtestA skill your agent uses to pick the correct Compose UI test entry point.
Choosing Test Rule Vs Runtest is an agent skill from skydoves/android-testing-skills. Use this skill to pick the correct Compose UI test entry point. Compares createComposeRule(), createAndroidComposeRule<A(), createEmptyComposeRule(), runComposeUiTest { }, and runAndroidComposeUiTest<A { }, plus the v1 vs v2 split (UnconfinedTestDispatcher vs StandardTestDispatcher). Encodes the rule that mixing runComposeUiTest { } and a ComposeTestRule in the same test is forbidden, that setContent may only run once, and that createEmptyComposeRule() returns ComposeTestRule (no setContent). Use when the user…
Its SKILL.md is about 4.5k 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 Mobile. It works with Jetpack Compose. The repository describes itself as: ⚡️ A set of skills for Android testing: Compose UI, AndroidX Test, JVM unit tests, and ADB. The licence is Apache-2.0.
Read from SKILL.md and the folder at commit 8665ed5. It shows what the files ask for, not the result of running them.
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.
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.
Links to these hosts (documentation or services it may open):
developer.android.comjetbrains.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Choosing Test Rule Vs Runtest loads about 4.5k tokens when it runs. Until then it costs about 206 tokens; SKILL.md has 1,251 words of instructions outside code blocks.
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.
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.
The full file from skydoves/android-testing-skills at commit 8665ed5, republished under its Apache-2.0 licence (© skydoves). 1,251 words, ~4,485 tokens.
.claude/skills/choosing-test-rule-vs-runtest/SKILL.md (or your agent's skills folder).Compose ships two parallel test entry points: a JUnit4 TestRule (createComposeRule() and friends) and a multiplatform suspending lambda (runComposeUiTest { }). Each one independently sets up the recomposer, MainTestClock, and IdlingResource. Mixing them in a single test produces double-environment bugs that are hard to diagnose. This skill picks the right one and surfaces the v1 → v2 deprecation that bites every existing codebase.
createComposeRule() and runComposeUiTest { }.WARNING on import androidx.compose.ui.test.junit4.createComposeRule or import androidx.compose.ui.test.runComposeUiTest.LaunchedEffects no longer run synchronously.ComponentActivity subclass and is unsure between createAndroidComposeRule and createEmptyComposeRule.IllegalStateException: setContent can only be called once per ComposeTestRule or "the launched Activity already calls setContent"../configuring-test-dependencies/SKILL.md../setting-up-host-vs-device-tests/SKILL.md.../../synchronization/synchronizing-with-idle/SKILL.md and ../../synchronization/testing-animations-deterministically/SKILL.md.androidx.compose.ui:ui-test, androidx.compose.ui:ui-test-junit4, and (for createComposeRule() / runComposeUiTest { }) androidx.compose.ui:ui-test-manifest on the right configurations — see ./configuring-test-dependencies/SKILL.md.MainTestClock and the recomposer share one kotlinx.coroutines.test.TestCoroutineScheduler.1. Decide JUnit4 rule vs suspending lambda.
| Path | Choose when |
|---|---|
createComposeRule() / createAndroidComposeRule<A>() | The codebase already uses JUnit4 rules; the developer wants one rule chained with RuleChain (e.g. HiltAndroidRule); the test is Android-only. |
runComposeUiTest { } / runAndroidComposeUiTest<A> { } | Compose Multiplatform; the developer wants effectContext: CoroutineContext to inject a TestDispatcher; the test is suspending end-to-end. |
Both surfaces expose the same matchers, finders, actions, and MainTestClock. The rule path is more familiar to existing Android engineers; the lambda path is the long-term recommendation for multiplatform.
2. Pick the right rule constructor for the JUnit4 path.
| Constructor | Returns | Hosts | setContent available? |
|---|---|---|---|
createComposeRule() | ComposeContentTestRule | androidx.activity.ComponentActivity (from ui-test-manifest) | Yes |
createAndroidComposeRule<A : ComponentActivity>() | AndroidComposeTestRule<ActivityScenarioRule<A>, A> | Custom Activity A (developer-declared in test manifest) | Yes |
createEmptyComposeRule() | ComposeTestRule (NOT ComposeContentTestRule) | None — developer launches their own scenario | No |
Source: compose/ui/ui-test-junit4/src/jvmAndAndroidMain/kotlin/androidx/compose/ui/test/junit4/ComposeTestRule.jvmAndAndroid.kt declares interface ComposeContentTestRule : ComposeTestRule { fun setContent(...) }; createEmptyComposeRule() returns the parent type only.
3. Pick the right suspending entry point for the lambda path.
| Function | Receiver | Hosts |
|---|---|---|
runComposeUiTest { } | ComposeUiTest | ComponentActivity |
runAndroidComposeUiTest<A> { } | AndroidComposeUiTest<A> (adds val activity: A?) | Custom Activity A |
runEmptyComposeUiTest { } | ComposeUiTest | None — setContent throws IllegalStateException |
runComposeUiTest and runAndroidComposeUiTest accept effectContext: CoroutineContext = EmptyCoroutineContext, runTestContext: CoroutineContext = EmptyCoroutineContext, and testTimeout: Duration = 60.seconds. runEmptyComposeUiTest is the exception — it accepts only block: ComposeUiTest.() -> Unit (no scheduling parameters); its purpose is to let the test launch its own ActivityScenario inside the block. Source: compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/ComposeUiTest.android.kt:184, 232, 352 (v1) and the v2 actuals at …/v2/ComposeUiTest.android.kt:75, 122, 238.
4. Prefer the v2 entry points over v1. This is non-negotiable for new code. The v1 forms (androidx.compose.ui.test.junit4.createComposeRule, androidx.compose.ui.test.runComposeUiTest) carry @Deprecated(level = DeprecationLevel.WARNING). The deprecation message on runComposeUiTest (verbatim from ComposeUiTest.android.kt) is:
"Use `androidx.compose.ui.test.v2.runComposeUiTest` instead. The v2 APIs align with
standard coroutine behavior by queuing tasks rather than executing them
immediately. Tests relying on immediate execution may require explicit
synchronization. Please refer to the migration guide for more details."createComposeRule() carries an analogous but separate deprecation message (in ComposeTestRule.jvmAndAndroid.kt:347-355) pointing at androidx.compose.ui.test.junit4.v2.createComposeRule. The two messages are NOT byte-identical — quote whichever applies to the API the developer is actually migrating.
Migration mapping:
| v1 (deprecated WARNING) | v2 (recommended) |
|---|---|
androidx.compose.ui.test.junit4.createComposeRule | androidx.compose.ui.test.junit4.v2.createComposeRule |
androidx.compose.ui.test.junit4.createAndroidComposeRule | androidx.compose.ui.test.junit4.v2.createAndroidComposeRule |
androidx.compose.ui.test.junit4.createEmptyComposeRule | androidx.compose.ui.test.junit4.v2.createEmptyComposeRule |
androidx.compose.ui.test.runComposeUiTest | androidx.compose.ui.test.v2.runComposeUiTest |
androidx.compose.ui.test.runAndroidComposeUiTest | androidx.compose.ui.test.v2.runAndroidComposeUiTest |
androidx.compose.ui.test.runEmptyComposeUiTest | androidx.compose.ui.test.v2.runEmptyComposeUiTest |
Behavior delta: v1 uses UnconfinedTestDispatcher (eager), v2 uses StandardTestDispatcher (queued). After migration, tests that relied on a LaunchedEffect / rememberCoroutineScope block running synchronously may need an explicit mainClock.advanceTimeBy(0) or runCurrent() to drain queued work. This is the only common breaking change.
runComposeUiTest (lines 157-160 of ComposeUiTest.android.kt) is explicit:"Keeping a reference to the [ComposeUiTest] outside of this function is an error. Also avoid
using [androidx.compose.ui.test.junit4.ComposeTestRule] (e.g., createComposeRule) inside
[runComposeUiTest][block] or any of their respective variants. Since these APIs independently
manage the test environment, mixing them may lead to unexpected behavior." Symptoms of accidental mixing: doubled setContent calls, recompositions running on the wrong scheduler, MainTestClock advancing in one environment but not the other, waitForIdle returning instantly because it queries the wrong recomposer.
6. Call setContent exactly once per test. Both ComposeContentTestRule.setContent and ComposeUiTest.setContent throw IllegalStateException on the second call. Recompose with state mutations, do NOT re-call setContent.
7. If the launched Activity calls setContent itself, do NOT call composeTestRule.setContent. The Activity has already installed Compose content; the rule call would override and orphan the previous tree. Use createAndroidComposeRule<MyActivity>() and read the existing tree directly via finders. The KDoc at line 200-204 of ComposeUiTest.android.kt warns: "if the Activity sets content during its launch, you cannot use setContent on the ComposeUiTest anymore as this would override the content and can lead to subtle bugs."
8. When custom coroutine semantics are needed, use effectContext. The lambda path takes a CoroutineContext that becomes the parent of LaunchedEffects and rememberCoroutineScope scopes. From ComposeUiTest.android.kt: "If this context contains a TestDispatcher or TestCoroutineScheduler (in that order), it will be used for composition and the MainTestClock." Pass a shared TestDispatcher to coordinate the test body's coroutine scheduler with composition's scheduler. The JUnit4 rule has no equivalent first-class hook — that is a real reason to prefer the lambda path when the production code does heavy LaunchedEffect work.
9. Default testTimeout is 60 seconds. From the same file, testTimeout: Duration = 60.seconds. Tests that exceed it throw AndroidComposeUiTestTimeoutException. Override per-test only; never globally raise it to mask flakes.
// WRONG — emits @Deprecated WARNING and uses UnconfinedTestDispatcher
import androidx.compose.ui.test.junit4.createComposeRule
class MyTest {
@get:Rule val rule = createComposeRule()
}
// WRONG because: v1 dispatches LaunchedEffect work eagerly. After bumping
// kotlinx-coroutines-test the same test will produce different observable
// behavior than runTest { } in the rest of the codebase.// RIGHT — v2, StandardTestDispatcher, no deprecation warning
import androidx.compose.ui.test.junit4.v2.createComposeRule
class MyTest {
@get:Rule val rule = createComposeRule()
}// WRONG
class MyTest {
@get:Rule val rule = createComposeRule() // env #1
@Test
fun bad() = runComposeUiTest { // env #2 — independent recomposer + clock
rule.setContent { App() } // sets content in env #1
onNodeWithTag("save").performClick() // queries env #2 — finds nothing
}
}
// WRONG because: each environment owns its own test scheduler and idling resource.
// The KDoc forbids this configuration explicitly.// RIGHT — pick one
class MyTest {
@Test
fun good() = runComposeUiTest {
setContent { App() }
onNodeWithTag("save").performClick()
}
}createEmptyComposeRule misuse// WRONG
@get:Rule val rule = createEmptyComposeRule()
@Test fun broken() {
rule.setContent { App() } // compile error — ComposeTestRule has no setContent
}
// WRONG because: createEmptyComposeRule() returns ComposeTestRule, not ComposeContentTestRule.
// It is for tests that launch their own ActivityScenario.// RIGHT — launch your own scenario, then query
@get:Rule val rule = createEmptyComposeRule()
@Test fun ok() {
ActivityScenario.launch(MyActivity::class.java).use {
// MyActivity.onCreate calls setContent { App() }
rule.onNodeWithTag("save").performClick()
}
}// WRONG
@get:Rule val rule = createAndroidComposeRule<MainActivity>()
@Test fun bad() {
rule.setContent { App() } // throws IllegalStateException — MainActivity.onCreate already set content
}// RIGHT
@get:Rule val rule = createAndroidComposeRule<MainActivity>()
@Test fun good() {
rule.onNodeWithTag("save").performClick() // query content the Activity already installed
}@OptIn(ExperimentalTestApi::class, ExperimentalCoroutinesApi::class)
@Test
fun launchedEffectFlow() = runComposeUiTest(
effectContext = StandardTestDispatcher(), // share scheduler with composition
) {
setContent { ScreenWithLaunchedEffect() }
mainClock.advanceTimeBy(0) // drain queued LaunchedEffect work
onNodeWithTag("counter").assertTextEquals("1")
}@get:Rule(order = 0) val hilt = HiltAndroidRule(this)
@get:Rule(order = 1) val compose = createAndroidComposeRule<HiltTestActivity>()
@Test fun feed() {
hilt.inject()
compose.onNodeWithTag("feed_list").assertIsDisplayed()
}This is the canonical reason to keep the JUnit4 rule path: RuleChain ordering. The lambda path has no equivalent — the developer has to manage Hilt initialization manually inside the suspending block.
androidx.compose.ui.test.junit4.v2.*, androidx.compose.ui.test.v2.*) over v1 for new code. The v1 forms are @Deprecated(level = WARNING).runComposeUiTest { } and a @get:Rule ComposeTestRule in the same test class. They manage independent test environments.setContent more than once per test. Both surfaces throw on the second call.composeTestRule.setContent when the launched Activity has already called setContent itself. Use createAndroidComposeRule<A>() and query the existing tree.createComposeRule() for ComponentActivity, createAndroidComposeRule<A>() for a custom Activity, createEmptyComposeRule() only when the test launches its own ActivityScenario.createAndroidComposeRule<A>() in src/androidTest/AndroidManifest.xml (or src/debug/AndroidManifest.xml) — see ./configuring-test-dependencies/SKILL.md.LaunchedEffects or rememberCoroutineScope, use the lambda path with effectContext = StandardTestDispatcher() so composition and the test body share one scheduler.mainClock.advanceTimeBy(0) (test clock) rather than runOnIdle { } (wall clock + idle wait) to drain v2 queued work — see ../../synchronization/testing-animations-deterministically/SKILL.md for the autoAdvance contract.import androidx.compose.ui.test.junit4.createComposeRule (v1) remains in new code; v2 path imported instead.@Deprecated WARNING from the IDE on the test entry point.@get:Rule ComposeTestRule OR a runComposeUiTest { } block, never both.setContent is called exactly once per test method (zero times when the Activity sets content itself).createEmptyComposeRule() only appears in tests that explicitly launch their own ActivityScenario.effectContext is passed, the test compiles with @OptIn(ExperimentalTestApi::class) (or the v2 equivalent) and mainClock.advanceTimeBy(0) is added where queued work needs draining.compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/ComposeUiTest.android.kt — runComposeUiTest, runAndroidComposeUiTest, runEmptyComposeUiTest, plus the v1 deprecation message. KDocs at lines 157-160, 204, 247, 338 forbid mixing rule + lambda.compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/v2/ComposeUiTest.android.kt — v2 runComposeUiTest actuals using StandardTestDispatcher.compose/ui/ui-test-junit4/src/jvmAndAndroidMain/kotlin/androidx/compose/ui/test/junit4/ComposeTestRule.jvmAndAndroid.kt — interface ComposeTestRule, interface ComposeContentTestRule : ComposeTestRule { fun setContent(...) }.compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/AndroidComposeTestRule.android.kt — actual createComposeRule(), createAndroidComposeRule<A>(), createEmptyComposeRule().compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/junit4/v2/AndroidComposeTestRule.android.kt — v2 actuals (StandardTestDispatcher default).© skydoves, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in compose/setup/choosing-test-rule-vs-runtest of skydoves/android-testing-skills.
Open the folder on GitHubat commit 8665ed5
Choosing Test Rule Vs Runtest 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Choosing Test Rule Vs Runtest this skillskydoves/android-testing-skills | 334 | — | ~4.5k | Automated safety check: Pass | Apache-2.0 | |
| Compose Multiplatform Patternsmonta-app/ocpp-emulator | 180 | 5 repos | ~2k | Automated safety check: Pass | Apache-2.0 | |
| Stylessreichholf/dreamDroid | 116 | 5 repos | ~2.3k | Automated safety check: Pass | GPL-3.0 | |
| Compose UIMoustachauve/WLED-Android | 169 | 3 repos | ~676 | Automated safety check: Pass | Apache-2.0 | |
| Compose Animationschrisbanes/skills | 1.1k | — | ~1.1k | Automated safety check: Pass | Apache-2.0 | |
| Compose UI Testing Patternschrisbanes/skills | 1.1k | — | ~1.8k | Automated safety check: Pass | Apache-2.0 |
monta-app/ocpp-emulator
Compose Multiplatform and Jetpack Compose patterns for KMP projects — state management, navigation, theming, performance, and platform-specific UI.
sreichholf/dreamDroid
A skill your agent uses to integrate the Jetpack Compose Styles API into an Android project.
Moustachauve/WLED-Android
Best practices for building UI with Jetpack Compose, focusing on state hoisting, detailed performance optimizations, and theming.
chrisbanes/skills
A skill your agent uses when writing or reviewing Jetpack Compose motion: visibility enter/exit, animating one property toward a target, color or size transitions, multiple properties from one…
chrisbanes/skills
A skill your agent uses when writing or reviewing Jetpack Compose UI tests, screenshot tests or baseline-recording evidence, previews, semantics assertions, fake image loading, keyboard input, focus…
androidx/androidx
Build, install, and run the Compose Material Catalog application on connected devices or emulators.
skydoves/android-testing-skills
A skill your agent uses to verify Compose layout measurements from a UI test using assertWidthIsEqualTo, assertHeightIsEqualTo, assertWidthIsAtLeast, assertHeightIsAtLeast…
skydoves/android-testing-skills
A skill your agent uses to verify a Compose semantics node's properties from a UI test using assertExists, assertDoesNotExist, assertIsDisplayed, assertIsNotDisplayed, assertIsDeactivated…
skydoves/android-testing-skills
A skill your agent uses to render every Jetpack Compose @Preview as a screenshot on a real Android device or emulator and publish a browsable HTML catalog from CI.
skydoves/android-testing-skills
A skill your agent uses to capture visual artefacts from a device for test failures, golden image generation, QA repro, and demo videos.
skydoves/android-testing-skills
A skill your agent uses to pick which behaviors to cover in an Android test suite using Google's five-category state vocabulary plus the explicit "what NOT to test" list from…
skydoves/android-testing-skills
A skill your agent uses to drive Jetpack Compose UI from tests with the high-level action APIs that do not go through a gesture builder — performClick, performScrollTo, performScrollToIndex…
Works with
Categories
A skill your agent uses to pick the correct Compose UI test entry point. Choosing Test Rule Vs Runtest is an agent skill from skydoves/android-testing-skills. Use this skill to pick the correct Compose UI test entry point.
Choosing Test Rule Vs Runtest fits situations like: pick the correct Compose UI test entry point; the user asks ComposeTestRule vs ComposeUiTest; reports IllegalStateException: setContent can only be called once; mentions runComposeUiTest.
Run `npx skills add skydoves/android-testing-skills --skill choosing-test-rule-vs-runtest -a claude-code`. Or copy the skill folder (compose/setup/choosing-test-rule-vs-runtest in skydoves/android-testing-skills) into .claude/skills/choosing-test-rule-vs-runtest in your project. Claude Code loads it when a task matches its description.
Run `npx skills add skydoves/android-testing-skills --skill choosing-test-rule-vs-runtest -a codex`. Or copy the skill folder (compose/setup/choosing-test-rule-vs-runtest in skydoves/android-testing-skills) into .agents/skills/choosing-test-rule-vs-runtest in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add skydoves/android-testing-skills --skill choosing-test-rule-vs-runtest -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/choosing-test-rule-vs-runtest, .gemini/skills/choosing-test-rule-vs-runtest, .github/skills/choosing-test-rule-vs-runtest and .opencode/skills/choosing-test-rule-vs-runtest in your project.
SKILL.md names no scripts, command-line tools or credentials: Choosing Test Rule Vs Runtest is instructions for the agent only.
SKILL.md names 2 domains. As links in the text: developer.android.com and jetbrains.com. This is read from the text; nothing was executed.
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.
Choosing Test Rule Vs Runtest is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 4.5k tokens (SKILL.md is roughly 18k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Choosing Test Rule Vs Runtest: Compose Multiplatform Patterns (monta-app/ocpp-emulator, 180 stars), Styles (sreichholf/dreamDroid, 116 stars), Compose UI (Moustachauve/WLED-Android, 169 stars) and Compose Animations (chrisbanes/skills, 1.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
skydoves (a GitHub user) maintains it in skydoves/android-testing-skills, which has 334 GitHub stars. The repository holds 50 skills in this directory. The repository was last updated on May 25, 2026.
Source: skydoves/android-testing-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.