Kotlin
Build robust Android and multiplatform apps with Kotlin idioms, coroutines, and null safety.
Why use this skill?
Master Kotlin development with the OpenClaw Kotlin skill. Get expert help with coroutines, null safety, Jetpack Compose, and robust Android architecture.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/ivangdavila/kotlinWhat This Skill Does
The Kotlin skill provides OpenClaw with an expert-level understanding of the Kotlin programming language, specifically tailored for Android development and Kotlin Multiplatform projects. It acts as an intelligent pair programmer that enforces idiomatic practices, ensures rigorous null safety, and manages complex asynchronous workflows using Kotlin Coroutines and Flows. By integrating this skill, your agent can effectively refactor legacy Java code, implement state management in Jetpack Compose, and troubleshoot concurrency issues that often plague high-performance applications.
Installation
To install this skill, run the following command in your OpenClaw terminal:
clawhub install openclaw/skills/skills/ivangdavila/kotlin
Use Cases
- Legacy Refactoring: Convert complex Java-based Android logic into modern, null-safe Kotlin code while maintaining binary compatibility using
@JvmOverloadsand@JvmStatic. - State Management: Implement lifecycle-aware state collection in Jetpack Compose using
collectAsStateWithLifecycleto prevent resource leaks and ensure UI consistency. - Asynchronous Architecture: Design scalable data layers using
StateFlowandSharedFlow, ensuring correct usage ofviewModelScopeand structured concurrency principles. - Code Auditing: Analyze existing codebases for common pitfalls, such as improper use of
!!(non-null assertion), incorrect scope function nesting, or memory-leaking coroutine scopes.
Example Prompts
- "Refactor this Java service class to Kotlin, ensuring all platform types are handled safely and exposing it correctly to Java consumers."
- "Help me identify why my Jetpack Compose UI isn't updating correctly when the underlying StateFlow changes in my ViewModel."
- "Write a clean implementation of a Repository pattern using Flow and Coroutines that handles data fetching and error states robustly."
Tips & Limitations
- Context is Key: Always provide the surrounding class or scope context when asking for refactoring help; Kotlin’s behavior often depends on the specific lifecycle scope (e.g.,
viewModelScopevs.lifecycleScope). - Prefer
firstOrNull(): Avoidfirst()on collections unless you are absolutely certain of the contents;firstOrNull()prevents common runtime crashes. - Avoid
GlobalScope: Never useGlobalScopein Android applications as it ignores lifecycle management and leads to memory leaks. - Polymorphism Awareness: Remember that Kotlin extension functions are resolved statically. If you are overriding behavior in a subclass, use standard member functions instead of extensions.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-ivangdavila-kotlin": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: code-execution
Related Skills
Animations
Create performant web animations with proper accessibility and timing.
Arduino
Develop Arduino projects avoiding common wiring, power, and code pitfalls.
Bulgarian
Write Bulgarian that sounds human. Not formal, not robotic, not AI-generated.
Arabic
Write Arabic that sounds human. Not formal, not robotic, not AI-generated.
Assistant
Manage tasks, communications, and scheduling with proactive and organized support.