kotlin-patterns

Standardize idiomatic Kotlin patterns for null safety, coroutines, and DSL builders.

Updated Apr 2, 2026
One-click install
npx skills add https://github.com/richardnpaul/everything-vscode-copilot --skill kotlin-patterns-richardnpaul
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-patterns
Source: https://github.com/richardnpaul/everything-vscode-copilot/tree/main/.github/skills/kotlin-patterns
Command: npx skills add https://github.com/richardnpaul/everything-vscode-copilot --skill kotlin-patterns-richardnpaul

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

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

Core Features & Use Cases

  • Standardizes Kotlin development patterns across projects to improve safety, readability, and maintainability.
  • Covers null-safety usage, immutability by default, sealed classes and interfaces, structured concurrency with coroutines and Flow, and DSL builders for expressive APIs.
  • Useful in new codebases, during code reviews, and while designing Kotlin modules or libraries.

Quick Start

Analyze a Kotlin project and start applying idiomatic patterns by auditing for null safety, immutability, and DSL usage.

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?

Standardized Kotlin patterns enforce null safety through compiler checks and prefer immutability by default using val and data classes. This combination prevents runtime exceptions and ensures thread-safe state management across application modules.

How do I use Kotlin coroutines and Flow for structured concurrency?

Kotlin coroutines and Flow provide structured concurrency by scoping asynchronous operations to lifecycles. Using defined patterns for coroutine builders and Flow operators ensures asynchronous streams are predictable, cancellable, and leak-free.

When should I use sealed classes and interfaces in Kotlin module design?

Use sealed classes and interfaces in Kotlin module design to represent constrained type hierarchies. They enable exhaustive when-expressions, allowing the compiler to guarantee all possible states are handled safely without needing an else branch.

How to build expressive APIs with Kotlin DSL builders?

Build expressive Kotlin DSL builders by leveraging function literals with receivers to create type-safe hierarchical configurations. Standardized DSL patterns improve API readability and allow users to construct complex nested data structures fluently.

Can I apply these Kotlin patterns during code reviews and refactoring?

You can apply these idiomatic Kotlin patterns during code reviews and refactoring to audit existing code for null safety, immutability, and DSL usage. Standardizing conventions improves readability and maintainability across new and existing codebases.