kotlin-convention

Enforce Kotlin coding conventions and idiomatic patterns for clean code.

1|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/iceflower/opencode-agents-and-skills --skill kotlin-convention-iceflower
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-convention
Source: https://github.com/iceflower/opencode-agents-and-skills/tree/main/skills/kotlin-convention
Command: npx skills add https://github.com/iceflower/opencode-agents-and-skills --skill kotlin-convention-iceflower

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides clear guidelines and best practices for writing idiomatic and maintainable Kotlin code, ensuring consistency and quality across projects.

Core Features & Use Cases

  • Null Safety: Enforces safe handling of null values to prevent NullPointerExceptions.
  • Data Classes: Guides the appropriate use of data class, value class, sealed class, and object.
  • Extension Functions: Demonstrates effective use cases for extending existing classes.
  • Collection Operations: Promotes the use of Kotlin's standard library for efficient collection manipulation.
  • Coroutines: Offers best practices for asynchronous programming with structured concurrency.
  • Naming Conventions: Defines standard naming rules for various code elements.
  • Spring Boot Specifics: Covers constructor injection, configuration properties, and common anti-patterns.

Quick Start

Apply the kotlin-convention skill to refactor the provided Kotlin code snippet for improved null safety.

Frequently Asked Questions about kotlin-convention

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

FAQPage Schema
What are the best practices for writing idiomatic Kotlin code?

Idiomatic Kotlin best practices involve enforcing null safety, using data classes appropriately, leveraging extension functions, and applying standard collection operations to ensure maintainable and robust code.

How do I handle null safety to prevent NullPointerExceptions in Kotlin?

To handle null safety in Kotlin, you should enforce safe handling of null values using the language's built-in null-safety features, which prevents NullPointerExceptions and improves overall code robustness.

How do I manage asynchronous programming with Kotlin coroutines?

Managing asynchronous programming with Kotlin coroutines requires following structured concurrency best practices, which ensures robust background task execution and improves application responsiveness.

Does this convention guide cover Spring Boot specific Kotlin patterns?

Yes, the Kotlin convention guide covers Spring Boot specific patterns, including constructor injection, configuration properties management, and avoiding common anti-patterns for robust application development.

When should I use data classes, value classes, or sealed classes in Kotlin?

You should use data classes, value classes, and sealed classes in Kotlin when you need to guide the appropriate modeling of restricted hierarchies or lightweight data containers, ensuring clear and maintainable code.