kotlin-patterns

Provide idiomatic Kotlin patterns for null safety, immutability, and coroutines.

1|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/TakMczk/copilot-cli-ecc --skill kotlin-patterns-takmczk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-patterns
Source: https://github.com/TakMczk/copilot-cli-ecc/tree/main/.github/skills/kotlin-patterns
Command: npx skills add https://github.com/TakMczk/copilot-cli-ecc --skill kotlin-patterns-takmczk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides guidance and examples for writing idiomatic, robust, and maintainable Kotlin code, covering best practices in null safety, immutability, coroutines, and more.

Core Features & Use Cases

  • Best Practices: Enforces idiomatic Kotlin conventions across key areas like null safety, immutability, and structured concurrency.
  • Code Examples: Offers clear, practical examples for various Kotlin features, including sealed classes, extension functions, and DSL builders.
  • Use Case: When developing a new Kotlin microservice, use this Skill to ensure adherence to modern Kotlin best practices, leading to more reliable and easier-to-maintain code.

Quick Start

Review the provided examples for idiomatic Kotlin patterns related to null safety and immutability.

Frequently Asked Questions about kotlin-patterns

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

FAQPage Schema
What are the best practices for null safety and immutability in Kotlin?

Idiomatic Kotlin best practices for null safety and immutability involve leveraging the type system to enforce non-null constraints and using data classes with val properties to ensure state cannot mutate. This Skill provides clear examples for implementing these patterns.

How do I use sealed classes and extension functions in Kotlin?

Using sealed classes and extension functions in Kotlin allows you to represent constrained hierarchies and add functionality to existing classes without inheritance. This Skill provides practical examples for applying these idiomatic Kotlin features correctly.

How do I implement structured concurrency with Kotlin coroutines and Flow?

Structured concurrency with Kotlin coroutines and Flow is implemented by scoping asynchronous operations to specific lifecycles to prevent leaks. This Skill covers idiomatic patterns for building robust and efficient concurrent applications.

Can I use Kotlin DSL builders for Gradle configuration?

Yes, you can use Kotlin DSL builders for Gradle configuration to achieve type-safe build scripts. This Skill provides idiomatic patterns and examples for Gradle Kotlin DSL, alongside guidance for general DSL builders.

When should I use idiomatic Kotlin patterns for code reviews?

Idiomatic Kotlin patterns should be used during code reviews and refactoring to enforce conventions across areas like null safety, immutability, and structured concurrency. This Skill provides guidance to ensure adherence to modern best practices.

What is the best way to design Kotlin microservice modules?

The best way to design Kotlin microservice modules is by applying idiomatic patterns for null safety, sealed classes, and structured concurrency. This Skill helps ensure new development is robust, efficient, and maintainable.