Agent skill

kotlin-patterns

Idiomatic Kotlin patterns, best practices, and conventions for building robust, efficient, and maintainable Kotlin applications with coroutines, null safety, and DSL builders.

mturacgithub.com/mturacGitHub ↗
codexcopilotcursorMIT
Install
npx skills add mturac/everything-openai-codex --skill kotlin-patterns --agent codex

Same command for any agent — swap --agent for claude-code, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 18 KB
Bundled scripts: none
Path: skills/kotlin-patterns/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 84
Language: JavaScript

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

It instructs the agent to enforce idiomatic Kotlin conventions across seven key areas: null safety, immutability by default, expression bodies, data classes for value objects, sealed classes and interfaces, scope functions usage, extension functions, coroutines (structured concurrency and Flow), delegation, DSL builders (type-safe builders and configuration DSL), sequences for lazy evaluation, Gradle Kotlin DSL usage, and error handling patterns. It provides concrete Kotlin examples and anti-pattern notes to guide writing robust, maintainable Kotlin code.

How it works

The skill outlines core patterns and practices: use Kotlin's nullability and Elvis for safety; prefer val and immutable collections; favor single-expression functions; use data classes and value classes for value objects; model exhaustive hierarchies with sealed classes and sealed interfaces; apply appropriate scope functions (let, apply, also, run, with) and show common pitfalls; create and apply extension functions without polluting the namespace; utilize coroutines with structured concurrency (coroutineScope, supervisorScope) and Flow with proper error handling; leverage delegation for properties and interfaces; build DSLs using @DslMarker and lambda receivers; implement type-safe DSLs for server/configuration; use sequences for large/infinitely generated data; configure Gradle via Kotlin DSL; and adopt robust error handling patterns using Kotlin Result or sealed classes. Concrete code snippets demonstrate each concept.

When to use it

  • Writing new Kotlin code
  • Reviewing Kotlin code
  • Refactoring existing Kotlin code
  • Designing Kotlin modules or libraries
  • Configuring Gradle Kotlin DSL builds

What it can touch

  • Code authored with Kotlin language constructs as shown in examples (no external tools specified in this section).

Caveats

  • License: MIT
  • Declared tools: codex, copilot, cursor
  • Sections are presented only where explicit content exists in the skill; no speculative or missing sections are added.
From the SKILL.md

# Kotlin Development Patterns Idiomatic Kotlin patterns and best practices for building robust, efficient, and maintainable applications. ## When to Use - Writing new Kotlin code - Reviewing Kotlin code - Refactoring existing Kotlin code - Designing Kotlin modules or libraries - Configuring Gradle Kotlin DSL builds ## How It Works This skill enforces idiomatic Kotlin conventions across seven key areas: null safety using the type system and safe-call operators, immutability via `val` and `copy()` on data classes, sealed classes and interfaces for exhaustive type hierarchies, structured concurrency with coroutines and `Flow`, extension functions for adding behaviour without inheritance, type-safe DSL builders using `@DslMarker` and lambda receivers, and Gradle Kotlin DSL for build configuration. ## Examples **Null safety with Elvis operator:** ```kotlin fun getUserEmail(userId: String): String { val user = userRepository.findById(userId) return user?.email ?: "unknown@example.com" } ``` **Sealed class for exhaustive results:** ```kotlin sealed class Result<out T> { data class Success<T>(val data: T) : Result<T>() data class Failure(val error: AppError) : Result<Nothing>() data object

What's inside
Steps it walks through
  1. When to Use
  2. How It Works
  3. Examples
  4. Core Principles
  5. 1. Null Safety
  6. 2. Immutability by Default
  7. 3. Expression Bodies and Single-Expression Functions
  8. 4. Data Classes for Value Objects
  9. Sealed Classes and Interfaces
  10. Modeling Restricted Hierarchies
  11. Sealed Interfaces for API Responses
  12. Scope Functions
  13. When to Use Each
  14. Anti-Patterns
More from everything-openai-codex
All skills →
About this skill
What does the kotlin-patterns skill do?

Idiomatic Kotlin patterns, best practices, and conventions for building robust, efficient, and maintainable Kotlin applications with coroutines, null safety, and DSL builders.

How do I install it?

Run `npx skills add mturac/everything-openai-codex --skill kotlin-patterns --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From mturac/everything-openai-codex, a repository with 84 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going