kotlin-language-patterns

Generate idiomatic Kotlin code with null-safety and stdlib patterns.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/ririnto/sinon --skill kotlin-language-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-language-patterns
Source: https://github.com/ririnto/sinon/tree/main/plugins/kotlin/skills/kotlin-language-patterns
Command: npx skills add https://github.com/ririnto/sinon --skill kotlin-language-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Kotlin codebases often struggle to maintain idiomatic Kotlin practices, leading to boilerplate, unsafe null handling, and opaque public APIs.

Core Features & Use Cases

  • Guides null-safety, type-shape selection, extension placement, and collection handling to produce robust APIs.
  • Provides best-practice patterns across Kotlin-native boundaries, interop with Java, and standard-library usage.
  • Helps teams decide when to use value classes, data classes, or sealed types for clear domain modeling.

Quick Start

Provide a concise Kotlin snippet that demonstrates idiomatic patterns following this guide.

Frequently Asked Questions about kotlin-language-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write idiomatic Kotlin for null-safety and collection handling?

Idiomatic Kotlin applies explicit nullability, type-shape decisions, and stdlib best-practice patterns to ensure robust APIs and minimal boilerplate. It guides safe null handling and proper collection selection across JVM and Kotlin-native boundaries.

What's the best way to choose between data classes, sealed types, and value classes in Kotlin?

Kotlin domain modeling selects value classes, data classes, or sealed types based on required type-shape decisions. This ensures clear public API surface contracts, stable member ordering, and explicit boundaries for serialization and filesystem paths.

How do I reduce boilerplate when designing Kotlin APIs for JVM interop?

Kotlin API design minimizes boilerplate by applying stdlib best-practice patterns and clear Kotlin-native boundaries. It ensures explicit nullability and stable member ordering across JVM and Kotlin-native boundaries for robust library implementation.

When should I use extension functions for Kotlin library implementation?

Kotlin extension placement is determined by type-shape decisions and clear surface contracts. Extensions are applied across API design and library implementation to maintain explicit nullability and minimal boilerplate without opaque public APIs.

Can I use Kotlin-native boundaries for serialization and date-time handling?

Kotlin-native boundaries provide clear surface contracts for serialization, date-time, and filesystem paths. Applying explicit nullability and stdlib best-practice patterns across these boundaries ensures robust and clean Kotlin code.