kotlin-patterns

Review Kotlin code for idiomatic patterns and structured concurrency compliance.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/luongldptit/move-ticket --skill kotlin-patterns-luongldptit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-patterns
Source: https://github.com/luongldptit/move-ticket/tree/main/.agent/skills/kotlin-patterns
Command: npx skills add https://github.com/luongldptit/move-ticket --skill kotlin-patterns-luongldptit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the problem of inconsistent, bug-prone Kotlin code by providing standardized idiomatic patterns and proven best practices, helping developers avoid common pitfalls like null pointer exceptions, unsafe concurrency, and unmaintainable code structures.

Core Features & Use Cases

  • Idiomatic Kotlin Best Practices: Covers null safety, immutability, data classes, sealed types, and scope functions for clean, maintainable code.
  • Concurrency & DSL Guidance: Provides patterns for structured coroutine concurrency, reactive Flow streams, and type-safe DSL builders.
  • Build & Error Handling: Includes Gradle Kotlin DSL configuration best practices and idiomatic error handling with Result types and preconditions.
  • Use Case: When refactoring a legacy Kotlin codebase, use this Skill to replace unsafe mutable state and GlobalScope coroutine launches with idiomatic immutable data classes and structured concurrency patterns.

Quick Start

Use the kotlin-patterns skill to review your existing Kotlin coroutine implementation for structured concurrency compliance and suggest improvements for null safety and error handling.

Frequently Asked Questions about kotlin-patterns

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

FAQPage Schema
How do I enforce null safety and avoid null pointer exceptions in Kotlin?

Enforce null safety by applying idiomatic Kotlin patterns that use safe calls, Elvis operators, and immutable data classes to eliminate unsafe null states. This prevents null pointer exceptions during application development and refactoring tasks.

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

The best way to implement structured concurrency is to replace GlobalScope launches with standardized Kotlin coroutine patterns. This ensures safe concurrency management in backend services and mobile apps without leaking background tasks.

How do I refactor legacy Kotlin code to use immutable data and sealed types?

Refactor legacy code by replacing unsafe mutable state with idiomatic immutable data classes and sealed types. This standardizes data structures and scope functions, resulting in maintainable and robust Kotlin applications.

How does Kotlin handle idiomatic error handling with Result types?

Kotlin handles errors idiomatically by applying standardized patterns using Result types and preconditions. This approach manages exceptions safely during collection processing and reactive Flow streams without throwing unchecked exceptions.