kotlin-expert

Apply StateFlow, sealed hierarchies, immutability, and DSL builders in Kotlin.

Updated Jan 19, 2026
One-click install
npx skills add https://github.com/kedokato-dev/skill-agent --skill kotlin-expert
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-expert
Source: https://github.com/kedokato-dev/skill-agent/tree/main/kotlin-expert
Command: npx skills add https://github.com/kedokato-dev/skill-agent --skill kotlin-expert

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill guides AmethystMultiplatform Kotlin developers to implement robust architecture patterns, including StateFlow/SharedFlow state management, sealed hierarchies, immutability, and DSL builders, with practical, code-backed guidance.

Core Features & Use Cases

  • StateFlow and SharedFlow patterns for UI state and event streams in multi-platform apps
  • Sealed Classes and Sealed Interfaces for modeling state variants and generic results
  • @Immutable and data class practices to improve Compose performance and immutability
  • DSL Builders for type-safe fluent APIs and readable configuration
  • Inline/reified techniques for zero-overhead abstractions and runtime type access

Quick Start

Refactor a sample Kotlin project to implement a StateFlow-based AccountManager and a SharedFlow-based RelayConnectionManager, following the patterns described above.

Frequently Asked Questions about kotlin-expert

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

FAQPage Schema
How do I implement StateFlow and SharedFlow for UI state and event streams in Kotlin?

Use sealed classes and sealed interfaces to model state variants and generic results, ensuring type-safe hierarchies that enforce immutability for event classes and prevent invalid state combinations in Kotlin.

How do I use @Immutable and data classes to improve Kotlin Compose performance?

Apply @Immutable and data class practices to enforce immutability patterns, optimizing Compose performance by ensuring stable inputs and preventing unnecessary recompositions across your Kotlin architecture.

What's the best way to create type-safe DSL builders in Kotlin?

Create type-safe DSL builders using Kotlin DSL builder templates to design fluent APIs, enabling readable configuration and type-safe domain-specific language construction within your application architecture.

When should I use inline and reified techniques for Kotlin abstractions?

Use inline and reified techniques when you need zero-overhead abstractions and runtime type access, allowing generic type parameter retention without performance penalties in Kotlin multiplatform codebases.

How do I refactor a Kotlin project to use StateFlow for account management?

Refactor your Kotlin project by implementing a StateFlow-based AccountManager and a SharedFlow-based RelayConnectionManager, applying private MutableStateFlow exposed publicly alongside SharedFlow for event distribution.