kotlin-best-practices

Standardize Kotlin null safety, error handling, and Exposed ORM patterns.

96|9|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/c0x12c/ai-toolkit --skill kotlin-best-practices-c0x12c
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-best-practices
Source: https://github.com/c0x12c/ai-toolkit/tree/main/.codex/skills/kotlin-best-practices
Command: npx skills add https://github.com/c0x12c/ai-toolkit --skill kotlin-best-practices-c0x12c

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Kotlin projects often suffer from inconsistent patterns, missed null-safety checks, and ad-hoc error handling. This Skill consolidates Kotlin coding standards to prevent common pitfalls and promote safer, more maintainable code.

Core Features & Use Cases

  • Null Safety Enforcement: ban double bang (!!) and encourage safe calls, Elvis, and smart casts.
  • Error Handling Patterns: prefer Either-based error handling over exceptions in managers and controllers.
  • Patterns for Enum and ORM: guidance on using enums with values and Exposed ORM best practices (e.g., UUIDTable, soft deletes).
  • Real-World Use: for code reviews, onboarding new Kotlin developers, and standardizing project patterns.

Quick Start

Review these Kotlin best practices before starting a new Kotlin feature, to ensure consistent, safe, and readable code.

Frequently Asked Questions about kotlin-best-practices

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

FAQPage Schema
How do I enforce Kotlin null safety and avoid using the double bang operator?

Enforcing Kotlin null safety involves banning the double bang (!!) operator and encouraging safe calls, the Elvis operator, and smart casts to prevent common null-safety mistakes across your codebase.

What is the best way to handle errors in Kotlin managers and controllers?

The best way to handle errors in Kotlin managers and controllers is to use Either-based error handling patterns instead of exceptions, standardizing error management and preventing ad-hoc handling.

How do I structure Exposed ORM patterns for Kotlin feature development?

To structure Exposed ORM patterns for Kotlin feature development, follow explicit guidance on using UUIDTable and implementing soft deletes, ensuring consistent database interactions and maintainable project patterns.

When do I need standardized Kotlin coding practices for code reviews?

You need standardized Kotlin coding practices during code reviews and onboarding to consolidate standards, prevent inconsistent patterns, missed null-safety checks, and ad-hoc error handling.

Does this Kotlin best practices guidance cover enum usage?

Yes, this Kotlin best practices guidance covers enum usage by codifying explicit rules for enums with values, alongside null safety, Either-based error handling, and Exposed ORM patterns.