agentsclimarketplace

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

Install
npx -y skills add ComeOnOliver/skillshub --skill kotlin-language

Assembled 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 val by default. Only use var if 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. Use if/try as expressions.
  • Classes: Use data class for DTOs. Use sealed interface/class for 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.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.