android-kotlin-expert

Review Android Kotlin code for lifecycle and state management issues.

Updated Feb 28, 2026
One-click install
npx skills add https://github.com/trancee/noise-protocol --skill android-kotlin-expert
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-kotlin-expert
Source: https://github.com/trancee/noise-protocol/tree/main/.github/skills/android-kotlin-expert
Command: npx skills add https://github.com/trancee/noise-protocol --skill android-kotlin-expert

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers build and review Android applications written in Kotlin, focusing on platform-specific concerns like UI state, lifecycle management, and architecture.

Core Features & Use Cases

  • Code Review: Analyze Kotlin code for adherence to Android best practices, lifecycle awareness, and state management.
  • Architecture Design: Assist in designing or refining app architecture, including ViewModel, repository patterns, and data flow.
  • Jetpack Compose: Provide guidance on building UI with Jetpack Compose, managing state, and handling events.
  • Coroutine Usage: Advise on the correct and safe use of Kotlin Coroutines within the Android lifecycle.
  • Use Case: Review a ViewModel that is not properly collecting StateFlow updates, leading to stale UI data, and suggest using collectAsStateWithLifecycle for proper lifecycle integration.

Quick Start

Review the provided Android Kotlin code snippet for lifecycle and state management issues.

Frequently Asked Questions about android-kotlin-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix stale UI data when collecting StateFlow in Jetpack Compose?

Fix stale UI data by switching to collectAsStateWithLifecycle for StateFlow collection, which ties data flow directly to the Android lifecycle and pauses updates when the app enters the background.

Why does my ViewModel lose state during configuration changes in Android?

ViewModel loses state during configuration changes if state management is improperly scoped; storing UI state in StateFlow within the ViewModel and using repository patterns ensures data survives device rotations.

What is the best way to structure Kotlin Coroutines within the Android lifecycle?

Structure Kotlin Coroutines by launching them from lifecycle-aware scopes such as viewModelScope, which automatically cancels asynchronous tasks when the ViewModel or lifecycle owner is destroyed to prevent memory leaks.

Can I use Jetpack Compose for complex app architecture with repository patterns?

Yes, Jetpack Compose works with repository patterns by collecting state from the ViewModel, which serves as the intermediary between the UI layer and the data repository for robust app architecture.

How to review Android Kotlin code for lifecycle awareness and state management issues?

Review Android Kotlin code by verifying ViewModels correctly expose StateFlow, checking Coroutines use lifecycle-aware scopes like viewModelScope, and ensuring Jetpack Compose elements handle events without leaking state.