coding-kotlin
coding-kotlin
Purpose
This skill equips the AI to generate, debug, and optimize Kotlin code, focusing on coroutines for async operations, data classes for immutable data handling, sealed classes for type-safe hierarchies, extension functions for reusable code, Gradle for project builds, and KMM for multiplatform development.
When to Use
Use this skill for Android app development requiring async tasks (e.g., network calls), data modeling in APIs, or cross-platform projects with shared logic. Apply it when performance matters, like using coroutines to avoid blocking threads, or when setting up Gradle for dependency management in KMM setups.
Key Capabilities
- Coroutines: Handle asynchronous code with structured concurrency; use
kotlinx.coroutinesfor non-blocking I/O. - Data classes: Automatically generate equals, hashCode, and toString; define with
data class User(val name: String, val id: Int). - Sealed classes: Restrict class inheritance for exhaustive when expressions; e.g.,
sealed class Result { data class Success(val data: String) : Result() }. - Extension functions: Add methods to existing classes without inheritance; e.g.,
fun String.reverse() = this.reversed(). - Gradle: Manage builds with scripts like build.gradle.kts for dependencies and tasks.
- KMM: Share code between Android/iOS; configure with shared modules in Gradle.
Usage Patterns
To accomplish tasks, always import necessary packages first (e.g., import kotlinx.coroutines.*). For async operations, wrap code in a coroutine scope like runBlocking { } and use launch for fire-and-forget or async for awaited results. When modeling data, use data classes for POJOs and sealed classes for state machines. For Gradle tasks, run commands from the project root and pass flags like --info for debugging. In KMM projects, structure code into shared and platform-specific modules, then link via Gradle configurations. Always check for nullability with ? to prevent crashes.
More from alphaonedev/openclaw-graph
playwright-scraper
Playwright web scraping: dynamic content, auth flows, pagination, data extraction, screenshots
1.4Kgcp-iam
Manages identity and access control for Google Cloud resources using IAM policies and roles.
370humanize-ai-text
AI text humanization: reduce AI-detection patterns, natural phrasing, tone adjustment
260macos-automation
AppleScript, JXA, Shortcuts, Automator, osascript, System Events, accessibility API
173tavily-web-search
Tavily: web search optimized for AI agents, answer synthesis, domain filtering, depth control
154clawflows
OpenClaw workflow automation: multi-step task chains, conditional logic, triggers, schedule
102