kotlin-patterns

Enforce idiomatic Kotlin patterns, null safety, and structured concurrency for JVM applications.

1|Updated Apr 11, 2026
One-click install
npx skills add https://github.com/its-Basudeba/Care-HMS --skill kotlin-patterns-its-basudeba
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-patterns
Source: https://github.com/its-Basudeba/Care-HMS/tree/main/.agent/skills/kotlin-patterns
Command: npx skills add https://github.com/its-Basudeba/Care-HMS --skill kotlin-patterns-its-basudeba

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the complexity of writing maintainable, efficient, and safe Kotlin code by providing a standardized set of idiomatic patterns and best practices.

Core Features & Use Cases

  • Idiomatic Pattern Enforcement: Provides guidance on null safety, immutability, and structured concurrency using coroutines.
  • Architectural Best Practices: Offers templates for sealed hierarchies, DSL builders, and reactive streams with Flow.
  • Use Case: Use this Skill to refactor legacy codebases into modern, type-safe Kotlin or to ensure new modules follow industry-standard conventions for performance and readability.

Quick Start

Apply the kotlin-patterns skill to review the current module for potential null-safety improvements and idiomatic refactoring opportunities.

Frequently Asked Questions about kotlin-patterns

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

FAQPage Schema
How do I refactor legacy code to idiomatic Kotlin with null safety?

Idiomatic Kotlin refactoring standardizes legacy codebases by enforcing null safety, immutability, and structured concurrency using coroutines to ensure robust and maintainable JVM applications. It provides architectural templates for sealed hierarchies and DSL builders.

What is the best way to implement structured concurrency with Kotlin coroutines?

Structured concurrency with Kotlin coroutines manages asynchronous tasks by enforcing scope hierarchies, ensuring that parent coroutines wait for child tasks to complete. This pattern prevents memory leaks and guarantees clean reactive stream management.

How do I build type-safe DSLs in Kotlin for architectural design?

Building type-safe DSLs in Kotlin utilizes receiver functions and sealed hierarchies to enforce strict compile-time validation. This architectural design pattern creates highly readable, domain-specific APIs while preventing invalid state configurations.

Does this approach support reactive stream management with Kotlin Flow?

Kotlin Flow supports reactive stream management by providing cold asynchronous data streams that integrate seamlessly with structured concurrency. It enables type-safe pipeline construction for continuous data emission and consumption.

Can I use these Kotlin patterns for exhaustive pattern matching?

Exhaustive pattern matching in Kotlin leverages sealed classes to ensure all possible subtypes are handled at compile time. This technique satisfies architectural requirements for type-safe hierarchies and eliminates missing branch errors.