Kotlin language
Skill ComeOnOliver/skillshub/skills/HoangNguyen0403/agent-skills-standard/kotlin-language
Idiomatic Kotlin 1.9+ standards including null safety, sealed classes, and expression syntax. Use when working with Kotlin null safety, data classes, sealed interfaces, extension functions, or migrating Java code to Kotlin. (triggers: **/*.kt, **/*.kts, val, var, ?., ?:, !!, data class, sealed, when, extension, lazy, lateinit, object)From its SKILL.md
npx -y skills add ComeOnOliver/skillshub --skill kotlin-languageAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
1.7 KB, 324 tokens by cl100k_base, as published. Nobody here has run it
Kotlin Language Patterns
Priority: P0 (CRITICAL)
Modern, idiomatic Kotlin standards for safety and conciseness.
Implementation Guidelines
- Immutability: Use
valby default. Only usevarif mutation is required locally. - Null Safety: Use
?for nullable types. Use safe call?.and Elvis?:over!!. - Expressions: Prefer expression bodies
fun foo() = ...for one-liners. Useif/tryas expressions. - Classes: Use
data classfor DTOs. Usesealed interface/classfor state hierarchies (e.g.,Success,Error,Loading). Access members as a computed property rather than a function. - Extension Functions: Prefer over utility classes (
StringUtil). Keep private/internal if module-specific. - Named Arguments: Use for clarity, especially with booleans or multiple same-type params.
- String Templates: Use
"$var"over concatenation. Use"""for multiline strings (SQL/JSON).
Anti-Patterns
- No !! Operator: Never use in production; prefer safe calls or requireNotNull.
- No Java-isms: Use properties not get/set; prefer top-level functions over companion object statics.
- No Lateinit Abuse: Prefer nullable types or lazy delegates instead.
- No Silenced Errors: Never swallow exceptions without logging or handling.
References
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.