Cursor plugin for modern Android development with Kotlin 2.x and Jetpack Compose. Teaches the AI to write stateless Screen + stateful Route composables, StateFlow + collectAsStateWithLifecycle, Hilt + hiltViewModel(), type-safe Navigation Compose, KSP, Version Catalogs, and Material 3. Catches 20 legacy regressions LLMs still produce.
LLMs trained on Android-View-system + Kotlin 1.x patterns ship code that does not match modern Compose. They produce:
findViewById<...>(R.id.x)andsetContentView(R.layout.x)in projects meant to be Compose-basedGlobalScope.launch { }(leaks across the process)LiveData+observeAsStateinstead ofStateFlow+collectAsStateWithLifecycle- Public
MutableStateFlowexposed from the ViewModel - Force-unwrap
!!everywhere - Lowercase composable names (
@Composable fun userCard()) LazyColumn { items(list) { ... } }without akeyargumentLaunchedEffect(true)/LaunchedEffect(Unit)as a catch-allandroidx.compose.material.*(Material 2) imports in a Material 3 projectModifier.padding(...).clickable { }(dead zone around the button)kotlinCompilerExtensionVersionincomposeOptions(removed in Kotlin 2.0+)kaptannotation processor instead of KSP- ViewModel drilled through composition instead of
hiltViewModel()at the screen root remember { mutableStateOf() }outside a@ComposablefunctionrunBlocking { }on the main thread- Side effects in composition body without
LaunchedEffect/DisposableEffect/SideEffect - Java-style
getX()/setX()accessors instead of Kotlin properties - Heavy work in the composition body (large
map/filter) withoutremember Log.dcalls scattered through the codebase- Hardcoded versions in module
build.gradle.ktsinstead oflibs.versions.toml
git clone https://github.com/RoninForge/roninforge-kotlin-compose.git ~/.cursor/plugins/local/roninforge-kotlin-composeOr copy into your project:
git clone https://github.com/RoninForge/roninforge-kotlin-compose.git
cp -r roninforge-kotlin-compose/rules/* your-project/.cursor/rules/
cp -r roninforge-kotlin-compose/skills/* your-project/.cursor/skills/
cp -r roninforge-kotlin-compose/agents/* your-project/.cursor/agents/| Rule | Scope | What it does |
|---|---|---|
compose-core |
Always active | Kotlin 2.x + kotlin-compose plugin, Material 3, state hoisting, StateFlow + collectAsStateWithLifecycle, Hilt, type-safe Navigation Compose, KSP, Version Catalogs, BOM |
compose-anti-patterns |
Always active | 20 regressions: findViewById, setContentView, GlobalScope, LiveData, public MutableState, !!, lowercase composables, LazyColumn without key, LaunchedEffect(true), Material 2, modifier order, kotlinCompilerExtensionVersion, kapt, runBlocking, side effects in composition |
compose-architecture |
**/*.kt |
Feature modularization, repository + data source, sealed UI state, ViewModel + stateIn, Ktor + Kotlin Serialization, Room with Flow + KSP, structured concurrency |
compose-performance |
**/*.kt |
Strong-skipping (Kotlin 2.x default), @Stable / @Immutable, remember keys, derivedStateOf, LazyColumn key + contentType, deferred reads |
compose-testing |
Agent-requested | createComposeRule, semantic matchers, ViewModel tests with runTest + Turbine, fake repositories, Hilt tests, Paparazzi screenshots |
| Skill | Command | What it does |
|---|---|---|
| New screen | /compose-new-screen |
Scaffold stateless Screen + stateful Route + ViewModel + sealed UI state + nav route + previews + test |
| Migrate Views to Compose | /compose-migrate-views-to-compose |
Per-screen migration from XML/Activity to setContent + Route + Screen, with View-to-Compose component mappings |
| Validate | /compose-validate |
Scan codebase for the 20 tracked anti-patterns, report by severity |
| Modernize build | /compose-modernize-build |
Move to Kotlin 2.x: introduce libs.versions.toml, apply kotlin-compose plugin, kapt to KSP, BOM, Material 3, target SDK 36 |
| Agent | What it does |
|---|---|
compose-reviewer |
Reviews Kotlin/Compose code by severity: critical (crashes, build breaks), warnings (regressions), suggestions (style + performance) |
The existing .cursorrules for Android cover style ("write idiomatic Kotlin"). None of them:
- Force the
kotlin-composeplugin and rejectkotlinCompilerExtensionVersion(Kotlin 2.0+ requirement) - Enforce Material 3 imports (every legacy project leaks
androidx.compose.material.*) - Push
collectAsStateWithLifecycle()overcollectAsState() - Catch the
Modifier.padding(...).clickable { }dead-zone bug - Teach type-safe Navigation Compose with
@Serializableroutes - Bundle a build-modernization skill for the catalog + KSP migration
tests/fixtures/anti-pattern-sample/ is an Activity + XML + LiveData + GlobalScope + Material 2 mess. tests/fixtures/correct-sample/ is the Compose-only + ViewModel + StateFlow + Material 3 + Hilt + Version Catalog equivalent.
MIT - see LICENSE
- Jetpack Compose April 2026 release
- Kotlin releases (2.x series, K2 + Compose plugin moved in 2.0)
- Compose Compiler Gradle plugin
- Type-safe Navigation in Compose
- Material 3 Adaptive
- Cursor Plugin Documentation
- RoninForge