agentsclimarketplace

Zen of kotlin

Skill sureshg/skills/skills/zen-of-kotlin

Write idiomatic, type-safe, immutable Kotlin guided by the Zen of Kotlin — domain-oriented types, composition over cleverness, illegal states unrepresentable.From its SKILL.md

Install
npx -y skills add sureshg/skills --skill zen-of-kotlin

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

2.4 KB, 441 tokens by cl100k_base, as published. Nobody here has run it

Zen of Kotlin

Guiding principles for writing clear, correct, and maintainable Kotlin code.

Make Illegal States Unrepresentable

Model invariants in types so invalid data cannot compile or be constructed.

  • When a domain is genuinely closed, use sealed hierarchies (sealed interface / sealed class) with exhaustive when branches.
  • Represent optionality explicitly with nullable types (T?) and eliminate ambiguity at boundaries.
  • Use strongly typed value wrappers (e.g., @JvmInline value class) instead of raw primitives.
  • Scope resources correctly (use { ... }) so leaks are impossible in normal control flow.

No Mutability by Default

Prefer val over var, and immutable data structures over mutable ones.

  • Write pure functions first; keep side effects at the edge of the system.
  • Express state changes as new values (copy(...)) instead of in-place mutation.
  • Isolate unavoidable effects behind small interfaces so behavior stays testable.

Make Data Types and Functions Domain-Oriented

Name types and operations in the language of the domain, not infrastructure.

  • Replace primitive obsession with domain-specific types (CustomerId, Email, Money, etc.).
  • Parse, then model: convert untrusted input at boundaries into validated domain values.
  • Keep domain logic in domain types/functions; keep transport and persistence concerns outside.

Prefer Composition, Expressiveness, and Clarity

Use small, composable functions and extension functions when they improve readability.

  • Use null-safe operators and standard library operations to express intent directly.
  • Avoid cleverness that hides behavior; optimize for maintainability and correctness.

Test Pyramids Are Good, Assertion Magic Is Not Required

Favor a layered testing strategy: types and pure functions first, then integrated behavior.

  • Keep tests explicit and readable; use straightforward assertions over opaque DSL complexity.
  • Test effects through boundaries with fakes first, then real integrations when needed.

Use Modern Kotlin, Keep It Simple

Target Kotlin 2.4.0 and current standard library APIs.

  • Prefer the Kotlin standard library before adding dependencies.
  • Choose explicit, maintainable code over incidental abstraction.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,506. 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.