kotlin-core

Guide Kotlin development with StateFlow, sealed hierarchies, and inline functions.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/felipebrgs1/skills --skill kotlin-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-core
Source: https://github.com/felipebrgs1/skills/tree/main/mobile/kotlin-core
Command: npx skills add https://github.com/felipebrgs1/skills --skill kotlin-core

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers write more robust, performant, and maintainable Kotlin code by leveraging advanced language features and patterns.

Core Features & Use Cases

  • State Management: Efficiently manage UI state with StateFlow and SharedFlow.
  • Type Safety: Utilize sealed hierarchies for robust state representation and error handling.
  • Performance: Improve code efficiency with inline functions, reified types, and value classes.
  • DSL Builders: Create expressive and type-safe Domain Specific Languages.
  • Immutability: Ensure thread safety and predictable state with @Immutable and immutable collections.
  • Use Case: When building a complex Android UI, use StateFlow for managing screen states, sealed classes for different screen states (Loading, Success, Error), and @Immutable for Compose data classes to optimize recomposition.

Quick Start

Use the kotlin-core skill to implement state management with StateFlow and sealed classes.

Frequently Asked Questions about kotlin-core

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

FAQPage Schema
How do I manage UI state in Android using Kotlin StateFlow and sealed classes?

Kotlin state management uses StateFlow to hold UI state and sealed classes to represent distinct screen states like Loading, Success, and Error. This combination provides robust state representation and efficient updates in modern Android applications.

What is the best way to optimize Kotlin code performance with inline functions and value classes?

Optimizing Kotlin performance involves applying inline functions to reduce overhead, reified types for type-safe generics, and value classes to avoid memory allocation. These features enhance code execution efficiency without sacrificing maintainability in backend or Android services.

How do I create type-safe DSL builders in Kotlin?

Creating type-safe DSL builders in Kotlin involves using builder patterns and function literals with receivers. This approach allows you to construct expressive, domain-specific languages while maintaining strict type safety and readable syntax.

When should I use @Immutable and immutable collections for thread safety in Kotlin?

You should use @Immutable and immutable collections in Kotlin when ensuring thread safety and predictable state management. Annotating Compose data classes with @Immutable also optimizes UI recomposition by preventing unnecessary redraws.

Can I use SharedFlow for state management in backend Kotlin services?

Yes, you can use SharedFlow for state management in backend Kotlin services. SharedFlow efficiently manages multi-cast state emissions and event broadcasting, complementing StateFlow for complex asynchronous data streams in modern software development.