Kotlin test architecture

From VincentChuWaiChow/vanguard-frontier-agentic · View interactive version

Kotlin test architecture is an AI agent skill from the GitHub repository VincentChuWaiChow/vanguard-frontier-agentic. Use this skill to statically review Kotlin/coroutine/Compose/Android/KMP test architecture and determinism: `runTest` and virtual-time usage, `StandardTestDispatcher` vs `UnconfinedTestDispatcher` choice and advance-call discipline, `Dispatchers.setMain`/`resetMain` hygiene and dispatcher injection,

How to use this skill

Skill file

kotlin-test-architecture

Purpose

This skill decides whether Kotlin/coroutine/Compose/Android/KMP tests are architected to be deterministic rather than flaky. A test suite is safe only when suspend tests use runTest with virtual time (never runBlocking), dispatchers are injected so tests can substitute a test dispatcher, Dispatchers.Main overrides are always reset, StandardTestDispatcher tests explicitly advance before asserting, Flow tests via Turbine consume every emission, Compose UI tests use semantics matchers, and the Robolectric/instrumented choice matches what the test actually needs.

Trigger conditions

When not to use

Lean operating rules

References

Load these only when needed:

Response minimum

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.