kotlin-expert

Provides Kotlin programming patterns for AmityMultiplatform including StateFlow, SharedFlow, sealed hierarchies, DSL builders, inline/reified functions, and immutability via @Immutable annotations.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/OpenRiverFlow/OpenRiverFlowTest --skill kotlin-expert-openriverflow
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: kotlin-expert
Source: https://github.com/OpenRiverFlow/OpenRiverFlowTest/tree/main/.claude/skills/kotlin-expert
Command: npx skills add https://github.com/OpenRiverFlow/OpenRiverFlowTest --skill kotlin-expert-openriverflow

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers write more efficient, robust, and maintainable Kotlin code by leveraging advanced language features and Amethyst-specific patterns.

Core Features & Use Cases

  • State Management: Implement advanced patterns using StateFlow and SharedFlow for reactive UIs.
  • Type Safety: Utilize sealed classes and interfaces for robust error handling and state modeling.
  • Performance: Optimize code with @Immutable annotations, DSL builders, and inline/reified functions.
  • Use Case: Refactor a complex UI state management system to use StateFlow for predictable updates, or implement a type-safe API using a DSL builder for cleaner configuration.

Quick Start

Show me an example of using StateFlow to manage UI state in Kotlin.

Frequently Asked Questions about kotlin-expert

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

FAQPage Schema
How do I manage UI state with StateFlow and SharedFlow in Kotlin?▼

Use sealed classes and interfaces for robust error handling and state modeling in Kotlin. They allow you to represent fixed hierarchies, ensuring exhaustive type safety and compile-time checks for all possible states and error conditions.

How do I optimize Kotlin performance with @Immutable and inline functions?▼

Optimize Kotlin performance by applying @Immutable annotations, DSL builders, and inline or reified functions. These features reduce object allocation overhead and enable compile-time optimizations for more efficient code execution.

What is the best way to build a type-safe configuration API using Kotlin DSL builders?▼

Build a type-safe API with Kotlin DSL builders to achieve cleaner configuration and domain-specific language structuring. This pattern leverages Kotlin's language features to create highly readable, strongly-typed configuration blocks.

When should I use sealed interfaces over sealed classes for state modeling in Kotlin?▼

Use sealed interfaces for state modeling in Kotlin when you need flexible hierarchies or want multiple implementations across different files. Sealed interfaces provide the same exhaustive when-branch checking as sealed classes but with broader extensibility.

Does this Kotlin guidance apply to general Android development or only specific codebases?▼

This Kotlin guidance focuses on specific idioms and best practices tailored for the AmethystMultiplatform codebase. While the core language patterns are universally applicable, the implementation examples prioritize Amethyst-specific state management and performance contexts.