android-kotlin-testing

android-kotlin-testing is a skill for Claude Code, Codex from haidrrrry/compose-kotlin-agent-skills. It costs 72 tokens per session (687 once invoked), scanned A, original, MIT.

A collection of testing patterns for Android apps written in Kotlin. It covers ViewModel tests, Jetpack Compose user-interface tests, fake dependencies, coroutine testing, and checks before release.

In plain words
What is it for?
Use it when writing ViewModel unit tests, testing Compose screens, replacing repositories with test fakes, testing Kotlin coroutines and StateFlow, configuring Hilt test dependencies, or preparing release checks.
Why use it?
It gives developers tested structures for checking app logic and screens without relying on real services. This helps catch problems in state changes, asynchronous code, dependency setup, and release readiness.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 scripts/validate_skills.py --strict.

Good fit Use it when writing ViewModel unit tests, testing Compose screens, replacing repositories with test fakes, testing Kotlin coroutines and StateFlow, configuring Hilt test dependencies, or preparing release checks.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/haidrrrry/compose-kotlin-agent-skills
agentmods
npx agentmods add skills/haidrrrry/compose-kotlin-agent-skills/android-kotlin-testing

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for android-kotlin-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/haidrrrry/compose-kotlin-agent-skills/android-kotlin-testing/github.svg)](https://agentmods.dev/skills/haidrrrry/compose-kotlin-agent-skills/android-kotlin-testing)
Your own site
<a href="https://agentmods.dev/skills/haidrrrry/compose-kotlin-agent-skills/android-kotlin-testing"><img src="https://agentmods.dev/badge/skills/haidrrrry/compose-kotlin-agent-skills/android-kotlin-testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for android-kotlin-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/haidrrrry/compose-kotlin-agent-skills/android-kotlin-testing"><img src="https://agentmods.dev/badge/skills/haidrrrry/compose-kotlin-agent-skills/android-kotlin-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 687 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00072 $0.00687
Opus 5 $0.00036 $0.00344
Sonnet 5 $0.00014 $0.00137
Haiku 4.5 $0.00007 $0.00069

Measured 11d ago against content hash b85e56981e7e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

android-kotlin-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/android-kotlin-testing/SKILL.md · 111 lines

How it starts

The opening of the file, as written. The whole thing — 111 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Android Kotlin — Testing Module

Parent kit: ../../SKILL.md · Index: ../../AGENTS.md

Read First

File When
../../references/11-testing.md Turbine, fakes, Compose test tags
../../references/05-hilt-di.md TestInstallIn modules
../../references/13-release-checklist.md Pre-ship checklist

ViewModel Test Template

@OptIn(ExperimentalCoroutinesApi::class)
class FeatureViewModelTest {

    @get:Rule
    val mainDispatcherRule = MainDispatcherRule()

    private val fakeRepo = FakeFeatureRepository()
    private lateinit var viewModel: FeatureViewModel

    @Before
    fun setup() {
        viewModel = FeatureViewModel(fakeRepo)
    }

    @Test
    fun `refresh success clears loading`() = runTest {
        fakeRepo.syncResult = Result.success(Unit)

        viewModel.onEvent(FeatureUiEvent.Refresh)

        viewModel.state.test {
            skipItems(1)
            val loading = awaitItem()
            assertTrue(loading.isLoading)
            val done = awaitItem()
            assertFalse(done.isLoading)
            assertNull(done.error)
        }
    }
}

Fake Over Mock

class FakeFeatureRepository : FeatureRepository {
    var syncResult: Result<Unit> = Result.success(Unit)
    private val items = MutableStateFlow<List<Feature>>(emptyList())

    override fun observeItems(): Flow<List<Feature>> = items
    override suspend fun sync(): Result<Unit> = syncResult
}

Prefer fakes implementing real interfaces — tests behavior, not interaction order.

Compose UI Test

class FeatureScreenTest {
    @get:Rule
    val composeRule = createComposeRule()

    @Test
    fun showsEmptyState() {
        composeRule.setContent {
            AppTheme {
                FeatureContent(
                    state = FeatureUiState(items = emptyList()),
                    onEvent = {}
                )
            }
        }
        composeRule.onNodeWithTag("feature_empty").assertIsDisplayed()
    }
}

Read the full file on GitHub · 111 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 111 lines · 72 tokens per session scan A b85e56981e7e

Subscribe to this mod's changes

android-kotlin-testing is a skill published in the GitHub repository haidrrrry/compose-kotlin-agent-skills (47 stars, last pushed 2mo ago), licensed MIT. It adds 72 tokens to every session and 687 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.