kotlin-coding-standards

Enforce Kotlin coding standards with detekt and ktlint integration.

17|1|Updated Jun 8, 2025
One-click install
npx skills add https://github.com/williamzujkowski/standards --skill kotlin-coding-standards
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-coding-standards
Source: https://github.com/williamzujkowski/standards/tree/main/skills/coding-standards/kotlin
Command: npx skills add https://github.com/williamzujkowski/standards --skill kotlin-coding-standards

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This skill provides a comprehensive guide to Kotlin coding standards, enabling you to build robust, concurrent, and idiomatic applications. It automates the enforcement of null safety, coroutines, and functional programming patterns, reducing common pitfalls and improving code reliability.

Core Features & Use Cases

  • Null Safety Mastery: Guides on using safe calls, Elvis operator, and smart casts to eliminate NullPointerExceptions.
  • Coroutine Implementation: Provides patterns for asynchronous programming with suspend functions, launch, async, and Flow.
  • Idiomatic Kotlin: Teaches data classes, sealed classes, extension functions, and delegation for cleaner, more expressive code.
  • Use Case: Set up a new Android project by applying these standards, automatically configuring Detekt and ktlint to ensure all Kotlin code adheres to best practices for null safety and concurrency.

Quick Start

Generate a Kotlin ViewModel template for an Android application, demonstrating coroutines and StateFlow for UI state management.

Frequently Asked Questions about kotlin-coding-standards

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

FAQPage Schema
How do I enforce null safety in Kotlin to prevent NullPointerExceptions?

Null safety in Kotlin is enforced through safe calls (?.), the Elvis operator (?:), and smart casts to eliminate NPEs. This Skill guides patterns for safe handling across Android and JVM projects, with detekt and ktlint configured to catch unsafe patterns automatically.

What's the best way to implement coroutines in Kotlin applications?

Coroutines enable asynchronous programming using suspend functions, launch, async, and Flow. This Skill provides patterns for proper coroutine usage in Android and JVM apps, preventing common mistakes and integrating with static analysis tools to ensure idiomatic implementations.

How do I set up coding standards for a Kotlin project automatically?

Configure detekt and ktlint in your Kotlin project to enforce standards on null safety, concurrency, and idiomatic patterns. This Skill specifies tool integration, val over var discipline, and consistent testing setups that apply across Android and JVM codebases.

Can I apply these standards to existing Android and JVM Kotlin code?

Yes, these standards apply to both Android and JVM Kotlin projects. The Skill guides conventions for data classes, sealed classes, extension functions, and delegation that work across platforms, with detekt and ktlint configured to enforce them on existing or new codebases.

What coding patterns does this cover for functional programming in Kotlin?

Functional programming patterns include trailing lambdas, proper extension function usage, sealed classes for type-safe abstractions, and disciplined immutability through val declarations. The Skill enforces these via static analysis to produce idiomatic, maintainable Kotlin code.