kotlin-code-style

Provide Kotlin code style and design guidance for idiomatic correctness.

Updated Apr 18, 2026
One-click install
npx skills add https://github.com/rotilho/skills --skill kotlin-code-style
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-code-style
Source: https://github.com/rotilho/skills/tree/main/kotlin-code-style
Command: npx skills add https://github.com/rotilho/skills --skill kotlin-code-style

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Kotlin teams often struggle to maintain consistent idiomatic code style and design practices across files and modules; this skill provides concrete guidance on file organization, type design, constructors, extensions, nullability, serialization, coroutines, Flow, and test style to reduce cognitive load during reviews.

Core Features & Use Cases

  • Guidelines for Kotlin file organization and package structure to improve readability
  • Rules for type design, data classes, constructors, factories, and visibility
  • Recommendations for extension functions placement and helper ownership
  • Best practices for nullability, serialization, coroutines, and Flow usage
  • Kotlin unit and integration test style guidance, excluding Cucumber/BDD

Quick Start

Provide idiomatic Kotlin guidance for a given module to improve readability and maintainability.

Frequently Asked Questions about kotlin-code-style

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

FAQPage Schema
What is idiomatic Kotlin code style for file organization and type design?

Idiomatic Kotlin code style enforces specific file organization, package structure, and type design rules to improve readability. It provides concrete guidance on data classes, constructors, and visibility to reduce cognitive load during code reviews and maintain consistency across modules.

How do I structure Kotlin coroutines and Flow for explicit concurrency?

Kotlin coroutines and Flow should follow explicit concurrency patterns to ensure maintainability. Best practices include applying specific rules for Flow usage and nullability to distinguish application code from library code, preventing hidden asynchronous behavior.

What's the best way to handle nullability and serialization in Kotlin?

The best way to handle nullability in Kotlin is enforcing explicit null safety rules alongside specific serialization best practices. This approach ensures type safety and data consistency across application and library codebases.

How do I write Kotlin unit and integration tests outside of BDD frameworks?

Kotlin unit and integration tests outside Cucumber or BDD require specific styling guidance to match idiomatic conventions. This includes applying consistent test structures that align with the overall codebase design and concurrency patterns.

When should I use extension functions vs helper ownership in Kotlin?

Extension functions in Kotlin should be placed according to specific recommendations for helper ownership and module structure. This ensures that extension functions enhance readability without creating ambiguous API surfaces or leaking internal implementation details.

Does this Kotlin code style distinguish between application and library code?

Yes, this Kotlin code style guidance explicitly distinguishes between application and library code requirements. It enforces different rules for visibility, nullability, and concurrency patterns to ensure libraries remain stable and applications remain flexible.