kotlin
Skill15 starsChanged 43 days agoMITView on GitHub
Expert Kotlin assistance covering coroutines, Flow, null safety, extension functions, sealed classes/interfaces, and Kotlin Multiplatform. Use when developing Android applications, server-side Kotlin services with Ktor/Spring, or sharing cross-platform business logic.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- its-ash/skillstheir own version, first seen Nov 1, 2026
- turkeryildirim/ai-skillstheir own version, first seen Nov 1, 2026
- kimtth/agent-skill-100-lines-or-lesstheir own version, first seen Jun 26, 2026
- margelo/react-native-skillstheir own version, first seen Jun 5, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- margelo/react-native-skills★ 172same name
- turkeryildirim/ai-skills★ 4same name
- kimtth/agent-skill-100-lines-or-less★ 2same name
- its-ash/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 0 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 141
Use Sealed Interfaces for UI State: Model UI and domain state using sealed interface for exhaustive when expressions.
- Very specific: line 143
Prefer Value Classes (@JvmInline value class): Create zero-allocation domain primitives for IDs and units of measure.
- Very specific: line 147
Use GlobalScope.launch: Always use structured concurrency with scoped lifecycles to prevent goroutine/coroutine leaks.
- Very specific: line 148
Use the !! force-unwrap operator: Handle nullables cleanly using ?.let { ...
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Kotlin
Modern Kotlin development with coroutines, null safety, and idiomatic patterns.
When to Use
- Modern Android Application Development: Google's official, primary language for native Android and Jetpack Compose.
- Server-Side Microservices (Ktor / Spring Boot): Writing expressive, concise, null-safe enterprise web backends.
- Kotlin Multiplatform (KMP): Sharing business logic, data models, and networking across Android, iOS, Desktop, and Web.
- Asynchronous Coroutines & Reactive Flows: Managing concurrent background tasks and streams without callback hell.
Quick Start
data class User(
val id: String,
val name: String,
val email: String,
val createdAt: Instant = Clock.System.now()
)
suspend fun fetchUser(id: String): User? {
return apiService.getUser(id)
}Core Concepts
Kotlin Coroutines & Structured Concurrency
Lightweight cooperative multitasking with automated cancellation propagation:
import kotlinx.coroutines.*
suspend fun fetchUserProfile(userId: String): UserProfile = coroutineScope {
// Run two network fetches in parallel
val profileDeferred = async { api.getProfile(userId) }
val ordersDeferred = async { api.getOrders(userId) }
val profile = profileDeferred.await()
val orders = ordersDeferred.await()
profile.copy(orders = orders)
}Kotlin Flow (Asynchronous Cold Streams)
Reactive streams with built-in backpressure and transformation operators:
import kotlinx.coroutines.flow.*
fun streamStockPrices(symbol: String): Flow<Double> = flow {
while (true) {
emit(api.getCurrentPrice(symbol))
delay(1000)
}
}.map { it * 1.05 } // Apply transformation
.flowOn(Dispatchers.IO)Extension Functions & Scope Functions
Extends existing classes without inheritance and scopes variable operations:
// Extension function on String
fun String.toSlug(): String = lowercase().replace(" ", "-").replace(Regex("[^a-z0-9-]"), "")
// Scope function (let, apply, run, also)
val user = User().apply {
name = "Alex"
role = "Lead"
}Common Patterns
Parallel Coroutine Execution
Problem: Fetching multiple remote resources concurrently without blocking the main execution thread.
Solution:
// Suspend function
suspend fun fetchData(): List<Item> {
return withContext(Dispatchers.IO) {
api.fetchItems()
}
}
// Parallel execution
suspend fun loadDashboard(): Dashboard {
return coroutineScope {
val user = async { fetchUser() }
val orders = async { fetchOrders() }
Dashboard(user.await(), orders.await())
}
}
// Flow for streams
fun observeUsers(): Flow<List<User>> = flow {
while (true) {
emit(fetchUsers())
delay(5000)
}
}.flowOn(Dispatchers.IO)Extension Functions
Problem: Adding domain-specific utility operations to standard or library types without inheritance.
Solution:
fun String.isValidEmail(): Boolean {
return Regex("^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}\$").matches(this)
}
fun <T> List<T>.secondOrNull(): T? = getOrNull(1)
inline fun <T> Result<T>.onSuccess(action: (T) -> Unit): Result<T> {
if (this is Result.Success) action(data)
return this
}Best Practices
Do:
- Leverage Kotlin Coroutines over Reactive Streams: Replace complex RxJava pipelines with clean coroutines and Flow.
- Use Sealed Interfaces for UI State: Model UI and domain state using
sealed interfacefor exhaustivewhenexpressions. - Specify Dispatchers Explicitly: Use
Dispatchers.IOfor disk/network I/O,Dispatchers.Defaultfor CPU math, andDispatchers.Mainfor UI. - Prefer Value Classes (
@JvmInline value class): Create zero-allocation domain primitives for IDs and units of measure.
Don't:
- Use
GlobalScope.launch: Always use structured concurrency with scoped lifecycles to prevent goroutine/coroutine leaks. - Use the
!!force-unwrap operator: Handle nullables cleanly using?.let { ... }or Elvis operator?:. - Expose mutable collections: Expose read-only
List<T>interfaces; keepMutableList<T>private inside classes.
Troubleshooting
| Error | Cause | Solution |
NullPointerException | Force unwrap on null | Use safe call ?. |
CancellationException | Coroutine cancelled | Handle or propagate |
IllegalStateException | Invalid state access | Check state before access |
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

