kotlin-code-style

Enforce Kotlin coding conventions and ktlint rules across JVM modules.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Kotlin projects often drift from official conventions; this Skill codifies and guides consistent code style to improve readability and maintainability.

Core Features & Use Cases

  • Enforces naming, data class patterns, sealed hierarchies, and extension function usage.
  • Guides scope functions, null-safety practices, and top-level declarations.
  • Use Case: teams adopting Kotlin 2.0+ style across modules to standardize code reviews and onboarding.

Quick Start

Configure your project to apply ktlint with the documented Kotlin conventions to format code and enforce rules.

Frequently Asked Questions about kotlin-code-style

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

FAQPage Schema
How do I enforce Kotlin coding conventions across multiple JVM modules?

You can enforce Kotlin coding conventions across JVM modules by applying ktlint to format code and standardize rules for data classes, sealed hierarchies, and extension functions. This ensures consistent style and improves code review standardization.

What is the best way to standardize Kotlin code style for a team adopting Kotlin 2.0+?

The best way to standardize Kotlin code style for teams adopting Kotlin 2.0+ is to codify official conventions using ktlint. This enforces idiomatic patterns for null safety and scope functions, reducing drift and improving onboarding consistency.

Does this Kotlin code style approach require ktlint to format sealed hierarchies and data classes?

Yes, enforcing Kotlin idioms and clean style requires ktlint as the baseline to format code and enforce official coding conventions. It specifically guides patterns for data classes, sealed hierarchies, and top-level declarations.

Can I use these Kotlin coding conventions for both library and app code?

Yes, these Kotlin coding conventions are applicable to both library and app code within JVM Kotlin modules. The rules cover extension function usage, null-safety practices, and scope functions to ensure readability across different project types.

Why does my Kotlin project drift from official conventions and how can static analysis help?

Kotlin projects often drift from official conventions due to inconsistent code reviews and onboarding. Applying static analysis with ktlint codifies common patterns, enforcing naming rules and null safety to improve maintainability and readability.

What are the limitations of using ktlint for Kotlin static analysis and code style?

While ktlint enforces official Kotlin coding conventions and static analysis, its scope is limited to JVM Kotlin modules. It focuses on structural formatting and common patterns like scope functions, rather than deeper architectural rule enforcement.